blob: c86996cde0999c9977a28a8dde5e93aca7c89c00 [file] [edit]
dnl configure.ac --- autoconf input file for systemtap
dnl Process this file with autoconf to produce a configure script.
AC_INIT([systemtap],[5.7],[systemtap@sourceware.org],[systemtap])
dnl ^^^ see also NEWS, systemtap.spec, testsuite/configure.ac
dnl doc/SystemTap_Beginners_Guide/en-US/Book_Info.xml
dnl Get the target arch for libHelperSDT.so
AC_CANONICAL_TARGET
AC_PREREQ([2.71])
dnl We don't maintain a ChangeLog, which makes us non-GNU -> foreign.
AM_INIT_AUTOMAKE([no-dist foreign])
AM_MAINTAINER_MODE
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
PKG_PROG_PKG_CONFIG
AC_USE_SYSTEM_EXTENSIONS
AC_PROG_MKDIR_P
AC_SUBST(MKDIR_P)
AC_PROG_LN_S
AC_PROG_CC
AC_PROG_CXX
AC_PROG_CPP
AM_PROG_AR
AM_PROG_CC_C_O
AC_PROG_RANLIB
AC_OBJEXT
AC_EXEEXT
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_SUBST(CFLAGS)
AC_SUBST(CXXFLAGS)
AC_SYS_LARGEFILE
AC_CHECK_FUNCS(ppoll)
AC_CHECK_FUNCS(openat)
AM_GNU_GETTEXT(external)
AM_GNU_GETTEXT_VERSION([0.19.4])
# Now let's try to find python version 3. We prioritize newer versions
# (like 3.12+ which are available on RHEL8/9) to ensure we have
# modern enough pip support for our PEP 517 build system.
# Override with ./configure PYTHON3=python3.13 to build against a specific minor.
AC_ARG_VAR([PYTHON3], [Python 3 interpreter for probe/tapset support])
if test -n "$PYTHON3"; then
AC_PATH_PROG([PYTHON3], [$PYTHON3], [:])
else
AC_PATH_PROGS([PYTHON3],
[python3.15 python3.14 python3.13 python3.12 python3.11 python3.10 python3.9 python3.8 python3.7 python3 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0], [:])
fi
python3_basename=$(basename "$PYTHON3")
AC_DEFINE_UNQUOTED([PYTHON3_BASENAME], "${python3_basename}",
[Base name of the python3 interpreter binary.])
# If we found python version 3, set up the other variables for python
# version 3 that AM_PATH_PYTHON sets up for python version 2.
if test "x$PYTHON3" != "x:"; then
AC_DEFINE([PYTHON3_EXISTS], [],
[The python3 interpreter binary exists.])
AC_CACHE_CHECK([for python3 version], [ac_cv_python3_version],
[ac_cv_python3_version=`$PYTHON3 -c "import sys; sys.stdout.write(sys.version[[:3]])"`])
AC_SUBST([PYTHON3_VERSION], [$ac_cv_python3_version])
python3_minor=`$PYTHON3 -c "import sys; sys.stdout.write(str(sys.version_info[[1]]))"`
AC_SUBST([PYTHON3_MINOR], [$python3_minor])
python3_libpython=`$PYTHON3 -c "import sysconfig, os; print(os.path.join(sysconfig.get_config_var('LIBDIR'), sysconfig.get_config_var('INSTSONAME')))"`
AC_SUBST([PYTHON3_LIBPYTHON], [$python3_libpython])
AC_SUBST([PYTHON3_PREFIX], ['${prefix}'])
AC_SUBST([PYTHON3_EXEC_PREFIX], ['${exec_prefix}'])
AC_CACHE_CHECK([for python3 platform], [ac_cv_python3_platform],
[ac_cv_python3_platform=`$PYTHON3 -c "import sys; sys.stdout.write(sys.platform)"`])
AC_SUBST([PYTHON3_PLATFORM], [$ac_cv_python3_platform])
AC_CACHE_CHECK([for python3 script directory], [ac_cv_python3_dir],
[ac_cv_python3_dir=`$PYTHON3 -c "
try:
import distutils.sysconfig as ds
print(ds.get_python_lib(0, 0, prefix='$PYTHON3_PREFIX'))
except ImportError:
import sysconfig
print(sysconfig.get_path('purelib', vars={'base': '\${prefix}', 'platbase': '\${prefix}', 'installed_base': '\${prefix}', 'installed_platbase': '\${prefix}'}))
"`])
AC_SUBST([python3dir], [$ac_cv_python3_dir])
AC_CACHE_CHECK([for python3 extension module directory],
[ac_cv_py3execdir],
[ac_cv_py3execdir=`$PYTHON3 -c "
try:
import distutils.sysconfig as ds
print(ds.get_python_lib(1, 0, prefix='$PYTHON3_EXEC_PREFIX'))
except ImportError:
import sysconfig
print(sysconfig.get_path('platlib', vars={'base': '\${prefix}', 'platbase': '\${prefix}', 'installed_base': '\${prefix}', 'installed_platbase': '\${prefix}'}))
"`])
AC_SUBST([py3execdir], [$ac_cv_py3execdir])
fi
# Make sure the python3 and py3execdir variables get sent down to
# the subconfigure in the testsuite directory.
AS_VAR_APPEND([ac_configure_args], [" python3='$PYTHON3' py3execdir='$ac_cv_py3execdir'"])
dnl Enable extra C++ debug checks (_GLIBCXX_DEBUG)
AC_MSG_CHECKING([whether to build with C++ debug checks])
AC_ARG_ENABLE([glibcxx-debug],
AS_HELP_STRING('[--enable-glibcxx-debug], [compile with -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC (implies --without-dyninst)]))
AS_IF([test "${enable_glibcxx_debug}" = "yes"], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
AM_CONDITIONAL([enable_glibcxx_debug], [test "${enable_glibcxx_debug}" = "yes"])
dnl _GLIBCXX_DEBUG changes the ABI of std:: containers; Dyninst is a
dnl pre-compiled shared library whose API passes std::set by reference,
dnl so linking against it with debug-mode containers fails.
AS_IF([test "${enable_glibcxx_debug}" = "yes" -a "${with_dyninst}" != "no"], [
AC_MSG_NOTICE([--enable-glibcxx-debug forces --without-dyninst (ABI incompatibility with pre-compiled Dyninst libraries)])
with_dyninst=no
])
dnl Allow the build to exclude -Werror
AC_MSG_CHECKING([whether to build with -Werror])
AC_ARG_ENABLE([Werror],
AS_HELP_STRING('[--enable-Werror], [compile with -Werror flags]))
AS_IF([test "${enable_Werror}" != "no"], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
AM_CONDITIONAL([Werror], [test "${enable_Werror}" != "no"])
dnl Handle the prologues option.
dnl
dnl If the user didn't specify --enable-prologues/--disable-prologues
dnl and the x86 system has a version of gcc less than version 4,
dnl automatically enable prologues.
if test "${enable_prologues+set}" != set; then
AC_MSG_CHECKING([to see if prologue searching should be the default])
if { echo '#if __i386__ == 1 && __GNUC__ < 4'
echo ' yes '
echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
enable_prologues=yes
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
fi
AC_ARG_ENABLE([prologues],
AS_HELP_STRING([--enable-prologues], [make -P prologue-searching default]),
[
if test "$enable_prologues" = yes; then
AC_DEFINE([ENABLE_PROLOGUES],[],[make -P prologue-searching default])
fi])
dnl Handle the disable-sdt-probes option.
dnl
dnl Default to --disable-sdt-probes if --enable-sdt-probes/--disable-prologues
dnl was not specified and the gcc version is less than version 4,
if test "${enable_sdt_probes+set}" != set; then
AC_MSG_CHECKING([to see if sdt probes should be the default])
if { echo '#if __GNUC__ < 4'
echo ' yes '
echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
enable_sdt_probes=no
AC_MSG_RESULT([no])
else
AC_MSG_RESULT([yes])
fi
fi
AC_ARG_ENABLE([sdt-probes],
[AS_HELP_STRING([--disable-sdt-probes],
[disable process.mark probes in stap, staprun, stapio])])
AS_IF([test "x$enable_sdt_probes" != xno], [
AC_DEFINE([ENABLE_SDT_PROBES], [1],
[Define to 1 to enable process.mark probes in stap, staprun, stapio.])
])
dnl We're now requiring *some* C++11, using RHEL6 (gcc 4.4.7) as a baseline.
dnl This is too strict about __cplusplus for gcc < 4.7, so we have a manual fallback.
AX_CXX_COMPILE_STDCXX(11, noext, optional)
have_cxx0x="no"
AS_IF([test "x$HAVE_CXX11" != x1],[
AC_LANG_PUSH(C++)
AX_CHECK_COMPILE_FLAG([-std=c++0x], [
AC_MSG_NOTICE([Compiling with -std=c++0x])
CXX="$CXX -std=c++0x"
HAVE_CXX11=1
have_cxx0x="yes"
], [
AC_MSG_ERROR([A compiler with C++11 support is required.])
])
AC_LANG_POP(C++)
])
dnl Some versions of dyninst (10.1) need -faligned-new
dnl If -faligned-new available, pass it in
AC_LANG_PUSH(C++)
AX_CHECK_COMPILE_FLAG([-faligned-new], ALIGNEDNEW="-faligned-new", ALIGNEDNEW="")
AC_LANG_POP(C++)
AC_SUBST(ALIGNEDNEW)
dnl Dyninst headers can trigger GCC's -Wtemplate-body; suppress if the
dnl compiler knows that option. Clang does not (unknown-warning-option
dnl under -Werror), so probe with -Werror like the other flag checks.
AC_LANG_PUSH(C++)
AX_CHECK_COMPILE_FLAG([-Wno-template-body],
[WNO_TEMPLATE_BODY="-Wno-template-body"],
[WNO_TEMPLATE_BODY=""],
[-Werror])
AC_LANG_POP(C++)
AC_SUBST(WNO_TEMPLATE_BODY)
dnl Carry forward some empty PIE*FLAGS so we don't have to modify
dnl all the Makefile.am's just now.
AC_SUBST(PIELDFLAGS)
AC_SUBST(PIECFLAGS)
AC_SUBST(PIECXXFLAGS)
dnl Handle optional debuginfod support. If not specified by the user,
dnl use it if present. If given --with-debuginfod=/PATH, interpret /PATH as a prefix
dnl of an elfutils install tree.
AC_ARG_WITH([debuginfod],
AS_HELP_STRING([--with-debuginfod],[Enable debuginfo lookups with debuginfod (auto/yes/no)]),
[], [with_debuginfod=auto])
AC_MSG_CHECKING([whether to use debuginfod])
if expr "$with_debuginfod" : "/.*" >/dev/null; then
dnl take the user at his or her word
debuginfod_LDFLAGS=-L$with_debuginfod/lib
debuginfod_LIBS=-ldebuginfod
debuginfod_CFLAGS=-I$with_debuginfod/include
have_debuginfod=1
AC_DEFINE([HAVE_LIBDEBUGINFOD], [1], [Define to 1 if debuginfod is enabled.])
AC_MSG_RESULT([yes])
elif test "x$with_debuginfod" != xno; then
dnl check in the system pkgconfig
PKG_CHECK_MODULES([debuginfod], [libdebuginfod >= 0.179],
[have_debuginfod=1
AC_DEFINE([HAVE_LIBDEBUGINFOD], [1], [Define to 1 if debuginfod is enabled.])],
[if test "x$with_debuginfod" = xyes; then
AC_MSG_ERROR(["--with-debuginfod was given, but libdebuginfod is missing or unusable."])
fi])
else
AC_MSG_RESULT([no])
fi
ac_save_CFLAGS="$CFLAGS"
ac_save_LDFLAGS="$LDFLAGS"
CFLAGS="$CFLAGS $debuginfod_CFLAGS"
LDFLAGS="$LDFLAGS $debuginfod_LDFLAGS"
AC_CHECK_LIB(debuginfod, debuginfod_find_metadata, [
AC_DEFINE([METADATA_QUERY_ENABLED], [1], [Define if a new enough version of elfutils exists to support metadata querying])
])
CFLAGS="$ac_save_CFLAGS"
LDFLAGS="$ac_save_LDFLAGS"
AC_SUBST(debuginfod_LDFLAGS)
dnl Handle optional sqlite support. If enabled/disabled by the user,
dnl do the right thing. If not specified by the user, use it if
dnl present.
AC_ARG_ENABLE([sqlite],
AS_HELP_STRING([--enable-sqlite], [build with sqlite support]),
[], dnl ACTION-IF-GIVEN
[enable_sqlite=check]) dnl ACTION-IF-NOT-GIVEN
sqlite3_LIBS=
AS_IF([test "x$enable_sqlite" != xno],
[PKG_CHECK_MODULES([sqlite3], [sqlite3 > 3.7],
[AC_DEFINE([HAVE_LIBSQLITE3], [1], [Define to 1 if you have the 'sqlite3' library (-lsqlite3).])],
[if test "x$enable_sqlite" != xcheck; then
AC_MSG_FAILURE([--enable-sqlite was given, but test for sqlite > 3.7 failed])
fi])])
dnl Handle the option to only build runtime
AC_ARG_ENABLE([translator],
AS_HELP_STRING([--disable-translator], [build only runtime utilities]),
[],
[enable_translator="yes"])
AM_CONDITIONAL([BUILD_TRANSLATOR], [test "$enable_translator" = "yes"])
dnl Handle the option to build the crash extension
AC_ARG_ENABLE([crash],
AS_HELP_STRING([--enable-crash@<:@=DIRECTORY@:>@],
[enable crash extension (default is disabled). Optional DIRECTORY
is the path to the crash header file (needed if installed in a
non-standard location).]),
[if test "$enable_crash" != "no"; then
dnl Handle custom install dir (if needed)
save_CPPFLAGS="$CPPFLAGS"
if test "$enable_crash" != "yes"; then
staplog_CPPFLAGS=-I$enable_crash
CPPFLAGS="${staplog_CPPFLAGS} $CPPFLAGS"
AC_SUBST([staplog_CPPFLAGS])
fi
AC_CHECK_HEADERS([crash/defs.h], [],
[AC_MSG_ERROR([cannot find required crash header (crash-devel may need to be installed)])],
[
#define NR_CPUS 256
])
CPPFLAGS="$save_CPPFLAGS"
fi],
[enable_crash="no"])
AM_CONDITIONAL([BUILD_CRASHMOD], [test "$enable_crash" != "no"])
dnl Handle the option to build the documentation
dnl --enable-docs=check checks for LaTeX et al. and decides accordingly
building_docs="no"
dnl Handle the option to install the prebuilt PDFs and man pages.
dnl Automatically turned on if --enable-docs is on or if --enable-docs=prebuilt.
installing_prebuilt_docs="yes"
AC_ARG_ENABLE([docs],
AS_HELP_STRING([--enable-docs],
[enable building documentation (default to only installing prebuilt docs).]),
[enable_docs=$enableval],
[enable_docs="prebuilt"])
AC_CHECK_PROG(have_latex, latex, yes, no)
AC_CHECK_PROG(have_dvips, dvips, yes, no)
AC_CHECK_PROG(have_ps2pdf, ps2pdf, yes, no)
if test "x${have_latex}${have_dvips}${have_ps2pdf}" != "xyesyesyes"; then
if test "$enable_docs" = "yes"; then
AC_MSG_ERROR([cannot find all tools for building documentation])
fi
if test "$enable_docs" = "check"; then
AC_MSG_WARN([will not build documentation, cannot find all tools])
fi
fi
if test "$enable_docs" = "prebuilt"; then
AC_MSG_NOTICE([will only install prebuilt documentation])
fi
if test "x${have_latex}${have_dvips}${have_ps2pdf}" = "xyesyesyes" -a "$enable_docs" != "no" -a "$enable_docs" != "prebuilt"; then
building_docs="yes"
installing_prebuilt_docs="yes"
fi
if test "$enable_docs" = "no"; then
installing_prebuilt_docs="no"
fi
AM_CONDITIONAL([BUILD_DOCS], [test "$building_docs" = "yes"])
AM_CONDITIONAL([INSTALL_PREBUILT_DOCS], [test "$installing_prebuilt_docs" = "yes"])
dnl Handle the option to build the reference documentation
building_refdocs="no"
AC_ARG_ENABLE([refdocs],
AS_HELP_STRING([--enable-refdocs],
[enable building reference documentation (default on if other documentation built).]),
[enable_refdocs=$enableval],
[enable_refdocs="check"])
if test "$building_docs" = "no" -a "$enable_refdocs" = "yes" ; then
AC_MSG_ERROR([must use --enable-docs with --enable-refdocs])
fi
if test "$enable_refdocs" != "no" -a "${building_docs}" = "yes"; then
building_refdocs="yes"
fi
AM_CONDITIONAL([BUILD_REFDOCS], [test "$building_refdocs" = "yes"])
AC_CHECK_PROG(have_xmlto, xmlto, yes, no)
AC_CHECK_PROG(have_fop, fop, yes, no)
if test "x${have_fop}" = "xyes"; then
# Due to rhbz505364 / 830266, we must actually test-run fop, not just
# hope that it works.
AC_MSG_CHECKING([to see if xmlto --with-fop actually works])
if xmlto --with-fop pdf ${srcdir}/doc/SystemTap_Tapset_Reference/dummy-tapsets.xml >/dev/null 2>&1; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([it's dead, Jim])
have_fop="broken"
fi
rm -f dummy-tapsets.pdf
fi
AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = "yes"])
AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = "yes"])
dnl Handle the option to build the html documentation
building_htmldocs="no"
AC_ARG_ENABLE([htmldocs],
AS_HELP_STRING([--enable-htmldocs],
[enable building html documentation (default off).]),
[building_htmldocs=$enableval],
[building_htmldocs="no"])
if test "$have_xmlto" = "no" -a "$building_htmldocs" = "yes"; then
AC_MSG_ERROR([xmlto required for building html documentation])
fi
AM_CONDITIONAL([BUILD_HTMLDOCS], [test "$building_htmldocs" = "yes"])
dnl There is a strange bug in older versions of xmlto when generating pdf.
dnl https://bugzilla.redhat.com/show_bug.cgi?id=526273
dnl So make sure to have a chapter title starting with L plus an refentry.
dnl This will make sure the xmlto pdf support test fails on buggy versions.
cat > conftest.xml << 'EOF'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []>
<book lang="en">
<bookinfo><title>foo</title></bookinfo>
<chapter id="logging.stp"><title>Logging Tapset</title>
<refentry id="API-log"><refnamediv><refname>log</refname>
<refpurpose>logging</refpurpose></refnamediv>
<refsect1><title>Description</title>
<para>baz</para></refsect1></refentry></chapter>
</book>
EOF
if test "x${have_xmlto}" = "xyes"; then
AC_MSG_CHECKING([for xmlto --stringparam support])
xmlto --stringparam man.authors.section.enabled=0 html-nochunks conftest.xml >/dev/null 2>&1
if test $? = 0; then
have_xmlto_stringparam="yes"
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
rm -f conftest.html
fi
AM_CONDITIONAL([XMLTO_STRINGPARAM], [test "$have_xmlto_stringparam" = "yes"])
rm -f conftest.xml
dnl See if we have the nss/nspr headers and libraries
AC_ARG_WITH([nss],
AS_HELP_STRING([--without-nss],
[Do not use NSS even if present]))
AS_IF([test "x$with_nss" != "xno"], [
PKG_CHECK_MODULES([nss], [nss >= 3],
[have_nss=yes
AC_DEFINE([HAVE_NSS], [1], [Define to 1 if you have the nss libraries.])
], [have_nss=no])
], [have_nss=no])
AM_CONDITIONAL([HAVE_NSS], [test "${have_nss}" = "yes"])
dnl See if we have the openssl headers and libraries
AC_ARG_WITH([openssl],
AS_HELP_STRING([--without-openssl],
[Do not use OPENSSL even if present]))
AS_IF([test "x$with_openssl" != "xno"], [
PKG_CHECK_MODULES([openssl], [openssl],
[have_openssl=yes
AC_DEFINE([HAVE_OPENSSL], [1], [Define to 1 if you have the openssl libraries.])
], [have_openssl=no])
], [have_openssl=no])
AM_CONDITIONAL([HAVE_OPENSSL], [test "${have_openssl}" = "yes"])
dnl Handle dracut directory configuration. Note we hard-code /usr by default,
dnl instead of $prefix, because dracut is a system service that doesn't listen
dnl at relocatable directories.
AC_ARG_WITH([dracutstap],
AS_HELP_STRING([--with-dracutstap=DIR],
[Install dracut module files in DIR]))
AS_IF([test "x$with_dracutstap" != "x"],[dracutstap="$with_dracutstap"],
[dracutstap=/usr/lib/dracut/modules.d/99stap])
AC_MSG_NOTICE([using dracut module directory $dracutstap])
AC_SUBST(dracutstap)
dnl PR20850 Fix the boot time probing feature for fedora too. Typical rhel
dnl location is /sbin, typical fedora location is /usr/bin.
AC_ARG_WITH([dracutbindir],
AS_HELP_STRING([--with-dracutbindir=DIR],
[Use the dracut binary located in DIR]))
AS_IF([test "x$with_dracutbindir" != "x"],[dracutbindir="$with_dracutbindir"],
[dracutbindir=/sbin])
AC_MSG_NOTICE([using dracut binary $dracutbindir])
AC_SUBST(dracutbindir)
dnl Handle the option to build the compile server.
AC_ARG_ENABLE([server],
AS_HELP_STRING([--enable-server],
[enable building of stap-server (default on if nss etc. found).]),
[enable_server=$enableval],
[enable_server="check"])
if test "$enable_server" != "no"; then
dnl See if we have enough libraries and tools to build the compile server
if test "x${have_nss}" != "xyes"; then
AC_MSG_WARN([will not build systemtap compile server, cannot find nss headers])
fi
fi
AM_CONDITIONAL([BUILD_SERVER], [test "${have_nss}" = "yes" -a "$enable_server" != "no"])
if test "${have_nss}" != "yes"; then
AC_MSG_WARN([compile-server client functionality will be disabled, cannot find nss development files])
fi
dnl See if we have the avahi libraries and headers
AC_ARG_WITH([avahi],
AS_HELP_STRING([--without-avahi],
[Do not use Avahi even if present]))
AS_IF([test "x$with_avahi" != "xno"], [
PKG_CHECK_MODULES([avahi], [avahi-client],
[have_avahi=yes
AC_DEFINE([HAVE_AVAHI], [1], [Define to 1 if you have the avahi libraries.])
], [have_avahi=no])
], [have_avahi=no])
AM_CONDITIONAL([HAVE_AVAHI], [test "${have_avahi}" = "yes"])
if test "${have_avahi}" != "yes"; then
AC_MSG_WARN([some compile-server functionality will be restricted, cannot find avahi development files])
fi
dnl Look for librpm.
AC_ARG_WITH([rpm],
[AS_HELP_STRING([--with-rpm],
[query rpm database for missing debuginfos])], [], [with_rpm="auto"])
if test "$with_rpm" != "no"; then
AC_CHECK_LIB(rpm, rpmtsInitIterator, [
AC_DEFINE([HAVE_LIBRPM],[1],[have librpm])
stap_LIBS="$stap_LIBS -lc -lrpm"
have_librpm="yes"], [have_librpm="no"])
dnl explicit -lrpmdb is a separate requirement on some older librpms
AC_CHECK_LIB(rpmdb, rpmdbNextIterator, [
stap_LIBS="$stap_LIBS -lrpmdb"])
AC_CHECK_LIB(rpmio, rpmFreeCrypto, [
AC_DEFINE([HAVE_LIBRPMIO],[1],[have librpmio])
stap_LIBS="$stap_LIBS -lc -lrpmio"
have_librpmio="yes"], [have_librpmio="no"])
if test "x$have_librpm" != "xyes" -a "$with_rpm" = "yes"; then
AC_MSG_ERROR([cannot find librpm])
fi
if test "x$have_librpmio" != "xyes" -a "$with_rpm" = "yes"; then
AC_MSG_WARN([cannot find librpmio])
fi
fi
AC_CHECK_HEADERS([stdatomic.h])
dnl Look for rpmcrypto.h
AC_CHECK_HEADERS([rpm/rpmcrypto.h], [
AC_DEFINE([HAVE_RPMCRYPTO_H],[1],[have rpmcrypto_h])
have_rpmcrypto_h=yes
AC_MSG_NOTICE([separate rpm/rpmcrypto.h])])
dnl Look for readline.
dnl
dnl First save the orignal value of LIBS.
LIBS_no_readline=$LIBS
dnl Check how for readline presence and how to link with it. On some
dnl systems you need to add a termcap compatible library.
have_libreadline="no"
AC_MSG_CHECKING([how to link readline libs])
for libtermcap in "" tinfo ncursesw ncurses curses termcap; do
if test -z "$libtermcap"; then
READLINE_LIBS="-lreadline"
else
READLINE_LIBS="-lreadline -l$libtermcap"
fi
LIBS="$READLINE_LIBS $LIBS_no_readline"
AC_LINK_IFELSE(
[AC_LANG_CALL([],[readline])],
[have_libreadline="yes"])
if test "$have_libreadline" = "yes"; then
break
fi
done
if test "$have_libreadline" = "no"; then
AC_MSG_RESULT([none])
READLINE_LIBS=""
else
AC_MSG_RESULT([$READLINE_LIBS])
AC_DEFINE(HAVE_LIBREADLINE, [1],
[Define if you have the readline library (-lreadline).])
fi
AC_SUBST([READLINE_LIBS])
AM_CONDITIONAL([HAVE_LIBREADLINE], [test "$have_libreadline" = "yes"])
dnl End of readline checks: restore LIBS
LIBS=$LIBS_no_readline
dnl Allow user to choose python3 for /usr/bin/dtrace
AC_ARG_WITH([python3],
AS_HELP_STRING([--with-python3],[prefer python version 3]), [], [with_python3="auto"])
AS_IF([test "x$with_python3" = "xyes"],
[AS_IF([test "x$PYTHON3" = "x:"],
[AC_MSG_ERROR([python version 3 is required])],
[AC_SUBST(preferred_python,[$PYTHON3])])],
[test "x$with_python3" = "xno"],
[AS_IF([test "x$PYTHON" = "x:"],
[AC_MSG_ERROR([python version 2 is required])],
[AC_SUBST(preferred_python,[$PYTHON])])],
[test "x$PYTHON3" != "x:"],
[AC_SUBST(preferred_python,[$PYTHON3])],
[test "x$PYTHON" != "x:"],
[AC_SUBST(preferred_python,[$PYTHON])],
[AC_MSG_ERROR([neither python version 2 nor 3 found])])
if test $enable_translator = yes; then
# Need libdwfl-capable recent elfutils http://elfutils.org/
# On modern debian/ubuntu and modern elfutils, libebl has been
# merged into libdw
# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=457543
save_LIBS="$LIBS"
AC_CHECK_LIB(ebl, ebl_strtabinit,[ebl_LIBS=-lebl],[ebl_LIBS=])
LIBS="$save_LIBS"
save_LIBS="$LIBS"
AC_CHECK_LIB(dw, dwfl_module_getsym,[],[
AC_MSG_ERROR([missing elfutils development headers/libraries (install elfutils-devel, libebl-dev, libdw-dev and/or libebl-devel)])],
[-Wl,--start-group -ldw $ebl_LIBS -Wl,--end-group -lelf])
AC_CHECK_LIB(dw, dwarf_next_unit,[],[
AC_MSG_ERROR([elfutils, libdw too old, need 0.148+])],
[-Wl,--start-group -ldw $ebl_LIBS -Wl,--end-group -lelf])
stap_LIBS="$stap_LIBS -Wl,--start-group -ldw $ebl_LIBS -Wl,--end-group -lelf"
LIBS="$save_LIBS"
# Elfutils built with --enable-thread-safety defines _ELFUTILS_THREAD_SAFE
# in <elfutils/version.h>. Used to allow concurrent read-only DWARF
# walks after Dwfl reporting (pass-2 dwarf builds; pass-3 unwind dump).
AC_CHECK_DECL([_ELFUTILS_THREAD_SAFE],
[have_elfutils_thread_safety=yes
AC_DEFINE([HAVE_ELFUTILS_THREAD_SAFETY], [1],
[Define to 1 if elfutils was built with --enable-thread-safety.])],
[have_elfutils_thread_safety=no],
[#include <elfutils/version.h>])
AC_MSG_CHECKING([for elfutils thread-safety support])
AC_MSG_RESULT([$have_elfutils_thread_safety])
# zlib: used to unwrap aarch64 EFI-zboot / s390x zipl vmlinuz images
# when hunting for the kernel NT_GNU_BUILD_ID (elfutils can't).
save_LIBS="$LIBS"
AC_CHECK_LIB(z, inflate, [
stap_LIBS="$stap_LIBS -lz"
AC_DEFINE([HAVE_LIBZ], [1], [Define to 1 if you have zlib.])
], [
AC_MSG_WARN([zlib not found; kernel vmlinuz build-id extraction disabled])
])
LIBS="$save_LIBS"
fi
AC_SUBST(stap_LIBS)
AC_MSG_NOTICE([stap will link $stap_LIBS])
# staprun has more modest libelf needs
save_LIBS="$LIBS"
dnl this will only succeed with elfutils 0.142+
AC_CHECK_LIB(elf,elf_getshdrstrndx,[],[
AC_MSG_FAILURE([libelf too old, need 0.142+])])
staprun_LIBS="$staprun_LIBS -lelf"
stapbpf_LIBS="$stapbpf_LIBS -lelf"
LIBS="$save_LIBS"
AC_SUBST(staprun_LIBS)
AC_SUBST(stapbpf_LIBS)
AC_MSG_NOTICE([staprun will link $staprun_LIBS])
AC_MSG_NOTICE([stapbpf will link $stapbpf_LIBS])
# Before PR4037, we used to arrange to pass CFLAGS+=-m64 for a staprun
# being compiled on 32-bit userspace but running against 64-bit kernels.
# This is no longer necessary.
AC_LANG_PUSH(C++)
# PR32788 concurrency goodies
AC_CHECK_HEADERS([boost/asio/thread_pool.hpp])
AC_CHECK_HEADERS([boost/asio/post.hpp])
# Use boost::string_ref if available; moot with PR32788
# AC_CHECK_HEADERS([boost/utility/string_ref.hpp])
# add boost_system bits for stapdyn with dyninst 10+
saved_LIBS="$LIBS"
LIBS="-lboost_system $LIBS"
AC_MSG_CHECKING([need for -lboost_system library])
AC_LINK_IFELSE([AC_LANG_SOURCE([
#include <boost/system/system_error.hpp>
int main() {
boost::system::error_condition e();
}
])],[AC_MSG_RESULT([yup])
BOOST_SYSTEM_LIB="-lboost_system"
],[AC_MSG_RESULT([nope])
BOOST_SYSTEM_LIB=""
])
LIBS="$saved_LIBS"
AC_SUBST(BOOST_SYSTEM_LIB)
AC_LANG_POP(C++)
# Check for Dyninst headers and libraries
AC_ARG_WITH([dyninst],
AS_HELP_STRING([--with-dyninst=DIRECTORY],
[find dyninst headers/libraries in DIRECTORY]))
case "$with_dyninst" in
no) ;;
''|yes) # Try a simple-minded distro search
DYNINST_CXXFLAGS="-I/usr/include/dyninst"
old_LIBS="$LIBS"
old_LDFLAGS="$LDFLAGS"
old_CPPFLAGS="$CPPFLAGS"
AC_LANG_PUSH(C++)
# Workaround for Dyninst requiring DYNINST_TBB_HAS_VERSION_H on newer TBB versions
AC_CHECK_HEADERS([tbb/version.h], [DYNINST_CXXFLAGS="$DYNINST_CXXFLAGS -DDYNINST_TBB_HAS_VERSION_H"])
CPPFLAGS="$CPPFLAGS $DYNINST_CXXFLAGS"
for location in /usr/lib64/dyninst /usr/lib/dyninst ${libdir}/dyninst; do
LDFLAGS="-L${location}"
LIBS="-lparseAPI ${BOOST_SYSTEM_LIB}"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <dyninst/CodeSource.h>]],
[[char *s; Dyninst::ParseAPI::SymtabCodeSource *sts = new Dyninst::ParseAPI::SymtabCodeSource(s);]])],
[found_DYNINST_LDFLAGS=yes],[found_DYNINST_LDFLAGS=no])
if test "$found_DYNINST_LDFLAGS" = "yes"; then
DYNINST_LDFLAGS="$LDFLAGS"
AC_MSG_NOTICE([dyninst libraries found in $DYNINST_LDFLAGS])
break
fi
done
AC_LANG_POP(C++)
CPPFLAGS="$old_CPPFLAGS"
LDFLAGS="$old_LDFLAGS"
LIBS="$old_LIBS"
# Add Dyninst libraries only if they are available
if test -d "/usr/include/dyninst"; then
save_LIBS="$LIBS"
AC_CHECK_LIB(tbb, TBB_runtime_interface_version, [tbb_LIBS=-ltbb],[tbb_LIBS=])
LIBS="$save_LIBS"
DYNINST_LIBS="-lparseAPI -lsymtabAPI -linstructionAPI $tbb_LIBS -lcommon"
fi
;;
*) # Use paths in the user-specified prefix
DYNINST_CXXFLAGS="-I$with_dyninst/include -I$with_dyninst/include/dyninst"
DYNINST_LDFLAGS="-L$with_dyninst/lib64/dyninst -Wl,-rpath-link,$with_dyninst/lib64/dyninst"
# Will assume Dyninst libraries are available as the path is specified
save_LIBS="$LIBS"
AC_CHECK_LIB(tbb, TBB_runtime_interface_version, [tbb_LIBS=-ltbb],[tbb_LIBS=])
LIBS="$save_LIBS"
DYNINST_LIBS="-lparseAPI -lsymtabAPI -linstructionAPI $tbb_LIBS -lcommon"
# Workaround for Dyninst requiring DYNINST_TBB_HAS_VERSION_H on newer TBB versions
AC_CHECK_HEADERS([tbb/version.h], [DYNINST_CXXFLAGS="$DYNINST_CXXFLAGS -DDYNINST_TBB_HAS_VERSION_H"])
;;
esac
if test "$with_dyninst" != "no"; then
AC_LANG_PUSH(C++)
old_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $DYNINST_CXXFLAGS"
AC_MSG_NOTICE([checking dyninst support])
AC_CHECK_HEADERS([dyninst/BPatch_object.h], [
AC_SUBST(DYNINST_CXXFLAGS)
AC_SUBST(DYNINST_LDFLAGS)
AC_SUBST(DYNINST_LIBS)
AC_DEFINE([HAVE_DYNINST],[1],[Define to 1 if Dyninst is enabled])
have_dyninst=yes
AC_MSG_NOTICE([dyninst support available])])
if test -n "$with_dyninst" -a "$have_dyninst" != "yes"; then
AC_MSG_ERROR([Dyninst does not appear to be usable])
fi
CPPFLAGS="$old_CPPFLAGS"
AC_LANG_POP(C++)
fi
AM_CONDITIONAL([HAVE_DYNINST], [test "${have_dyninst}" = "yes"])
dnl Check for the libvirt and libxml2 devel packages
AC_ARG_ENABLE([virt],
AS_HELP_STRING([--enable-virt],
[enable building of stapvirt support (default on if libvirt etc. found).]),
[enable_virt=$enableval],
[enable_virt="check"])
dnl We require libvirt >= 1.0.2 because stapvirt relies on the
dnl virDomainOpenChannel function, which was implemented in 1.0.2.
AC_ARG_ENABLE([libvirt],
AS_HELP_STRING([--disable-libvirt], [Do not use libvirt even if present]))
if test "$enable_libvirt" != no; then
PKG_CHECK_MODULES([libvirt], [libvirt >= 1.0.2], [
have_libvirt=yes
AC_DEFINE([HAVE_LIBVIRT],[1],[Define to 1 if libvirt development libraries are installed])
], [have_libvirt=no])
fi
AM_CONDITIONAL([HAVE_LIBVIRT], [test "${have_libvirt}" = "yes"])
PKG_CHECK_MODULES([libxml2], [libxml-2.0], [
have_libxml2=yes
AC_DEFINE([HAVE_LIBXML2],[1],[Define to 1 if libxml2 development libraries are installed])
], [have_libxml2=no])
AM_CONDITIONAL([HAVE_LIBXML2], [test "${have_libxml2}" = "yes"])
if test "$enable_virt" != "no"; then
dnl See if we have enough libraries and tools to build the virt server
if test "x${have_libvirt}" != "xyes"; then
AC_MSG_WARN([will not build systemtap virt support, cannot find libvirt headers])
fi
if test "x${have_libxml2}" != "xyes"; then
AC_MSG_WARN([will not build systemtap virt support, cannot find xml2 headers])
fi
fi
AM_CONDITIONAL([BUILD_VIRT], [test "${have_libvirt}" = "yes" -a "${have_libxml2}" = "yes" -a "$enable_virt" != "no"])
dnl Handle the option to build python3 probe support
AC_ARG_WITH([python3-probes],
AS_HELP_STRING([--without-python3-probes],
[Disable building python version 3 probe support, even if it is available]))
have_python3_support=no
AS_IF([test "x$with_python3_probes" != "xno"],
[dnl First, check to make sure we have the 'python3-config' script.
AS_IF([test "x$PYTHON3" != "x:" ],
[AC_PATH_PROG([PYTHON3_CONFIG], [${python3_basename}-config])])
AS_IF([test "x$PYTHON3_CONFIG" != "x"],
[dnl Use the 'python3-config' script to find the python
dnl include directories.
PYTHON3_CPPFLAGS=`$PYTHON3_CONFIG --includes 2> /dev/null`
AC_SUBST([PYTHON3_CPPFLAGS], [$PYTHON3_CPPFLAGS])
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$PYTHON3_CPPFLAGS $CPPFLAGS"
dnl Now make sure we can find the python 3 Python.h file.
AC_CHECK_HEADERS([Python.h], [have_python3_support=yes])
CPPFLAGS="$save_CPPFLAGS"])])
AS_IF([test "x$have_python3_support" = "xyes"],
[AC_DEFINE([HAVE_PYTHON3_PROBES], [1],
[Define to 1 to enable python version 3 probe support in systemtap.])],
[AS_IF([test "x$with_python3_probes" = "xyes"],
[AC_MSG_ERROR([python version 3 probe support requested but not found])])
])
AM_CONDITIONAL([HAVE_PYTHON3_PROBES], [test "x$have_python3_support" = "xyes"])
dnl We want either (or both) python probe support.
AM_CONDITIONAL([HAVE_PYTHON_PROBES],
[test "x$have_python3_support" = "xyes"])
PKG_CHECK_MODULES([jsonc], [json-c >= 0.13], [have_jsonc=yes], [have_jsonc=no])
PKG_CHECK_MODULES([ncurses], [ncurses], [have_ncurses=yes], [have_ncurses=no])
AC_ARG_ENABLE([monitor], AS_HELP_STRING([--disable-monitor],[Disable monitor]))
if test "$enable_monitor" != "no"; then
dnl Check for presence of json-c and ncurses for use in monitor mode
if test "${have_jsonc}" = "yes" -a "${have_ncurses}" = yes; then
AC_DEFINE([HAVE_MONITOR_LIBS],[1],[Define to 1 if json-c and ncurses libraries are installed])
fi
fi
AM_CONDITIONAL([HAVE_MONITOR_LIBS], [test "${have_jsonc}" = "yes" -a "${have_ncurses}" = "yes" -a "$enable_monitor" != "no"])
if test "${have_jsonc}" = "yes"; then
AC_DEFINE([HAVE_JSON_C],[1],[Define to 1 if the json-c library is installed])
fi
AM_CONDITIONAL([HAVE_JSON_C], [test "${have_jsonc}" = "yes"])
# We require gcc >=8 since we use some more modern language features such as lambda-capture [this] and
# initializer list constructors in class template argument deduction
AC_MSG_CHECKING([to see if the language server is supported])
if { echo '#if __GNUC__ >= 8 '
echo ' yes '
echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
have_language_server_support=yes
AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_LANGUAGE_SERVER_SUPPORT], [1],
[Define to 1 if the language server is supported])
else
AC_MSG_RESULT([no])
fi
AM_CONDITIONAL([HAVE_LANGUAGE_SERVER_SUPPORT], [test "x$have_language_server_support" = "xyes"])
AC_CACHE_CHECK([for assembler .section "?" flags support], stap_cv_sectionq, [
old_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wa,--fatal-warnings"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([asm(".section .note.foo,\"?\",\"note\"\n"
".byte 1, 2, 3\n"
".previous\n"
".section .text,\"axG\",\"progbits\",foogroup,comdat\n"
".byte 1\n"
".pushsection .note.foo,\"?\",\"note\"\n"
".byte 4, 5, 6\n"
".popsection\n"
".byte 2\n");])],
stap_cv_sectionq=yes, stap_cv_sectionq=no)
CFLAGS="$old_CFLAGS"])
AC_SUBST(support_section_question)
support_section_question=0
if test $stap_cv_sectionq = yes; then
support_section_question=1
fi
AC_CACHE_CHECK([for assembler .section "R" flags support], stap_cv_sectionr, [
old_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wa,--fatal-warnings"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([asm(".section .text,\"aGR\",\"progbits\",foogroup,comdat\n"
".byte 2\n");])],
stap_cv_sectionr=yes, stap_cv_sectionr=no)
CFLAGS="$old_CFLAGS"])
AC_SUBST(support_section_retain)
support_section_retain=0
if test $stap_cv_sectionr = yes; then
support_section_retain=1
fi
AC_ARG_WITH([bpf],
AS_HELP_STRING([--without-bpf],[Do not try to build BPF components]))
dnl Allow --without-bpf to disable this autodetection, as some kernels
dnl have some headers but missing some decls like __NR_bpf. Too hard
dnl to detect all the prereqs here.
AS_IF([test "x$with_bpf" != "xno"], [
AC_CHECK_DECLS([BPF_PROG_TYPE_PERF_EVENT],
[AC_DEFINE([HAVE_BPF_DECLS], [1], [Define to 1 if you have the necessary declarations in bpf.h])],
[],
[#include <linux/bpf.h>])
])
AM_CONDITIONAL(HAVE_BPF_DECLS, [test "x$ac_cv_have_decl_BPF_PROG_TYPE_PERF_EVENT" = "xyes"])
AC_CONFIG_FILES([includes/sys/sdt-config.h po/Makefile.in])
dnl determine whether BPF raw tracepoints are available
AC_CHECK_DECLS([BPF_PROG_TYPE_RAW_TRACEPOINT],
[AC_DEFINE([HAVE_BPF_PROG_TYPE_RAW_TRACEPOINT], [1], [Define to 1 if you have the necessary declarations in bpf.h])],
[],
[#include <linux/bpf.h>])
AC_CHECK_DECLS([BPF_PROG_TYPE_LSM],
[AC_DEFINE([HAVE_BPF_PROG_TYPE_LSM], [1], [Define to 1 if you have BPF LSM support in bpf.h])],
[],
[#include <linux/bpf.h>])
AC_CHECK_DECLS([BPF_PROG_TYPE_XDP],
[AC_DEFINE([HAVE_BPF_PROG_TYPE_XDP], [1], [Define to 1 if you have BPF XDP support in bpf.h])],
[],
[#include <linux/bpf.h>])
dnl Optional libbpf support for LSM hook BTF ID resolution
AC_ARG_WITH([libbpf],
AS_HELP_STRING([--without-libbpf],
[Do not use libbpf even if present]))
AS_IF([test "x$with_libbpf" != "xno"], [
PKG_CHECK_MODULES([libbpf], [libbpf >= 1.0],
[have_libbpf=yes
AC_DEFINE([HAVE_LIBBPF], [1], [Define to 1 if you have libbpf])],
[have_libbpf=no])
])
AM_CONDITIONAL([HAVE_LIBBPF], [test "x$have_libbpf" = "xyes"])
dnl Optional libselinux support allows stapdyn to check
dnl for booleans that would prevent Dyninst from working.
AC_ARG_WITH([selinux],
AS_HELP_STRING([--without-selinux],
[Do not use libselinux even if present]))
AS_IF([test "x$with_selinux" != "xno"], [
PKG_CHECK_MODULES([selinux], [libselinux],
[have_selinux=yes
AC_DEFINE([HAVE_SELINUX], [1], [Define to 1 if you have the SELinux libraries.])
], [have_selinux=no])
], [have_selinux=no])
AM_CONDITIONAL([HAVE_SELINUX], [test "${have_selinux}" = "yes"])
dnl Used in monitor mode. Only available on kernel versions >= 2.6.35
AC_CHECK_DECL([F_SETPIPE_SZ],
[AC_DEFINE(HAVE_F_SETPIPE_SZ,[1], Define to 1 if F_SETPIPE_SZ is available.)],
[],
[#include <fcntl.h>])
dnl Handle java+byteman support
AC_CHECK_PROG(have_javac, javac, yes, no)
AC_CHECK_PROG(have_jar, jar, yes, no)
if test "$have_javac" != no -a "$have_jar" != no; then
echo java found, will try to configure Byteman support
AC_ARG_WITH([java],
[AS_HELP_STRING([--with-java=DIRECTORY],
[Specify JDK directory to compile libHelperSDT.so against (default is /usr/lib/jvm/java)])],
[],
[with_java=/usr/lib/jvm/java])
dnl don't use AC_CHECK_FILE here, as that blocks cross-compiling
if test ! -d "$with_java"; then
AC_MSG_NOTICE([directory $with_java not found, disabling java support])
with_java=no
fi
dnl PR34475: some JDKs ship javac but fail at VM init (e.g.
dnl java-25-openjdk-25-0.1.0.8-1.0.riscv64.fc42 with SV57 satp). Also
dnl catch language-level rejection of the real HelperSDT sources before
dnl we commit to building java support.
if test "$with_java" != "no"; then
AC_MSG_CHECKING([whether javac can compile HelperSDT])
rm -rf conftest.javac
mkdir -p conftest.javac/org/systemtap/byteman/helper
sed 's|@pkglibexecdir@|/tmp|g' \
"$srcdir/java/org/systemtap/byteman/helper/HelperSDT.java.in" \
> conftest.javac/org/systemtap/byteman/helper/HelperSDT.java
if (cd conftest.javac && javac -d . org/systemtap/byteman/helper/HelperSDT.java) >conftest.javac.out 2>&1; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
cat conftest.javac.out >&AS_MESSAGE_LOG_FD
AC_MSG_NOTICE([javac cannot compile HelperSDT.java, disabling java support])
with_java=no
fi
rm -rf conftest.javac conftest.javac.out
fi
AC_SUBST(JAVADIR, "${with_java}") # always needed to compile
if test "$with_java" != "no"; then
AC_DEFINE_UNQUOTED(HAVE_JAVA, "1", [Flag indicating that libHelperSDT.so is available (can be found in PKGLIBDIR)])
fi
AM_CONDITIONAL([HAVE_JAVA], [test "$with_java" != "no"])
else
AC_MSG_WARN([will not run per-method java probing, missing byteman or java requirements])
AM_CONDITIONAL([HAVE_JAVA],false)
fi # java+byteman support
AC_SUBST(ENABLE_NLS, "$USE_NLS")
AC_SUBST(localedir, "$localedir")
AC_SUBST(LOCALEDIR, "$localedir")
AC_ARG_WITH([extra-version],
AS_HELP_STRING([--with-extra-version=STRING],
[Add STRING to stap -V version]))
AS_IF([test "x$with_extra_version" != "xno"], [
stap_extra_version="$with_extra_version"
AC_MSG_NOTICE([Adding extra version $stap_extra_version])], [
stap_extra_version=""])
AC_DEFINE_UNQUOTED(STAP_EXTRA_VERSION, "$stap_extra_version", [extra stap version code])
AC_SUBST(STAP_EXTRA_VERSION, "$stap_extra_version")
dnl NEED_BASE_CLIENT_CODE is defined when we have HAVE_NSS
AM_CONDITIONAL([NEED_BASE_CLIENT_CODE],
[test "x$have_nss" = "xyes"])
AS_IF([test "x$have_nss" = "xyes"], [
AC_DEFINE([NEED_BASE_CLIENT_CODE], [1],
[Define to 1 if the base client code is needed.])
])
dnl This is here mainly to make sure that configure --prefix=... changes
dnl the config.h files so files depending on it are recompiled
dnl prefix is passed through indirectly in the Makefile.am AM_CPPFLAGS.
dnl Formerly: Don't use this directly (when not given it is set to NONE).
dnl Currently: inline autoconf's later defaulting
stap_prefix=$prefix
test "$stap_prefix" = NONE && stap_prefix=$ac_default_prefix
AC_DEFINE_UNQUOTED(STAP_PREFIX, "$stap_prefix", [configure prefix location])
AC_SUBST(STAP_PREFIX, "$stap_prefix")
dnl compute a fully expanded $pkglibexecdir for substitution here and there
stap_libexecdir=$libexecdir
test "$stap_libexecdir" = '${exec_prefix}/libexec' && stap_libexecdir=$stap_prefix/libexec
AC_SUBST(pkglibexecdir, "$stap_libexecdir/$PACKAGE")
AC_CONFIG_HEADERS([config.h:config.in])
dnl XXX: we'd like fully expanded path names for the @macros@ in there,
dnl not like exec_prefix=${prefix}
AC_CONFIG_FILES([Makefile doc/Makefile man/Makefile man/cs/Makefile \
doc/beginners/Makefile doc/SystemTap_Tapset_Reference/Makefile \
man/stap.1 man/stappaths.7 man/stap-onboot.8 \
man/cs/stap.1 man/cs/stappaths.7 man/cs/systemtap.8 \
initscript/config.stap-server \
initscript/stap-server \
initscript/stap-service-prepare initscript/stap-onboot \
initscript/stap@.service initscript/staprun@.service \
initscript/99stap/module-setup.sh \
initscript/99stap/install \
initscript/99stap/check ])
AC_CONFIG_SUBDIRS(testsuite)
if test $enable_translator = "yes"; then
AC_CONFIG_FILES([run-stap], [chmod +x run-stap])
fi
AC_CONFIG_FILES([dtrace], [chmod +x dtrace])
AC_CONFIG_FILES(stapdyn/Makefile)
AC_CONFIG_FILES(java/Makefile)
AC_CONFIG_FILES([java/stapbm], [chmod +x java/stapbm])
AC_CONFIG_FILES(java/org/systemtap/byteman/helper/HelperSDT.java)
AC_CONFIG_FILES(python/Makefile)
AC_CONFIG_FILES(interactive-notebook/Makefile)
AC_CONFIG_FILES([interactive-notebook/stap-jupyter-container], [chmod +x interactive-notebook/stap-jupyter-container])
AC_CONFIG_FILES([interactive-notebook/stap-jupyter-install], [chmod +x interactive-notebook/stap-jupyter-install])
AC_CONFIG_FILES(staprun/Makefile)
AC_CONFIG_FILES(stapbpf/Makefile)
AC_CONFIG_FILES([staprun/run-staprun], [chmod +x staprun/run-staprun])
AC_CONFIG_FILES([staprun/guest/stapshd], [chmod +x staprun/guest/stapshd])
AC_CONFIG_FILES([staprun/guest/stapsh-daemon], [chmod +x staprun/guest/stapsh-daemon])
AC_CONFIG_FILES([staprun/guest/stapsh@.service])
AC_CONFIG_FILES(stap-exporter/Makefile)
AC_CONFIG_FILES([stap-profile-annotate], [chmod +x stap-profile-annotate])
dnl AC_CONFIG_FILES([macros.systemtap])
dnl ^^^ not that one, because we want to expand $vars etc. to fqdn's,
dnl so we do the mapping in the Makefile.am
# Setup "shadow" directory doc/beginners that has the basic directories setup for
# xmlto in one directory (through directory links if necessary).
# It would be nice to use AC_CONFIG_LINKS, but automake complains when
# the src is a directory and not a file.
AC_CONFIG_COMMANDS([doc/beginners],
[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])
AC_OUTPUT
if test "${prefix}" = "/usr/local"; then
AC_MSG_NOTICE([])
AC_MSG_NOTICE([For a private or temporary build of systemtap, we recommend])
AC_MSG_NOTICE([configuring with a prefix. For example, try])
AC_MSG_NOTICE([$0 $ac_configure_args --prefix=$HOME/systemtap-${PACKAGE_VERSION}-$$])
AC_MSG_NOTICE([Running systemtap uninstalled, entirely out of the build tree,])
AC_MSG_NOTICE([is not supported.])
fi