aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@gmail.com>2009-05-17 15:39:40 +0200
committerMike Frysinger <vapier@gentoo.org>2011-02-14 01:09:01 -0500
commit92273e99dd31f84ec7d2513aea7352a2d19beec0 (patch)
tree051e78a85c13286c425dd855f2ea791a835224e0
parentuse libtool 2.2 macro and avoid dirty hacks (diff)
downloadsandbox-92273e99dd31f84ec7d2513aea7352a2d19beec0.tar.gz
sandbox-92273e99dd31f84ec7d2513aea7352a2d19beec0.tar.bz2
sandbox-92273e99dd31f84ec7d2513aea7352a2d19beec0.zip
make the libdl/dlopen/dlvsym tests more autoconfyv2.5
Instead of testing manually for libdl and then libc for dlopen, just use AC_SEARCH_LIBS (and then AC_CHECK_FUNCS to check for dlvsym). The code is much nicer now. Signed-off-by: Diego Elio Pettenò <flameeyes@gmail.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rw-r--r--configure.ac21
1 files changed, 2 insertions, 19 deletions
diff --git a/configure.ac b/configure.ac
index a0a0a76..3f4025c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -232,28 +232,11 @@ if echo " $LDFLAGS " | $EGREP ' -static ' >/dev/null 2>&1; then
fi
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
+AC_SEARCH_LIBS([dlopen], [dl])
dnl uClibc doesn't currently provide dlvsym() so lets
dnl verify the toolchain supports it
-AC_CHECK_LIB([$DL_LIB], [dlvsym],
- [AC_DEFINE([HAVE_DLVSYM], [1], [libdl supports dlvsym])],
- [AC_DEFINE([HAVE_DLVSYM], [0], [libdl does not support dlvsym])]
-)
+AC_CHECK_FUNCS([dlvsym])
dnl when using libc5, (f)trucate's offset argument type is size_t with
dnl libc5, but it's off_t with libc6 (glibc2).