configure: Use AC_SEARCH_LIBS for the Solaris libs to avoid unused function checks.

This commit is contained in:
Alexandre Julliard 2007-04-23 16:31:58 +02:00
parent 41c599646f
commit 2871041910
3 changed files with 96 additions and 105 deletions

159
configure vendored
View File

@ -15748,9 +15748,6 @@ fi
@ -15766,7 +15763,6 @@ for ac_func in \
asctime_r \
chsize \
clone \
connect \
dlopen \
epoll_create \
ffs \
@ -15779,14 +15775,12 @@ for ac_func in \
futimes \
futimesat \
getdirentries \
gethostbyname \
getopt_long \
getpagesize \
getpwuid \
gettid \
gettimeofday \
getuid \
inet_aton \
kqueue \
lstat \
memmove \
@ -16156,16 +16150,12 @@ fi
fi
if test "$ac_cv_func_gethostbyname" = no
then
{ echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5
echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6; }
if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
{ echo "$as_me:$LINENO: checking for library containing gethostbyname" >&5
echo $ECHO_N "checking for library containing gethostbyname... $ECHO_C" >&6; }
if test "${ac_cv_search_gethostbyname+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lnsl $LIBS"
ac_func_search_save_LIBS=$LIBS
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@ -16188,6 +16178,13 @@ return gethostbyname ();
return 0;
}
_ACEOF
for ac_lib in '' nsl; do
if test -z "$ac_lib"; then
ac_res="none required"
else
ac_res=-l$ac_lib
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
fi
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
@ -16206,41 +16203,43 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
test ! -s conftest.err
} && test -s conftest$ac_exeext &&
$as_test_x conftest$ac_exeext; then
ac_cv_lib_nsl_gethostbyname=yes
ac_cv_search_gethostbyname=$ac_res
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_nsl_gethostbyname=no
fi
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
conftest$ac_exeext
if test "${ac_cv_search_gethostbyname+set}" = set; then
break
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5
echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6; }
if test $ac_cv_lib_nsl_gethostbyname = yes; then
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBNSL 1
_ACEOF
LIBS="-lnsl $LIBS"
done
if test "${ac_cv_search_gethostbyname+set}" = set; then
:
else
ac_cv_search_gethostbyname=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_search_gethostbyname" >&5
echo "${ECHO_T}$ac_cv_search_gethostbyname" >&6; }
ac_res=$ac_cv_search_gethostbyname
if test "$ac_res" != no; then
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
fi
fi
if test "$ac_cv_func_connect" = no
then
{ echo "$as_me:$LINENO: checking for connect in -lsocket" >&5
echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6; }
if test "${ac_cv_lib_socket_connect+set}" = set; then
{ echo "$as_me:$LINENO: checking for library containing connect" >&5
echo $ECHO_N "checking for library containing connect... $ECHO_C" >&6; }
if test "${ac_cv_search_connect+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lsocket $LIBS"
ac_func_search_save_LIBS=$LIBS
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@ -16263,6 +16262,13 @@ return connect ();
return 0;
}
_ACEOF
for ac_lib in '' socket; do
if test -z "$ac_lib"; then
ac_res="none required"
else
ac_res=-l$ac_lib
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
fi
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
@ -16281,41 +16287,43 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
test ! -s conftest.err
} && test -s conftest$ac_exeext &&
$as_test_x conftest$ac_exeext; then
ac_cv_lib_socket_connect=yes
ac_cv_search_connect=$ac_res
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_socket_connect=no
fi
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
conftest$ac_exeext
if test "${ac_cv_search_connect+set}" = set; then
break
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5
echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6; }
if test $ac_cv_lib_socket_connect = yes; then
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBSOCKET 1
_ACEOF
LIBS="-lsocket $LIBS"
done
if test "${ac_cv_search_connect+set}" = set; then
:
else
ac_cv_search_connect=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_search_connect" >&5
echo "${ECHO_T}$ac_cv_search_connect" >&6; }
ac_res=$ac_cv_search_connect
if test "$ac_res" != no; then
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
fi
fi
if test "$ac_cv_func_inet_aton" = no
then
{ echo "$as_me:$LINENO: checking for inet_aton in -lresolv" >&5
echo $ECHO_N "checking for inet_aton in -lresolv... $ECHO_C" >&6; }
if test "${ac_cv_lib_resolv_inet_aton+set}" = set; then
{ echo "$as_me:$LINENO: checking for library containing inet_aton" >&5
echo $ECHO_N "checking for library containing inet_aton... $ECHO_C" >&6; }
if test "${ac_cv_search_inet_aton+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lresolv $LIBS"
ac_func_search_save_LIBS=$LIBS
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@ -16338,6 +16346,13 @@ return inet_aton ();
return 0;
}
_ACEOF
for ac_lib in '' resolv; do
if test -z "$ac_lib"; then
ac_res="none required"
else
ac_res=-l$ac_lib
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
fi
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
@ -16356,30 +16371,36 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
test ! -s conftest.err
} && test -s conftest$ac_exeext &&
$as_test_x conftest$ac_exeext; then
ac_cv_lib_resolv_inet_aton=yes
ac_cv_search_inet_aton=$ac_res
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_resolv_inet_aton=no
fi
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
conftest$ac_exeext
if test "${ac_cv_search_inet_aton+set}" = set; then
break
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_inet_aton" >&5
echo "${ECHO_T}$ac_cv_lib_resolv_inet_aton" >&6; }
if test $ac_cv_lib_resolv_inet_aton = yes; then
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBRESOLV 1
_ACEOF
LIBS="-lresolv $LIBS"
done
if test "${ac_cv_search_inet_aton+set}" = set; then
:
else
ac_cv_search_inet_aton=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_search_inet_aton" >&5
echo "${ECHO_T}$ac_cv_search_inet_aton" >&6; }
ac_res=$ac_cv_search_inet_aton
if test "$ac_res" != no; then
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
fi
fi

