From 92273e99dd31f84ec7d2513aea7352a2d19beec0 Mon Sep 17 00:00:00 2001 From: Diego Elio Pettenò Date: Sun, 17 May 2009 15:39:40 +0200 Subject: make the libdl/dlopen/dlvsym tests more autoconfy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ò Signed-off-by: Mike Frysinger --- configure.ac | 21 ++------------------- 1 file 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). -- cgit v1.2.3-65-gdbad