1 dnl configure.ac --- autoconf input file for systemtap
2 dnl Process this file with autoconf to produce a configure script.
4 AC_INIT([systemtap], 3.0, systemtap@sourceware.org, systemtap)
5 dnl ^^^ see also NEWS, systemtap.spec, testsuite/configure.ac
6 dnl doc/SystemTap_Beginners_Guide/en-US/Book_Info.xml
8 dnl Get the target arch for libHelperSDT.so
12 dnl We don't maintain a ChangeLog, which makes us non-GNU -> foreign.
13 AM_INIT_AUTOMAKE([no-dist foreign])
16 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
18 AC_USE_SYSTEM_EXTENSIONS
36 AC_CHECK_FUNCS(openat)
37 AM_GNU_GETTEXT(external)
38 AM_GNU_GETTEXT_VERSION([0.19.4])
40 if test "x$GMSGFMT" = "x:"; then
41 AC_MSG_ERROR([missing gnu /usr/bin/msgfmt])
44 dnl Handle the prologues option.
46 dnl If the user didn't specify --enable-prologues/--disable-prologues
47 dnl and the x86 system has a version of gcc less than version 4,
48 dnl automatically enable prologues.
49 if test "${enable_prologues+set}" != set; then
50 AC_MSG_CHECKING([to see if prologue searching should be the default])
51 if { echo '#if __i386__ == 1 && __GNUC__ < 4'
53 echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
60 AC_ARG_ENABLE([prologues],
61 AS_HELP_STRING([--enable-prologues], [make -P prologue-searching default]),
63 if test "$enable_prologues" = yes; then
64 AC_DEFINE([ENABLE_PROLOGUES],[],[make -P prologue-searching default])
67 dnl Handle the disable-sdt-probes option.
69 dnl Default to --disable-sdt-probes if --enable-sdt-probes/--disable-prologues
70 dnl was not specified and the gcc version is less than version 4,
72 if test "${enable_sdt_probes+set}" != set; then
73 AC_MSG_CHECKING([to see if sdt probes should be the default])
74 if { echo '#if __GNUC__ < 4'
76 echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
83 AC_ARG_ENABLE([sdt-probes],
84 [AS_HELP_STRING([--disable-sdt-probes],
85 [disable process.mark probes in stap, staprun, stapio])])
86 AS_IF([test "x$enable_sdt_probes" != xno], [
87 AC_DEFINE([ENABLE_SDT_PROBES], [1],
88 [Define to 1 to enable process.mark probes in stap, staprun, stapio.])
92 [AS_HELP_STRING([--disable-ssp], [disable gcc stack-protector])])
93 AS_IF([test "x$enable_ssp" != xno],[
95 save_CXXFLAGS="$CXXFLAGS"
96 CXXFLAGS="$CXXFLAGS -Werror -fstack-protector-all -D_FORTIFY_SOURCE=2"
97 CFLAGS="$CFLAGS -Werror -fstack-protector-all -D_FORTIFY_SOURCE=2"
98 AC_COMPILE_IFELSE([AC_LANG_SOURCE([int something ();])], [
99 AC_MSG_NOTICE([Compiling with gcc -fstack-protector-all et al.])
100 CFLAGS="$save_CFLAGS -fstack-protector-all -D_FORTIFY_SOURCE=2"
101 CXXFLAGS="$save_CXXFLAGS -fstack-protector-all -D_FORTIFY_SOURCE=2"],[
102 AC_MSG_NOTICE([Compiler does not support -fstack-protector-all et al.])
103 CFLAGS="$save_CFLAGS"
104 CXXFLAGS="$save_CXXFLAGS"])])
107 dnl Link with gold if possible
108 dnl but: https://bugzilla.redhat.com/show_bug.cgi?id=636603
110 dnl AC_PATH_PROG(GOLD, [ld.gold], [no])
111 dnl if test "x$GOLD" != "xno"
114 dnl ln -sf $GOLD Bdir/ld
115 dnl LDFLAGS="$LDFLAGS -B`pwd`/Bdir/"
116 dnl AC_MSG_NOTICE([using ld.gold to link])
120 # Compiling without fPIE by default (see PR 9922)
122 [AS_HELP_STRING([--enable-pie], [enable position-independent-executable])])
123 AS_IF([test "x$enable_pie" == xyes],[
126 PIELDFLAGS='-pie -Wl,-z,relro -Wl,-z,now'
127 save_CFLAGS="$CFLAGS"
128 save_CXXFLAGS="$CXXFLAGS"
129 save_LDFLAGS="$LDFLAGS"
130 CFLAGS="$CFLAGS $PIECFLAGS"
131 CXXFLAGS="$CXXFLAGS $PIECXXFLAGS"
132 LDFLAGS="$LDFLAGS $PIELDFLAGS"
133 AC_LINK_IFELSE([AC_LANG_SOURCE([void main () {}])], [
134 AC_MSG_NOTICE([Compiling with gcc pie et al.])
136 AC_MSG_NOTICE([Compiler does not support -pie et al.])
141 CFLAGS="$save_CFLAGS"
142 CXXFLAGS="$save_CXXFLAGS"
143 LDFLAGS="$save_LDFLAGS"
147 AC_SUBST(PIECXXFLAGS)
149 dnl Handle optional sqlite support. If enabled/disabled by the user,
150 dnl do the right thing. If not specified by the user, use it if
152 AC_ARG_ENABLE([sqlite],
153 AS_HELP_STRING([--enable-sqlite], [build with sqlite support]),
154 [], dnl ACTION-IF-GIVEN
155 [enable_sqlite=check]) dnl ACTION-IF-NOT-GIVEN
157 AS_IF([test "x$enable_sqlite" != xno],
158 [AC_CHECK_LIB([sqlite3], [sqlite3_open],
159 [AC_SUBST([sqlite3_LIBS], [-lsqlite3])
160 AC_DEFINE([HAVE_LIBSQLITE3], [1], [Define to 1 if you have the 'sqlite3' library (-lsqlite3).])],
161 [if test "x$enable_sqlite" != xcheck; then
162 AC_MSG_FAILURE([--enable-sqlite was given, but test for sqlite failed])
165 dnl Handle the option to only build runtime
166 AC_ARG_ENABLE([translator],
167 AS_HELP_STRING([--disable-translator], [build only runtime utilities]),
169 [enable_translator="yes"])
170 AM_CONDITIONAL([BUILD_TRANSLATOR], [test "$enable_translator" == "yes"])
172 dnl Handle the option to build the crash extension
173 AC_ARG_ENABLE([crash],
174 AS_HELP_STRING([--enable-crash@<:@=DIRECTORY@:>@],
175 [enable crash extension (default is disabled). Optional DIRECTORY
176 is the path to the crash header file (needed if installed in a
177 non-standard location).]),
178 [if test "$enable_crash" != "no"; then
179 dnl Handle custom install dir (if needed)
180 save_CPPFLAGS="$CPPFLAGS"
181 if test "$enable_crash" != "yes"; then
182 staplog_CPPFLAGS=-I$enable_crash
183 CPPFLAGS="${staplog_CPPFLAGS} $CPPFLAGS"
184 AC_SUBST([staplog_CPPFLAGS])
186 AC_CHECK_HEADERS([crash/defs.h], [],
187 [AC_MSG_ERROR([cannot find required crash header (crash-devel may need to be installed)])],
191 CPPFLAGS="$save_CPPFLAGS"
194 AM_CONDITIONAL([BUILD_CRASHMOD], [test "$enable_crash" != "no"])
196 dnl Handle the option to build the documentation
198 AC_ARG_ENABLE([docs],
199 AS_HELP_STRING([--enable-docs],
200 [enable building documentation (default on if latex etc. found).]),
201 [enable_docs=$enableval],
202 [enable_docs="check"])
203 AC_CHECK_PROG(have_latex, latex, yes, no)
204 AC_CHECK_PROG(have_dvips, dvips, yes, no)
205 AC_CHECK_PROG(have_ps2pdf, ps2pdf, yes, no)
206 AC_CHECK_PROG(have_latex2html, latex2html, yes, no)
207 if test "x${have_latex}${have_dvips}${have_ps2pdf}${have_latex2html}" != "xyesyesyesyes"; then
208 if test "$enable_docs" == "yes"; then
209 AC_MSG_ERROR([cannot find all tools for building documentation])
211 if test "$enable_docs" == "check"; then
212 AC_MSG_WARN([will not build documentation, cannot find all tools])
215 if test "x${have_latex}${have_dvips}${have_ps2pdf}${have_latex2html}" == "xyesyesyesyes" -a "$enable_docs" != "no"; then
218 AM_CONDITIONAL([BUILD_DOCS], [test "$building_docs" == "yes"])
221 dnl Handle the option to build the reference documentation
222 building_refdocs="no"
223 AC_ARG_ENABLE([refdocs],
224 AS_HELP_STRING([--enable-refdocs],
225 [enable building reference documentation (default on if xmlto etc. found and other documentation built).]),
226 [enable_refdocs=$enableval],
227 [enable_refdocs="check"])
228 if test "$building_docs" == "no" -a "$enable_refdocs" == "yes" ; then
229 AC_MSG_ERROR([must use --enable-docs with --enable-refdocs])
231 AC_CHECK_PROG(have_xmlto, xmlto, yes, no)
232 if test "$enable_refdocs" == "yes"; then
233 if test "x${have_xmlto}" != "xyes"; then
234 AC_MSG_ERROR([cannot find xmlto for building reference documentation])
237 if test "x${have_xmlto}" == "xyes" -a "$enable_refdocs" != "no" -a "${building_docs}" == "yes"; then
238 building_refdocs="yes"
240 AM_CONDITIONAL([BUILD_REFDOCS], [test "$building_refdocs" == "yes"])
242 AC_CHECK_PROG(have_fop, fop, yes, no)
243 if test "x${have_fop}" == "xyes"; then
244 # Due to rhbz505364 / 830266, we must actually test-run fop, not just
245 # hope that it works.
246 AC_MSG_CHECKING([to see if xmlto --with-fop actually works])
247 if xmlto --with-fop pdf ${srcdir}/doc/SystemTap_Tapset_Reference/dummy-tapsets.xml >/dev/null 2>&1; then
250 AC_MSG_RESULT([it's dead, Jim])
253 rm -f dummy-tapsets.pdf
255 AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" == "yes"])
256 AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" == "yes"])
258 dnl There is a strange bug in older versions of xmlto when generating pdf.
259 dnl https://bugzilla.redhat.com/show_bug.cgi?id=526273
260 dnl So make sure to have a chapter title starting with L plus an refentry.
261 dnl This will make sure the xmlto pdf support test fails on buggy versions.
262 cat > conftest.xml << 'EOF'
263 <?xml version="1.0" encoding="UTF-8"?>
264 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
265 "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []>
267 <bookinfo><title>foo</title></bookinfo>
268 <chapter id="logging.stp"><title>Logging Tapset</title>
269 <refentry id="API-log"><refnamediv><refname>log</refname>
270 <refpurpose>logging</refpurpose></refnamediv>
271 <refsect1><title>Description</title>
272 <para>baz</para></refsect1></refentry></chapter>
276 if test "x${have_xmlto}" == "xyes"; then
277 AC_MSG_CHECKING([for xmlto --stringparam support])
278 xmlto --stringparam man.authors.section.enabled=0 html-nochunks conftest.xml >/dev/null 2>&1
279 if test $? == 0; then
280 have_xmlto_stringparam="yes"
287 AM_CONDITIONAL([XMLTO_STRINGPARAM], [test "$have_xmlto_stringparam" == "yes"])
289 if test "x${building_refdocs}" == "xyes"; then
290 AC_MSG_CHECKING([for xmlto pdf support])
291 # xmlto pdf may work *only* with --with-fop
292 # XXX: To an extent this test is redundant in that the --with-fop test
293 # already ran xmlto --with-fop pdf ....
294 if test "x$have_fop" == "xyes"; then
295 XMLTOPDF_FOP=--with-fop
299 xmlto $XMLTOPDF_FOP pdf conftest.xml >& /dev/null
300 if test $? == 0; then
305 AC_MSG_WARN([Not building reference documentation in PDF format])
309 AM_CONDITIONAL([BUILD_PDFREFDOCS], [test "$have_xmlto_pdf" == "yes"])
313 dnl See if we have the nss/nspr headers and libraries
315 AS_HELP_STRING([--without-nss],
316 [Do not use NSS even if present]))
318 AS_IF([test "x$with_nss" != "xno"], [
319 PKG_CHECK_MODULES([nss], [nss >= 3],
321 AC_DEFINE([HAVE_NSS], [1], [Define to 1 if you have the nss libraries.])
325 AM_CONDITIONAL([HAVE_NSS], [test "${have_nss}" = "yes"])
327 dnl Handle dracut directory configuration. Note we hard-code /usr by default,
328 dnl instead of $prefix, because dracut is a system service that doesn't listen
329 dnl at relocatable directories.
330 AC_ARG_WITH([dracutstap],
331 AS_HELP_STRING([--with-dracutstap=DIR],
332 [Install dracut module files in DIR]))
333 AS_IF([test "x$with_dracutstap" != "x"],[dracutstap="$with_dracutstap"],
334 [dracutstap=/usr/lib/dracut/modules.d/99stap])
335 AC_MSG_NOTICE([using dracut module directory $dracutstap])
338 dnl Handle the option to build the compile server.
339 AC_ARG_ENABLE([server],
340 AS_HELP_STRING([--enable-server],
341 [enable building of stap-server (default on if nss etc. found).]),
342 [enable_server=$enableval],
343 [enable_server="check"])
345 if test "$enable_server" != "no"; then
346 dnl See if we have enough libraries and tools to build the compile server
347 if test "x${have_nss}" != "xyes"; then
348 AC_MSG_WARN([will not build systemtap compile server, cannot find nss headers])
351 AM_CONDITIONAL([BUILD_SERVER], [test "${have_nss}" == "yes" -a "$enable_server" != "no"])
353 if test "${have_nss}" != "yes"; then
354 AC_MSG_WARN([compile-server client functionality will be disabled, cannot find nss development files])
357 dnl See if we have the avahi libraries and headers
359 AS_HELP_STRING([--without-avahi],
360 [Do not use Avahi even if present]))
362 AS_IF([test "x$with_avahi" != "xno"], [
363 PKG_CHECK_MODULES([avahi], [avahi-client],
365 AC_DEFINE([HAVE_AVAHI], [1], [Define to 1 if you have the avahi libraries.])
369 AM_CONDITIONAL([HAVE_AVAHI], [test "${have_avahi}" = "yes"])
371 if test "${have_avahi}" != "yes"; then
372 AC_MSG_WARN([some compile-server functionality will be restricted, cannot find avahi development files])
378 [AS_HELP_STRING([--with-rpm],
379 [query rpm database for missing debuginfos])], [], [with_rpm="auto"])
380 if test "$with_rpm" != "no"; then
381 AC_CHECK_LIB(rpm, rpmtsInitIterator, [
382 AC_DEFINE([HAVE_LIBRPM],[1],[have librpm])
383 stap_LIBS="$stap_LIBS -lc -lrpm"
384 have_librpm="yes"], [have_librpm="no"])
385 AC_CHECK_LIB(rpmio, rpmFreeCrypto, [
386 AC_DEFINE([HAVE_LIBRPMIO],[1],[have librpmio])
387 stap_LIBS="$stap_LIBS -lc -lrpmio"
388 have_librpmio="yes"], [have_librpmio="no"])
389 if test "x$have_librpm" != "xyes" -a "$with_rpm" == "yes"; then
390 AC_MSG_ERROR([cannot find librpm])
392 if test "x$have_librpmio" != "xyes" -a "$with_rpm" == "yes"; then
393 AC_MSG_WARN([cannot find librpmio])
398 dnl Allow user to choose python3 for /usr/bin/dtrace
399 AC_ARG_WITH([python3],
400 AS_HELP_STRING([--with-python3],[prefer /usr/bin/python3]))
401 AS_IF([test "x$with_python3" = "xyes"],
402 [AC_SUBST(python,[python3])],
403 [AC_SUBST(python,[python])])
405 dnl Handle elfutils. If '--with-elfutils=DIR' wasn't specified, used
406 dnl the system's elfutils.
408 AC_ARG_WITH([elfutils],
409 AS_HELP_STRING([--with-elfutils=DIRECTORY],
410 [find elfutils source code in DIRECTORY]),
412 case "$with_elfutils" in
413 yes) AC_MSG_ERROR([--with-elfutils requires an argument]) ;;
415 *) build_elfutils=yes ;;
417 AM_CONDITIONAL(BUILD_ELFUTILS, test $build_elfutils = yes)
418 AC_SUBST(elfutils_abs_srcdir, `AS_IF([test $build_elfutils = yes],
419 [cd $with_elfutils && pwd])`)
421 if test $enable_translator = yes; then
422 if test $build_elfutils = no; then
423 # Need libdwfl-capable recent elfutils http://elfutils.fedorahosted.org/
425 # On modern debian/ubuntu, libebl has been merged into libdw
426 # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=457543
428 AC_CHECK_LIB(ebl, ebl_get_elfmachine,[ebl_LIBS=-lebl],[ebl_LIBS=])
432 AC_CHECK_LIB(dw, dwfl_module_getsym,[],[
433 AC_MSG_ERROR([missing elfutils development headers/libraries (install elfutils-devel, libebl-dev, libdw-dev and/or libebl-devel)])],
434 [-Wl,--start-group -ldw $ebl_LIBS -Wl,--end-group -lelf])
435 AC_CHECK_LIB(dw, dwarf_next_unit,[],[
436 AC_MSG_ERROR([elfutils, libdw too old, need 0.148+])],
437 [-Wl,--start-group -ldw $ebl_LIBS -Wl,--end-group -lelf])
438 stap_LIBS="$stap_LIBS -Wl,--start-group -ldw $ebl_LIBS -Wl,--end-group -lelf"
441 # We built our own and stap_LDFLAGS points at the install.
442 stap_LIBS="$stap_LIBS -Wl,--start-group -ldw -lebl -Wl,--end-group -lelf"
447 AC_MSG_NOTICE([stap will link $stap_LIBS])
449 # staprun has more modest libelf needs
450 if test $build_elfutils = no; then
452 dnl this will only succeed with elfutils 0.142+
453 AC_CHECK_LIB(elf,elf_getshdrstrndx,[],[
454 AC_MSG_FAILURE([libelf too old, need 0.142+])])
455 staprun_LIBS="$staprun_LIBS -lelf"
458 # We built our own and staprun_LDFLAGS points at the install.
459 staprun_LIBS="$staprun_LIBS -lelf"
462 AC_SUBST(staprun_LIBS)
463 AC_MSG_NOTICE([staprun will link $staprun_LIBS])
466 dnl Plop in the build (configure) date
467 date=`date +%Y-%m-%d`
468 AC_DEFINE_UNQUOTED(DATE, "$date", [Configuration/build date])
469 AC_SUBST(DATE, "$date")
471 # Before PR4037, we used to arrange to pass CFLAGS+=-m64 for a staprun
472 # being compiled on 32-bit userspace but running against 64-bit kernels.
473 # This is no longer necessary.
475 # Use tr1/unordered_map if available
477 AC_CHECK_HEADERS([tr1/unordered_map])
478 AC_CHECK_HEADERS([tr1/memory])
479 AC_CHECK_HEADERS([boost/shared_ptr.hpp])
480 AC_CHECK_HEADERS([boost/utility/string_ref.hpp])
484 # Check for Dyninst headers and libraries
485 AC_ARG_WITH([dyninst],
486 AS_HELP_STRING([--with-dyninst=DIRECTORY],
487 [find dyninst headers/libraries in DIRECTORY]))
489 case "$with_dyninst" in
491 ''|yes) # Try a simple-minded distro search
492 DYNINST_CXXFLAGS="-I/usr/include/dyninst"
493 DYNINST_LDFLAGS="-L/usr/lib64/dyninst -L/usr/lib/dyninst" # XXX both lib paths!?!
495 *) # Use paths in the user-specified prefix
496 DYNINST_CXXFLAGS="-I$with_dyninst/include"
497 DYNINST_LDFLAGS="-L$with_dyninst/lib/" # XXX need lib64 too?
500 if test "$with_dyninst" != "no"; then
502 old_CPPFLAGS="$CPPFLAGS"
503 CPPFLAGS="$CPPFLAGS $DYNINST_CXXFLAGS"
504 AC_MSG_NOTICE([checking dyninst support])
505 AC_CHECK_HEADERS([BPatch_object.h], [
506 AC_SUBST(DYNINST_CXXFLAGS)
507 AC_SUBST(DYNINST_LDFLAGS)
508 AC_DEFINE([HAVE_DYNINST],[1],[Define to 1 if Dyninst is enabled])
510 AC_MSG_NOTICE([dyninst support available])])
511 if test -n "$with_dyninst" -a "$have_dyninst" != "yes"; then
512 AC_MSG_ERROR([Dyninst does not appear to be usable])
514 CPPFLAGS="$old_CPPFLAGS"
517 AM_CONDITIONAL([HAVE_DYNINST], [test "${have_dyninst}" = "yes"])
520 dnl Check for the libvirt and libxml2 devel packages
522 AC_ARG_ENABLE([virt],
523 AS_HELP_STRING([--enable-virt],
524 [enable building of stapvirt support (default on if libvirt etc. found).]),
525 [enable_virt=$enableval],
526 [enable_virt="check"])
528 dnl We require libvirt >= 1.0.2 because stapvirt relies on the
529 dnl virDomainOpenChannel function, which was implemented in 1.0.2.
530 PKG_CHECK_MODULES([libvirt], [libvirt >= 1.0.2], [
532 AC_DEFINE([HAVE_LIBVIRT],[1],[Define to 1 if libvirt development libraries are installed])
533 ], [have_libvirt=no])
534 AM_CONDITIONAL([HAVE_LIBVIRT], [test "${have_libvirt}" = "yes"])
535 PKG_CHECK_MODULES([libxml2], [libxml-2.0], [
537 AC_DEFINE([HAVE_LIBXML2],[1],[Define to 1 if libxml2 development libraries are installed])
538 ], [have_libxml2=no])
539 AM_CONDITIONAL([HAVE_LIBXML2], [test "${have_libxml2}" = "yes"])
541 if test "$enable_virt" != "no"; then
542 dnl See if we have enough libraries and tools to build the virt server
543 if test "x${have_libvirt}" != "xyes"; then
544 AC_MSG_WARN([will not build systemtap virt support, cannot find libvirt headers])
546 if test "x${have_libxml2}" != "xyes"; then
547 AC_MSG_WARN([will not build systemtap virt support, cannot find xml2 headers])
550 AM_CONDITIONAL([BUILD_VIRT], [test "${have_libvirt}" == "yes" -a "${have_libxml2}" == "yes" -a "$enable_virt" != "no"])
553 AC_CACHE_CHECK([for assembler .section "?" flags support], stap_cv_sectionq, [
555 CFLAGS="$CFLAGS -Wa,--fatal-warnings"
556 AC_COMPILE_IFELSE([AC_LANG_SOURCE([asm(".section .note.foo,\"?\",\"note\"\n"
559 ".section .text,\"axG\",\"progbits\",foogroup,comdat\n"
561 ".pushsection .note.foo,\"?\",\"note\"\n"
565 stap_cv_sectionq=yes, stap_cv_sectionq=no)
566 CFLAGS="$old_CFLAGS"])
567 AC_SUBST(support_section_question)
568 support_section_question=0
569 if test $stap_cv_sectionq = yes; then
570 support_section_question=1
572 AC_CONFIG_FILES([includes/sys/sdt-config.h po/Makefile.in])
574 if test $build_elfutils = yes -a $enable_translator = yes; then
576 case "$with_elfutils" in
577 /*) elfutils_srcdir="$with_elfutils" ;;
578 *) elfutils_srcdir="${here}/$with_elfutils" ;;
581 if ! test -f ${elfutils_srcdir}/configure; then
582 AC_MSG_ERROR([No ${elfutils_srcdir}/configure, forgot to run autoreconf -i?])
584 AC_MSG_NOTICE([running ${elfutils_srcdir}/configure])
586 save_CFLAGS="$CFLAGS"
587 save_CXXFLAGS="$CXXFLAGS"
588 CXXFLAGS="$CXXFLAGS -fgnu89-inline"
589 CFLAGS="$CFLAGS -fgnu89-inline"
591 AC_COMPILE_IFELSE([AC_LANG_SOURCE([int something ();])], [
592 AC_MSG_NOTICE([Compiling elfutils with gcc -fgnu89-inline])
593 gnu89_inline_flag="-fgnu89-inline"],[
594 AC_MSG_NOTICE([Compiler does not support -fgnu89-inline])])
595 CFLAGS="$save_CFLAGS"
596 CXXFLAGS="$save_CXXFLAGS"
598 # Our libdw.so's libebl will look in $ORIGIN/../lib/... but that
599 # $ORIGIN is where libdw.so resides, which is not where there is a ../lib.
600 # Note that $libdir might be using a quoted use of $exec_prefix or $prefix.
601 # So we must make sure to pass those settings to elfutils configure.
602 elfutils_rpath="-Wl,--enable-new-dtags,-rpath,${libdir}/${PACKAGE_NAME}"
603 # Check whether this is a source release, or a source checkout.
604 # We need --enable-maintainer-mode if it isn't a source release.
605 # elfutils.spec is only distributed in source releases.
606 if test -f ${elfutils_srcdir}/elfutils.spec; then
607 need_maintainer_option=""
609 need_maintainer_option="--enable-maintainer-mode"
611 (mkdir -p build-elfutils && cd build-elfutils &&
612 bash ${elfutils_srcdir}/configure --enable-libebl-subdir=${PACKAGE_NAME} \
613 --includedir="${here}/include-elfutils" \
614 --libdir="${here}/lib-elfutils" \
615 --exec-prefix="$exec_prefix" \
618 ${need_maintainer_option} \
619 CFLAGS="${CFLAGS/-Wall/} $gnu89_inline_flag -fexceptions" \
620 LDFLAGS="$LDFLAGS $elfutils_rpath" &&
621 if test -f ${elfutils_srcdir}/config/version.h.in; then
622 echo Found elfutils/version.h header...
624 echo elfutils/version.h header not found, need elfutils 0.142+...
628 if test $? != 0; then exit -1; fi
631 dnl Optional libselinux support allows stapdyn to check
632 dnl for booleans that would prevent Dyninst from working.
633 AC_ARG_WITH([selinux],
634 AS_HELP_STRING([--without-selinux],
635 [Do not use libselinux even if present]))
637 AS_IF([test "x$with_selinux" != "xno"], [
638 PKG_CHECK_MODULES([selinux], [libselinux],
640 AC_DEFINE([HAVE_SELINUX], [1], [Define to 1 if you have the SELinux libraries.])
641 ], [have_selinux=no])
642 ], [have_selinux=no])
644 AM_CONDITIONAL([HAVE_SELINUX], [test "${have_selinux}" = "yes"])
646 dnl Handle java+byteman support
647 AC_CHECK_PROG(have_javac, javac, yes, no)
648 AC_CHECK_PROG(have_jar, jar, yes, no)
649 if test "$have_javac" != no -a "$have_jar" != no; then
650 echo java found, will try to configure Byteman support
653 [AS_HELP_STRING([--with-java=DIRECTORY],
654 [Specify JDK directory to compile libHelperSDT.so against (default is /usr/lib/jvm/java)])],
656 [with_java=/usr/lib/jvm/java])
657 dnl don't use AC_CHECK_FILE here, as that blocks cross-compiling
658 if test ! -d "$with_java"; then
661 AC_SUBST(JAVADIR, "${with_java}") # always needed to compile
663 if test "$with_java" != "no"; then
664 AC_DEFINE_UNQUOTED(HAVE_JAVA, "1", [Flag indicating that libHelperSDT.so is available (can be found in PKGLIBDIR)])
667 AM_CONDITIONAL([HAVE_JAVA], [test "$with_java" != "no"])
670 AC_MSG_WARN([will not run per-method java probing, missing byteman or java requirements])
671 AM_CONDITIONAL([HAVE_JAVA],false)
672 fi # java+byteman support
674 AC_SUBST(ENABLE_NLS, "$USE_NLS")
675 AC_SUBST(localedir, "$localedir")
676 AC_SUBST(LOCALEDIR, "$localedir")
678 AC_ARG_WITH([extra-version],
679 AS_HELP_STRING([--with-extra-version=STRING],
680 [Add STRING to stap -V version]))
681 AS_IF([test "x$with_extra_version" != "xno"], [
682 stap_extra_version="$with_extra_version"
683 AC_MSG_NOTICE([Adding extra version $stap_extra_version])], [
684 stap_extra_version=""])
685 AC_DEFINE_UNQUOTED(STAP_EXTRA_VERSION, "$stap_extra_version", [extra stap version code])
686 AC_SUBST(STAP_EXTRA_VERSION, "$stap_extra_version")
688 dnl The stap translator stringtable benefits performance-wise from c++11 constructs.
689 AX_CHECK_COMPILE_FLAG([-std=c++11],[cxx11="-std=c++11"],[cxx11=""])
690 AS_IF([test "x$cxx11" != "x"],[
691 AC_MSG_NOTICE([Compiling parts of systemtap with -std=c++11])])
694 dnl This is here mainly to make sure that configure --prefix=... changes
695 dnl the config.h files so files depending on it are recompiled
696 dnl prefix is passed through indirectly in the Makefile.am AM_CPPFLAGS.
697 dnl Formerly: Don't use this directly (when not given it is set to NONE).
698 dnl Currently: inline autoconf's later defaulting
701 test "$stap_prefix" = NONE && stap_prefix=$ac_default_prefix
702 AC_DEFINE_UNQUOTED(STAP_PREFIX, "$stap_prefix", [configure prefix location])
703 AC_SUBST(STAP_PREFIX, "$stap_prefix")
705 AC_CONFIG_HEADERS([config.h:config.in])
706 AC_CONFIG_FILES([Makefile doc/Makefile man/Makefile \
707 doc/beginners/Makefile doc/SystemTap_Tapset_Reference/Makefile \
708 man/stappaths.7 man/systemtap.8 \
709 initscript/config.systemtap initscript/config.stap-server \
710 initscript/systemtap initscript/stap-server \
711 initscript/99stap/module-setup.sh ])
712 AC_CONFIG_SUBDIRS(testsuite)
713 if test $enable_translator == "yes"; then
714 AC_CONFIG_FILES([run-stap], [chmod +x run-stap])
716 AC_CONFIG_FILES([dtrace], [chmod +x dtrace])
717 AC_CONFIG_FILES(stapdyn/Makefile)
718 AC_CONFIG_FILES(java/Makefile)
719 AC_CONFIG_FILES([java/stapbm], [chmod +x java/stapbm])
720 AC_CONFIG_FILES(staprun/Makefile)
721 AC_CONFIG_FILES([staprun/run-staprun], [chmod +x staprun/run-staprun])
722 AC_CONFIG_FILES([staprun/guest/stapshd], [chmod +x staprun/guest/stapshd])
723 AC_CONFIG_FILES([staprun/guest/stapsh-daemon], [chmod +x staprun/guest/stapsh-daemon])
724 AC_CONFIG_FILES([staprun/guest/stapsh@.service])
726 # Setup "shadow" directory doc/beginners that has the basic directories setup for
727 # xmlto in one directory (through directory links if necessary).
728 # It would be nice to use AC_CONFIG_LINKS, but automake complains when
729 # the src is a directory and not a file.
730 AC_CONFIG_COMMANDS([doc/beginners],
731 [rm -f $ac_abs_top_builddir/doc/beginners/en-US $ac_abs_top_builddir/doc/beginners/build/en-US/testsuite && mkdir -p $ac_abs_top_builddir/doc/beginners/build/en-US && ln -s $ac_abs_top_srcdir/doc/SystemTap_Beginners_Guide/en-US $ac_abs_top_builddir/doc/beginners/en-US && ln -s $ac_abs_top_srcdir/testsuite $ac_abs_top_builddir/doc/beginners/build/en-US/testsuite])
735 if test "${prefix}" = "/usr/local"; then
737 AC_MSG_NOTICE([For a private or temporary build of systemtap, we recommend])
738 AC_MSG_NOTICE([configuring with a prefix. For example, try])
739 AC_MSG_NOTICE([$0 $ac_configure_args --prefix=$HOME/systemtap-${PACKAGE_VERSION}-$$])
740 AC_MSG_NOTICE([Running systemtap uninstalled, entirely out of the build tree,])
741 AC_MSG_NOTICE([is not supported.])