From: Todd C. Miller Date: Mon, 11 Oct 2010 13:21:56 +0000 (-0400) Subject: Fix dlopen() detection for systems where dlopen() is in a separate library. X-Git-Tag: SUDO_1_8_0~208 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=443d18b11a521e61390c085fd24256487c1ef723;p=sudo Fix dlopen() detection for systems where dlopen() is in a separate library. --- diff --git a/configure b/configure index a30cd9cce..8001faa8d 100755 --- a/configure +++ b/configure @@ -18083,6 +18083,8 @@ fi # case "$lt_cv_dlopen" in dlopen) + $as_echo "#define HAVE_DLOPEN 1" >>confdefs.h + SUDOERS_OBJS="$SUDOERS_OBJS plugin_error.lo" LT_STATIC="--tag=disable-static" ;; @@ -18091,33 +18093,26 @@ case "$lt_cv_dlopen" in SUDOERS_OBJS="$SUDOERS_OBJS plugin_error.lo" LT_STATIC="--tag=disable-static" + case " $LIBOBJS " in + *" dlopen.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS dlopen.$ac_objext" + ;; +esac + ;; - no) + *) # Preload sudoers module symbols SUDO_OBJS="${SUDO_OBJS} preload.o" SUDO_LIBS="${SUDO_LIBS} \$(top_builddir)/plugins/sudoers/sudoers.la" LT_STATIC="" - ;; -esac -for ac_func in dlopen -do : - ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" -if test "x$ac_cv_func_dlopen" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_DLOPEN 1 -_ACEOF - -else - case " $LIBOBJS " in - *" $ac_func.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" + case " $LIBOBJS " in + *" dlopen.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS dlopen.$ac_objext" ;; esac -fi -done - - + ;; +esac # # Add library needed for dynamic loading, if any. @@ -20602,5 +20597,6 @@ fi + diff --git a/configure.in b/configure.in index 4fe4cbefe..4549653ea 100644 --- a/configure.in +++ b/configure.in @@ -2668,6 +2668,7 @@ fi # case "$lt_cv_dlopen" in dlopen) + AC_DEFINE(HAVE_DLOPEN) SUDOERS_OBJS="$SUDOERS_OBJS plugin_error.lo" LT_STATIC="--tag=disable-static" ;; @@ -2675,15 +2676,16 @@ case "$lt_cv_dlopen" in AC_DEFINE(HAVE_SHL_LOAD) SUDOERS_OBJS="$SUDOERS_OBJS plugin_error.lo" LT_STATIC="--tag=disable-static" + AC_LIBOBJ(dlopen) ;; - no) + *) # Preload sudoers module symbols SUDO_OBJS="${SUDO_OBJS} preload.o" SUDO_LIBS="${SUDO_LIBS} \$(top_builddir)/plugins/sudoers/sudoers.la" LT_STATIC="" + AC_LIBOBJ(dlopen) ;; esac -AC_REPLACE_FUNCS(dlopen) # # Add library needed for dynamic loading, if any. @@ -2847,6 +2849,7 @@ AH_TEMPLATE(HAVE_DD_FD, [Define to 1 if your `DIR' contains dd_fd.]) AH_TEMPLATE(HAVE_DIRFD, [Define to 1 if you have the `dirfd' function or macro.]) AH_TEMPLATE(HAVE_DGETTEXT, [Define to 1 if you have the `dgettext' function.]) AH_TEMPLATE(HAVE_DISPCRYPT, [Define to 1 if you have the `dispcrypt' function.]) +AH_TEMPLATE(HAVE_DLOPEN, [Define to 1 if you have the `dlopen' function.]) AH_TEMPLATE(HAVE_EXTENDED_GLOB, [Define to 1 if your glob.h defines the GLOB_BRACE and GLOB_TILDE flags.]) AH_TEMPLATE(HAVE_FCNTL_CLOSEM, [Define to 1 if your system has the F_CLOSEM fcntl.]) AH_TEMPLATE(HAVE_FNMATCH, [Define to 1 if you have the `fnmatch' function.])