aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2013-08-12 20:01:30 +0000
committerGuy Harris <guy@alum.mit.edu>2013-08-12 20:01:30 +0000
commitbebe1200ded4978ab25e42be368ab89552e79294 (patch)
treef8320615f7a14663e1e47dc2958cb2f8e6716511 /configure.ac
parent4b641014a28ad66bc10596b75e8862799ced6a49 (diff)
Just check whether dladdr() is available; we check in the code whether
it succeeds, so there's no point in checking whether it succeeds in a sample program. svn path=/trunk/; revision=51322
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac29
1 files changed, 20 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac
index 5d5676c36a..67731951bc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1574,23 +1574,34 @@ else
fi
#
-# If we have <dlfcn.h>, check whether we can use dladdr to find a
-# filename (hopefully, a full pathname, but no guarantees) for
-# the executable.
+# If we have <dlfcn.h>, check whether we have dladdr.
#
if test "$ac_cv_header_dlfcn_h" = "yes"
then
- AC_MSG_CHECKING(whether dladdr can be used to find the pathname of an executable)
- AC_WIRESHARK_CHECK_DLADDR
- if test x$ac_cv_dladdr_finds_executable_path = xno
+ #
+ # Use GLib compiler flags and linker flags; GLib's gmodule
+ # stuff uses the dl APIs if available, so it might know
+ # what flags are needed.
+ #
+ ac_save_CFLAGS="$CFLAGS"
+ ac_save_LIBS="$LIBS"
+ CFLAGS="$CFLAGS $GLIB_CFLAGS"
+ LIBS="$GLIB_LIBS $LIBS"
+ AC_CHECK_FUNCS(dladdr)
+ if test x$ac_cv_func_dladdr = xno
then
#
# OK, try it with -ldl, in case you need that to get
- # dladdr().
+ # dladdr(). For some reason, on Linux, that's not
+ # part of the GLib flags; perhaps GLib itself is
+ # linked with libdl, so that you can link with
+ # Glib and it'll pull libdl in itself.
#
- AC_WIRESHARK_CHECK_DLADDR(-ldl)
+ LIBS="$LIBS -ldl"
+ AC_CHECK_FUNCS(dladdr)
fi
- AC_MSG_RESULT($ac_cv_dladdr_finds_executable_path)
+ CFLAGS="$ac_save_CFLAGS"
+ LIBS="$ac_save_LIBS"
fi
#