mirror of
https://github.com/curl/curl.git
synced 2026-04-14 22:41:40 +03:00
build: require POSIX strdup()
Stop detecting this function and drop the local fallback. Let us know if this update is causing an issue. Notes: - on Windows `_strdup()` is required instead. - `strdup()/_strdup()` were required before this patch to build one of the examples: `block_ip`. - `strdup()/_strdup()` were required in 8.18.0 and earlier to build tests. Closes #20505
This commit is contained in:
parent
710d5a28fb
commit
0590753a3c
10 changed files with 0 additions and 120 deletions
|
|
@ -3935,92 +3935,6 @@ AC_DEFUN([CURL_CHECK_FUNC_STRCMPI], [
|
|||
])
|
||||
|
||||
|
||||
dnl CURL_CHECK_FUNC_STRDUP
|
||||
dnl -------------------------------------------------
|
||||
dnl Verify if strdup is available, prototyped, and
|
||||
dnl can be compiled. If all of these are true, and
|
||||
dnl usage has not been previously disallowed with
|
||||
dnl shell variable curl_disallow_strdup, then
|
||||
dnl HAVE_STRDUP will be defined.
|
||||
|
||||
AC_DEFUN([CURL_CHECK_FUNC_STRDUP], [
|
||||
AC_REQUIRE([CURL_INCLUDES_STRING])dnl
|
||||
AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl
|
||||
#
|
||||
tst_links_strdup="unknown"
|
||||
tst_proto_strdup="unknown"
|
||||
tst_compi_strdup="unknown"
|
||||
tst_allow_strdup="unknown"
|
||||
#
|
||||
AC_MSG_CHECKING([if strdup can be linked])
|
||||
AC_LINK_IFELSE([
|
||||
AC_LANG_FUNC_LINK_TRY([strdup])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
tst_links_strdup="yes"
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
tst_links_strdup="no"
|
||||
])
|
||||
#
|
||||
if test "$tst_links_strdup" = "yes"; then
|
||||
AC_MSG_CHECKING([if strdup is prototyped])
|
||||
AC_EGREP_CPP([strdup],[
|
||||
$curl_includes_string
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
tst_proto_strdup="yes"
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
tst_proto_strdup="no"
|
||||
])
|
||||
fi
|
||||
#
|
||||
if test "$tst_proto_strdup" = "yes"; then
|
||||
AC_MSG_CHECKING([if strdup is compilable])
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
$curl_includes_string
|
||||
$curl_includes_stdlib
|
||||
]],[[
|
||||
free(strdup(""));
|
||||
]])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
tst_compi_strdup="yes"
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
tst_compi_strdup="no"
|
||||
])
|
||||
fi
|
||||
#
|
||||
if test "$tst_compi_strdup" = "yes"; then
|
||||
AC_MSG_CHECKING([if strdup usage allowed])
|
||||
if test "x$curl_disallow_strdup" != "xyes"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
tst_allow_strdup="yes"
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
tst_allow_strdup="no"
|
||||
fi
|
||||
fi
|
||||
#
|
||||
AC_MSG_CHECKING([if strdup might be used])
|
||||
if test "$tst_links_strdup" = "yes" &&
|
||||
test "$tst_proto_strdup" = "yes" &&
|
||||
test "$tst_compi_strdup" = "yes" &&
|
||||
test "$tst_allow_strdup" = "yes"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE_UNQUOTED(HAVE_STRDUP, 1,
|
||||
[Define to 1 if you have the strdup function.])
|
||||
curl_cv_func_strdup="yes"
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
curl_cv_func_strdup="no"
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
dnl CURL_CHECK_FUNC_STRERROR_R
|
||||
dnl -------------------------------------------------
|
||||
dnl Verify if strerror_r is available, prototyped, can be compiled and
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue