aboutsummaryrefslogtreecommitdiffhomepage
path: root/configure.ac
diff options
context:
space:
mode:
authorGravatar ross <unknown>2005-09-20 16:35:26 +0000
committerGravatar ross <unknown>2005-09-20 16:35:26 +0000
commit9e07e664ff3381521b8e410e0dab9f7d742e2559 (patch)
treed2ae30467729f78ef6e68e6848a3289d6b225e9d /configure.ac
parent366d3741b70c3a6a0e32f0e092c5b063678a7964 (diff)
[project @ 2005-09-20 16:35:26 by ross]
move RTLD_* tests down to unix package
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac79
1 files changed, 77 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 0f9a182..9a7932f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -48,8 +48,83 @@ case "$cv_func_usleep_return_type" in
;;
esac
-# TODO: avoid adding dl if absent or unneeded
-EXTRA_LIBS=dl
+dnl ** sometimes RTLD_NEXT is hidden in #ifdefs we really don't wan to set
+AC_MSG_CHECKING(for RTLD_NEXT from dlfcn.h)
+AC_EGREP_CPP(yes,
+[
+ #include <dlfcn.h>
+ #ifdef RTLD_NEXT
+ yes
+ #endif
+], [
+ AC_MSG_RESULT(yes)
+ AC_DEFINE([HAVE_RTLDNEXT], [1], [Define to 1 if we can see RTLD_NEXT in dlfcn.h.])
+], [
+ AC_MSG_RESULT(no)
+ ])
+
+dnl ** RTLD_DEFAULT isn't available on cygwin
+AC_MSG_CHECKING(for RTLD_DEFAULT from dlfcn.h)
+AC_EGREP_CPP(yes,
+[
+ #include <dlfcn.h>
+ #ifdef RTLD_DEFAULT
+ yes
+ #endif
+], [
+ AC_MSG_RESULT(yes)
+ AC_DEFINE([HAVE_RTLDDEFAULT], [1], [Define to 1 if RTLD_DEFAULT is available.])
+], [
+ AC_MSG_RESULT(no)
+ ])
+
+dnl ** RTLD_LOCAL isn't available on cygwin or openbsd
+AC_MSG_CHECKING(for RTLD_LOCAL from dlfcn.h)
+AC_EGREP_CPP(yes,
+[
+ #include <dlfcn.h>
+ #ifdef RTLD_LOCAL
+ yes
+ #endif
+], [
+ AC_MSG_RESULT(yes)
+ AC_DEFINE([HAVE_RTLDLOCAL], [1], [Define to 1 if RTLD_LOCAL is available.])
+], [
+ AC_MSG_RESULT(no)
+ ])
+
+dnl ** RTLD_GLOBAL isn't available on openbsd
+AC_MSG_CHECKING(for RTLD_GLOBAL from dlfcn.h)
+AC_EGREP_CPP(yes,
+[
+ #include <dlfcn.h>
+ #ifdef RTLD_GLOBAL
+ yes
+ #endif
+], [
+ AC_MSG_RESULT(yes)
+ AC_DEFINE([HAVE_RTLDGLOBAL], [1], [Define to 1 if RTLD_GLOBAL is available.])
+], [
+ AC_MSG_RESULT(no)
+ ])
+
+dnl ** RTLD_NOW isn't available on openbsd
+AC_MSG_CHECKING(for RTLD_NOW from dlfcn.h)
+AC_EGREP_CPP(yes,
+[
+ #include <dlfcn.h>
+ #ifdef RTLD_NOW
+ yes
+ #endif
+], [
+ AC_MSG_RESULT(yes)
+ AC_DEFINE([HAVE_RTLDNOW], [1], [Define to 1 if we can see RTLD_NOW in dlfcn.h])
+], [
+ AC_MSG_RESULT(no)
+ ])
+
+# Avoid adding dl if absent or unneeded
+AC_CHECK_LIB(dl, dlopen, [EXTRA_LIBS=dl], [EXTRA_LIBS=])
AC_SUBST([EXTRA_LIBS])
AC_CONFIG_FILES([unix.buildinfo])