]> sourceware.org Git - systemtap.git/blame_incremental - configure.ac
pre-release update-docs
[systemtap.git] / configure.ac
... / ...
CommitLineData
1dnl configure.ac --- autoconf input file for systemtap
2dnl Process this file with autoconf to produce a configure script.
3
4AC_INIT([systemtap],[5.2],[systemtap@sourceware.org],[systemtap])
5dnl ^^^ see also NEWS, systemtap.spec, testsuite/configure.ac
6dnl doc/SystemTap_Beginners_Guide/en-US/Book_Info.xml
7
8dnl Get the target arch for libHelperSDT.so
9AC_CANONICAL_TARGET
10
11AC_PREREQ([2.71])
12dnl We don't maintain a ChangeLog, which makes us non-GNU -> foreign.
13AM_INIT_AUTOMAKE([no-dist foreign])
14AM_MAINTAINER_MODE
15
16m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
17
18PKG_PROG_PKG_CONFIG
19AC_USE_SYSTEM_EXTENSIONS
20AC_PROG_MKDIR_P
21AC_SUBST(MKDIR_P)
22AC_PROG_LN_S
23AC_PROG_CC
24AC_PROG_CXX
25AC_PROG_CPP
26AM_PROG_AR
27AM_PROG_CC_C_O
28AC_PROG_RANLIB
29AC_OBJEXT
30AC_EXEEXT
31AC_PROG_INSTALL
32AC_PROG_MAKE_SET
33AC_SUBST(CFLAGS)
34AC_SUBST(CXXFLAGS)
35AC_SYS_LARGEFILE
36AC_CHECK_FUNCS(ppoll)
37AC_CHECK_FUNCS(openat)
38AM_GNU_GETTEXT(external)
39AM_GNU_GETTEXT_VERSION([0.19.4])
40
41# We want the 'PYTHON' varible to be python version 2. We also want
42# our custom 'PYTHON3' varible to be python version 3.
43#
44# Note that the python2/python3 code was inspired by code in the
45# 'abrt' configure:
46# <https://github.com/abrt/abrt/blob/master/configure.ac>
47#
48# First, figure out what version of python is in the executable named
49# 'python'. On most systems that is python version 2, but on arch
50# linux that is python version 3.
51AC_PATH_PROG([PYTHON_UNKNOWN], [python], [no])
52if test "x$PYTHON_UNKNOWN" != "xno"; then
53 # OK, we found 'python'. What version is it?
54 AC_CACHE_CHECK([whether $PYTHON_UNKNOWN is version 2 or 3],
55 [ac_cv_python_unknown_version],
56 [ac_cv_python_unknown_version=`$PYTHON_UNKNOWN -c "import sys; sys.stdout.write(sys.version[[:3]][[0]])"`])
57fi
58
59# Now we'll update the _AM_PYTHON_INTERPRETER_LIST variable (which
60# AM_PATH_PYTHON uses) to only be version 2 versions of python. Note
61# that the m4_define happens when autoconf is run, but the
62# PLAIN_PYTHON_INTERPRETER variable expansion will happen when the
63# user runs configure.
64#
65# Note that for python2, we prefer an executable named 'python2' over
66# one just named 'python'.
67if test "x$PYTHON_UNKNOWN" != "xno" -a "x$ac_cv_python_unknown_version" = "x2"; then
68 PLAIN_PYTHON_INTERPRETER=python
69else
70 PLAIN_PYTHON_INTERPRETER=python2
71fi
72m4_define([_AM_PYTHON_INTERPRETER_LIST],
73 [python2 $PLAIN_PYTHON_INTERPRETER python2.7 python2.6])
74
75# Now we can call AM_PATH_PYTHON to find python version 2.6+ (and
76# version 2 only).
77AM_PATH_PYTHON([2.6], [], [:])
78python_basename=$(basename "$PYTHON")
79AC_DEFINE_UNQUOTED([PYTHON_BASENAME], "${python_basename}",
80 [Base name of the python2 interpreter binary.])
81if test "x$PYTHON" != "x:"; then
82AC_DEFINE([PYTHON_EXISTS], [],
83 [The python2 interpreter binary exists.])
84fi
85
86# AM_PATH_PYTHON defines 'pyexecdir'. Make sure the python and
87# pyexecdir variables get sent down to the subconfigure in the
88# testsuite directory.
89AS_VAR_APPEND([ac_configure_args], [" python='$PYTHON' pyexecdir='$pyexecdir'"])
90
91# Now let's try to find python version 3.
92AC_PATH_PROGS([PYTHON3],
93 [python3 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0], [:])
94python3_basename=$(basename "$PYTHON3")
95AC_DEFINE_UNQUOTED([PYTHON3_BASENAME], "${python3_basename}",
96 [Base name of the python3 interpreter binary.])
97
98# If we found python version 3, set up the other variables for python
99# version 3 that AM_PATH_PYTHON sets up for python version 2.
100if test "x$PYTHON3" != "x:"; then
101 AC_DEFINE([PYTHON3_EXISTS], [],
102 [The python3 interpreter binary exists.])
103 AC_CACHE_CHECK([for python3 version], [ac_cv_python3_version],
104 [ac_cv_python3_version=`$PYTHON3 -c "import sys; sys.stdout.write(sys.version[[:3]])"`])
105 AC_SUBST([PYTHON3_VERSION], [$ac_cv_python3_version])
106 AC_SUBST([PYTHON3_PREFIX], ['${prefix}'])
107 AC_SUBST([PYTHON3_EXEC_PREFIX], ['${exec_prefix}'])
108 AC_CACHE_CHECK([for python3 platform], [ac_cv_python3_platform],
109 [ac_cv_python3_platform=`$PYTHON3 -c "import sys; sys.stdout.write(sys.platform)"`])
110 AC_SUBST([PYTHON3_PLATFORM], [$ac_cv_python3_platform])
111
112 AC_CACHE_CHECK([for python3 script directory], [ac_cv_python3_dir],
113 [ac_cv_python3_dir=`$PYTHON3 -c "import distutils.sysconfig; print(distutils.sysconfig.get_python_lib(0,0,prefix='$PYTHON3_PREFIX'))"`])
114 AC_SUBST([python3dir], [$ac_cv_python3_dir])
115
116 AC_CACHE_CHECK([for python3 extension module directory],
117 [ac_cv_py3execdir],
118 [ac_cv_py3execdir=`$PYTHON3 -c "import distutils.sysconfig; print(distutils.sysconfig.get_python_lib(1,0,prefix='$PYTHON3_EXEC_PREFIX'))"`])
119 AC_SUBST([py3execdir], [$ac_cv_py3execdir])
120fi
121
122# Make sure the python3 and py3execdir variables get sent down to
123# the subconfigure in the testsuite directory.
124AS_VAR_APPEND([ac_configure_args], [" python3='$PYTHON3' py3execdir='$ac_cv_py3execdir'"])
125
126dnl Allow the build to exclude -Werror
127AC_MSG_CHECKING([whether to build with -Werror])
128AC_ARG_ENABLE([Werror],
129 AS_HELP_STRING('[--enable-Werror], [compile with -Werror flags]))
130AS_IF([test "${enable_Werror}" != "no"], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
131AM_CONDITIONAL([Werror], [test "${enable_Werror}" != "no"])
132
133dnl Handle the prologues option.
134dnl
135dnl If the user didn't specify --enable-prologues/--disable-prologues
136dnl and the x86 system has a version of gcc less than version 4,
137dnl automatically enable prologues.
138if test "${enable_prologues+set}" != set; then
139 AC_MSG_CHECKING([to see if prologue searching should be the default])
140 if { echo '#if __i386__ == 1 && __GNUC__ < 4'
141 echo ' yes '
142 echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
143 enable_prologues=yes
144 AC_MSG_RESULT([yes])
145 else
146 AC_MSG_RESULT([no])
147 fi
148fi
149AC_ARG_ENABLE([prologues],
150 AS_HELP_STRING([--enable-prologues], [make -P prologue-searching default]),
151 [
152if test "$enable_prologues" = yes; then
153 AC_DEFINE([ENABLE_PROLOGUES],[],[make -P prologue-searching default])
154fi])
155
156dnl Handle the disable-sdt-probes option.
157dnl
158dnl Default to --disable-sdt-probes if --enable-sdt-probes/--disable-prologues
159dnl was not specified and the gcc version is less than version 4,
160
161if test "${enable_sdt_probes+set}" != set; then
162 AC_MSG_CHECKING([to see if sdt probes should be the default])
163 if { echo '#if __GNUC__ < 4'
164 echo ' yes '
165 echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
166 enable_sdt_probes=no
167 AC_MSG_RESULT([no])
168 else
169 AC_MSG_RESULT([yes])
170 fi
171fi
172AC_ARG_ENABLE([sdt-probes],
173 [AS_HELP_STRING([--disable-sdt-probes],
174 [disable process.mark probes in stap, staprun, stapio])])
175AS_IF([test "x$enable_sdt_probes" != xno], [
176 AC_DEFINE([ENABLE_SDT_PROBES], [1],
177 [Define to 1 to enable process.mark probes in stap, staprun, stapio.])
178])
179
180dnl We're now requiring *some* C++11, using RHEL6 (gcc 4.4.7) as a baseline.
181dnl This is too strict about __cplusplus for gcc < 4.7, so we have a manual fallback.
182AX_CXX_COMPILE_STDCXX(11, noext, optional)
183have_cxx0x="no"
184AS_IF([test "x$HAVE_CXX11" != x1],[
185 AC_LANG_PUSH(C++)
186 AX_CHECK_COMPILE_FLAG([-std=c++0x], [
187 AC_MSG_NOTICE([Compiling with -std=c++0x])
188 CXX="$CXX -std=c++0x"
189 HAVE_CXX11=1
190 have_cxx0x="yes"
191 ], [
192 AC_MSG_ERROR([A compiler with C++11 support is required.])
193 ])
194 AC_LANG_POP(C++)
195 ])
196
197dnl Some versions of dyninst (10.1) need -faligned-new
198dnl If -faligned-new available, pass it in
199AC_LANG_PUSH(C++)
200AX_CHECK_COMPILE_FLAG([-faligned-new], ALIGNEDNEW="-faligned-new", ALIGNEDNEW="")
201AC_LANG_POP(C++)
202
203AC_SUBST(ALIGNEDNEW)
204
205dnl Carry forward some empty PIE*FLAGS so we don't have to modify
206dnl all the Makefile.am's just now.
207AC_SUBST(PIELDFLAGS)
208AC_SUBST(PIECFLAGS)
209AC_SUBST(PIECXXFLAGS)
210
211dnl Handle optional debuginfod support. If not specified by the user,
212dnl use it if present. If given --with-debuginfod=/PATH, interpret /PATH as a prefix
213dnl of an elfutils install tree.
214AC_ARG_WITH([debuginfod],
215 AS_HELP_STRING([--with-debuginfod],[Enable debuginfo lookups with debuginfod (auto/yes/no)]),
216 [], [with_debuginfod=auto])
217AC_MSG_CHECKING([whether to use debuginfod])
218if expr "$with_debuginfod" : "/.*" >/dev/null; then
219dnl take the user at his or her word
220 debuginfod_LDFLAGS=-L$with_debuginfod/lib
221 debuginfod_LIBS=-ldebuginfod
222 debuginfod_CFLAGS=-I$with_debuginfod/include
223 have_debuginfod=1
224 AC_DEFINE([HAVE_LIBDEBUGINFOD], [1], [Define to 1 if debuginfod is enabled.])
225 AC_MSG_RESULT([yes])
226elif test "x$with_debuginfod" != xno; then
227dnl check in the system pkgconfig
228 PKG_CHECK_MODULES([debuginfod], [libdebuginfod >= 0.179],
229 [have_debuginfod=1
230 AC_DEFINE([HAVE_LIBDEBUGINFOD], [1], [Define to 1 if debuginfod is enabled.])],
231 [if test "x$with_debuginfod" = xyes; then
232 AC_MSG_ERROR(["--with-debuginfod was given, but libdebuginfod is missing or unusable."])
233 fi])
234else
235 AC_MSG_RESULT([no])
236fi
237
238ac_save_CFLAGS="$CFLAGS"
239ac_save_LDFLAGS="$LDFLAGS"
240CFLAGS="$CFLAGS $debuginfod_CFLAGS"
241LDFLAGS="$LDFLAGS $debuginfod_LDFLAGS"
242AC_CHECK_LIB(debuginfod, debuginfod_find_metadata, [
243 AC_DEFINE([METADATA_QUERY_ENABLED], [1], [Define if a new enough version of elfutils exists to support metadata querying])
244])
245CFLAGS="$ac_save_CFLAGS"
246LDFLAGS="$ac_save_LDFLAGS"
247AC_SUBST(debuginfod_LDFLAGS)
248
249dnl Handle optional sqlite support. If enabled/disabled by the user,
250dnl do the right thing. If not specified by the user, use it if
251dnl present.
252AC_ARG_ENABLE([sqlite],
253 AS_HELP_STRING([--enable-sqlite], [build with sqlite support]),
254 [], dnl ACTION-IF-GIVEN
255 [enable_sqlite=check]) dnl ACTION-IF-NOT-GIVEN
256sqlite3_LIBS=
257AS_IF([test "x$enable_sqlite" != xno],
258 [PKG_CHECK_MODULES([sqlite3], [sqlite3 > 3.7],
259 [AC_DEFINE([HAVE_LIBSQLITE3], [1], [Define to 1 if you have the 'sqlite3' library (-lsqlite3).])],
260 [if test "x$enable_sqlite" != xcheck; then
261 AC_MSG_FAILURE([--enable-sqlite was given, but test for sqlite > 3.7 failed])
262 fi])])
263
264dnl Handle the option to only build runtime
265AC_ARG_ENABLE([translator],
266 AS_HELP_STRING([--disable-translator], [build only runtime utilities]),
267 [],
268 [enable_translator="yes"])
269AM_CONDITIONAL([BUILD_TRANSLATOR], [test "$enable_translator" = "yes"])
270
271dnl Handle the option to build the crash extension
272AC_ARG_ENABLE([crash],
273 AS_HELP_STRING([--enable-crash@<:@=DIRECTORY@:>@],
274 [enable crash extension (default is disabled). Optional DIRECTORY
275 is the path to the crash header file (needed if installed in a
276 non-standard location).]),
277 [if test "$enable_crash" != "no"; then
278 dnl Handle custom install dir (if needed)
279 save_CPPFLAGS="$CPPFLAGS"
280 if test "$enable_crash" != "yes"; then
281 staplog_CPPFLAGS=-I$enable_crash
282 CPPFLAGS="${staplog_CPPFLAGS} $CPPFLAGS"
283 AC_SUBST([staplog_CPPFLAGS])
284 fi
285 AC_CHECK_HEADERS([crash/defs.h], [],
286 [AC_MSG_ERROR([cannot find required crash header (crash-devel may need to be installed)])],
287 [
288#define NR_CPUS 256
289 ])
290 CPPFLAGS="$save_CPPFLAGS"
291 fi],
292 [enable_crash="no"])
293AM_CONDITIONAL([BUILD_CRASHMOD], [test "$enable_crash" != "no"])
294
295dnl Handle the option to build the documentation
296dnl --enable-docs=check checks for LaTeX et al. and decides accordingly
297building_docs="no"
298dnl Handle the option to install the prebuilt PDFs and man pages.
299dnl Automatically turned on if --enable-docs is on or if --enable-docs=prebuilt.
300installing_prebuilt_docs="yes"
301AC_ARG_ENABLE([docs],
302 AS_HELP_STRING([--enable-docs],
303 [enable building documentation (default to only installing prebuilt docs).]),
304 [enable_docs=$enableval],
305 [enable_docs="prebuilt"])
306AC_CHECK_PROG(have_latex, latex, yes, no)
307AC_CHECK_PROG(have_dvips, dvips, yes, no)
308AC_CHECK_PROG(have_ps2pdf, ps2pdf, yes, no)
309if test "x${have_latex}${have_dvips}${have_ps2pdf}" != "xyesyesyes"; then
310 if test "$enable_docs" = "yes"; then
311 AC_MSG_ERROR([cannot find all tools for building documentation])
312 fi
313 if test "$enable_docs" = "check"; then
314 AC_MSG_WARN([will not build documentation, cannot find all tools])
315 fi
316fi
317if test "$enable_docs" = "prebuilt"; then
318 AC_MSG_NOTICE([will only install prebuilt documentation])
319fi
320if test "x${have_latex}${have_dvips}${have_ps2pdf}" = "xyesyesyes" -a "$enable_docs" != "no" -a "$enable_docs" != "prebuilt"; then
321 building_docs="yes"
322 installing_prebuilt_docs="yes"
323fi
324if test "$enable_docs" = "no"; then
325 installing_prebuilt_docs="no"
326fi
327AM_CONDITIONAL([BUILD_DOCS], [test "$building_docs" = "yes"])
328AM_CONDITIONAL([INSTALL_PREBUILT_DOCS], [test "$installing_prebuilt_docs" = "yes"])
329
330
331dnl Handle the option to build the reference documentation
332building_refdocs="no"
333AC_ARG_ENABLE([refdocs],
334 AS_HELP_STRING([--enable-refdocs],
335 [enable building reference documentation (default on if other documentation built).]),
336 [enable_refdocs=$enableval],
337 [enable_refdocs="check"])
338if test "$building_docs" = "no" -a "$enable_refdocs" = "yes" ; then
339 AC_MSG_ERROR([must use --enable-docs with --enable-refdocs])
340fi
341if test "$enable_refdocs" != "no" -a "${building_docs}" = "yes"; then
342 building_refdocs="yes"
343fi
344AM_CONDITIONAL([BUILD_REFDOCS], [test "$building_refdocs" = "yes"])
345
346AC_CHECK_PROG(have_xmlto, xmlto, yes, no)
347AC_CHECK_PROG(have_fop, fop, yes, no)
348if test "x${have_fop}" = "xyes"; then
349 # Due to rhbz505364 / 830266, we must actually test-run fop, not just
350 # hope that it works.
351 AC_MSG_CHECKING([to see if xmlto --with-fop actually works])
352 if xmlto --with-fop pdf ${srcdir}/doc/SystemTap_Tapset_Reference/dummy-tapsets.xml >/dev/null 2>&1; then
353 AC_MSG_RESULT([yes])
354 else
355 AC_MSG_RESULT([it's dead, Jim])
356 have_fop="broken"
357 fi
358 rm -f dummy-tapsets.pdf
359fi
360AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = "yes"])
361AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = "yes"])
362
363dnl Handle the option to build the html documentation
364building_htmldocs="no"
365AC_ARG_ENABLE([htmldocs],
366 AS_HELP_STRING([--enable-htmldocs],
367 [enable building html documentation (default off).]),
368 [building_htmldocs=$enableval],
369 [building_htmldocs="no"])
370if test "$have_xmlto" = "no" -a "$building_htmldocs" = "yes"; then
371 AC_MSG_ERROR([xmlto required for building html documentation])
372fi
373
374AM_CONDITIONAL([BUILD_HTMLDOCS], [test "$building_htmldocs" = "yes"])
375
376dnl There is a strange bug in older versions of xmlto when generating pdf.
377dnl https://bugzilla.redhat.com/show_bug.cgi?id=526273
378dnl So make sure to have a chapter title starting with L plus an refentry.
379dnl This will make sure the xmlto pdf support test fails on buggy versions.
380cat > conftest.xml << 'EOF'
381<?xml version="1.0" encoding="UTF-8"?>
382<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
383"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []>
384 <book lang="en">
385 <bookinfo><title>foo</title></bookinfo>
386 <chapter id="logging.stp"><title>Logging Tapset</title>
387 <refentry id="API-log"><refnamediv><refname>log</refname>
388 <refpurpose>logging</refpurpose></refnamediv>
389 <refsect1><title>Description</title>
390 <para>baz</para></refsect1></refentry></chapter>
391 </book>
392EOF
393
394if test "x${have_xmlto}" = "xyes"; then
395AC_MSG_CHECKING([for xmlto --stringparam support])
396 xmlto --stringparam man.authors.section.enabled=0 html-nochunks conftest.xml >/dev/null 2>&1
397 if test $? = 0; then
398 have_xmlto_stringparam="yes"
399 AC_MSG_RESULT([yes])
400 else
401 AC_MSG_RESULT([no])
402 fi
403 rm -f conftest.html
404fi
405AM_CONDITIONAL([XMLTO_STRINGPARAM], [test "$have_xmlto_stringparam" = "yes"])
406
407rm -f conftest.xml
408
409dnl See if we have the nss/nspr headers and libraries
410AC_ARG_WITH([nss],
411 AS_HELP_STRING([--without-nss],
412 [Do not use NSS even if present]))
413
414AS_IF([test "x$with_nss" != "xno"], [
415 PKG_CHECK_MODULES([nss], [nss >= 3],
416 [have_nss=yes
417 AC_DEFINE([HAVE_NSS], [1], [Define to 1 if you have the nss libraries.])
418 ], [have_nss=no])
419], [have_nss=no])
420
421AM_CONDITIONAL([HAVE_NSS], [test "${have_nss}" = "yes"])
422
423dnl See if we have the openssl headers and libraries
424AC_ARG_WITH([openssl],
425 AS_HELP_STRING([--without-openssl],
426 [Do not use OPENSSL even if present]))
427
428AS_IF([test "x$with_openssl" != "xno"], [
429 PKG_CHECK_MODULES([openssl], [openssl],
430 [have_openssl=yes
431 AC_DEFINE([HAVE_OPENSSL], [1], [Define to 1 if you have the openssl libraries.])
432 ], [have_openssl=no])
433], [have_openssl=no])
434
435AM_CONDITIONAL([HAVE_OPENSSL], [test "${have_openssl}" = "yes"])
436
437dnl Handle dracut directory configuration. Note we hard-code /usr by default,
438dnl instead of $prefix, because dracut is a system service that doesn't listen
439dnl at relocatable directories.
440AC_ARG_WITH([dracutstap],
441 AS_HELP_STRING([--with-dracutstap=DIR],
442 [Install dracut module files in DIR]))
443AS_IF([test "x$with_dracutstap" != "x"],[dracutstap="$with_dracutstap"],
444 [dracutstap=/usr/lib/dracut/modules.d/99stap])
445AC_MSG_NOTICE([using dracut module directory $dracutstap])
446AC_SUBST(dracutstap)
447
448dnl PR20850 Fix the boot time probing feature for fedora too. Typical rhel
449dnl location is /sbin, typical fedora location is /usr/bin.
450AC_ARG_WITH([dracutbindir],
451 AS_HELP_STRING([--with-dracutbindir=DIR],
452 [Use the dracut binary located in DIR]))
453AS_IF([test "x$with_dracutbindir" != "x"],[dracutbindir="$with_dracutbindir"],
454 [dracutbindir=/sbin])
455AC_MSG_NOTICE([using dracut binary $dracutbindir])
456AC_SUBST(dracutbindir)
457
458dnl Handle the option to build the compile server.
459AC_ARG_ENABLE([server],
460 AS_HELP_STRING([--enable-server],
461 [enable building of stap-server (default on if nss etc. found).]),
462 [enable_server=$enableval],
463 [enable_server="check"])
464
465if test "$enable_server" != "no"; then
466dnl See if we have enough libraries and tools to build the compile server
467 if test "x${have_nss}" != "xyes"; then
468 AC_MSG_WARN([will not build systemtap compile server, cannot find nss headers])
469 fi
470fi
471AM_CONDITIONAL([BUILD_SERVER], [test "${have_nss}" = "yes" -a "$enable_server" != "no"])
472
473if test "${have_nss}" != "yes"; then
474 AC_MSG_WARN([compile-server client functionality will be disabled, cannot find nss development files])
475fi
476
477dnl See if we have the avahi libraries and headers
478AC_ARG_WITH([avahi],
479 AS_HELP_STRING([--without-avahi],
480 [Do not use Avahi even if present]))
481
482AS_IF([test "x$with_avahi" != "xno"], [
483 PKG_CHECK_MODULES([avahi], [avahi-client],
484 [have_avahi=yes
485 AC_DEFINE([HAVE_AVAHI], [1], [Define to 1 if you have the avahi libraries.])
486 ], [have_avahi=no])
487], [have_avahi=no])
488
489AM_CONDITIONAL([HAVE_AVAHI], [test "${have_avahi}" = "yes"])
490
491if test "${have_avahi}" != "yes"; then
492 AC_MSG_WARN([some compile-server functionality will be restricted, cannot find avahi development files])
493fi
494
495
496dnl Look for librpm.
497AC_ARG_WITH([rpm],
498 [AS_HELP_STRING([--with-rpm],
499 [query rpm database for missing debuginfos])], [], [with_rpm="auto"])
500if test "$with_rpm" != "no"; then
501 AC_CHECK_LIB(rpm, rpmtsInitIterator, [
502 AC_DEFINE([HAVE_LIBRPM],[1],[have librpm])
503 stap_LIBS="$stap_LIBS -lc -lrpm"
504 have_librpm="yes"], [have_librpm="no"])
505 dnl explicit -lrpmdb is a separate requirement on some older librpms
506 AC_CHECK_LIB(rpmdb, rpmdbNextIterator, [
507 stap_LIBS="$stap_LIBS -lrpmdb"])
508 AC_CHECK_LIB(rpmio, rpmFreeCrypto, [
509 AC_DEFINE([HAVE_LIBRPMIO],[1],[have librpmio])
510 stap_LIBS="$stap_LIBS -lc -lrpmio"
511 have_librpmio="yes"], [have_librpmio="no"])
512 if test "x$have_librpm" != "xyes" -a "$with_rpm" = "yes"; then
513 AC_MSG_ERROR([cannot find librpm])
514 fi
515 if test "x$have_librpmio" != "xyes" -a "$with_rpm" = "yes"; then
516 AC_MSG_WARN([cannot find librpmio])
517 fi
518fi
519
520AC_CHECK_HEADERS([stdatomic.h])
521
522dnl Look for rpmcrypto.h
523AC_CHECK_HEADERS([rpm/rpmcrypto.h], [
524 AC_DEFINE([HAVE_RPMCRYPTO_H],[1],[have rpmcrypto_h])
525 have_rpmcrypto_h=yes
526 AC_MSG_NOTICE([separate rpm/rpmcrypto.h])])
527
528dnl Look for readline.
529dnl
530dnl First save the orignal value of LIBS.
531LIBS_no_readline=$LIBS
532
533dnl Check how for readline presence and how to link with it. On some
534dnl systems you need to add a termcap compatible library.
535have_libreadline="no"
536AC_MSG_CHECKING([how to link readline libs])
537for libtermcap in "" tinfo ncursesw ncurses curses termcap; do
538 if test -z "$libtermcap"; then
539 READLINE_LIBS="-lreadline"
540 else
541 READLINE_LIBS="-lreadline -l$libtermcap"
542 fi
543 LIBS="$READLINE_LIBS $LIBS_no_readline"
544 AC_LINK_IFELSE(
545 [AC_LANG_CALL([],[readline])],
546 [have_libreadline="yes"])
547 if test "$have_libreadline" = "yes"; then
548 break
549 fi
550done
551if test "$have_libreadline" = "no"; then
552 AC_MSG_RESULT([none])
553 READLINE_LIBS=""
554else
555 AC_MSG_RESULT([$READLINE_LIBS])
556 AC_DEFINE(HAVE_LIBREADLINE, [1],
557 [Define if you have the readline library (-lreadline).])
558fi
559AC_SUBST([READLINE_LIBS])
560AM_CONDITIONAL([HAVE_LIBREADLINE], [test "$have_libreadline" = "yes"])
561
562dnl End of readline checks: restore LIBS
563LIBS=$LIBS_no_readline
564
565dnl Allow user to choose python3 for /usr/bin/dtrace
566AC_ARG_WITH([python3],
567 AS_HELP_STRING([--with-python3],[prefer python version 3]), [], [with_python3="auto"])
568AS_IF([test "x$with_python3" = "xyes"],
569 [AS_IF([test "x$PYTHON3" = "x:"],
570 [AC_MSG_ERROR([python version 3 is required])],
571 [AC_SUBST(preferred_python,[$PYTHON3])])],
572 [test "x$with_python3" = "xno"],
573 [AS_IF([test "x$PYTHON" = "x:"],
574 [AC_MSG_ERROR([python version 2 is required])],
575 [AC_SUBST(preferred_python,[$PYTHON])])],
576 [test "x$PYTHON3" != "x:"],
577 [AC_SUBST(preferred_python,[$PYTHON3])],
578 [test "x$PYTHON" != "x:"],
579 [AC_SUBST(preferred_python,[$PYTHON])],
580 [AC_MSG_ERROR([neither python version 2 nor 3 found])])
581
582if test $enable_translator = yes; then
583 # Need libdwfl-capable recent elfutils http://elfutils.org/
584 # On modern debian/ubuntu and modern elfutils, libebl has been
585 # merged into libdw
586 # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=457543
587 save_LIBS="$LIBS"
588 AC_CHECK_LIB(ebl, ebl_strtabinit,[ebl_LIBS=-lebl],[ebl_LIBS=])
589 LIBS="$save_LIBS"
590
591 save_LIBS="$LIBS"
592 AC_CHECK_LIB(dw, dwfl_module_getsym,[],[
593 AC_MSG_ERROR([missing elfutils development headers/libraries (install elfutils-devel, libebl-dev, libdw-dev and/or libebl-devel)])],
594 [-Wl,--start-group -ldw $ebl_LIBS -Wl,--end-group -lelf])
595 AC_CHECK_LIB(dw, dwarf_next_unit,[],[
596 AC_MSG_ERROR([elfutils, libdw too old, need 0.148+])],
597 [-Wl,--start-group -ldw $ebl_LIBS -Wl,--end-group -lelf])
598 stap_LIBS="$stap_LIBS -Wl,--start-group -ldw $ebl_LIBS -Wl,--end-group -lelf"
599 LIBS="$save_LIBS"
600fi
601
602AC_SUBST(stap_LIBS)
603AC_MSG_NOTICE([stap will link $stap_LIBS])
604
605# staprun has more modest libelf needs
606save_LIBS="$LIBS"
607dnl this will only succeed with elfutils 0.142+
608AC_CHECK_LIB(elf,elf_getshdrstrndx,[],[
609 AC_MSG_FAILURE([libelf too old, need 0.142+])])
610staprun_LIBS="$staprun_LIBS -lelf"
611stapbpf_LIBS="$stapbpf_LIBS -lelf"
612LIBS="$save_LIBS"
613
614AC_SUBST(staprun_LIBS)
615AC_SUBST(stapbpf_LIBS)
616AC_MSG_NOTICE([staprun will link $staprun_LIBS])
617AC_MSG_NOTICE([stapbpf will link $stapbpf_LIBS])
618
619# Before PR4037, we used to arrange to pass CFLAGS+=-m64 for a staprun
620# being compiled on 32-bit userspace but running against 64-bit kernels.
621# This is no longer necessary.
622
623AC_LANG_PUSH(C++)
624# Use boost::string_ref if available
625AC_CHECK_HEADERS([boost/utility/string_ref.hpp])
626# add boost_system bits for stapdyn with dyninst 10+
627saved_LIBS="$LIBS"
628LIBS="-lboost_system $LIBS"
629AC_MSG_CHECKING([need for -lboost_system library])
630AC_LINK_IFELSE([AC_LANG_SOURCE([
631#include <boost/system/system_error.hpp>
632int main() {
633 boost::system::error_condition e();
634}
635])],[AC_MSG_RESULT([yup])
636 BOOST_SYSTEM_LIB="-lboost_system"
637],[AC_MSG_RESULT([nope])
638 BOOST_SYSTEM_LIB=""
639])
640LIBS="$saved_LIBS"
641AC_SUBST(BOOST_SYSTEM_LIB)
642
643AC_LANG_POP(C++)
644
645# Check for Dyninst headers and libraries
646AC_ARG_WITH([dyninst],
647 AS_HELP_STRING([--with-dyninst=DIRECTORY],
648 [find dyninst headers/libraries in DIRECTORY]))
649
650case "$with_dyninst" in
651no) ;;
652''|yes) # Try a simple-minded distro search
653 DYNINST_CXXFLAGS="-I/usr/include/dyninst"
654 old_LIBS="$LIBS"
655 old_LDFLAGS="$LDFLAGS"
656 old_CPPFLAGS="$CPPFLAGS"
657 CPPFLAGS="$CPPFLAGS $DYNINST_CXXFLAGS"
658 AC_LANG_PUSH(C++)
659 for location in /usr/lib64/dyninst /usr/lib/dyninst ${libdir}/dyninst; do
660 LDFLAGS="-L${location}"
661 LIBS="-lparseAPI ${BOOST_SYSTEM_LIB}"
662 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <dyninst/CodeSource.h>]],
663 [[char *s; Dyninst::ParseAPI::SymtabCodeSource *sts = new Dyninst::ParseAPI::SymtabCodeSource(s);]])],
664
665 [found_DYNINST_LDFLAGS=yes],[found_DYNINST_LDFLAGS=no])
666 if test "$found_DYNINST_LDFLAGS" = "yes"; then
667 DYNINST_LDFLAGS="$LDFLAGS"
668 break
669 fi
670 done
671 AC_LANG_POP(C++)
672 CPPFLAGS="$old_CPPFLAGS"
673 LDFLAGS="$old_LDFLAGS"
674 LIBS="$old_LIBS"
675
676 # Add Dyninst libraries only if they are available
677 if test -d "/usr/include/dyninst"; then
678 save_LIBS="$LIBS"
679 AC_CHECK_LIB(tbb, TBB_runtime_interface_version, [tbb_LIBS=-ltbb],[tbb_LIBS=])
680 LIBS="$save_LIBS"
681 DYNINST_LIBS="-lparseAPI -lsymtabAPI -linstructionAPI $tbb_LIBS -lcommon"
682 fi
683 ;;
684*) # Use paths in the user-specified prefix
685 DYNINST_CXXFLAGS="-I$with_dyninst/include -I$with_dyninst/include/dyninst"
686 DYNINST_LDFLAGS="-L$with_dyninst/lib64/dyninst -Wl,-rpath-link,$with_dyninst/lib64/dyninst"
687 # Will assume Dyninst libraries are available as the path is specified
688 save_LIBS="$LIBS"
689 AC_CHECK_LIB(tbb, TBB_runtime_interface_version, [tbb_LIBS=-ltbb],[tbb_LIBS=])
690 LIBS="$save_LIBS"
691 DYNINST_LIBS="-lparseAPI -lsymtabAPI -linstructionAPI $tbb_LIBS -lcommon"
692 ;;
693esac
694if test "$with_dyninst" != "no"; then
695 AC_LANG_PUSH(C++)
696 old_CPPFLAGS="$CPPFLAGS"
697 CPPFLAGS="$CPPFLAGS $DYNINST_CXXFLAGS"
698 AC_MSG_NOTICE([checking dyninst support])
699 AC_CHECK_HEADERS([dyninst/BPatch_object.h], [
700 AC_SUBST(DYNINST_CXXFLAGS)
701 AC_SUBST(DYNINST_LDFLAGS)
702 AC_SUBST(DYNINST_LIBS)
703 AC_DEFINE([HAVE_DYNINST],[1],[Define to 1 if Dyninst is enabled])
704 have_dyninst=yes
705 AC_MSG_NOTICE([dyninst support available])])
706 if test -n "$with_dyninst" -a "$have_dyninst" != "yes"; then
707 AC_MSG_ERROR([Dyninst does not appear to be usable])
708 fi
709 CPPFLAGS="$old_CPPFLAGS"
710 AC_LANG_POP(C++)
711fi
712AM_CONDITIONAL([HAVE_DYNINST], [test "${have_dyninst}" = "yes"])
713
714
715dnl Check for the libvirt and libxml2 devel packages
716
717AC_ARG_ENABLE([virt],
718 AS_HELP_STRING([--enable-virt],
719 [enable building of stapvirt support (default on if libvirt etc. found).]),
720 [enable_virt=$enableval],
721 [enable_virt="check"])
722
723dnl We require libvirt >= 1.0.2 because stapvirt relies on the
724dnl virDomainOpenChannel function, which was implemented in 1.0.2.
725AC_ARG_ENABLE([libvirt],
726 AS_HELP_STRING([--disable-libvirt], [Do not use libvirt even if present]))
727
728if test "$enable_libvirt" != no; then
729 PKG_CHECK_MODULES([libvirt], [libvirt >= 1.0.2], [
730 have_libvirt=yes
731 AC_DEFINE([HAVE_LIBVIRT],[1],[Define to 1 if libvirt development libraries are installed])
732 ], [have_libvirt=no])
733fi
734AM_CONDITIONAL([HAVE_LIBVIRT], [test "${have_libvirt}" = "yes"])
735PKG_CHECK_MODULES([libxml2], [libxml-2.0], [
736 have_libxml2=yes
737 AC_DEFINE([HAVE_LIBXML2],[1],[Define to 1 if libxml2 development libraries are installed])
738 ], [have_libxml2=no])
739AM_CONDITIONAL([HAVE_LIBXML2], [test "${have_libxml2}" = "yes"])
740
741if test "$enable_virt" != "no"; then
742dnl See if we have enough libraries and tools to build the virt server
743 if test "x${have_libvirt}" != "xyes"; then
744 AC_MSG_WARN([will not build systemtap virt support, cannot find libvirt headers])
745 fi
746 if test "x${have_libxml2}" != "xyes"; then
747 AC_MSG_WARN([will not build systemtap virt support, cannot find xml2 headers])
748 fi
749fi
750AM_CONDITIONAL([BUILD_VIRT], [test "${have_libvirt}" = "yes" -a "${have_libxml2}" = "yes" -a "$enable_virt" != "no"])
751
752dnl Handle the option to build python2 probe support
753AC_ARG_WITH([python2-probes],
754 AS_HELP_STRING([--without-python2-probes],
755 [Disable building python version 2 probe support, even if it is available]))
756have_python2_support=no
757AS_IF([test "x$with_python2_probes" != "xno"],
758 [dnl First, check to make sure we have the 'python-config' script.
759 AS_IF([test "x$PYTHON" != "x:"],
760 [AC_PATH_PROGS([PYTHON_CONFIG], [${python_basename}-config python2-config python-config])])
761 AS_IF([test "x$PYTHON_CONFIG" != "x"],
762 [dnl Use the 'python-config' script to find the python
763 dnl include directories.
764 PYTHON_CPPFLAGS=`$PYTHON_CONFIG --includes 2> /dev/null`
765 AC_SUBST([PYTHON_CPPFLAGS], [$PYTHON_CPPFLAGS])
766 save_CPPFLAGS="$CPPFLAGS"
767 CPPFLAGS="$PYTHON_CPPFLAGS $CPPFLAGS"
768 dnl Now make sure we can find the python 2 Python.h file. We
769 dnl need to clear the cached result, since this might be a
770 dnl cached result from the python 3 header file (since they
771 dnl share the same name).
772 AS_UNSET([ac_cv_header_Python_h])
773 AC_CHECK_HEADERS([Python.h], [have_python2_support=yes])
774 CPPFLAGS="$save_CPPFLAGS"])])
775AS_IF([test "x$have_python2_support" = "xyes"],
776 [AC_DEFINE([HAVE_PYTHON2_PROBES], [1],
777 [Define to 1 to enable python version 2 probe support in systemtap.])],
778 [AS_IF([test "x$with_python2_probes" = "xyes"],
779 [AC_MSG_ERROR([python version 2 probe support requested but not found])])
780])
781AM_CONDITIONAL([HAVE_PYTHON2_PROBES], [test "x$have_python2_support" = "xyes"])
782
783dnl Handle the option to build python3 probe support
784AC_ARG_WITH([python3-probes],
785 AS_HELP_STRING([--without-python3-probes],
786 [Disable building python version 3 probe support, even if it is available]))
787have_python3_support=no
788AS_IF([test "x$with_python3_probes" != "xno"],
789 [dnl First, check to make sure we have the 'python3-config' script.
790 AS_IF([test "x$PYTHON3" != "x:" ],
791 [AC_PATH_PROG([PYTHON3_CONFIG], [${python3_basename}-config])])
792 AS_IF([test "x$PYTHON3_CONFIG" != "x"],
793 [dnl Use the 'python3-config' script to find the python
794 dnl include directories.
795 PYTHON3_CPPFLAGS=`$PYTHON3_CONFIG --includes 2> /dev/null`
796 AC_SUBST([PYTHON3_CPPFLAGS], [$PYTHON3_CPPFLAGS])
797 save_CPPFLAGS="$CPPFLAGS"
798 CPPFLAGS="$PYTHON3_CPPFLAGS $CPPFLAGS"
799 dnl Now make sure we can find the python 3 Python.h
800 dnl file. However, we've got a problem. AC_CHECK_HEADERS
801 dnl was called above for the python 2 version of
802 dnl Python.h. But, autoconf doesn't really know the
803 dnl difference between the two files, since they both have
804 dnl the same name. So, we'll unset the cache variable.
805 AS_UNSET([ac_cv_header_Python_h])
806 AC_CHECK_HEADERS([Python.h], [have_python3_support=yes])
807 CPPFLAGS="$save_CPPFLAGS"])])
808AS_IF([test "x$have_python3_support" = "xyes"],
809 [AC_DEFINE([HAVE_PYTHON3_PROBES], [1],
810 [Define to 1 to enable python version 3 probe support in systemtap.])],
811 [AS_IF([test "x$with_python3_probes" = "xyes"],
812 [AC_MSG_ERROR([python version 3 probe support requested but not found])])
813])
814AM_CONDITIONAL([HAVE_PYTHON3_PROBES], [test "x$have_python3_support" = "xyes"])
815
816dnl We want either (or both) python probe support.
817AM_CONDITIONAL([HAVE_PYTHON_PROBES],
818 [test "x$have_python2_support" = "xyes" -o "x$have_python3_support" = "xyes"])
819
820PKG_CHECK_MODULES([jsonc], [json-c >= 0.13], [have_jsonc=yes], [have_jsonc=no])
821PKG_CHECK_MODULES([ncurses], [ncurses], [have_ncurses=yes], [have_ncurses=no])
822
823AC_ARG_ENABLE([monitor], AS_HELP_STRING([--disable-monitor],[Disable monitor]))
824if test "$enable_monitor" != "no"; then
825dnl Check for presence of json-c and ncurses for use in monitor mode
826if test "${have_jsonc}" = "yes" -a "${have_ncurses}" = yes; then
827 AC_DEFINE([HAVE_MONITOR_LIBS],[1],[Define to 1 if json-c and ncurses libraries are installed])
828fi
829fi
830AM_CONDITIONAL([HAVE_MONITOR_LIBS], [test "${have_jsonc}" = "yes" -a "${have_ncurses}" = "yes" -a "$enable_monitor" != "no"])
831if test "${have_jsonc}" = "yes"; then
832 AC_DEFINE([HAVE_JSON_C],[1],[Define to 1 if the json-c library is installed])
833fi
834AM_CONDITIONAL([HAVE_JSON_C], [test "${have_jsonc}" = "yes"])
835
836# We require gcc >=8 since we use some more modern language features such as lambda-capture [this] and
837# initializer list constructors in class template argument deduction
838AC_MSG_CHECKING([to see if the language server is supported])
839if { echo '#if __GNUC__ >= 8 '
840 echo ' yes '
841 echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
842 have_language_server_support=yes
843 AC_MSG_RESULT([yes])
844 AC_DEFINE([HAVE_LANGUAGE_SERVER_SUPPORT], [1],
845 [Define to 1 if the language server is supported])
846else
847 AC_MSG_RESULT([no])
848fi
849AM_CONDITIONAL([HAVE_LANGUAGE_SERVER_SUPPORT], [test "x$have_language_server_support" = "xyes"])
850
851AC_CACHE_CHECK([for assembler .section "?" flags support], stap_cv_sectionq, [
852old_CFLAGS="$CFLAGS"
853CFLAGS="$CFLAGS -Wa,--fatal-warnings"
854AC_COMPILE_IFELSE([AC_LANG_SOURCE([asm(".section .note.foo,\"?\",\"note\"\n"
855 ".byte 1, 2, 3\n"
856 ".previous\n"
857 ".section .text,\"axG\",\"progbits\",foogroup,comdat\n"
858 ".byte 1\n"
859 ".pushsection .note.foo,\"?\",\"note\"\n"
860 ".byte 4, 5, 6\n"
861 ".popsection\n"
862 ".byte 2\n");])],
863 stap_cv_sectionq=yes, stap_cv_sectionq=no)
864CFLAGS="$old_CFLAGS"])
865AC_SUBST(support_section_question)
866support_section_question=0
867if test $stap_cv_sectionq = yes; then
868 support_section_question=1
869fi
870
871
872AC_ARG_WITH([bpf],
873 AS_HELP_STRING([--without-bpf],[Do not try to build BPF components]))
874
875dnl Allow --without-bpf to disable this autodetection, as some kernels
876dnl have some headers but missing some decls like __NR_bpf. Too hard
877dnl to detect all the prereqs here.
878AS_IF([test "x$with_bpf" != "xno"], [
879 AC_CHECK_DECLS([BPF_PROG_TYPE_PERF_EVENT],
880 [AC_DEFINE([HAVE_BPF_DECLS], [1], [Define to 1 if you have the necessary declarations in bpf.h])],
881 [],
882 [#include <linux/bpf.h>])
883 ])
884AM_CONDITIONAL(HAVE_BPF_DECLS, [test "x$ac_cv_have_decl_BPF_PROG_TYPE_PERF_EVENT" = "xyes"])
885AC_CONFIG_FILES([includes/sys/sdt-config.h po/Makefile.in])
886
887dnl determine whether BPF raw tracepoints are available
888AC_CHECK_DECLS([BPF_PROG_TYPE_RAW_TRACEPOINT],
889 [AC_DEFINE([HAVE_BPF_PROG_TYPE_RAW_TRACEPOINT], [1], [Define to 1 if you have the necessary declarations in bpf.h])],
890 [],
891 [#include <linux/bpf.h>])
892
893dnl Optional libselinux support allows stapdyn to check
894dnl for booleans that would prevent Dyninst from working.
895AC_ARG_WITH([selinux],
896 AS_HELP_STRING([--without-selinux],
897 [Do not use libselinux even if present]))
898
899AS_IF([test "x$with_selinux" != "xno"], [
900 PKG_CHECK_MODULES([selinux], [libselinux],
901 [have_selinux=yes
902 AC_DEFINE([HAVE_SELINUX], [1], [Define to 1 if you have the SELinux libraries.])
903 ], [have_selinux=no])
904], [have_selinux=no])
905
906AM_CONDITIONAL([HAVE_SELINUX], [test "${have_selinux}" = "yes"])
907
908dnl Used in monitor mode. Only available on kernel versions >= 2.6.35
909AC_CHECK_DECL([F_SETPIPE_SZ],
910 [AC_DEFINE(HAVE_F_SETPIPE_SZ,[1], Define to 1 if F_SETPIPE_SZ is available.)],
911 [],
912 [#include <fcntl.h>])
913
914dnl Handle java+byteman support
915AC_CHECK_PROG(have_javac, javac, yes, no)
916AC_CHECK_PROG(have_jar, jar, yes, no)
917if test "$have_javac" != no -a "$have_jar" != no; then
918echo java found, will try to configure Byteman support
919
920AC_ARG_WITH([java],
921 [AS_HELP_STRING([--with-java=DIRECTORY],
922 [Specify JDK directory to compile libHelperSDT.so against (default is /usr/lib/jvm/java)])],
923 [],
924 [with_java=/usr/lib/jvm/java])
925dnl don't use AC_CHECK_FILE here, as that blocks cross-compiling
926if test ! -d "$with_java"; then
927 AC_MSG_NOTICE([directory $with_java not found, disabling java support])
928 with_java=no
929fi
930AC_SUBST(JAVADIR, "${with_java}") # always needed to compile
931
932if test "$with_java" != "no"; then
933AC_DEFINE_UNQUOTED(HAVE_JAVA, "1", [Flag indicating that libHelperSDT.so is available (can be found in PKGLIBDIR)])
934fi
935
936AM_CONDITIONAL([HAVE_JAVA], [test "$with_java" != "no"])
937
938else
939AC_MSG_WARN([will not run per-method java probing, missing byteman or java requirements])
940AM_CONDITIONAL([HAVE_JAVA],false)
941fi # java+byteman support
942
943AC_SUBST(ENABLE_NLS, "$USE_NLS")
944AC_SUBST(localedir, "$localedir")
945AC_SUBST(LOCALEDIR, "$localedir")
946
947AC_ARG_WITH([extra-version],
948 AS_HELP_STRING([--with-extra-version=STRING],
949 [Add STRING to stap -V version]))
950AS_IF([test "x$with_extra_version" != "xno"], [
951 stap_extra_version="$with_extra_version"
952 AC_MSG_NOTICE([Adding extra version $stap_extra_version])], [
953 stap_extra_version=""])
954AC_DEFINE_UNQUOTED(STAP_EXTRA_VERSION, "$stap_extra_version", [extra stap version code])
955AC_SUBST(STAP_EXTRA_VERSION, "$stap_extra_version")
956
957dnl Handle the option to build httpd web compilation service
958AC_ARG_ENABLE([http],
959 AS_HELP_STRING([--enable-http],
960 [Enable building http web compilation service, if possible]))
961have_http_support=no
962dnl (default off)
963AS_IF([test "x$enable_http" = "xyes"],
964 [dnl Do we have the microhttpd library?
965 PKG_CHECK_MODULES([libmicrohttpd], [libmicrohttpd > 0.9.0], [have_libmicrohttpd=true], [have_libmicrohttpd=false])
966
967 dnl Do we have the uuid library?
968 PKG_CHECK_MODULES([uuid], [uuid >= 2.17.0], [have_libuuid=true], [have_libuuid=false])
969
970 dnl Do we have the curl library?
971 PKG_CHECK_MODULES([libcurl], [libcurl >= 7.19.7], [have_libcurl=true], [have_libcurl=false])
972
973 dnl If we have all of the libraries, the json-c and nss libraries,
974 dnl and full C++11 support, we could build the httpd web
975 dnl compilation service.
976 AS_IF([test "x$have_libmicrohttpd" = "xtrue" -a "x$have_libuuid" = "xtrue" -a "x$have_libcurl" = "xtrue" -a "x$have_jsonc" = "xyes" -a "x$have_nss" = "xyes" -a "x$have_openssl" = "xyes" -a "x$have_cxx0x" = "xno"], [have_http_support=yes])])
977
978AS_IF([test "x$have_http_support" = "xyes"],
979 [AC_DEFINE([HAVE_HTTP_SUPPORT], [1],
980 [Define to 1 to enable http web service support in systemtap.])],
981 [AS_IF([test "x$enable_http" = "xyes"],
982 [AC_MSG_ERROR([http service support requested but not found])])
983])
984AM_CONDITIONAL([HAVE_HTTP_SUPPORT], [test "x$have_http_support" = "xyes"])
985
986dnl NEED_BASE_CLIENT_CODE is defined when we have either HAVE_NSS
987dnl or HAVE_HTTP_SUPPORT.
988AM_CONDITIONAL([NEED_BASE_CLIENT_CODE],
989 [test "x$have_http_support" = "xyes" -o "x$have_nss" = "xyes"])
990AS_IF([test "x$have_http_support" = "xyes" -o "x$have_nss" = "xyes"], [
991 AC_DEFINE([NEED_BASE_CLIENT_CODE], [1],
992 [Define to 1 if the base client code is needed.])
993])
994
995dnl This is here mainly to make sure that configure --prefix=... changes
996dnl the config.h files so files depending on it are recompiled
997dnl prefix is passed through indirectly in the Makefile.am AM_CPPFLAGS.
998dnl Formerly: Don't use this directly (when not given it is set to NONE).
999dnl Currently: inline autoconf's later defaulting
1000
1001stap_prefix=$prefix
1002test "$stap_prefix" = NONE && stap_prefix=$ac_default_prefix
1003AC_DEFINE_UNQUOTED(STAP_PREFIX, "$stap_prefix", [configure prefix location])
1004AC_SUBST(STAP_PREFIX, "$stap_prefix")
1005
1006dnl compute a fully expanded $pkglibexecdir for substitution here and there
1007stap_libexecdir=$libexecdir
1008test "$stap_libexecdir" = '${exec_prefix}/libexec' && stap_libexecdir=$stap_prefix/libexec
1009AC_SUBST(pkglibexecdir, "$stap_libexecdir/$PACKAGE")
1010
1011AC_CONFIG_HEADERS([config.h:config.in])
1012
1013dnl XXX: we'd like fully expanded path names for the @macros@ in there,
1014dnl not like exec_prefix=${prefix}
1015
1016AC_CONFIG_FILES([Makefile doc/Makefile man/Makefile man/cs/Makefile \
1017doc/beginners/Makefile doc/SystemTap_Tapset_Reference/Makefile \
1018man/stap.1 man/stappaths.7 man/systemtap-service.8 \
1019man/cs/stap.1 man/cs/stappaths.7 man/cs/systemtap.8 \
1020initscript/config.systemtap initscript/config.stap-server \
1021initscript/systemtap initscript/stap-server \
1022initscript/99stap/module-setup.sh \
1023initscript/99stap/install \
1024initscript/99stap/check ])
1025AC_CONFIG_SUBDIRS(testsuite)
1026if test $enable_translator = "yes"; then
1027 AC_CONFIG_FILES([run-stap], [chmod +x run-stap])
1028fi
1029AC_CONFIG_FILES([dtrace], [chmod +x dtrace])
1030AC_CONFIG_FILES(stapdyn/Makefile)
1031AC_CONFIG_FILES(java/Makefile)
1032AC_CONFIG_FILES([java/stapbm], [chmod +x java/stapbm])
1033AC_CONFIG_FILES(java/org/systemtap/byteman/helper/HelperSDT.java)
1034AC_CONFIG_FILES(python/Makefile)
1035AC_CONFIG_FILES(interactive-notebook/Makefile)
1036AC_CONFIG_FILES([interactive-notebook/stap-jupyter-container], [chmod +x interactive-notebook/stap-jupyter-container])
1037AC_CONFIG_FILES([interactive-notebook/stap-jupyter-install], [chmod +x interactive-notebook/stap-jupyter-install])
1038AC_CONFIG_FILES(staprun/Makefile)
1039AC_CONFIG_FILES(stapbpf/Makefile)
1040AC_CONFIG_FILES([httpd/Makefile httpd/docker/Makefile])
1041AC_CONFIG_FILES([staprun/run-staprun], [chmod +x staprun/run-staprun])
1042AC_CONFIG_FILES([staprun/guest/stapshd], [chmod +x staprun/guest/stapshd])
1043AC_CONFIG_FILES([staprun/guest/stapsh-daemon], [chmod +x staprun/guest/stapsh-daemon])
1044AC_CONFIG_FILES([staprun/guest/stapsh@.service])
1045AC_CONFIG_FILES(stap-exporter/Makefile)
1046AC_CONFIG_FILES([stap-profile-annotate], [chmod +x stap-profile-annotate])
1047
1048dnl AC_CONFIG_FILES([macros.systemtap])
1049dnl ^^^ not that one, because we want to expand $vars etc. to fqdn's,
1050dnl so we do the mapping in the Makefile.am
1051
1052# Setup "shadow" directory doc/beginners that has the basic directories setup for
1053# xmlto in one directory (through directory links if necessary).
1054# It would be nice to use AC_CONFIG_LINKS, but automake complains when
1055# the src is a directory and not a file.
1056AC_CONFIG_COMMANDS([doc/beginners],
1057 [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])
1058
1059AC_OUTPUT
1060
1061if test "${prefix}" = "/usr/local"; then
1062 AC_MSG_NOTICE([])
1063 AC_MSG_NOTICE([For a private or temporary build of systemtap, we recommend])
1064 AC_MSG_NOTICE([configuring with a prefix. For example, try])
1065 AC_MSG_NOTICE([$0 $ac_configure_args --prefix=$HOME/systemtap-${PACKAGE_VERSION}-$$])
1066 AC_MSG_NOTICE([Running systemtap uninstalled, entirely out of the build tree,])
1067 AC_MSG_NOTICE([is not supported.])
1068fi
This page took 0.027514 seconds and 6 git commands to generate.