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], 2.2, 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
9 dnl We don't maintain a ChangeLog, which makes us non-GNU -> foreign.
10 AM_INIT_AUTOMAKE([no-dist foreign])
13 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
15 AC_USE_SYSTEM_EXTENSIONS
32 AM_GNU_GETTEXT(external)
33 AM_GNU_GETTEXT_VERSION(0.17)
35 AC_CHECK_FUNCS(openat)
37 dnl Handle the prologues option.
39 dnl If the user didn't specify --enable-prologues/--disable-prologues
40 dnl and the x86 system has a version of gcc less than version 4,
41 dnl automatically enable prologues.
42 if test "${enable_prologues+set}" != set; then
43 AC_MSG_CHECKING([to see if prologue searching should be the default])
44 if { echo '#if __i386__ == 1 && __GNUC__ < 4'
46 echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
53 AC_ARG_ENABLE([prologues],
54 AS_HELP_STRING([--enable-prologues], [make -P prologue-searching default]),
56 if test "$enable_prologues" = yes; then
57 AC_DEFINE([ENABLE_PROLOGUES],[],[make -P prologue-searching default])
60 dnl Handle the disable-sdt-probes option.
62 dnl Default to --disable-sdt-probes if --enable-sdt-probes/--disable-prologues
63 dnl was not specified and the gcc version is less than version 4,
65 if test "${enable_sdt_probes+set}" != set; then
66 AC_MSG_CHECKING([to see if sdt probes should be the default])
67 if { echo '#if __GNUC__ < 4'
69 echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
76 AC_ARG_ENABLE([sdt-probes],
77 [AS_HELP_STRING([--disable-sdt-probes],
78 [disable process.mark probes in stap, staprun, stapio])])
79 AS_IF([test "x$enable_sdt_probes" != xno], [
80 AC_DEFINE([ENABLE_SDT_PROBES], [1],
81 [Define to 1 to enable process.mark probes in stap, staprun, stapio.])
85 [AS_HELP_STRING([--disable-ssp], [disable gcc stack-protector])])
86 AS_IF([test "x$enable_ssp" != xno],[
88 save_CXXFLAGS="$CXXFLAGS"
89 CXXFLAGS="$CXXFLAGS -Werror -fstack-protector-all -D_FORTIFY_SOURCE=2"
90 CFLAGS="$CFLAGS -Werror -fstack-protector-all -D_FORTIFY_SOURCE=2"
91 AC_COMPILE_IFELSE([AC_LANG_SOURCE([int something ();])], [
92 AC_MSG_NOTICE([Compiling with gcc -fstack-protector-all et al.])
93 CFLAGS="$save_CFLAGS -fstack-protector-all -D_FORTIFY_SOURCE=2"
94 CXXFLAGS="$save_CXXFLAGS -fstack-protector-all -D_FORTIFY_SOURCE=2"],[
95 AC_MSG_NOTICE([Compiler does not support -fstack-protector-all et al.])
97 CXXFLAGS="$save_CXXFLAGS"])])
100 dnl Link with gold if possible
101 dnl but: https://bugzilla.redhat.com/show_bug.cgi?id=636603
103 dnl AC_PATH_PROG(GOLD, [ld.gold], [no])
104 dnl if test "x$GOLD" != "xno"
107 dnl ln -sf $GOLD Bdir/ld
108 dnl LDFLAGS="$LDFLAGS -B`pwd`/Bdir/"
109 dnl AC_MSG_NOTICE([using ld.gold to link])
113 # Compiling without fPIE by default (see PR 9922)
115 [AS_HELP_STRING([--enable-pie], [enable position-independent-executable])])
116 AS_IF([test "x$enable_pie" == xyes],[
119 PIELDFLAGS='-pie -Wl,-z,relro -Wl,-z,now'
120 save_CFLAGS="$CFLAGS"
121 save_CXXFLAGS="$CXXFLAGS"
122 save_LDFLAGS="$LDFLAGS"
123 CFLAGS="$CFLAGS $PIECFLAGS"
124 CXXFLAGS="$CXXFLAGS $PIECXXFLAGS"
125 LDFLAGS="$LDFLAGS $PIELDFLAGS"
126 AC_LINK_IFELSE([AC_LANG_SOURCE([void main () {}])], [
127 AC_MSG_NOTICE([Compiling with gcc pie et al.])
129 AC_MSG_NOTICE([Compiler does not support -pie et al.])
134 CFLAGS="$save_CFLAGS"
135 CXXFLAGS="$save_CXXFLAGS"
136 LDFLAGS="$save_LDFLAGS"
140 AC_SUBST(PIECXXFLAGS)
142 dnl Handle optional sqlite support. If enabled/disabled by the user,
143 dnl do the right thing. If not specified by the user, use it if
145 AC_ARG_ENABLE([sqlite],
146 AS_HELP_STRING([--enable-sqlite], [build with sqlite support]),
147 [], dnl ACTION-IF-GIVEN
148 [enable_sqlite=check]) dnl ACTION-IF-NOT-GIVEN
150 AS_IF([test "x$enable_sqlite" != xno],
151 [AC_CHECK_LIB([sqlite3], [sqlite3_open],
152 [AC_SUBST([sqlite3_LIBS], [-lsqlite3])
153 AC_DEFINE([HAVE_LIBSQLITE3], [1], [Define to 1 if you have the `sqlite3' library (-lsqlite3).])],
154 [if test "x$enable_sqlite" != xcheck; then
155 AC_MSG_FAILURE([--enable-sqlite was given, but test for sqlite failed])
158 dnl Handle the option to only build runtime
159 AC_ARG_ENABLE([translator],
160 AS_HELP_STRING([--disable-translator], [build only runtime utilities]),
162 [enable_translator="yes"])
163 AM_CONDITIONAL([BUILD_TRANSLATOR], [test "$enable_translator" == "yes"])
165 dnl Handle the option to build the crash extension
166 AC_ARG_ENABLE([crash],
167 AS_HELP_STRING([--enable-crash@<:@=DIRECTORY@:>@],
168 [enable crash extension (default is disabled). Optional DIRECTORY
169 is the path to the crash header file (needed if installed in a
170 non-standard location).]),
171 [if test "$enable_crash" != "no"; then
172 dnl Handle custom install dir (if needed)
173 save_CPPFLAGS="$CPPFLAGS"
174 if test "$enable_crash" != "yes"; then
175 staplog_CPPFLAGS=-I$enable_crash
176 CPPFLAGS="${staplog_CPPFLAGS} $CPPFLAGS"
177 AC_SUBST([staplog_CPPFLAGS])
179 AC_CHECK_HEADERS([crash/defs.h], [],
180 [AC_MSG_ERROR([cannot find required crash header (crash-devel may need to be installed)])],
184 CPPFLAGS="$save_CPPFLAGS"
187 AM_CONDITIONAL([BUILD_CRASHMOD], [test "$enable_crash" != "no"])
189 dnl Handle the option to build the documentation
191 AC_ARG_ENABLE([docs],
192 AS_HELP_STRING([--enable-docs],
193 [enable building documentation (default on if latex etc. found).]),
194 [enable_docs=$enableval],
195 [enable_docs="check"])
196 AC_CHECK_PROG(have_latex, latex, yes, no)
197 AC_CHECK_PROG(have_dvips, dvips, yes, no)
198 AC_CHECK_PROG(have_ps2pdf, ps2pdf, yes, no)
199 AC_CHECK_PROG(have_latex2html, latex2html, yes, no)
200 if test "x${have_latex}${have_dvips}${have_ps2pdf}${have_latex2html}" != "xyesyesyesyes"; then
201 if test "$enable_docs" == "yes"; then
202 AC_MSG_ERROR([cannot find all tools for building documentation])
204 if test "$enable_docs" == "check"; then
205 AC_MSG_WARN([will not build documentation, cannot find all tools])
208 if test "x${have_latex}${have_dvips}${have_ps2pdf}${have_latex2html}" == "xyesyesyesyes" -a "$enable_docs" != "no"; then
211 AM_CONDITIONAL([BUILD_DOCS], [test "$building_docs" == "yes"])
213 dnl Handle the options to build the publican options
214 building_publican="no"
215 AC_ARG_ENABLE([publican],
216 AS_HELP_STRING([--enable-publican],
217 [enable building publican documentation guides (default on if publican found and other documentation built).]),
218 [enable_publican=$enableval],
219 [enable_publican="check"])
220 if test "$building_docs" == "no" -a "$enable_publican" == "yes" ; then
221 AC_MSG_ERROR([must use --enable-docs with --enable-publican])
223 AC_CHECK_PROG(have_publican, publican, yes, no)
224 if test "$enable_publican" == "yes"; then
225 if test "x${have_publican}" != "xyes"; then
226 AC_MSG_ERROR([cannot find publican for building publican guides])
229 if test "x${have_publican}" == "xyes" -a "$enable_publican" != "no" -a "${building_docs}" == "yes"; then
230 building_publican="yes"
232 AM_CONDITIONAL([BUILD_PUBLICAN], [test "$building_publican" == "yes"])
233 publican_brand="common"
234 AC_ARG_WITH([publican-brand],
235 AS_HELP_STRING([--with-publican-brand=BRAND],
236 [building publican documentation guides using given brand (defaults to "common").]),
237 [publican_brand=$withval],
238 [publican_brand="common"])
239 PUBLICAN_BRAND=$publican_brand
240 AC_SUBST(PUBLICAN_BRAND)
242 dnl Handle the option to build the reference documentation
243 building_refdocs="no"
244 AC_ARG_ENABLE([refdocs],
245 AS_HELP_STRING([--enable-refdocs],
246 [enable building reference documentation (default on if xmlto etc. found and other documentation built).]),
247 [enable_refdocs=$enableval],
248 [enable_refdocs="check"])
249 if test "$building_docs" == "no" -a "$enable_refdocs" == "yes" ; then
250 AC_MSG_ERROR([must use --enable-docs with --enable-refdocs])
252 AC_CHECK_PROG(have_xmlto, xmlto, yes, no)
253 if test "$enable_refdocs" == "yes"; then
254 if test "x${have_xmlto}" != "xyes"; then
255 AC_MSG_ERROR([cannot find xmlto for building reference documentation])
258 if test "x${have_xmlto}" == "xyes" -a "$enable_refdocs" != "no" -a "${building_docs}" == "yes"; then
259 building_refdocs="yes"
261 AM_CONDITIONAL([BUILD_REFDOCS], [test "$building_refdocs" == "yes"])
263 AC_CHECK_PROG(have_fop, fop, yes, no)
264 if test "x${have_fop}" == "xyes"; then
265 # Due to rhbz505364 / 830266, we must actually test-run fop, not just
266 # hope that it works.
267 AC_MSG_CHECKING([to see if xmlto --with-fop actually works])
268 if xmlto --with-fop pdf ${srcdir}/doc/SystemTap_Tapset_Reference/dummy-tapsets.xml >/dev/null 2>&1; then
271 AC_MSG_RESULT([it's dead, Jim])
274 rm -f dummy-tapsets.pdf
276 AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" == "yes"])
278 dnl There is a strange bug in older versions of xmlto when generating pdf.
279 dnl https://bugzilla.redhat.com/show_bug.cgi?id=526273
280 dnl So make sure to have a chapter title starting with L plus an refentry.
281 dnl This will make sure the xmlto pdf support test fails on buggy versions.
282 cat > conftest.xml << 'EOF'
283 <?xml version="1.0" encoding="UTF-8"?>
284 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
285 "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []>
287 <bookinfo><title>foo</title></bookinfo>
288 <chapter id="logging.stp"><title>Logging Tapset</title>
289 <refentry id="API-log"><refnamediv><refname>log</refname>
290 <refpurpose>logging</refpurpose></refnamediv>
291 <refsect1><title>Description</title>
292 <para>baz</para></refsect1></refentry></chapter>
296 if test "x${have_xmlto}" == "xyes"; then
297 AC_MSG_CHECKING([for xmlto --stringparam support])
298 xmlto --stringparam man.authors.section.enabled=0 html-nochunks conftest.xml >/dev/null 2>&1
299 if test $? == 0; then
300 have_xmlto_stringparam="yes"
307 AM_CONDITIONAL([XMLTO_STRINGPARAM], [test "$have_xmlto_stringparam" == "yes"])
309 if test "x${building_refdocs}" == "xyes"; then
310 AC_MSG_CHECKING([for xmlto pdf support])
311 # xmlto pdf may work *only* with --with-fop
312 # XXX: To an extent this test is redundant in that the --with-fop test
313 # already ran xmlto --with-fop pdf ....
314 if test "x$have_fop" == "xyes"; then
315 XMLTOPDF_FOP=--with-fop
319 xmlto $XMLTOPDF_FOP pdf conftest.xml >& /dev/null
320 if test $? == 0; then
325 AC_MSG_WARN([Not building reference documentation in PDF format])
329 AM_CONDITIONAL([BUILD_PDFREFDOCS], [test "$have_xmlto_pdf" == "yes"])
333 dnl See if we have the nss/nspr headers and libraries
335 AS_HELP_STRING([--without-nss],
336 [Do not use NSS even if present]))
338 AS_IF([test "x$with_nss" != "xno"], [
339 PKG_CHECK_MODULES([nss], [nss >= 3],
341 AC_DEFINE([HAVE_NSS], [1], [Define to 1 if you have the nss libraries.])
345 AM_CONDITIONAL([HAVE_NSS], [test "${have_nss}" = "yes"])
347 dnl Handle the option to build the compile server.
348 AC_ARG_ENABLE([server],
349 AS_HELP_STRING([--enable-server],
350 [enable building of stap-server (default on if nss etc. found).]),
351 [enable_server=$enableval],
352 [enable_server="check"])
354 if test "$enable_server" != "no"; then
355 dnl See if we have enough libraries and tools to build the compile server
356 if test "x${have_nss}" != "xyes"; then
357 AC_MSG_WARN([will not build systemtap compile server, cannot find nss headers])
360 AM_CONDITIONAL([BUILD_SERVER], [test "${have_nss}" == "yes" -a "$enable_server" != "no"])
362 if test "${have_nss}" != "yes"; then
363 AC_MSG_WARN([compile-server client functionality will be disabled, cannot find nss development files])
366 dnl See if we have the avahi libraries and headers
368 AS_HELP_STRING([--without-avahi],
369 [Do not use Avahi even if present]))
371 AS_IF([test "x$with_avahi" != "xno"], [
372 PKG_CHECK_MODULES([avahi], [avahi-client],
374 AC_DEFINE([HAVE_AVAHI], [1], [Define to 1 if you have the avahi libraries.])
378 AM_CONDITIONAL([HAVE_AVAHI], [test "${have_avahi}" = "yes"])
380 if test "${have_avahi}" != "yes"; then
381 AC_MSG_WARN([some compile-server functionality will be restricted, cannot find avahi development files])
387 [AS_HELP_STRING([--with-rpm],
388 [query rpm database for missing debuginfos])], [], [with_rpm="auto"])
389 if test "$with_rpm" != "no"; then
390 AC_CHECK_LIB(rpm, rpmtsInitIterator, [
391 AC_DEFINE([HAVE_LIBRPM],[1],[have librpm])
392 stap_LIBS="$stap_LIBS -lc -lrpm"
393 have_librpm="yes"], [have_librpm="no"])
394 AC_CHECK_LIB(rpmio, rpmFreeCrypto, [
395 AC_DEFINE([HAVE_LIBRPMIO],[1],[have librpmio])
396 stap_LIBS="$stap_LIBS -lc -lrpmio"
397 have_librpmio="yes"], [have_librpmio="no"])
398 if test "x$have_librpm" != "xyes" -a "$with_rpm" == "yes"; then
399 AC_MSG_ERROR([cannot find librpm])
401 if test "x$have_librpmio" != "xyes" -a "$with_rpm" == "yes"; then
402 AC_MSG_WARN([cannot find librpmio])
407 dnl Handle elfutils. If '--with-elfutils=DIR' wasn't specified, used
408 dnl the system's elfutils.
410 AC_ARG_WITH([elfutils],
411 AS_HELP_STRING([--with-elfutils=DIRECTORY],
412 [find elfutils source code in DIRECTORY]),
414 case "$with_elfutils" in
415 yes) AC_MSG_ERROR([--with-elfutils requires an argument]) ;;
417 *) build_elfutils=yes ;;
419 AM_CONDITIONAL(BUILD_ELFUTILS, test $build_elfutils = yes)
420 AC_SUBST(elfutils_abs_srcdir, `AS_IF([test $build_elfutils = yes],
421 [cd $with_elfutils && pwd])`)
423 if test $enable_translator = yes; then
424 if test $build_elfutils = no; then
425 # Need libdwfl-capable recent elfutils http://elfutils.fedorahosted.org/
427 # On modern debian/ubuntu, libebl has been merged into libdw
428 # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=457543
430 AC_CHECK_LIB(ebl, ebl_get_elfmachine,[ebl_LIBS=-lebl],[ebl_LIBS=])
434 AC_CHECK_LIB(dw, dwfl_module_getsym,[],[
435 AC_MSG_ERROR([missing elfutils development headers/libraries (install elfutils-devel, libebl-dev, libdw-dev and/or libebl-devel)])],
436 [-Wl,--start-group -ldw $ebl_LIBS -Wl,--end-group -lelf])
437 AC_CHECK_LIB(dw, dwarf_next_unit,[],[
438 AC_MSG_ERROR([elfutils, libdw too old, need 0.148+])],
439 [-Wl,--start-group -ldw $ebl_LIBS -Wl,--end-group -lelf])
440 stap_LIBS="$stap_LIBS -Wl,--start-group -ldw $ebl_LIBS -Wl,--end-group -lelf"
443 # We built our own and stap_LDFLAGS points at the install.
444 stap_LIBS="$stap_LIBS -Wl,--start-group -ldw -lebl -Wl,--end-group -lelf"
449 AC_MSG_NOTICE([stap will link $stap_LIBS])
451 # staprun has more modest libelf needs
452 if test $build_elfutils = no; then
453 AC_CHECK_HEADERS([libelf.h])
456 dnl this will only succeed with elfutils 0.142+
457 AC_CHECK_LIB(elf,elf_getshdrstrndx,[
458 AC_DEFINE([HAVE_ELF_GETSHDRSTRNDX],[1],[Define to 1 if libelf has elf_getshdrstrndx])
459 staprun_LIBS="$staprun_LIBS -lelf"
463 # We built our own and staprun_LDFLAGS points at the install.
464 staprun_LIBS="$staprun_LIBS -lelf"
467 AC_SUBST(staprun_LIBS)
468 AC_MSG_NOTICE([staprun will link $staprun_LIBS])
471 dnl Plop in the build (configure) date
472 date=`date +%Y-%m-%d`
473 AC_DEFINE_UNQUOTED(DATE, "$date", [Configuration/build date])
474 AC_SUBST(DATE, "$date")
476 # Before PR4037, we used to arrange to pass CFLAGS+=-m64 for a staprun
477 # being compiled on 32-bit userspace but running against 64-bit kernels.
478 # This is no longer necessary.
480 # Use tr1/unordered_map if available
482 AC_CHECK_HEADERS([tr1/unordered_map])
483 AC_CHECK_HEADERS([tr1/memory])
484 AC_CHECK_HEADERS([boost/shared_ptr.hpp])
488 # Check for Dyninst headers and libraries
489 AC_ARG_WITH([dyninst],
490 AS_HELP_STRING([--with-dyninst=DIRECTORY],
491 [find dyninst headers/libraries in DIRECTORY]))
493 case "$with_dyninst" in
495 ''|yes) # Try a simple-minded distro search
496 DYNINST_CXXFLAGS="-I/usr/include/dyninst"
497 DYNINST_LDFLAGS="-L/usr/lib64/dyninst -L/usr/lib/dyninst" # XXX both lib paths!?!
499 *) # Use paths in the user-specified prefix
500 DYNINST_CXXFLAGS="-I$with_dyninst/include"
501 DYNINST_LDFLAGS="-L$with_dyninst/lib/" # XXX need lib64 too?
504 if test "$with_dyninst" != "no"; then
506 old_CPPFLAGS="$CPPFLAGS"
507 CPPFLAGS="$CPPFLAGS $DYNINST_CXXFLAGS"
508 AC_MSG_NOTICE([checking dyninst support])
509 AC_CHECK_HEADERS([BPatch_object.h], [
510 AC_SUBST(DYNINST_CXXFLAGS)
511 AC_SUBST(DYNINST_LDFLAGS)
512 AC_DEFINE([HAVE_DYNINST],[1],[Define to 1 if Dyninst is enabled])
514 AC_MSG_NOTICE([dyninst support available])])
515 if test -n "$with_dyninst" -a "$have_dyninst" != "yes"; then
516 AC_MSG_ERROR([Dyninst does not appear to be usable])
518 CPPFLAGS="$old_CPPFLAGS"
521 AM_CONDITIONAL([HAVE_DYNINST], [test "${have_dyninst}" = "yes"])
524 AC_CACHE_CHECK([for assembler .section "?" flags support], stap_cv_sectionq, [
526 CFLAGS="$CFLAGS -Wa,--fatal-warnings"
527 AC_COMPILE_IFELSE([AC_LANG_SOURCE([asm(".section .note.foo,\"?\",\"note\"\n"
530 ".section .text,\"axG\",\"progbits\",foogroup,comdat\n"
532 ".pushsection .note.foo,\"?\",\"note\"\n"
536 stap_cv_sectionq=yes, stap_cv_sectionq=no)
537 CFLAGS="$old_CFLAGS"])
538 AC_SUBST(support_section_question)
539 support_section_question=0
540 if test $stap_cv_sectionq = yes; then
541 support_section_question=1
543 AC_CONFIG_FILES([includes/sys/sdt-config.h po/Makefile.in])
545 if test $build_elfutils = yes -a $enable_translator = yes; then
546 case "$with_elfutils" in
547 /*) elfutils_srcdir="$with_elfutils" ;;
548 *) elfutils_srcdir="../$with_elfutils" ;;
550 AC_MSG_NOTICE([running ${elfutils_srcdir}/configure])
552 save_CFLAGS="$CFLAGS"
553 save_CXXFLAGS="$CXXFLAGS"
554 CXXFLAGS="$CXXFLAGS -fgnu89-inline"
555 CFLAGS="$CFLAGS -fgnu89-inline"
557 AC_COMPILE_IFELSE([AC_LANG_SOURCE([int something ();])], [
558 AC_MSG_NOTICE([Compiling elfutils with gcc -fgnu89-inline])
559 gnu89_inline_flag="-fgnu89-inline"],[
560 AC_MSG_NOTICE([Compiler does not support -fgnu89-inline])])
561 CFLAGS="$save_CFLAGS"
562 CXXFLAGS="$save_CXXFLAGS"
564 # Our libdw.so's libebl will look in $ORIGIN/../lib/... but that
565 # $ORIGIN is where libdw.so resides, which is not where there is a ../lib.
566 # Note that $libdir might be using a quoted use of $exec_prefix or $prefix.
567 # So we must make sure to pass those settings to elfutils configure.
568 elfutils_rpath="-Wl,--enable-new-dtags,-rpath,${libdir}/${PACKAGE_NAME}"
570 # Check whether this is a source release, or a source checkout.
571 # We need --enable-maintainer-mode if it isn't a source release.
572 # elfutils.spec is only distributed in source releases.
573 if test -f ${elfutils_srcdir}/elfutils.spec; then
574 need_maintainer_option=""
576 need_maintainer_option="--enable-maintainer-mode"
578 (mkdir -p build-elfutils && cd build-elfutils &&
579 bash ${elfutils_srcdir}/configure --enable-libebl-subdir=${PACKAGE_NAME} \
580 --includedir="${here}/include-elfutils" \
581 --libdir="${here}/lib-elfutils" \
582 --exec-prefix="$exec_prefix" \
584 ${need_maintainer_option} \
585 CFLAGS="${CFLAGS/-Wall/} $gnu89_inline_flag -fexceptions" \
586 LDFLAGS="$LDFLAGS $elfutils_rpath" &&
587 if test -f ${elfutils_srcdir}/config/version.h.in; then
588 echo Found elfutils/version.h header...
590 echo elfutils/version.h header not found, need elfutils 0.142+...
594 if test $? != 0; then exit -1; fi
597 dnl Optional libselinux support allows stapdyn to check
598 dnl for booleans that would prevent Dyninst from working.
599 AC_ARG_WITH([selinux],
600 AS_HELP_STRING([--without-selinux],
601 [Do not use libselinux even if present]))
603 AS_IF([test "x$with_selinux" != "xno"], [
604 PKG_CHECK_MODULES([selinux], [libselinux],
606 AC_DEFINE([HAVE_SELINUX], [1], [Define to 1 if you have the SELinux libraries.])
607 ], [have_selinux=no])
608 ], [have_selinux=no])
610 AM_CONDITIONAL([HAVE_SELINUX], [test "${have_selinux}" = "yes"])
612 dnl Handle java+byteman support
613 AC_CHECK_PROG(have_java, java, yes, no)
614 AC_CHECK_PROG(have_byteman_submit, bmsubmit.sh, yes, no)
615 AC_CHECK_PROG(have_byteman_install, bminstall.sh, yes, no)
616 if test -n "$have_java" -a "$have_byteman_submit" -a "$have_byteman_install" != no; then
618 # TODOXXX support specifying existing libHelperSDT.so using --with-helper ??
621 [AS_HELP_STRING([--with-jdk=DIRECTORY],
622 [Specify the directory containing the JDK install])],
624 [with_jdk=/usr/lib/jvm/java]) # TODOXXX is this a sensible default?
625 AC_CHECK_FILE([$with_jdk],[have_jdk=yes],[have_jdk=no])
627 AC_SUBST(JAVADIR, "$with_jdk")
629 if test -n "$with_jdk" -a "$have_jdk" != "no"; then
630 # echo DEFINING JAVA_HELPER : $with_jdk $have_jdk
631 AC_DEFINE_UNQUOTED(HAVE_JAVA_HELPER, "${with_jdk}/jre/lib/amd64", [Destination directory for libHelperSDT.so]) # TODOXXX customizability of postfix... coordinate with javahelperdir in java/Makefile.am....
633 # echo NOTDEFINING JAVA_HELPER : $with_jdk $have_jdk
636 AM_CONDITIONAL([HAVE_JAVA_HELPER], [test "${have_jdk}" != "no"])
639 AC_MSG_WARN([will not run per-method java probing, missing byteman or java requirements])
640 AM_CONDITIONAL([HAVE_JAVA_HELPER],false)
643 AC_SUBST(ENABLE_NLS, "$USE_NLS")
644 AC_SUBST(localedir, "$localedir")
645 AC_SUBST(LOCALEDIR, "$localedir")
647 AC_ARG_WITH([extra-version],
648 AS_HELP_STRING([--with-extra-version=STRING],
649 [Add STRING to stap -V version]))
650 AS_IF([test "x$with_extra_version" != "xno"], [
651 stap_extra_version="$with_extra_version"
652 AC_MSG_NOTICE([Adding extra version $stap_extra_version])], [
653 stap_extra_version=""])
654 AC_DEFINE_UNQUOTED(STAP_EXTRA_VERSION, "$stap_extra_version", [extra stap version code])
655 AC_SUBST(STAP_EXTRA_VERSION, "$stap_extra_version")
657 dnl This is here mainly to make sure that configure --prefix=... changes
658 dnl the config.h files so files depending on it are recompiled
659 dnl prefix is passed through indirectly in the Makefile.am AM_CPPFLAGS.
660 dnl Formerly: Don't use this directly (when not given it is set to NONE).
661 dnl Currently: inline autoconf's later defaulting
664 test "$stap_prefix" = NONE && stap_prefix=$ac_default_prefix
665 AC_DEFINE_UNQUOTED(STAP_PREFIX, "$stap_prefix", [configure prefix location])
666 AC_SUBST(STAP_PREFIX, "$stap_prefix")
668 AC_CONFIG_HEADERS([config.h:config.in])
669 AC_CONFIG_FILES([Makefile doc/Makefile man/Makefile \
670 doc/beginners/Makefile doc/SystemTap_Tapset_Reference/Makefile \
672 initscript/config.systemtap initscript/config.stap-server \
673 initscript/systemtap initscript/stap-server ])
674 AC_CONFIG_SUBDIRS(testsuite)
675 if test $enable_translator == "yes"; then
676 AC_CONFIG_FILES([run-stap], [chmod +x run-stap])
678 AC_CONFIG_FILES([dtrace], [chmod +x dtrace])
679 AC_CONFIG_FILES(stapdyn/Makefile)
680 AC_CONFIG_FILES(java/Makefile)
681 AC_CONFIG_FILES(staprun/Makefile)
682 AC_CONFIG_FILES([staprun/run-staprun], [chmod +x staprun/run-staprun])
683 AC_CONFIG_FILES(re2c-migrate/Makefile)
685 # Setup "shadow" directory doc/beginners that has everything setup for
686 # publican in one directory (through directory links if necessary).
687 # It would be nice to use AC_CONFIG_LINKS, but automake complains when
688 # the src is a directory and not a file.
689 AC_CONFIG_FILES([doc/beginners/publican.cfg:doc/SystemTap_Beginners_Guide/publican.cfg.in])
690 AC_CONFIG_COMMANDS([doc/beginners],
691 [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])
695 if test "${prefix}" = "/usr/local"; then
697 AC_MSG_NOTICE([For a private or temporary build of systemtap, we recommend])
698 AC_MSG_NOTICE([configuring with a prefix. For example, try])
699 AC_MSG_NOTICE([$0 $ac_configure_args --prefix=$HOME/systemtap-${PACKAGE_VERSION}-$$])
700 AC_MSG_NOTICE([Running systemtap uninstalled, entirely out of the build tree,])
701 AC_MSG_NOTICE([is not supported.])