This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFC] [PATCH] Fix configure scripts for Debian systems


I found that on Debian systems (or at least Ubuntu Hardy), libdw is
shipped only as a static library.  This causes problems with our current
configure script, because there's apparently a circular link dependency
between libdw and libebl.

I added --enable-staticdw to configure, so it can try the link test in a
different way.  I'm no autoconf expert though, so I'd like others to
check this before I commit.  Or, if anyone knows how to do this without
the explicit option, that would be even better.

Thanks,

Josh


diff --git a/configure.ac b/configure.ac
index b561cf3..5ef44b9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -181,14 +181,30 @@ AC_SUBST(elfutils_abs_srcdir, `AS_IF([test $build_elfutils = yes],
                                     [cd $with_elfutils && pwd])`)

 if test $build_elfutils = no; then
+  AC_ARG_ENABLE([staticdw],
+    [AS_HELP_STRING([--enable-staticdw], [support distributions with static libdw])])
+
   # Need libdwfl-capable recent elfutils from Fedora
   save_LIBS="$LIBS"
-  AC_CHECK_LIB(dw, dwfl_module_getsym,,[
-    AC_MSG_ERROR([missing elfutils development headers/libraries (dw 0.123+)])])
-  AC_CHECK_LIB(ebl, ebl_openbackend,,[
-    AC_MSG_ERROR([missing elfutils development headers/libraries (ebl 0.123+)])])
+  AS_IF([test "x$enable_staticdw" != xyes],[
+    AC_CHECK_LIB(dw, dwfl_module_getsym,,[
+      AC_MSG_ERROR([missing elfutils development headers/libraries (dw 0.123+)])])
+    AC_CHECK_LIB(ebl, ebl_openbackend,,[
+      AC_MSG_ERROR([missing elfutils development headers/libraries (ebl 0.123+)])])
+
+    stap_LIBS="$LIBS"
+  ],[
+    # Debian ships with a static libdw, which has a circular dependency on libebl
+    AC_CHECK_LIB(dw, dwfl_module_getsym,[],[
+      AC_MSG_ERROR([missing elfutils development headers/libraries (dw 0.123+)])],
+      [-Wl,--start-group -ldw -lebl -Wl,--end-group -lelf])
+    dnl  XXX Do we need the ebl check, since it was referenced above?
+    AC_CHECK_LIB(ebl, ebl_openbackend,[],[
+      AC_MSG_ERROR([missing elfutils development headers/libraries (ebl 0.123+)])],
+      [-lelf])

-  stap_LIBS="$LIBS"
+    stap_LIBS="-Wl,--start-group -ldw -lebl -Wl,--end-group -lelf"
+  ])
   LIBS="$save_LIBS"
 else
   # We built our own and stap_LDFLAGS points at the install.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]