From: Theodore Ts'o Date: Tue, 7 Jun 2016 04:14:35 +0000 (-0400) Subject: configure: fix detection of dlopen() for BSD systems X-Git-Tag: v1.43.1~10 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=32179ce25bff497e2e75a479ef97e9ae0b4bfd9c;p=tools%2Fe2fsprogs.git configure: fix detection of dlopen() for BSD systems Signed-off-by: Theodore Ts'o --- diff --git a/configure b/configure index ec274f3..e6be281 100755 --- 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 diff --git a/configure.ac b/configure.ac index 5fa1ddb..67d7231 100644 --- a/configure.ac +++ b/configure.ac @@ -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) diff --git a/lib/config.h.in b/lib/config.h.in index da96e9f..bc006de 100644 --- a/lib/config.h.in +++ b/lib/config.h.in @@ -120,7 +120,7 @@ /* Define to 1 if you have the 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.' */