From 2f1b5347c98fdd85b5312dd0e845ddc688a2ae55 Mon Sep 17 00:00:00 2001 From: psychon Date: Fri, 16 May 2008 15:01:41 +0000 Subject: [PATCH] configure: Fix dlopen() detection The 'appendLib -ldl' is the important part, autoconf doesn't do that automatically if you give it an argument. This bug only triggered with --disable-debug (libssl pulled in libdl). git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1057 726aef4b-f618-498e-8847-2d620e286838 --- configure | 10 +++++++++- configure.in | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/configure b/configure index ac8f789a..dcb54804 100755 --- a/configure +++ b/configure @@ -3564,6 +3564,12 @@ fi if test "$MODULES" = "yes"; then FOUND_DL=no + + # Don't use any libs like -lssl -lcrypto when checking for dlopen(), + # because they might change the test results + SAVED_LIBS="$LIBS" + LIBS="" + { echo "$as_me:$LINENO: checking for dlopen" >&5 echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; } if test "${ac_cv_func_dlopen+set}" = set; then @@ -3711,10 +3717,12 @@ fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } if test $ac_cv_lib_dl_dlopen = yes; then - FOUND_DL=yes + FOUND_DL=yes ; appendLib -ldl fi + appendLib "$SAVED_LIBS" + if test $FOUND_DL = "no" ; then { { echo "$as_me:$LINENO: error: Could not find dlopen. Try --disable-modules" >&5 echo "$as_me: error: Could not find dlopen. Try --disable-modules" >&2;} diff --git a/configure.in b/configure.in index a75c5ba2..857145ef 100644 --- a/configure.in +++ b/configure.in @@ -137,8 +137,16 @@ AC_ARG_WITH( [module-data-prefix], if test "$MODULES" = "yes"; then FOUND_DL=no + + # Don't use any libs like -lssl -lcrypto when checking for dlopen(), + # because they might change the test results + SAVED_LIBS="$LIBS" + LIBS="" + AC_CHECK_FUNC(dlopen, FOUND_DL=yes,) - AC_CHECK_LIB( dl, dlopen, FOUND_DL=yes,) + AC_CHECK_LIB( dl, dlopen, FOUND_DL=yes ; appendLib -ldl,) + + appendLib "$SAVED_LIBS" if test $FOUND_DL = "no" ; then AC_ERROR([Could not find dlopen. Try --disable-modules])