View File

@ -1153,7 +1153,6 @@ AC_CHECK_FUNCS(\
asctime_r \
chsize \
clone \
connect \
dlopen \
epoll_create \
ffs \
@ -1166,14 +1165,12 @@ AC_CHECK_FUNCS(\
futimes \
futimesat \
getdirentries \
gethostbyname \
getopt_long \
getpagesize \
getpwuid \
gettid \
gettimeofday \
getuid \
inet_aton \
kqueue \
lstat \
memmove \
@ -1222,22 +1219,13 @@ then
fi
dnl Check for -lnsl for Solaris
if test "$ac_cv_func_gethostbyname" = no
then
AC_CHECK_LIB(nsl,gethostbyname)
fi
AC_SEARCH_LIBS(gethostbyname, nsl)
dnl Check for -lsocket for Solaris
if test "$ac_cv_func_connect" = no
then
AC_CHECK_LIB(socket,connect)
fi
AC_SEARCH_LIBS(connect, socket)
dnl Check for -lresolv for Solaris
if test "$ac_cv_func_inet_aton" = no
then
AC_CHECK_LIB(resolv,inet_aton)
fi
AC_SEARCH_LIBS(inet_aton, resolv)
dnl **** Check for functions which may rely on -lsocket on Solaris.
AC_CHECK_FUNCS(\

View File

@ -47,9 +47,6 @@
/* Define to 1 if you have the `clone' function. */
#undef HAVE_CLONE
/* Define to 1 if you have the `connect' function. */
#undef HAVE_CONNECT
/* Define to 1 if you have the <CoreAudio/CoreAudio.h> header file. */
#undef HAVE_COREAUDIO_COREAUDIO_H
@ -180,9 +177,6 @@
/* Define to 1 if you have the `getdirentries' function. */
#undef HAVE_GETDIRENTRIES
/* Define to 1 if you have the `gethostbyname' function. */
#undef HAVE_GETHOSTBYNAME
/* Define to 1 if you have the `getnameinfo' function. */
#undef HAVE_GETNAMEINFO
@ -243,9 +237,6 @@
/* Define to 1 if you have the <ieeefp.h> header file. */
#undef HAVE_IEEEFP_H
/* Define to 1 if you have the `inet_aton' function. */
#undef HAVE_INET_ATON
/* Define to 1 if you have the `inet_network' function. */
#undef HAVE_INET_NETWORK
@ -309,18 +300,9 @@
/* Define to 1 if you have the `i386' library (-li386). */
#undef HAVE_LIBI386
/* Define to 1 if you have the `nsl' library (-lnsl). */
#undef HAVE_LIBNSL
/* Define to 1 if you have the `ossaudio' library (-lossaudio). */
#undef HAVE_LIBOSSAUDIO
/* Define to 1 if you have the `resolv' library (-lresolv). */
#undef HAVE_LIBRESOLV
/* Define to 1 if you have the `socket' library (-lsocket). */
#undef HAVE_LIBSOCKET
/* Define if you have the Xinerama library */
#undef HAVE_LIBXINERAMA