aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schlemmer <azarah@gentoo.org>2005-12-05 09:53:28 +0000
committerMartin Schlemmer <azarah@gentoo.org>2005-12-05 09:53:28 +0000
commiteb334306e6f74d963ea0d7b18c0b33cef4210ed3 (patch)
tree275c1533720af19457b4a140f7800105474b9295 /configure.ac
parentQuoting fixes (diff)
downloadsandbox-eb334306e6f74d963ea0d7b18c0b33cef4210ed3.tar.gz
sandbox-eb334306e6f74d963ea0d7b18c0b33cef4210ed3.tar.bz2
sandbox-eb334306e6f74d963ea0d7b18c0b33cef4210ed3.zip
Add checks for bsd that have dlopen() in libc.
Signed-off-by: Martin Schlemmer <azarah@gentoo.org>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac19
1 files changed, 18 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 70033fd..3b5978e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -55,9 +55,26 @@ AC_CHECK_FUNCS([ \
strerror strndup strrchr strspn strstr \
])
+dnl Some libc's like those on bsd have dlopen() in libc, and not libdl
+AC_CHECK_LIB([dl], [dlopen],
+ [have_libdl="yes"],
+ [have_libdl="no"]
+)
+if test x"$have_libdl" = xyes ; then
+ LIBDL="-ldl"
+ AC_SUBST([LIBDL])
+ DL_LIB="dl"
+else
+ DL_LIB="c"
+ AC_CHECK_LIB([c], [dlopen],
+ [],
+ [AC_MSG_ERROR([Unable to determine library providing dlopen])]
+ )
+fi
+
dnl uClibc doesn't currently provide dlvsym() so lets
dnl verify the toolchain supports it
-AC_CHECK_LIB([dl], [dlvsym],
+AC_CHECK_LIB([$DL_LIB], [dlvsym],
[AC_DEFINE([HAVE_DLVSYM], [1], [libdl supports dlvsym])],
[AC_DEFINE([HAVE_DLVSYM], [0], [libdl does not support dlvsym])]
)