From: Alan T. DeKok Date: Sat, 22 Sep 2012 07:58:55 +0000 (+0200) Subject: Check for dlopen, too X-Git-Tag: release_3_0_0_beta1~1687 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=691e57bc644bc6ab32dcf1e31b29c2687e6b0eb1;p=thirdparty%2Ffreeradius-server.git Check for dlopen, too --- diff --git a/configure b/configure index a9ec96ae33a..9e85bcd38c0 100755 --- a/configure +++ b/configure @@ -15982,6 +15982,52 @@ fi fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBDL 1 +_ACEOF + + LIBS="-ldl $LIBS" + +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getsockname in -lsocket" >&5 $as_echo_n "checking for getsockname in -lsocket... " >&6; } if ${ac_cv_lib_socket_getsockname+:} false; then : diff --git a/configure.in b/configure.in index e31292a4821..32ba4a3806f 100644 --- a/configure.in +++ b/configure.in @@ -504,6 +504,9 @@ else ) fi +dnl Check if we need -lsocket +AC_CHECK_LIB(dl, dlopen) + dnl Check if we need -lsocket AC_CHECK_LIB(socket, getsockname) diff --git a/src/include/autoconf.h.in b/src/include/autoconf.h.in index 7cc2d87538a..35b73e38544 100644 --- a/src/include/autoconf.h.in +++ b/src/include/autoconf.h.in @@ -116,6 +116,9 @@ /* Define to 1 if you have the `crypto' library (-lcrypto). */ #undef HAVE_LIBCRYPTO +/* Define to 1 if you have the `dl' library (-ldl). */ +#undef HAVE_LIBDL + /* Define to 1 if you have the `nsl' library (-lnsl). */ #undef HAVE_LIBNSL