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.6, 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
35 AM_GNU_GETTEXT(external)
36 AM_GNU_GETTEXT_VERSION([0.18.2])
38 AC_CHECK_FUNCS(openat)
40 dnl Handle the prologues option.
42 dnl If the user didn't specify --enable-prologues/--disable-prologues
43 dnl and the x86 system has a version of gcc less than version 4,
44 dnl automatically enable prologues.
45 if test "${enable_prologues+set}" != set; then
46 AC_MSG_CHECKING([to see if prologue searching should be the default])
47 if { echo '#if __i386__ == 1 && __GNUC__ < 4'
49 echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
56 AC_ARG_ENABLE([prologues],
57 AS_HELP_STRING([--enable-prologues], [make -P prologue-searching default]),
59 if test "$enable_prologues" = yes; then
60 AC_DEFINE([ENABLE_PROLOGUES],[],[make -P prologue-searching default])
63 dnl Handle the disable-sdt-probes option.
65 dnl Default to --disable-sdt-probes if --enable-sdt-probes/--disable-prologues
66 dnl was not specified and the gcc version is less than version 4,
68 if test "${enable_sdt_probes+set}" != set; then
69 AC_MSG_CHECKING([to see if sdt probes should be the default])
70 if { echo '#if __GNUC__ < 4'
72 echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
79 AC_ARG_ENABLE([sdt-probes],
80 [AS_HELP_STRING([--disable-sdt-probes],
81 [disable process.mark probes in stap, staprun, stapio])])
82 AS_IF([test "x$enable_sdt_probes" != xno], [
83 AC_DEFINE([ENABLE_SDT_PROBES], [1],
84 [Define to 1 to enable process.mark probes in stap, staprun, stapio.])
88 [AS_HELP_STRING([--disable-ssp], [disable gcc stack-protector])])
89 AS_IF([test "x$enable_ssp" != xno],[
91 save_CXXFLAGS="$CXXFLAGS"
92 CXXFLAGS="$CXXFLAGS -Werror -fstack-protector-all -D_FORTIFY_SOURCE=2"
93 CFLAGS="$CFLAGS -Werror -fstack-protector-all -D_FORTIFY_SOURCE=2"
94 AC_COMPILE_IFELSE([AC_LANG_SOURCE([int something ();])], [
95 AC_MSG_NOTICE([Compiling with gcc -fstack-protector-all et al.])
96 CFLAGS="$save_CFLAGS -fstack-protector-all -D_FORTIFY_SOURCE=2"
97 CXXFLAGS="$save_CXXFLAGS -fstack-protector-all -D_FORTIFY_SOURCE=2"],[
98 AC_MSG_NOTICE([Compiler does not support -fstack-protector-all et al.])
100 CXXFLAGS="$save_CXXFLAGS"])])
103 dnl Link with gold if possible
104 dnl but: https://bugzilla.redhat.com/show_bug.cgi?id=636603
106 dnl AC_PATH_PROG(GOLD, [ld.gold], [no])
107 dnl if test "x$GOLD" != "xno"
110 dnl ln -sf $GOLD Bdir/ld
111 dnl LDFLAGS="$LDFLAGS -B`pwd`/Bdir/"
112 dnl AC_MSG_NOTICE([using ld.gold to link])
116 # Compiling without fPIE by default (see PR 9922)
118 [AS_HELP_STRING([--enable-pie], [enable position-independent-executable])])
119 AS_IF([test "x$enable_pie" == xyes],[
122 PIELDFLAGS='-pie -Wl,-z,relro -Wl,-z,now'
123 save_CFLAGS="$CFLAGS"
124 save_CXXFLAGS="$CXXFLAGS"
125 save_LDFLAGS="$LDFLAGS"
126 CFLAGS="$CFLAGS $PIECFLAGS"
127 CXXFLAGS="$CXXFLAGS $PIECXXFLAGS"
128 LDFLAGS="$LDFLAGS $PIELDFLAGS"
129 AC_LINK_IFELSE([AC_LANG_SOURCE([void main () {}])], [
130 AC_MSG_NOTICE([Compiling with gcc pie et al.])
132 AC_MSG_NOTICE([Compiler does not support -pie et al.])
137 CFLAGS="$save_CFLAGS"
138 CXXFLAGS="$save_CXXFLAGS"
139 LDFLAGS="$save_LDFLAGS"
143 AC_SUBST(PIECXXFLAGS)
145 dnl Handle optional sqlite support. If enabled/disabled by the user,
146 dnl do the right thing. If not specified by the user, use it if
148 AC_ARG_ENABLE([sqlite],
149 AS_HELP_STRING([--enable-sqlite], [build with sqlite support]),
150 [], dnl ACTION-IF-GIVEN
151 [enable_sqlite=check]) dnl ACTION-IF-NOT-GIVEN
153 AS_IF([test "x$enable_sqlite" != xno],
154 [AC_CHECK_LIB([sqlite3], [sqlite3_open],
155 [AC_SUBST([sqlite3_LIBS], [-lsqlite3])
156 AC_DEFINE([HAVE_LIBSQLITE3], [1], [Define to 1 if you have the 'sqlite3' library (-lsqlite3).])],
157 [if test "x$enable_sqlite" != xcheck; then
158 AC_MSG_FAILURE([--enable-sqlite was given, but test for sqlite failed])
161 dnl Handle the option to only build runtime
162 AC_ARG_ENABLE([translator],
163 AS_HELP_STRING([--disable-translator], [build only runtime utilities]),
165 [enable_translator="yes"])
166 AM_CONDITIONAL([BUILD_TRANSLATOR], [test "$enable_translator" == "yes"])
168 dnl Handle the option to build the crash extension
169 AC_ARG_ENABLE([crash],
170 AS_HELP_STRING([--enable-crash@<:@=DIRECTORY@:>@],
171 [enable crash extension (default is disabled). Optional DIRECTORY
172 is the path to the crash header file (needed if installed in a
173 non-standard location).]),
174 [if test "$enable_crash" != "no"; then
175 dnl Handle custom install dir (if needed)
176 save_CPPFLAGS="$CPPFLAGS"
177 if test "$enable_crash" != "yes"; then
178 staplog_CPPFLAGS=-I$enable_crash
179 CPPFLAGS="${staplog_CPPFLAGS} $CPPFLAGS"
180 AC_SUBST([staplog_CPPFLAGS])
182 AC_CHECK_HEADERS([crash/defs.h], [],
183 [AC_MSG_ERROR([cannot find required crash header (crash-devel may need to be installed)])],
187 CPPFLAGS="$save_CPPFLAGS"
190 AM_CONDITIONAL([BUILD_CRASHMOD], [test "$enable_crash" != "no"])
192 dnl Handle the option to build the documentation
194 AC_ARG_ENABLE([docs],
195 AS_HELP_STRING([--enable-docs],
196 [enable building documentation (default on if latex etc. found).]),
197 [enable_docs=$enableval],
198 [enable_docs="check"])
199 AC_CHECK_PROG(have_xvfb, xvfb-run, yes, no)
200 AM_CONDITIONAL([HAVE_XVFB], [test "$have_xvfb" == "yes"])
201 AC_CHECK_PROG(have_latex, latex, yes, no)
202 AC_CHECK_PROG(have_dvips, dvips, yes, no)
203 AC_CHECK_PROG(have_ps2pdf, ps2pdf, yes, no)
204 AC_CHECK_PROG(have_latex2html, latex2html, yes, no)
205 if test "x${have_latex}${have_dvips}${have_ps2pdf}${have_latex2html}" != "xyesyesyesyes"; then
206 if test "$enable_docs" == "yes"; then
207 AC_MSG_ERROR([cannot find all tools for building documentation])
209 if test "$enable_docs" == "check"; then
210 AC_MSG_WARN([will not build documentation, cannot find all tools])
213 if test "x${have_latex}${have_dvips}${have_ps2pdf}${have_latex2html}" == "xyesyesyesyes" -a "$enable_docs" != "no"; then
216 AM_CONDITIONAL([BUILD_DOCS], [test "$building_docs" == "yes"])
218 dnl Handle the options to build the publican options
219 building_publican="no"
220 AC_ARG_ENABLE([publican],
221 AS_HELP_STRING([--enable-publican],
222 [enable building publican documentation guides (default on if publican found and other documentation built).]),
223 [enable_publican=$enableval],
224 [enable_publican="check"])
225 if test "$building_docs" == "no" -a "$enable_publican" == "yes" ; then
226 AC_MSG_ERROR([must use --enable-docs with --enable-publican])
228 AC_CHECK_PROG(have_publican, publican, yes, no)
229 if test "$enable_publican" == "yes"; then
230 if test "x${have_publican}" != "xyes"; then
231 AC_MSG_ERROR([cannot find publican for building publican guides])
234 if test "x${have_publican}" == "xyes" -a "$enable_publican" != "no" -a "${building_docs}" == "yes"; then
235 building_publican="yes"
237 AM_CONDITIONAL([BUILD_PUBLICAN], [test "$building_publican" == "yes"])
238 publican_brand="common"
239 AC_ARG_WITH([publican-brand],
240 AS_HELP_STRING([--with-publican-brand=BRAND],
241 [building publican documentation guides using given brand (defaults to "common").]),
242 [publican_brand=$withval],
243 [publican_brand="common"])
244 PUBLICAN_BRAND=$publican_brand
245 AC_SUBST(PUBLICAN_BRAND)
247 dnl Handle the option to build the reference documentation
248 building_refdocs="no"
249 AC_ARG_ENABLE([refdocs],
250 AS_HELP_STRING([--enable-refdocs],
251 [enable building reference documentation (default on if xmlto etc. found and other documentation built).]),
252 [enable_refdocs=$enableval],
253 [enable_refdocs="check"])
254 if test "$building_docs" == "no" -a "$enable_refdocs" == "yes" ; then
255 AC_MSG_ERROR([must use --enable-docs with --enable-refdocs])
257 AC_CHECK_PROG(have_xmlto, xmlto, yes, no)
258 if test "$enable_refdocs" == "yes"; then
259 if test "x${have_xmlto}" != "xyes"; then
260 AC_MSG_ERROR([cannot find xmlto for building reference documentation])
263 if test "x${have_xmlto}" == "xyes" -a "$enable_refdocs" != "no" -a "${building_docs}" == "yes"; then
264 building_refdocs="yes"
266 AM_CONDITIONAL([BUILD_REFDOCS], [test "$building_refdocs" == "yes"])
268 AC_CHECK_PROG(have_fop, fop, yes, no)
269 if test "x${have_fop}" == "xyes"; then
270 # Due to rhbz505364 / 830266, we must actually test-run fop, not just
271 # hope that it works.
272 AC_MSG_CHECKING([to see if xmlto --with-fop actually works])
273 if xmlto --with-fop pdf ${srcdir}/doc/SystemTap_Tapset_Reference/dummy-tapsets.xml >/dev/null 2>&1; then
276 AC_MSG_RESULT([it's dead, Jim])
279 rm -f dummy-tapsets.pdf
281 AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" == "yes"])
283 dnl There is a strange bug in older versions of xmlto when generating pdf.
284 dnl https://bugzilla.redhat.com/show_bug.cgi?id=526273
285 dnl So make sure to have a chapter title starting with L plus an refentry.
286 dnl This will make sure the xmlto pdf support test fails on buggy versions.
287 cat > conftest.xml << 'EOF'
288 <?xml version="1.0" encoding="UTF-8"?>
289 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
290 "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []>
292 <bookinfo><title>foo</title></bookinfo>
293 <chapter id="logging.stp"><title>Logging Tapset</title>
294 <refentry id="API-log"><refnamediv><refname>log</refname>
295 <refpurpose>logging</refpurpose></refnamediv>
296 <refsect1><title>Description</title>
297 <para>baz</para></refsect1></refentry></chapter>
301 if test "x${have_xmlto}" == "xyes"; then
302 AC_MSG_CHECKING([for xmlto --stringparam support])
303 xmlto --stringparam man.authors.section.enabled=0 html-nochunks conftest.xml >/dev/null 2>&1
304 if test $? == 0; then
305 have_xmlto_stringparam="yes"
312 AM_CONDITIONAL([XMLTO_STRINGPARAM], [test "$have_xmlto_stringparam" == "yes"])
314 if test "x${building_refdocs}" == "xyes"; then
315 AC_MSG_CHECKING([for xmlto pdf support])
316 # xmlto pdf may work *only* with --with-fop
317 # XXX: To an extent this test is redundant in that the --with-fop test
318 # already ran xmlto --with-fop pdf ....
319 if test "x$have_fop" == "xyes"; then
320 XMLTOPDF_FOP=--with-fop
324 xmlto $XMLTOPDF_FOP pdf conftest.xml >& /dev/null
325 if test $? == 0; then
330 AC_MSG_WARN([Not building reference documentation in PDF format])
334 AM_CONDITIONAL([BUILD_PDFREFDOCS], [test "$have_xmlto_pdf" == "yes"])
338 dnl See if we have the nss/nspr headers and libraries
340 AS_HELP_STRING([--without-nss],
341 [Do not use NSS even if present]))
343 AS_IF([test "x$with_nss" != "xno"], [
344 PKG_CHECK_MODULES([nss], [nss >= 3],
346 AC_DEFINE([HAVE_NSS], [1], [Define to 1 if you have the nss libraries.])
350 AM_CONDITIONAL([HAVE_NSS], [test "${have_nss}" = "yes"])
352 dnl Handle the option to build the compile server.
353 AC_ARG_ENABLE([server],
354 AS_HELP_STRING([--enable-server],
355 [enable building of stap-server (default on if nss etc. found).]),
356 [enable_server=$enableval],
357 [enable_server="check"])
359 if test "$enable_server" != "no"; then
360 dnl See if we have enough libraries and tools to build the compile server
361 if test "x${have_nss}" != "xyes"; then
362 AC_MSG_WARN([will not build systemtap compile server, cannot find nss headers])
365 AM_CONDITIONAL([BUILD_SERVER], [test "${have_nss}" == "yes" -a "$enable_server" != "no"])
367 if test "${have_nss}" != "yes"; then
368 AC_MSG_WARN([compile-server client functionality will be disabled, cannot find nss development files])
371 dnl See if we have the avahi libraries and headers
373 AS_HELP_STRING([--without-avahi],
374 [Do not use Avahi even if present]))
376 AS_IF([test "x$with_avahi" != "xno"], [
377 PKG_CHECK_MODULES([avahi], [avahi-client],
379 AC_DEFINE([HAVE_AVAHI], [1], [Define to 1 if you have the avahi libraries.])
383 AM_CONDITIONAL([HAVE_AVAHI], [test "${have_avahi}" = "yes"])
385 if test "${have_avahi}" != "yes"; then
386 AC_MSG_WARN([some compile-server functionality will be restricted, cannot find avahi development files])
392 [AS_HELP_STRING([--with-rpm],
393 [query rpm database for missing debuginfos])], [], [with_rpm="auto"])
394 if test "$with_rpm" != "no"; then
395 AC_CHECK_LIB(rpm, rpmtsInitIterator, [
396 AC_DEFINE([HAVE_LIBRPM],[1],[have librpm])
397 stap_LIBS="$stap_LIBS -lc -lrpm"
398 have_librpm="yes"], [have_librpm="no"])
399 AC_CHECK_LIB(rpmio, rpmFreeCrypto, [
400 AC_DEFINE([HAVE_LIBRPMIO],[1],[have librpmio])
401 stap_LIBS="$stap_LIBS -lc -lrpmio"
402 have_librpmio="yes"], [have_librpmio="no"])
403 if test "x$have_librpm" != "xyes" -a "$with_rpm" == "yes"; then
404 AC_MSG_ERROR([cannot find librpm])
406 if test "x$have_librpmio" != "xyes" -a "$with_rpm" == "yes"; then
407 AC_MSG_WARN([cannot find librpmio])
412 dnl Handle elfutils. If '--with-elfutils=DIR' wasn't specified, used
413 dnl the system's elfutils.
415 AC_ARG_WITH([elfutils],
416 AS_HELP_STRING([--with-elfutils=DIRECTORY],
417 [find elfutils source code in DIRECTORY]),
419 case "$with_elfutils" in
420 yes) AC_MSG_ERROR([--with-elfutils requires an argument]) ;;
422 *) build_elfutils=yes ;;
424 AM_CONDITIONAL(BUILD_ELFUTILS, test $build_elfutils = yes)
425 AC_SUBST(elfutils_abs_srcdir, `AS_IF([test $build_elfutils = yes],
426 [cd $with_elfutils && pwd])`)
428 if test $enable_translator = yes; then
429 if test $build_elfutils = no; then
430 # Need libdwfl-capable recent elfutils http://elfutils.fedorahosted.org/
432 # On modern debian/ubuntu, libebl has been merged into libdw
433 # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=457543
435 AC_CHECK_LIB(ebl, ebl_get_elfmachine,[ebl_LIBS=-lebl],[ebl_LIBS=])
439 AC_CHECK_LIB(dw, dwfl_module_getsym,[],[
440 AC_MSG_ERROR([missing elfutils development headers/libraries (install elfutils-devel, libebl-dev, libdw-dev and/or libebl-devel)])],
441 [-Wl,--start-group -ldw $ebl_LIBS -Wl,--end-group -lelf])
442 AC_CHECK_LIB(dw, dwarf_next_unit,[],[
443 AC_MSG_ERROR([elfutils, libdw too old, need 0.148+])],
444 [-Wl,--start-group -ldw $ebl_LIBS -Wl,--end-group -lelf])
445 stap_LIBS="$stap_LIBS -Wl,--start-group -ldw $ebl_LIBS -Wl,--end-group -lelf"
448 # We built our own and stap_LDFLAGS points at the install.
449 stap_LIBS="$stap_LIBS -Wl,--start-group -ldw -lebl -Wl,--end-group -lelf"
454 AC_MSG_NOTICE([stap will link $stap_LIBS])
456 # staprun has more modest libelf needs
457 if test $build_elfutils = no; then
459 dnl this will only succeed with elfutils 0.142+
460 AC_CHECK_LIB(elf,elf_getshdrstrndx,[],[
461 AC_MSG_FAILURE([libelf too old, need 0.142+])])
462 staprun_LIBS="$staprun_LIBS -lelf"
465 # We built our own and staprun_LDFLAGS points at the install.
466 staprun_LIBS="$staprun_LIBS -lelf"
469 AC_SUBST(staprun_LIBS)
470 AC_MSG_NOTICE([staprun will link $staprun_LIBS])
473 dnl Plop in the build (configure) date
474 date=`date +%Y-%m-%d`
475 AC_DEFINE_UNQUOTED(DATE, "$date", [Configuration/build date])
476 AC_SUBST(DATE, "$date")
478 # Before PR4037, we used to arrange to pass CFLAGS+=-m64 for a staprun
479 # being compiled on 32-bit userspace but running against 64-bit kernels.
480 # This is no longer necessary.
482 # Use tr1/unordered_map if available
484 AC_CHECK_HEADERS([tr1/unordered_map])
485 AC_CHECK_HEADERS([tr1/memory])
486 AC_CHECK_HEADERS([boost/shared_ptr.hpp])
490 # Check for Dyninst headers and libraries
491 AC_ARG_WITH([dyninst],
492 AS_HELP_STRING([--with-dyninst=DIRECTORY],
493 [find dyninst headers/libraries in DIRECTORY]))
495 case "$with_dyninst" in
497 ''|yes) # Try a simple-minded distro search
498 DYNINST_CXXFLAGS="-I/usr/include/dyninst"
499 DYNINST_LDFLAGS="-L/usr/lib64/dyninst -L/usr/lib/dyninst" # XXX both lib paths!?!
501 *) # Use paths in the user-specified prefix
502 DYNINST_CXXFLAGS="-I$with_dyninst/include"
503 DYNINST_LDFLAGS="-L$with_dyninst/lib/" # XXX need lib64 too?
506 if test "$with_dyninst" != "no"; then
508 old_CPPFLAGS="$CPPFLAGS"
509 CPPFLAGS="$CPPFLAGS $DYNINST_CXXFLAGS"
510 AC_MSG_NOTICE([checking dyninst support])
511 AC_CHECK_HEADERS([BPatch_object.h], [
512 AC_SUBST(DYNINST_CXXFLAGS)
513 AC_SUBST(DYNINST_LDFLAGS)
514 AC_DEFINE([HAVE_DYNINST],[1],[Define to 1 if Dyninst is enabled])
516 AC_MSG_NOTICE([dyninst support available])])
517 if test -n "$with_dyninst" -a "$have_dyninst" != "yes"; then
518 AC_MSG_ERROR([Dyninst does not appear to be usable])
520 CPPFLAGS="$old_CPPFLAGS"
523 AM_CONDITIONAL([HAVE_DYNINST], [test "${have_dyninst}" = "yes"])
525 dnl Check for the libvirt and libxml2 devel packages
527 dnl We require libvirt >= 1.0.2 because stapvirt relies on the
528 dnl virDomainOpenChannel function, which was implemented in 1.0.2.
529 PKG_CHECK_MODULES([libvirt], [libvirt >= 1.0.2], [
531 AC_DEFINE([HAVE_LIBVIRT],[1],[Define to 1 if libvirt development libraries are installed])
532 ], [have_libvirt=no])
533 AM_CONDITIONAL([HAVE_LIBVIRT], [test "${have_libvirt}" = "yes"])
534 PKG_CHECK_MODULES([libxml2], [libxml-2.0], [
536 AC_DEFINE([HAVE_LIBXML2],[1],[Define to 1 if libxml2 development libraries are installed])
537 ], [have_libxml2=no])
538 AM_CONDITIONAL([HAVE_LIBXML2], [test "${have_libxml2}" = "yes"])
540 AC_CACHE_CHECK([for assembler .section "?" flags support], stap_cv_sectionq, [
542 CFLAGS="$CFLAGS -Wa,--fatal-warnings"
543 AC_COMPILE_IFELSE([AC_LANG_SOURCE([asm(".section .note.foo,\"?\",\"note\"\n"
546 ".section .text,\"axG\",\"progbits\",foogroup,comdat\n"
548 ".pushsection .note.foo,\"?\",\"note\"\n"
552 stap_cv_sectionq=yes, stap_cv_sectionq=no)
553 CFLAGS="$old_CFLAGS"])
554 AC_SUBST(support_section_question)
555 support_section_question=0
556 if test $stap_cv_sectionq = yes; then
557 support_section_question=1
559 AC_CONFIG_FILES([includes/sys/sdt-config.h po/Makefile.in])
561 if test $build_elfutils = yes -a $enable_translator = yes; then
563 case "$with_elfutils" in
564 /*) elfutils_srcdir="$with_elfutils" ;;
565 *) elfutils_srcdir="${here}/$with_elfutils" ;;
568 if ! test -f ${elfutils_srcdir}/configure; then
569 AC_MSG_ERROR([No ${elfutils_srcdir}/configure, forgot to run autoreconf -i?])
571 AC_MSG_NOTICE([running ${elfutils_srcdir}/configure])
573 save_CFLAGS="$CFLAGS"
574 save_CXXFLAGS="$CXXFLAGS"
575 CXXFLAGS="$CXXFLAGS -fgnu89-inline"
576 CFLAGS="$CFLAGS -fgnu89-inline"
578 AC_COMPILE_IFELSE([AC_LANG_SOURCE([int something ();])], [
579 AC_MSG_NOTICE([Compiling elfutils with gcc -fgnu89-inline])
580 gnu89_inline_flag="-fgnu89-inline"],[
581 AC_MSG_NOTICE([Compiler does not support -fgnu89-inline])])
582 CFLAGS="$save_CFLAGS"
583 CXXFLAGS="$save_CXXFLAGS"
585 # Our libdw.so's libebl will look in $ORIGIN/../lib/... but that
586 # $ORIGIN is where libdw.so resides, which is not where there is a ../lib.
587 # Note that $libdir might be using a quoted use of $exec_prefix or $prefix.
588 # So we must make sure to pass those settings to elfutils configure.
589 elfutils_rpath="-Wl,--enable-new-dtags,-rpath,${libdir}/${PACKAGE_NAME}"
590 # Check whether this is a source release, or a source checkout.
591 # We need --enable-maintainer-mode if it isn't a source release.
592 # elfutils.spec is only distributed in source releases.
593 if test -f ${elfutils_srcdir}/elfutils.spec; then
594 need_maintainer_option=""
596 need_maintainer_option="--enable-maintainer-mode"
598 (mkdir -p build-elfutils && cd build-elfutils &&
599 bash ${elfutils_srcdir}/configure --enable-libebl-subdir=${PACKAGE_NAME} \
600 --includedir="${here}/include-elfutils" \
601 --libdir="${here}/lib-elfutils" \
602 --exec-prefix="$exec_prefix" \
605 ${need_maintainer_option} \
606 CFLAGS="${CFLAGS/-Wall/} $gnu89_inline_flag -fexceptions" \
607 LDFLAGS="$LDFLAGS $elfutils_rpath" &&
608 if test -f ${elfutils_srcdir}/config/version.h.in; then
609 echo Found elfutils/version.h header...
611 echo elfutils/version.h header not found, need elfutils 0.142+...
615 if test $? != 0; then exit -1; fi
618 dnl Optional libselinux support allows stapdyn to check
619 dnl for booleans that would prevent Dyninst from working.
620 AC_ARG_WITH([selinux],
621 AS_HELP_STRING([--without-selinux],
622 [Do not use libselinux even if present]))
624 AS_IF([test "x$with_selinux" != "xno"], [
625 PKG_CHECK_MODULES([selinux], [libselinux],
627 AC_DEFINE([HAVE_SELINUX], [1], [Define to 1 if you have the SELinux libraries.])
628 ], [have_selinux=no])
629 ], [have_selinux=no])
631 AM_CONDITIONAL([HAVE_SELINUX], [test "${have_selinux}" = "yes"])
633 dnl Handle java+byteman support
634 AC_CHECK_PROG(have_javac, javac, yes, no)
635 AC_CHECK_PROG(have_jar, jar, yes, no)
636 if test "$have_javac" != no -a "$have_jar" != no; then
637 echo java found, will try to configure Byteman support
640 [AS_HELP_STRING([--with-java=DIRECTORY],
641 [Specify JDK directory to compile libHelperSDT.so against (default is /usr/lib/jvm/java)])],
643 [with_java=/usr/lib/jvm/java])
644 dnl don't use AC_CHECK_FILE here, as that blocks cross-compiling
645 if test ! -d "$with_java"; then
648 AC_SUBST(JAVADIR, "${with_java}") # always needed to compile
650 if test "$with_java" != "no"; then
651 AC_DEFINE_UNQUOTED(HAVE_JAVA, "1", [Flag indicating that libHelperSDT.so is available (can be found in PKGLIBDIR)])
654 AM_CONDITIONAL([HAVE_JAVA], [test "$with_java" != "no"])
657 AC_MSG_WARN([will not run per-method java probing, missing byteman or java requirements])
658 AM_CONDITIONAL([HAVE_JAVA],false)
659 fi # java+byteman support
661 AC_SUBST(ENABLE_NLS, "$USE_NLS")
662 AC_SUBST(localedir, "$localedir")
663 AC_SUBST(LOCALEDIR, "$localedir")
665 AC_ARG_WITH([extra-version],
666 AS_HELP_STRING([--with-extra-version=STRING],
667 [Add STRING to stap -V version]))
668 AS_IF([test "x$with_extra_version" != "xno"], [
669 stap_extra_version="$with_extra_version"
670 AC_MSG_NOTICE([Adding extra version $stap_extra_version])], [
671 stap_extra_version=""])
672 AC_DEFINE_UNQUOTED(STAP_EXTRA_VERSION, "$stap_extra_version", [extra stap version code])
673 AC_SUBST(STAP_EXTRA_VERSION, "$stap_extra_version")
675 dnl This is here mainly to make sure that configure --prefix=... changes
676 dnl the config.h files so files depending on it are recompiled
677 dnl prefix is passed through indirectly in the Makefile.am AM_CPPFLAGS.
678 dnl Formerly: Don't use this directly (when not given it is set to NONE).
679 dnl Currently: inline autoconf's later defaulting
682 test "$stap_prefix" = NONE && stap_prefix=$ac_default_prefix
683 AC_DEFINE_UNQUOTED(STAP_PREFIX, "$stap_prefix", [configure prefix location])
684 AC_SUBST(STAP_PREFIX, "$stap_prefix")
686 AC_CONFIG_HEADERS([config.h:config.in])
687 AC_CONFIG_FILES([Makefile doc/Makefile man/Makefile \
688 doc/beginners/Makefile doc/SystemTap_Tapset_Reference/Makefile \
689 man/stappaths.7 man/systemtap.8 \
690 initscript/config.systemtap initscript/config.stap-server \
691 initscript/systemtap initscript/stap-server \
692 initscript/99stap/module-setup.sh ])
693 AC_CONFIG_SUBDIRS(testsuite)
694 if test $enable_translator == "yes"; then
695 AC_CONFIG_FILES([run-stap], [chmod +x run-stap])
697 AC_CONFIG_FILES([dtrace], [chmod +x dtrace])
698 AC_CONFIG_FILES(stapdyn/Makefile)
699 AC_CONFIG_FILES(java/Makefile)
700 AC_CONFIG_FILES([java/stapbm], [chmod +x java/stapbm])
701 AC_CONFIG_FILES(staprun/Makefile)
702 AC_CONFIG_FILES([staprun/run-staprun], [chmod +x staprun/run-staprun])
703 AC_CONFIG_FILES([staprun/guest/stapshd], [chmod +x staprun/guest/stapshd])
704 AC_CONFIG_FILES([staprun/guest/stapsh-daemon], [chmod +x staprun/guest/stapsh-daemon])
705 AC_CONFIG_FILES([staprun/guest/stapsh@.service])
707 # Setup "shadow" directory doc/beginners that has everything setup for
708 # publican in one directory (through directory links if necessary).
709 # It would be nice to use AC_CONFIG_LINKS, but automake complains when
710 # the src is a directory and not a file.
711 AC_CONFIG_FILES([doc/beginners/publican.cfg:doc/SystemTap_Beginners_Guide/publican.cfg.in])
712 AC_CONFIG_COMMANDS([doc/beginners],
713 [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])
717 if test "${prefix}" = "/usr/local"; then
719 AC_MSG_NOTICE([For a private or temporary build of systemtap, we recommend])
720 AC_MSG_NOTICE([configuring with a prefix. For example, try])
721 AC_MSG_NOTICE([$0 $ac_configure_args --prefix=$HOME/systemtap-${PACKAGE_VERSION}-$$])
722 AC_MSG_NOTICE([Running systemtap uninstalled, entirely out of the build tree,])
723 AC_MSG_NOTICE([is not supported.])