Check for dlopen, too
authorAlan T. DeKok <aland@freeradius.org>
Sat, 22 Sep 2012 07:58:55 +0000 (09:58 +0200)
committerAlan T. DeKok <aland@freeradius.org>
Sat, 22 Sep 2012 07:58:55 +0000 (09:58 +0200)
configure
configure.in
src/include/autoconf.h.in

index a9ec96a..9e85bcd 100755 (executable)
--- a/configure
+++ b/configure
 
 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 :
index e31292a..32ba4a3 100644 (file)
@@ -505,6 +505,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)
 
 dnl Check for -lresolv
index 7cc2d87..35b73e3 100644 (file)
 /* 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