mirror of
https://github.com/curl/curl.git
synced 2026-08-24 21:13:40 +03:00
Refactor how libraries are checked for connect() function,
and check for connect() as it is done for other functions.
This commit is contained in:
parent
2d716517a8
commit
1ff4e9008b
6 changed files with 284 additions and 6 deletions
41
acinclude.m4
41
acinclude.m4
|
|
@ -2202,6 +2202,47 @@ AC_DEFUN([CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC], [
|
|||
])
|
||||
|
||||
|
||||
dnl CURL_CHECK_LIBS_CONNECT
|
||||
dnl -------------------------------------------------
|
||||
dnl Verify if network connect function is already available
|
||||
dnl using current libraries or if another one is required.
|
||||
|
||||
AC_DEFUN([CURL_CHECK_LIBS_CONNECT], [
|
||||
AC_MSG_CHECKING([for connect in libraries])
|
||||
tst_connect_save_LIBS="$LIBS"
|
||||
tst_connect_need_LIBS="unknown"
|
||||
for tst_lib in '' '-lsocket' ; do
|
||||
if test "$tst_connect_need_LIBS" = "unknown"; then
|
||||
LIBS="$tst_lib $tst_connect_save_LIBS"
|
||||
AC_LINK_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
]],[[
|
||||
if(0 != connect(0, 0, 0))
|
||||
return 1;
|
||||
]])
|
||||
],[
|
||||
tst_connect_need_LIBS="$tst_lib"
|
||||
])
|
||||
fi
|
||||
done
|
||||
LIBS="$tst_connect_save_LIBS"
|
||||
#
|
||||
case X-"$tst_connect_need_LIBS" in
|
||||
X-unknown)
|
||||
AC_MSG_RESULT([cannot find connect])
|
||||
AC_MSG_ERROR([cannot find connect function in libraries.])
|
||||
;;
|
||||
X-)
|
||||
AC_MSG_RESULT([yes])
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT([$tst_connect_need_LIBS])
|
||||
LIBS="$tst_connect_need_LIBS $tst_connect_save_LIBS"
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
|
||||
dnl CURL_DEFINE_UNQUOTED (VARIABLE, [VALUE])
|
||||
dnl -------------------------------------------------
|
||||
dnl Like AC_DEFINE_UNQUOTED this macro will define a C preprocessor
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue