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], 1.5, systemtap@sources.redhat.com, systemtap)
5 dnl ^^^ see also NEWS, systemtap.spec, testsuite/configure.ac
8 AM_INIT_AUTOMAKE([no-dist foreign])
11 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
13 AC_USE_SYSTEM_EXTENSIONS
30 AM_GNU_GETTEXT(external)
31 AM_GNU_GETTEXT_VERSION
33 dnl Handle the prologues option.
35 dnl If the user didn't specify --enable-prologues/--disable-prologues
36 dnl and the x86 system has a version of gcc less than version 4,
37 dnl automatically enable prologues.
38 if test "${enable_prologues+set}" != set; then
39 AC_MSG_CHECKING([to see if prologue searching should be the default])
40 if { echo '#if __i386__ == 1 && __GNUC__ < 4'
42 echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
49 AC_ARG_ENABLE([prologues],
50 AS_HELP_STRING([--enable-prologues], [make -P prologue-searching default]),
52 if test "$enable_prologues" = yes; then
53 AC_DEFINE([ENABLE_PROLOGUES],[],[make -P prologue-searching default])
56 AC_ARG_ENABLE([sdt-probes],
57 [AS_HELP_STRING([--disable-sdt-probes],
58 [disable process.mark probes in stap, staprun, stapio])])
59 AS_IF([test "x$enable_sdt_probes" != xno], [
60 AC_DEFINE([ENABLE_SDT_PROBES], [1],
61 [Define to 1 to enable process.mark probes in stap, staprun, stapio.])
65 [AS_HELP_STRING([--disable-ssp], [disable gcc stack-protector])])
66 AS_IF([test "x$enable_ssp" != xno],[
68 save_CXXFLAGS="$CXXFLAGS"
69 CXXFLAGS="$CXXFLAGS -Werror -fstack-protector-all -D_FORTIFY_SOURCE=2"
70 CFLAGS="$CFLAGS -Werror -fstack-protector-all -D_FORTIFY_SOURCE=2"
71 AC_COMPILE_IFELSE([int something ();], [
72 AC_MSG_NOTICE([Compiling with gcc -fstack-protector-all et al.])
73 CFLAGS="$save_CFLAGS -fstack-protector-all -D_FORTIFY_SOURCE=2"
74 CXXFLAGS="$save_CXXFLAGS -fstack-protector-all -D_FORTIFY_SOURCE=2"],[
75 AC_MSG_NOTICE([Compiler does not support -fstack-protector-all et al.])
77 CXXFLAGS="$save_CXXFLAGS"])])
80 dnl Link with gold if possible
81 dnl but: https://bugzilla.redhat.com/show_bug.cgi?id=636603
83 dnl AC_PATH_PROG(GOLD, [ld.gold], [no])
84 dnl if test "x$GOLD" != "xno"
87 dnl ln -sf $GOLD Bdir/ld
88 dnl LDFLAGS="$LDFLAGS -B`pwd`/Bdir/"
89 dnl AC_MSG_NOTICE([using ld.gold to link])
93 # Compiling without fPIE by default (see PR 9922)
95 [AS_HELP_STRING([--enable-pie], [enable position-independent-executable])])
96 AS_IF([test "x$enable_pie" == xyes],[
98 save_CXXFLAGS="$CXXFLAGS"
99 save_LDFLAGS="$LDFLAGS"
100 CFLAGS="$CFLAGS -fPIE"
101 CXXFLAGS="$CXXFLAGS -fPIE"
102 LDFLAGS="$LDFLAGS -pie -Wl,-z,relro -Wl,-z,now"
103 AC_LINK_IFELSE([void main () {}], [
104 AC_MSG_NOTICE([Compiling with gcc pie et al.])
105 # LDFLAGS is special since it may be passed down to bundled-elfutils,
106 # and interfere with the .so's built therein
107 PIELDFLAGS="$LDFLAGS"
108 LDFLAGS="$save_LDFLAGS"
110 CFLAGS="$save_CFLAGS"
111 PIECXXFLAGS="$CXXFLAGS"
112 CXXFLAGS="$save_CXXFLAGS"
114 AC_MSG_NOTICE([Compiler does not support -pie et al.])
116 CFLAGS="$save_CFLAGS"
118 CXXFLAGS="$save_CXXFLAGS"
120 LDFLAGS="$save_LDFLAGS"])])
123 AC_SUBST(PIECXXFLAGS)
125 dnl Handle optional sqlite support. If enabled/disabled by the user,
126 dnl do the right thing. If not specified by the user, use it if
128 AC_ARG_ENABLE([sqlite],
129 AS_HELP_STRING([--enable-sqlite], [build with sqlite support]),
130 [], dnl ACTION-IF-GIVEN
131 [enable_sqlite=check]) dnl ACTION-IF-NOT-GIVEN
133 AS_IF([test "x$enable_sqlite" != xno],
134 [AC_CHECK_LIB([sqlite3], [sqlite3_open],
135 [AC_SUBST([sqlite3_LIBS], [-lsqlite3])
136 AC_DEFINE([HAVE_LIBSQLITE3], [1], [Define to 1 if you have the `sqlite3' library (-lsqlite3).])],
137 [if test "x$enable_sqlite" != xcheck; then
138 AC_MSG_FAILURE([--enable-sqlite was given, but test for sqlite failed])
141 dnl Handle the option to only build runtime
142 AC_ARG_ENABLE([translator],
143 AS_HELP_STRING([--disable-translator], [build only runtime utilities]),
145 [enable_translator="yes"])
146 AM_CONDITIONAL([BUILD_TRANSLATOR], [test "$enable_translator" == "yes"])
148 dnl Handle the option to build the crash extension
149 AC_ARG_ENABLE([crash],
150 AS_HELP_STRING([--enable-crash@<:@=DIRECTORY@:>@],
151 [enable crash extension (default is disabled). Optional DIRECTORY
152 is the path to the crash header file (needed if installed in a
153 non-standard location).]),
154 [if test "$enable_crash" != "no"; then
155 dnl Handle custom install dir (if needed)
156 save_CPPFLAGS="$CPPFLAGS"
157 if test "$enable_crash" != "yes"; then
158 staplog_CPPFLAGS=-I$enable_crash
159 CPPFLAGS="${staplog_CPPFLAGS} $CPPFLAGS"
160 AC_SUBST([staplog_CPPFLAGS])
162 AC_CHECK_HEADERS([crash/defs.h], [],
163 [AC_MSG_ERROR([cannot find required crash header (crash-devel may need to be installed)])],
167 CPPFLAGS="$save_CPPFLAGS"
170 AM_CONDITIONAL([BUILD_CRASHMOD], [test "$enable_crash" != "no"])
172 dnl Handle the option to build the documentation
174 AC_ARG_ENABLE([docs],
175 AS_HELP_STRING([--enable-docs],
176 [enable building documentation (default on if latex etc. found).]),
177 [enable_docs=$enableval],
178 [enable_docs="check"])
179 AC_CHECK_PROG(have_latex, latex, yes, no)
180 AC_CHECK_PROG(have_dvips, dvips, yes, no)
181 AC_CHECK_PROG(have_ps2pdf, ps2pdf, yes, no)
182 AC_CHECK_PROG(have_latex2html, latex2html, yes, no)
183 if test "x${have_latex}${have_dvips}${have_ps2pdf}${have_latex2html}" != "xyesyesyesyes"; then
184 if test "$enable_docs" == "yes"; then
185 AC_MSG_ERROR([cannot find all tools for building documentation])
187 if test "$enable_docs" == "check"; then
188 AC_MSG_WARN([will not build documentation, cannot find all tools])
191 if test "x${have_latex}${have_dvips}${have_ps2pdf}${have_latex2html}" == "xyesyesyesyes" -a "$enable_docs" != "no"; then
194 AM_CONDITIONAL([BUILD_DOCS], [test "$building_docs" == "yes"])
196 dnl Handle the options to build the publican options
197 building_publican="no"
198 AC_ARG_ENABLE([publican],
199 AS_HELP_STRING([--enable-publican],
200 [enable building publican documentation guides (default on if publican found and other documentation built).]),
201 [enable_publican=$enableval],
202 [enable_publican="check"])
203 if test "$building_docs" == "no" -a "$enable_publican" == "yes" ; then
204 AC_MSG_ERROR([must use --enable-docs with --enable-publican])
206 AC_CHECK_PROG(have_publican, publican, yes, no)
207 if test "$enable_publican" == "yes"; then
208 if test "x${have_publican}" != "xyes"; then
209 AC_MSG_ERROR([cannot find publican for building publican guides])
212 if test "x${have_publican}" == "xyes" -a "$enable_publican" != "no" -a "${building_docs}" == "yes"; then
213 building_publican="yes"
215 AM_CONDITIONAL([BUILD_PUBLICAN], [test "$building_publican" == "yes"])
216 publican_brand="common"
217 AC_ARG_WITH([publican-brand],
218 AS_HELP_STRING([--with-publican-brand=BRAND],
219 [building publican documentation guides using given brand (defaults to "common").]),
220 [publican_brand=$withval],
221 [publican_brand="common"])
222 PUBLICAN_BRAND=$publican_brand
223 AC_SUBST(PUBLICAN_BRAND)
225 dnl Handle the option to build the reference documentation
226 building_refdocs="no"
227 AC_ARG_ENABLE([refdocs],
228 AS_HELP_STRING([--enable-refdocs],
229 [enable building reference documentation (default on if xmlto etc. found and other documentation built).]),
230 [enable_refdocs=$enableval],
231 [enable_refdocs="check"])
232 if test "$building_docs" == "no" -a "$enable_refdocs" == "yes" ; then
233 AC_MSG_ERROR([must use --enable-docs with --enable-refdocs])
235 AC_CHECK_PROG(have_xmlto, xmlto, yes, no)
236 if test "$enable_refdocs" == "yes"; then
237 if test "x${have_xmlto}" != "xyes"; then
238 AC_MSG_ERROR([cannot find xmlto for building reference documentation])
241 if test "x${have_xmlto}" == "xyes" -a "$enable_refdocs" != "no" -a "${building_docs}" == "yes"; then
242 building_refdocs="yes"
244 AM_CONDITIONAL([BUILD_REFDOCS], [test "$building_refdocs" == "yes"])
246 dnl There is a strange bug in older versions of xmlto when generating pdf.
247 dnl https://bugzilla.redhat.com/show_bug.cgi?id=526273
248 dnl So make sure to have a chapter title starting with L plus an refentry.
249 dnl This will make sure the xmlto pdf support test fails on buggy versions.
250 cat > conftest.xml << 'EOF'
251 <?xml version="1.0" encoding="UTF-8"?>
252 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
253 "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []>
255 <bookinfo><title>foo</title></bookinfo>
256 <chapter id="logging.stp"><title>Logging Tapset</title>
257 <refentry id="API-log"><refnamediv><refname>log</refname>
258 <refpurpose>logging</refpurpose></refnamediv>
259 <refsect1><title>Description</title>
260 <para>baz</para></refsect1></refentry></chapter>
264 if test "x${have_xmlto}" == "xyes"; then
265 AC_MSG_CHECKING([for xmlto --stringparam support])
266 xmlto --stringparam man.authors.section.enabled=0 html-nochunks conftest.xml >/dev/null 2>&1
267 if test $? == 0; then
268 have_xmlto_stringparam="yes"
275 AM_CONDITIONAL([XMLTO_STRINGPARAM], [test "$have_xmlto_stringparam" == "yes"])
277 if test "x${building_refdocs}" == "xyes"; then
278 AC_MSG_CHECKING([for xmlto pdf support])
279 xmlto pdf conftest.xml >& /dev/null
280 if test $? == 0; then
285 AC_MSG_WARN([Not building reference documentation in PDF format])
289 AM_CONDITIONAL([BUILD_PDFREFDOCS], [test "$have_xmlto_pdf" == "yes"])
293 dnl See if we have the nss/nspr headers and libraries
294 AC_CHECK_FILE([/usr/include/nss3], nssdir=nss3, [
295 AC_CHECK_FILE([/usr/include/nss], nssdir=nss)
297 AC_CHECK_FILE([/usr/include/nspr4], nsprdir=nspr4, [
298 AC_CHECK_FILE([/usr/include/nspr], nsprdir=nspr)
300 if test "x$nssdir" != "x" -a "x$nsprdir" != "x"; then
301 nss_CFLAGS="-I/usr/include/$nssdir"
302 nspr_CFLAGS="-I/usr/include/$nsprdir"
304 AC_SUBST(nspr_CFLAGS)
305 save_CPPFLAGS="$CPPFLAGS"
306 CPPFLAGS="$CFLAGS $nss_CFLAGS $nspr_CFLAGS"
307 have_nss_includes=yes
308 AC_CHECK_HEADERS(["$nsprdir/nspr.h" "$nsprdir/plgetopt.h" "$nsprdir/prerror.h" "$nssdir/ssl.h" "$nssdir/nss.h" "$nssdir/pk11func.h" "$nssdir/secerr.h"], [], have_nss_includes=no)
309 CPPFLAGS="$save_CPPFLAGS"
312 AC_CHECK_LIB(nspr4, PR_Connect, [
313 AC_CHECK_LIB(ssl3, SSL_ReHandshake, have_nss_libs=yes)
315 if test "x${have_nss_includes}${have_nss_libs}" = "xyesyes"; then
316 AC_DEFINE([HAVE_NSS], [1], [Define to 1 if you have the nss libraries.])
318 AM_CONDITIONAL([HAVE_NSS], [test "x${have_nss_includes}${have_nss_libs}" == "xyesyes"])
320 dnl Handle the option to build the compile server.
321 AC_ARG_ENABLE([server],
322 AS_HELP_STRING([--enable-server],
323 [enable building of stap-server (default on if nss etc. found).]),
324 [enable_server=$enableval],
325 [enable_server="check"])
327 if test "$enable_server" != "no"; then
328 dnl See if we have enough libraries and tools to build the compile server
329 if test "x${have_nss_includes}" != "xyes"; then
330 AC_MSG_WARN([will not build systemtap compile server, cannot find nss/nspr headers])
332 if test "x${have_nss_libs}" != "xyes"; then
333 AC_MSG_WARN([will not build systemtap compile server, cannot find nss/nspr libraries])
335 AC_CHECK_PROG(have_certutil, certutil, [yes], [no])
336 if test "x${have_certutil}" != "xyes"; then
337 AC_MSG_WARN([will not build systemtap compile server, cannot find certutil])
340 AM_CONDITIONAL([BUILD_SERVER], [test "x${have_nss_includes}${have_nss_libs}${have_certutil}" == "xyesyesyes" -a "$enable_server" != "no"])
342 if test "x${have_nss_includes}" != "xyes"; then
343 AC_MSG_WARN([some compile server client functionality will be restricted, cannot find nss/nspr headers])
345 if test "x${have_nss_libs}" != "xyes"; then
346 AC_MSG_WARN([some compile server client functionality will be restricted, cannot find nss/nspr libraries])
349 dnl See if we have the avahi libraries and headers
350 AC_CHECK_FILE([/usr/include/avahi-client], avahi_clientdir=avahi-client)
351 AC_CHECK_FILE([/usr/include/avahi-common], avahi_commondir=avahi-common)
352 if test "x$avahi_clientdir" != "x" -a "x$avahi_commondir" != "x"; then
353 have_avahi_includes=yes
354 AC_CHECK_HEADERS(["$avahi_clientdir/client.h" "$avahi_clientdir/lookup.h" "$avahi_commondir/simple-watch.h" "$avahi_commondir/malloc.h" "$avahi_commondir/error.h"], [], have_avahi_includes=no)
357 AC_CHECK_LIB(avahi-client, avahi_client_new,
358 AC_CHECK_LIB(avahi-common, avahi_strerror, have_avahi_libs=yes))
359 if test "x${have_avahi_includes}" != "xyes"; then
360 AC_MSG_WARN([some compile server client functionality will be restricted, cannot find avahi headers])
362 if test "x${have_avahi_libs}" != "xyes"; then
363 AC_MSG_WARN([some compile server client functionality will be restricted, cannot find avahi libraries])
365 if test "x${have_avahi_includes}${have_avahi_libs}" = "xyesyes"; then
366 AC_DEFINE([HAVE_AVAHI], [1], [Define to 1 if you have the avahi libraries.])
368 AM_CONDITIONAL([HAVE_AVAHI], [test "x${have_avahi_includes}${have_avahi_libs}" == "xyesyes"])
370 dnl Handle the optional grapher
371 AC_ARG_ENABLE([grapher],
372 AS_HELP_STRING([--enable-grapher],
373 [enable building of grapher (default on if needed requirements are found).]),
374 [], dnl ACTION-IF-GIVEN
375 [enable_grapher="check"]) dnl ACTION-IF-NOT-GIVEN
376 dnl If the user didn't disable the grapher, check the grapher's requirements.
377 AS_IF([test "x$enable_grapher" != xno],
379 dnl Check for gtkmm. Strictly speaking, this isn't necessary,
380 dnl since the libglademm24-devel rpm requires the gtkmm24-devel
381 dnl rpm. But, this could be a non-rpm system. This check will
382 dnl give the user a better idea about how to fix missing
384 PKG_CHECK_MODULES([gtkmm], [gtkmm-2.4 >= 2.8.0],
385 have_gtkmm="yes", have_gtkmm="no")
386 AS_IF([test "x${have_gtkmm}" == "xno" -a x"$enable_grapher" == "xyes"],
387 AC_MSG_WARN([systemtap cannot find required gtkmm libs (gtkmm24-devel version 2.8.0 or higher may need to be installed)]))
389 dnl Check for libglade
390 PKG_CHECK_MODULES([libglade], [libglademm-2.4 >= 2.6.7],
391 have_libglade="yes", have_libglade="no")
392 AS_IF([test "x${have_libglade}" == "xno" -a x"$enable_grapher" == "xyes"],
393 AC_MSG_WARN([systemtap cannot find required libglade libs (libglademm24-devel version 2.6.7 or higher may need to be installed)]))
395 dnl Check for needed boost headers
396 have_boost_headers="yes"
398 AC_CHECK_HEADERS([boost/algorithm/string.hpp boost/range.hpp],
399 [], have_boost_headers="no")
401 AS_IF([test "x${have_boost_headers}" == "xno" -a x"$enable_grapher" == "xyes"],
402 AC_MSG_WARN([cannot find required boost headers (boost-devel may need to be installed)]))
404 dnl Bundle up all the grapher requirements into 1 variable.
405 AS_IF([test "x${have_gtkmm}${have_libglade}${have_boost_headers}" == "xyesyesyes"],
406 have_grapher_reqs="yes", have_grapher_reqs="no")
408 dnl If the user explicitly said to enable the grapher, but we can't
409 dnl (since one or more of its requirements aren't installed), error.
410 AS_IF([test "x${have_grapher_reqs}" == "xno" -a x"$enable_grapher" == "xyes"],
411 AC_MSG_ERROR([systemtap cannot find grapher build requirements (gtkmm, libglade, and boost headers)]))
412 dnl If the user didn't say to disable the grapher, and all the
413 dnl requirements are installed, enable the grapher.
414 AM_CONDITIONAL([BUILD_GRAPHER], [test "x${have_grapher_reqs}" == "xyes" -a x"$enable_grapher" != "xno"])
419 [AS_HELP_STRING([--with-rpm],
420 [query rpm database for missing debuginfos])], [], [with_rpm="auto"])
421 if test "$with_rpm" != "no"; then
422 AC_CHECK_LIB(rpm, rpmtsInitIterator, [
423 AC_DEFINE([HAVE_LIBRPM],[1],[have librpm])
424 stap_LIBS="$stap_LIBS -lrpm"
425 have_librpm="yes"], [have_librpm="no"])
426 AC_CHECK_LIB(rpmio, rpmFreeCrypto, [
427 AC_DEFINE([HAVE_LIBRPMIO],[1],[have librpmio])
428 stap_LIBS="$stap_LIBS -lrpmio"
429 have_librpmio="yes"], [have_librpmio="no"])
430 if test "x$have_librpm" != "xyes" -a "$with_rpm" == "yes"; then
431 AC_MSG_ERROR([cannot find librpm])
433 if test "x$have_librpmio" != "xyes" -a "$with_rpm" == "yes"; then
434 AC_MSG_WARN([cannot find librpmio])
439 dnl Handle elfutils. If '--with-elfutils=DIR' wasn't specified, used
440 dnl the system's elfutils.
442 AC_ARG_WITH([elfutils],
443 AS_HELP_STRING([--with-elfutils=DIRECTORY],
444 [find elfutils source code in DIRECTORY]),
446 case "$with_elfutils" in
447 yes) AC_MSG_ERROR([--with-elfutils requires an argument]) ;;
449 *) build_elfutils=yes ;;
451 AM_CONDITIONAL(BUILD_ELFUTILS, test $build_elfutils = yes)
452 AC_SUBST(elfutils_abs_srcdir, `AS_IF([test $build_elfutils = yes],
453 [cd $with_elfutils && pwd])`)
455 if test $enable_translator = yes; then
456 if test $build_elfutils = no; then
457 # Need libdwfl-capable recent elfutils http://elfutils.fedorahosted.org/
459 # On modern debian/ubuntu, libebl has been merged into libdw
460 # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=457543
462 AC_CHECK_LIB(ebl, ebl_get_elfmachine,[ebl_LIBS=-lebl],[ebl_LIBS=])
466 AC_CHECK_LIB(dw, dwfl_module_getsym,[],[
467 AC_MSG_ERROR([missing elfutils development headers/libraries (install elfutils-devel, libebl-dev, libdw-dev and/or libebl-devel)])],
468 [-Wl,--start-group -ldw $ebl_LIBS -Wl,--end-group -lelf])
469 AC_CHECK_LIB(dw, dwarf_getelf,[],[
470 AC_MSG_ERROR([elfutils, libdw too old, need 0.126+])],
471 [-Wl,--start-group -ldw $ebl_LIBS -Wl,--end-group -lelf])
472 stap_LIBS="$stap_LIBS -Wl,--start-group -ldw $ebl_LIBS -Wl,--end-group -lelf"
475 # We built our own and stap_LDFLAGS points at the install.
476 stap_LIBS="$stap_LIBS -Wl,--start-group -ldw -lebl -Wl,--end-group -lelf"
481 AC_MSG_NOTICE([stap will link $stap_LIBS])
484 dnl Plop in the build (configure) date
485 date=`date +%Y-%m-%d`
486 AC_DEFINE_UNQUOTED(DATE, "$date", [Configuration/build date])
487 AC_SUBST(DATE, "$date")
489 # Before PR4037, we used to arrange to pass CFLAGS+=-m64 for a staprun
490 # being compiled on 32-bit userspace but running against 64-bit kernels.
491 # This is no longer necessary.
493 # Use tr1/unordered_map if available
495 AC_CHECK_HEADERS([tr1/unordered_map])
496 AC_CHECK_HEADERS([tr1/memory])
497 AC_CHECK_HEADERS([boost/shared_ptr.hpp])
501 AC_CACHE_CHECK([for assembler .section "?" flags support], stap_cv_sectionq, [
503 CFLAGS="$CFLAGS -Wa,--fatal-warnings"
504 AC_COMPILE_IFELSE([asm(".section .note.foo,\"?\",\"note\"\n"
507 ".section .text,\"axG\",\"progbits\",foogroup,comdat\n"
509 ".pushsection .note.foo,\"?\",\"note\"\n"
513 stap_cv_sectionq=yes, stap_cv_sectionq=no)
514 CFLAGS="$old_CFLAGS"])
515 AC_SUBST(support_section_question)
516 support_section_question=0
517 if test $stap_cv_sectionq = yes; then
518 support_section_question=1
520 AC_CONFIG_FILES([includes/sys/sdt-config.h po/Makefile.in])
523 if test $build_elfutils = yes -a $enable_translator = yes; then
524 case "$with_elfutils" in
525 /*) elfutils_srcdir="$with_elfutils" ;;
526 *) elfutils_srcdir="../$with_elfutils" ;;
528 AC_MSG_NOTICE([running ${elfutils_srcdir}/configure])
530 save_CFLAGS="$CFLAGS"
531 save_CXXFLAGS="$CXXFLAGS"
532 CXXFLAGS="$CXXFLAGS -fgnu89-inline"
533 CFLAGS="$CFLAGS -fgnu89-inline"
535 AC_COMPILE_IFELSE([int something ();], [
536 AC_MSG_NOTICE([Compiling elfutils with gcc -fgnu89-inline])
537 gnu89_inline_flag="-fgnu89-inline"],[
538 AC_MSG_NOTICE([Compiler does not support -fgnu89-inline])])
539 CFLAGS="$save_CFLAGS"
540 CXXFLAGS="$save_CXXFLAGS"
542 # Our libdw.so's libebl will look in $ORIGIN/../lib/... but that
543 # $ORIGIN is where libdw.so resides, which is not where there is a ../lib.
544 # Note that $libdir might be using a quoted use of $exec_prefix or $prefix.
545 # So we must make sure to pass those settings to elfutils configure.
546 elfutils_rpath="-Wl,--enable-new-dtags,-rpath,${libdir}/${PACKAGE_NAME}"
548 (mkdir -p build-elfutils && cd build-elfutils &&
549 bash ${elfutils_srcdir}/configure --enable-libebl-subdir=${PACKAGE_NAME} \
550 --includedir="${here}/include-elfutils" \
551 --libdir="${here}/lib-elfutils" \
552 --exec-prefix="$exec_prefix" \
554 CFLAGS="${CFLAGS/-Wall/} $gnu89_inline_flag" \
555 LDFLAGS="$LDFLAGS $elfutils_rpath" &&
556 if test -f ${elfutils_srcdir}/config/version.h.in; then
557 echo Trying to install elfutils version header...
558 make install-pkgincludeHEADERS
560 # so that elfutils/version.h - available from 0.138 - may be found.
561 # Don't use install-data because that will fail (installing in $prefix).
563 if test $? != 0; then exit; fi
564 save_CPPFLAGS=${CPPFLAGS}
565 CPPFLAGS="${CPPFLAGS} -Iinclude-elfutils" # in case bundled elfutils
566 AC_CHECK_HEADERS([elfutils/version.h])
567 CPPFLAGS="$save_CPPFLAGS"
569 AC_CHECK_HEADERS([elfutils/version.h])
572 dnl This is here mainly to make sure that configure --prefix=... changes
573 dnl the config.h files so files depending on it are recompiled
574 dnl prefix is passed through indirectly in the Makefile.am AM_CPPFLAGS.
575 dnl Formerly: Don't use this directly (when not given it is set to NONE).
576 dnl Currently: inline autoconf's later defaulting
578 AC_SUBST(LOCALEDIR, "$localedir")
581 test "$stap_prefix" = NONE && stap_prefix=$ac_default_prefix
582 AC_DEFINE_UNQUOTED(STAP_PREFIX, "$stap_prefix", [configure prefix location])
584 AC_CONFIG_HEADERS([config.h:config.in])
585 AC_CONFIG_FILES([Makefile doc/Makefile \
586 doc/beginners/Makefile doc/SystemTap_Tapset_Reference/Makefile \
588 grapher/stapgraph.1 \
590 initscript/systemtap initscript/stap-server ])
591 AC_CONFIG_SUBDIRS(testsuite runtime/staprun)
592 if test $enable_translator == "yes"; then
593 AC_CONFIG_FILES([run-stap], [chmod +x run-stap])
595 AC_CONFIG_FILES([dtrace], [chmod +x dtrace])
597 # Setup "shadow" directory doc/beginners that has everything setup for
598 # publican in one directory (through directory links if necessary).
599 # It would be nice to use AC_CONFIG_LINKS, but automake complains when
600 # the src is a directory and not a file.
601 AC_CONFIG_FILES([doc/beginners/publican.cfg:doc/SystemTap_Beginners_Guide/publican.cfg.in])
602 AC_CONFIG_COMMANDS([doc/beginners],
603 [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])
607 if test "${prefix}" = "/usr/local"; then
609 AC_MSG_NOTICE([For a private or temporary build of systemtap, we recommend])
610 AC_MSG_NOTICE([configuring with a prefix. For example, try])
611 AC_MSG_NOTICE([$0 $ac_configure_args --prefix=$HOME/systemtap-${PACKAGE_VERSION}-$$])
612 AC_MSG_NOTICE([Running systemtap uninstalled, entirely out of the build tree,])
613 AC_MSG_NOTICE([is not supported.])