]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
configure: fix detection of dlopen() for BSD systems
authorTheodore Ts'o <tytso@mit.edu>
Tue, 7 Jun 2016 04:14:35 +0000 (00:14 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 7 Jun 2016 05:01:37 +0000 (01:01 -0400)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
configure
configure.ac
lib/config.h.in

index ec274f3bdb5edf367e4fabfe313fb8cfa5e0469e..e6be281df47d0ca51e5f10859b0e1e0e85439819 100755 (executable)
--- a/configure
+++ b/configure
@@ -3728,9 +3728,6 @@ fi
 $as_echo "$ac_cv_lib_dl_dlopen" >&6; }
 if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
   DLOPEN_LIB=-ldl
-
-$as_echo "#define HAVE_DLOPEN 1" >>confdefs.h
-
 fi
 
 
@@ -13069,7 +13066,10 @@ if test "$ac_res" != no; then :
 fi
 
 fi
-for ac_func in         __secure_getenv         add_key         backtrace       blkid_probe_get_topology        blkid_probe_enable_partitions   chflags         fadvise64       fallocate       fallocate64     fchown  fdatasync       fstat64         ftruncate64     futimes         getcwd  getdtablesize   getmntinfo      getpwuid_r      getrlimit       getrusage       jrand48         keyctl  llistxattr      llseek  lseek64         mallinfo        mbstowcs        memalign        mempcpy         mmap    msync   nanosleep       open64  pathconf        posix_fadvise   posix_fadvise64         posix_memalign  prctl   pread   pwrite  pread64         pwrite64        secure_getenv   setmntent       setresgid       setresuid       snprintf        srandom         stpcpy  strcasecmp      strdup  strnlen         strptime        strtoull        sync_file_range         sysconf         usleep  utime   utimes  valloc
+if test -n "$DLOPEN_LIB" ; then
+   ac_cv_func_dlopen=yes
+fi
+for ac_func in         __secure_getenv         add_key         backtrace       blkid_probe_get_topology        blkid_probe_enable_partitions   chflags         dlopen  fadvise64       fallocate       fallocate64     fchown  fdatasync       fstat64         ftruncate64     futimes         getcwd  getdtablesize   getmntinfo      getpwuid_r      getrlimit       getrusage       jrand48         keyctl  llistxattr      llseek  lseek64         mallinfo        mbstowcs        memalign        mempcpy         mmap    msync   nanosleep       open64  pathconf        posix_fadvise   posix_fadvise64         posix_memalign  prctl   pread   pwrite  pread64         pwrite64        secure_getenv   setmntent       setresgid       setresuid       snprintf        srandom         stpcpy  strcasecmp      strdup  strnlen         strptime        strtoull        sync_file_range         sysconf         usleep  utime   utimes  valloc
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -13175,7 +13175,7 @@ done
 
 fi
 
-if test "$ac_cv_lib_dl_dlopen" = yes ; then
+if test "$ac_cv_func_dlopen" = yes ; then
    MAGIC_LIB=$DLOPEN_LIB
 fi
 
index 5fa1ddba452e3f1322dcd76a7b38788050871d1f..67d723188d80c3662a76cc005fb0431b5985dff6 100644 (file)
@@ -84,9 +84,7 @@ dnl
 dnl Check to see if libdl exists for the sake of dlopen
 dnl
 DLOPEN_LIB=''
-AC_CHECK_LIB(dl, dlopen,
-[DLOPEN_LIB=-ldl
-AC_DEFINE(HAVE_DLOPEN, 1, [Define to 1 if dlopen/libdl exists])])
+AC_CHECK_LIB(dl, dlopen,DLOPEN_LIB=-ldl)
 AC_SUBST(DLOPEN_LIB)
 dnl
 AC_ARG_WITH([cc],
@@ -1081,6 +1079,9 @@ if test -n "$BLKID_CMT"; then
   AC_SEARCH_LIBS([blkid_probe_all], [blkid])
 fi
 dnl
+if test -n "$DLOPEN_LIB" ; then
+   ac_cv_func_dlopen=yes
+fi
 AC_CHECK_FUNCS(m4_flatten([
        __secure_getenv
        add_key
@@ -1088,6 +1089,7 @@ AC_CHECK_FUNCS(m4_flatten([
        blkid_probe_get_topology
        blkid_probe_enable_partitions
        chflags
+       dlopen
        fadvise64
        fallocate
        fallocate64
@@ -1155,7 +1157,7 @@ dnl See if libmagic exists
 dnl
 AC_CHECK_LIB(magic, magic_file, [MAGIC_LIB=-lmagic
 AC_CHECK_HEADERS([magic.h])])
-if test "$ac_cv_lib_dl_dlopen" = yes ; then
+if test "$ac_cv_func_dlopen" = yes ; then
    MAGIC_LIB=$DLOPEN_LIB
 fi
 AC_SUBST(MAGIC_LIB)
index da96e9f7e4df9edf508dc93d25d89d30b62157c9..bc006deef917443f5de718bbd67dcd0faf257ca5 100644 (file)
 /* Define to 1 if you have the <dirent.h> header file. */
 #undef HAVE_DIRENT_H
 
-/* Define to 1 if dlopen/libdl exists */
+/* Define to 1 if you have the `dlopen' function. */
 #undef HAVE_DLOPEN
 
 /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */