summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac35
1 files changed, 26 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac
index b7c1bc47..ed099702 100644
--- a/configure.ac
+++ b/configure.ac
@@ -87,8 +87,8 @@ AS_IF([test "x$enable_pie" != xno],[
save_CFLAGS="$CFLAGS"
save_CXXFLAGS="$CXXFLAGS"
save_LDFLAGS="$LDFLAGS"
- CFLAGS="$CFLAGS -fpie"
- CXXFLAGS="$CXXFLAGS -fpie"
+ CFLAGS="$CFLAGS -fPIE"
+ CXXFLAGS="$CXXFLAGS -fPIE"
LDFLAGS="$LDFLAGS -pie -Wl,-z,relro -Wl,-z,now"
AC_LINK_IFELSE([void main () {}], [
AC_MSG_NOTICE([Compiling with gcc pie et al.])
@@ -180,19 +180,36 @@ AM_CONDITIONAL(BUILD_ELFUTILS, test $build_elfutils = yes)
AC_SUBST(elfutils_abs_srcdir, `AS_IF([test $build_elfutils = yes],
[cd $with_elfutils && pwd])`)
+AC_ARG_ENABLE([staticdw],
+ [AS_HELP_STRING([--enable-staticdw], [support distributions with static libdw])])
+
if test $build_elfutils = no; then
# 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.
- stap_LIBS="-ldw -lebl"
+ AS_IF([test "x$enable_staticdw" != xyes],[stap_LIBS="-ldw -lebl"],
+ [stap_LIBS="-Wl,--start-group -ldw -lebl -Wl,--end-group -lelf"])
fi
AC_SUBST(stap_LIBS)
@@ -233,7 +250,7 @@ AC_CHECK_HEADERS([tr1/unordered_map])
AC_LANG_POP(C++)
AC_CONFIG_HEADERS([config.h:config.in])
-AC_CONFIG_FILES(Makefile doc/Makefile systemtap.spec stap.1 stapprobes.5 stapfuncs.5 stapex.5 staprun.8 man/stapprobes.iosched.5 man/stapprobes.netdev.5 man/stapprobes.nfs.5 man/stapprobes.nfsd.5 man/stapprobes.pagefault.5 man/stapprobes.process.5 man/stapprobes.rpc.5 man/stapprobes.scsi.5 man/stapprobes.signal.5 man/stapprobes.socket.5 man/stapprobes.tcp.5 man/stapprobes.udp.5)
+AC_CONFIG_FILES(Makefile doc/Makefile systemtap.spec stap.1 stapprobes.5 stapfuncs.5 stapvars.5 stapex.5 staprun.8 man/stapprobes.iosched.5 man/stapprobes.netdev.5 man/stapprobes.nfs.5 man/stapprobes.nfsd.5 man/stapprobes.pagefault.5 man/stapprobes.process.5 man/stapprobes.rpc.5 man/stapprobes.scsi.5 man/stapprobes.signal.5 man/stapprobes.socket.5 man/stapprobes.tcp.5 man/stapprobes.udp.5)
AC_CONFIG_SUBDIRS(testsuite)
AC_OUTPUT