]>
Commit | Line | Data |
---|---|---|
2f1a1aea FCE |
1 | dnl configure.ac --- autoconf input file for systemtap |
2 | dnl Process this file with autoconf to produce a configure script. | |
3 | ||
ece75bcd | 4 | AC_INIT([systemtap], 3.2, systemtap@sourceware.org, systemtap) |
97859b9d | 5 | dnl ^^^ see also NEWS, systemtap.spec, testsuite/configure.ac |
4c4adc41 | 6 | dnl doc/SystemTap_Beginners_Guide/en-US/Book_Info.xml |
e872ae09 | 7 | |
2689a171 SM |
8 | dnl Get the target arch for libHelperSDT.so |
9 | AC_CANONICAL_TARGET | |
10 | ||
97859b9d JS |
11 | AC_PREREQ(2.63) |
12 | dnl We don't maintain a ChangeLog, which makes us non-GNU -> foreign. | |
675c6934 | 13 | AM_INIT_AUTOMAKE([no-dist foreign]) |
2f1a1aea FCE |
14 | AM_MAINTAINER_MODE |
15 | ||
618a8a63 JS |
16 | m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) |
17 | ||
8f223b3e | 18 | AC_USE_SYSTEM_EXTENSIONS |
db887d2c | 19 | AC_PROG_MKDIR_P |
7fbd9d09 | 20 | AC_SUBST(MKDIR_P) |
2f1a1aea FCE |
21 | AC_PROG_LN_S |
22 | AC_PROG_CC | |
23 | AC_PROG_CXX | |
24 | AC_PROG_CPP | |
8ae7a94a | 25 | AM_PROG_CC_C_O |
2f1a1aea FCE |
26 | AC_PROG_RANLIB |
27 | AC_OBJEXT | |
28 | AC_EXEEXT | |
29 | AC_PROG_INSTALL | |
30 | AC_PROG_MAKE_SET | |
31 | AC_SUBST(CFLAGS) | |
32 | AC_SUBST(CXXFLAGS) | |
97859b9d | 33 | AC_SYS_LARGEFILE |
e04a4b41 | 34 | AC_CHECK_FUNCS(ppoll) |
56629dde | 35 | AC_CHECK_FUNCS(openat) |
3477519f | 36 | AM_GNU_GETTEXT(external) |
42973bd2 | 37 | AM_GNU_GETTEXT_VERSION([0.19.4]) |
3477519f FCE |
38 | |
39 | if test "x$GMSGFMT" = "x:"; then | |
40 | AC_MSG_ERROR([missing gnu /usr/bin/msgfmt]) | |
41 | fi | |
2f1a1aea | 42 | |
e5d623b1 DS |
43 | # We want the 'PYTHON' varible to be python version 2. We also want |
44 | # our custom 'PYTHON3' varible to be python version 3. | |
45 | # | |
bcec8a9d DS |
46 | # Note that the python2/python3 code was inspired by code in the |
47 | # 'abrt' configure: | |
48 | # <https://github.com/abrt/abrt/blob/master/configure.ac> | |
49 | # | |
e5d623b1 DS |
50 | # First, figure out what version of python is in the executable named |
51 | # 'python'. On most systems that is python version 2, but on arch | |
52 | # linux that is python version 3. | |
53 | AC_PATH_PROG([PYTHON_UNKNOWN], [python], [no]) | |
54 | if test "x$PYTHON_UNKNOWN" != "xno"; then | |
55 | # OK, we found 'python'. What version is it? | |
56 | AC_CACHE_CHECK([whether $PYTHON_UNKNOWN is version 2 or 3], | |
57 | [ac_cv_python_unknown_version], | |
58 | [ac_cv_python_unknown_version=`$PYTHON_UNKNOWN -c "import sys; sys.stdout.write(sys.version[[:3]][[0]])"`]) | |
59 | fi | |
60 | ||
61 | # Now we'll update the _AM_PYTHON_INTERPRETER_LIST variable (which | |
62 | # AM_PATH_PYTHON uses) to only be version 2 versions of python. Note | |
63 | # that the m4_define happens when autoconf is run, but the | |
64 | # FIRST_PYTHON_INTERPRETER variable expansion will happen when the | |
65 | # user runs configure. | |
66 | if test "x$PYTHON_UNKNOWN" != "xno" -a "x$ac_cv_python_unknown_version" = "x2"; then | |
67 | FIRST_PYTHON_INTERPRETER=python | |
68 | else | |
69 | FIRST_PYTHON_INTERPRETER=python2 | |
70 | fi | |
71 | m4_define([_AM_PYTHON_INTERPRETER_LIST], | |
72 | [$FIRST_PYTHON_INTERPRETER python2 python2.7 python2.6]) | |
73 | ||
74 | # Now we can call AM_PATH_PYTHON to find python version 2.6+ (and | |
75 | # version 2 only). | |
76 | AM_PATH_PYTHON([2.6], [], [:]) | |
dd9af8b3 DS |
77 | python_basename=$(basename "$PYTHON") |
78 | AC_DEFINE_UNQUOTED([PYTHON_BASENAME], "${python_basename}", | |
79 | [Base name of the python2 interpreter binary.]) | |
e01cd0ba DS |
80 | # AM_PATH_PYTHON defines 'pyexecdir'. Make sure the python and |
81 | # pyexecdir variables get sent down to the subconfigure in the | |
82 | # testsuite directory. | |
83 | AS_VAR_APPEND([ac_configure_args], [" python='$PYTHON' pyexecdir='$pyexecdir'"]) | |
e5d623b1 DS |
84 | |
85 | # Now let's try to find python version 3. | |
86 | if test "x$PYTHON_UNKNOWN" != "xno" -a "x$python_unknown_version" = "x3"; then | |
87 | AC_PATH_PROG([PYTHON3], [python]) | |
88 | else | |
89 | AC_PATH_PROGS([PYTHON3], | |
90 | [python3 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0]) | |
91 | fi | |
dd9af8b3 DS |
92 | python3_basename=$(basename "$PYTHON3") |
93 | AC_DEFINE_UNQUOTED([PYTHON3_BASENAME], "${python3_basename}", | |
94 | [Base name of the python3 interpreter binary.]) | |
e5d623b1 DS |
95 | |
96 | # If we found python version 3, set up the other variables for python | |
97 | # version 3 that AM_PATH_PYTHON sets up for python version 2. | |
98 | if test -n "$PYTHON3"; then | |
99 | AC_CACHE_CHECK([for python3 version], [ac_cv_python3_version], | |
100 | [ac_cv_python3_version=`$PYTHON3 -c "import sys; sys.stdout.write(sys.version[[:3]])"`]) | |
d7f07c29 | 101 | AC_SUBST([PYTHON3_VERSION], [$ac_cv_python3_version]) |
e5d623b1 DS |
102 | AC_SUBST([PYTHON3_PREFIX], ['${prefix}']) |
103 | AC_SUBST([PYTHON3_EXEC_PREFIX], ['${exec_prefix}']) | |
104 | AC_CACHE_CHECK([for python3 platform], [ac_cv_python3_platform], | |
105 | [ac_cv_python3_platform=`$PYTHON3 -c "import sys; sys.stdout.write(sys.platform)"`]) | |
106 | AC_SUBST([PYTHON3_PLATFORM], [$ac_cv_python3_platform]) | |
107 | ||
108 | AC_CACHE_CHECK([for python3 script directory], [ac_cv_python3_dir], | |
109 | [ac_cv_python3_dir=`$PYTHON3 -c "import distutils.sysconfig; print(distutils.sysconfig.get_python_lib(0,0,prefix='$PYTHON3_PREFIX'))"`]) | |
e6effc54 | 110 | AC_SUBST([python3dir], [$ac_cv_python3_dir]) |
e5d623b1 DS |
111 | |
112 | AC_CACHE_CHECK([for python3 extension module directory], | |
113 | [ac_cv_py3execdir], | |
114 | [ac_cv_py3execdir=`$PYTHON3 -c "import distutils.sysconfig; print(distutils.sysconfig.get_python_lib(1,0,prefix='$PYTHON3_EXEC_PREFIX'))"`]) | |
e6effc54 | 115 | AC_SUBST([py3execdir], [$ac_cv_py3execdir]) |
e01cd0ba DS |
116 | |
117 | # Make sure the python3 and py3execdir variables get sent down to | |
118 | # the subconfigure in the testsuite directory. | |
119 | AS_VAR_APPEND([ac_configure_args], [" python3='$PYTHON3' py3execdir='$ac_cv_py3execdir'"]) | |
e5d623b1 DS |
120 | fi |
121 | ||
e8f3c2c2 DS |
122 | dnl Handle the prologues option. |
123 | dnl | |
70d28673 DS |
124 | dnl If the user didn't specify --enable-prologues/--disable-prologues |
125 | dnl and the x86 system has a version of gcc less than version 4, | |
126 | dnl automatically enable prologues. | |
127 | if test "${enable_prologues+set}" != set; then | |
128 | AC_MSG_CHECKING([to see if prologue searching should be the default]) | |
129 | if { echo '#if __i386__ == 1 && __GNUC__ < 4' | |
130 | echo ' yes ' | |
131 | echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then | |
132 | enable_prologues=yes | |
133 | AC_MSG_RESULT([yes]) | |
134 | else | |
135 | AC_MSG_RESULT([no]) | |
136 | fi | |
137 | fi | |
e8f3c2c2 DS |
138 | AC_ARG_ENABLE([prologues], |
139 | AS_HELP_STRING([--enable-prologues], [make -P prologue-searching default]), | |
140 | [ | |
70d28673 DS |
141 | if test "$enable_prologues" = yes; then |
142 | AC_DEFINE([ENABLE_PROLOGUES],[],[make -P prologue-searching default]) | |
143 | fi]) | |
144 | ||
e1bfefdc SC |
145 | dnl Handle the disable-sdt-probes option. |
146 | dnl | |
147 | dnl Default to --disable-sdt-probes if --enable-sdt-probes/--disable-prologues | |
148 | dnl was not specified and the gcc version is less than version 4, | |
149 | ||
150 | if test "${enable_sdt_probes+set}" != set; then | |
151 | AC_MSG_CHECKING([to see if sdt probes should be the default]) | |
152 | if { echo '#if __GNUC__ < 4' | |
153 | echo ' yes ' | |
154 | echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then | |
8b714d4b | 155 | enable_sdt_probes=no |
e1bfefdc SC |
156 | AC_MSG_RESULT([no]) |
157 | else | |
158 | AC_MSG_RESULT([yes]) | |
159 | fi | |
160 | fi | |
0f5d597d JS |
161 | AC_ARG_ENABLE([sdt-probes], |
162 | [AS_HELP_STRING([--disable-sdt-probes], | |
163 | [disable process.mark probes in stap, staprun, stapio])]) | |
164 | AS_IF([test "x$enable_sdt_probes" != xno], [ | |
165 | AC_DEFINE([ENABLE_SDT_PROBES], [1], | |
166 | [Define to 1 to enable process.mark probes in stap, staprun, stapio.]) | |
167 | ]) | |
168 | ||
c3ce3b26 JS |
169 | dnl We're now requiring *some* C++11, using RHEL6 (gcc 4.4.7) as a baseline. |
170 | dnl This is too strict about __cplusplus for gcc < 4.7, so we have a manual fallback. | |
171 | AX_CXX_COMPILE_STDCXX(11, noext, optional) | |
172 | AS_IF([test "x$HAVE_CXX11" != x1],[ | |
173 | AC_LANG_PUSH(C++) | |
174 | AX_CHECK_COMPILE_FLAG([-std=c++0x], [ | |
175 | AC_MSG_NOTICE([Compiling with -std=c++0x]) | |
176 | CXX="$CXX -std=c++0x" | |
177 | HAVE_CXX11=1 | |
178 | ], [ | |
179 | AC_MSG_ERROR([A compiler with C++11 support is required.]) | |
180 | ]) | |
181 | AC_LANG_POP(C++) | |
182 | ]) | |
183 | ||
9921a199 | 184 | AC_ARG_ENABLE([ssp], |
bbfd8c1a FCE |
185 | [AS_HELP_STRING([--disable-ssp], [disable gcc stack-protector])]) |
186 | AS_IF([test "x$enable_ssp" != xno],[ | |
187 | save_CFLAGS="$CFLAGS" | |
188 | save_CXXFLAGS="$CXXFLAGS" | |
f0510eaa FCE |
189 | CXXFLAGS="$CXXFLAGS -Werror -fstack-protector-all -D_FORTIFY_SOURCE=2" |
190 | CFLAGS="$CFLAGS -Werror -fstack-protector-all -D_FORTIFY_SOURCE=2" | |
5d4aa1f5 | 191 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([int something ();])], [ |
f0510eaa FCE |
192 | AC_MSG_NOTICE([Compiling with gcc -fstack-protector-all et al.]) |
193 | CFLAGS="$save_CFLAGS -fstack-protector-all -D_FORTIFY_SOURCE=2" | |
a530cfe0 | 194 | CXXFLAGS="$save_CXXFLAGS -fstack-protector-all -D_FORTIFY_SOURCE=2"],[ |
bbfd8c1a FCE |
195 | AC_MSG_NOTICE([Compiler does not support -fstack-protector-all et al.]) |
196 | CFLAGS="$save_CFLAGS" | |
197 | CXXFLAGS="$save_CXXFLAGS"])]) | |
70d28673 | 198 | |
cbe7ea07 FCE |
199 | |
200 | dnl Link with gold if possible | |
201 | dnl but: https://bugzilla.redhat.com/show_bug.cgi?id=636603 | |
202 | dnl | |
203 | dnl AC_PATH_PROG(GOLD, [ld.gold], [no]) | |
204 | dnl if test "x$GOLD" != "xno" | |
205 | dnl then | |
206 | dnl mkdir -p Bdir | |
207 | dnl ln -sf $GOLD Bdir/ld | |
208 | dnl LDFLAGS="$LDFLAGS -B`pwd`/Bdir/" | |
209 | dnl AC_MSG_NOTICE([using ld.gold to link]) | |
210 | dnl fi | |
211 | ||
212 | ||
e1e3ba36 | 213 | # Compiling without fPIE by default (see PR 9922) |
8730f377 | 214 | AC_ARG_ENABLE([pie], |
882ddac1 | 215 | [AS_HELP_STRING([--enable-pie], [enable position-independent-executable])]) |
e1e3ba36 | 216 | AS_IF([test "x$enable_pie" == xyes],[ |
97859b9d JS |
217 | PIECFLAGS='-fPIE' |
218 | PIECXXFLAGS='-fPIE' | |
219 | PIELDFLAGS='-pie -Wl,-z,relro -Wl,-z,now' | |
8730f377 FCE |
220 | save_CFLAGS="$CFLAGS" |
221 | save_CXXFLAGS="$CXXFLAGS" | |
222 | save_LDFLAGS="$LDFLAGS" | |
97859b9d JS |
223 | CFLAGS="$CFLAGS $PIECFLAGS" |
224 | CXXFLAGS="$CXXFLAGS $PIECXXFLAGS" | |
225 | LDFLAGS="$LDFLAGS $PIELDFLAGS" | |
5d4aa1f5 | 226 | AC_LINK_IFELSE([AC_LANG_SOURCE([void main () {}])], [ |
8730f377 | 227 | AC_MSG_NOTICE([Compiling with gcc pie et al.]) |
97859b9d | 228 | ], [ |
8730f377 | 229 | AC_MSG_NOTICE([Compiler does not support -pie et al.]) |
5574ef2c | 230 | PIECFLAGS="" |
5574ef2c | 231 | PIECXXFLAGS="" |
8730f377 | 232 | PIELDFLAGS="" |
97859b9d JS |
233 | ]) |
234 | CFLAGS="$save_CFLAGS" | |
235 | CXXFLAGS="$save_CXXFLAGS" | |
236 | LDFLAGS="$save_LDFLAGS" | |
237 | ]) | |
8730f377 | 238 | AC_SUBST(PIELDFLAGS) |
5574ef2c MW |
239 | AC_SUBST(PIECFLAGS) |
240 | AC_SUBST(PIECXXFLAGS) | |
8730f377 | 241 | |
9921a199 DS |
242 | dnl Handle optional sqlite support. If enabled/disabled by the user, |
243 | dnl do the right thing. If not specified by the user, use it if | |
244 | dnl present. | |
245 | AC_ARG_ENABLE([sqlite], | |
e8f3c2c2 DS |
246 | AS_HELP_STRING([--enable-sqlite], [build with sqlite support]), |
247 | [], dnl ACTION-IF-GIVEN | |
248 | [enable_sqlite=check]) dnl ACTION-IF-NOT-GIVEN | |
9921a199 DS |
249 | sqlite3_LIBS= |
250 | AS_IF([test "x$enable_sqlite" != xno], | |
1fbe397b FCE |
251 | [PKG_CHECK_MODULES([sqlite3], [sqlite3 > 3.7], |
252 | [AC_DEFINE([HAVE_LIBSQLITE3], [1], [Define to 1 if you have the 'sqlite3' library (-lsqlite3).])], | |
9921a199 DS |
253 | [if test "x$enable_sqlite" != xcheck; then |
254 | AC_MSG_FAILURE([--enable-sqlite was given, but test for sqlite failed]) | |
255 | fi])]) | |
e6c086bb | 256 | |
6d14a4a9 EB |
257 | dnl Handle the option to only build runtime |
258 | AC_ARG_ENABLE([translator], | |
259 | AS_HELP_STRING([--disable-translator], [build only runtime utilities]), | |
260 | [], | |
261 | [enable_translator="yes"]) | |
262 | AM_CONDITIONAL([BUILD_TRANSLATOR], [test "$enable_translator" == "yes"]) | |
263 | ||
564eb0a8 DS |
264 | dnl Handle the option to build the crash extension |
265 | AC_ARG_ENABLE([crash], | |
266 | AS_HELP_STRING([--enable-crash@<:@=DIRECTORY@:>@], | |
267 | [enable crash extension (default is disabled). Optional DIRECTORY | |
268 | is the path to the crash header file (needed if installed in a | |
269 | non-standard location).]), | |
270 | [if test "$enable_crash" != "no"; then | |
271 | dnl Handle custom install dir (if needed) | |
272 | save_CPPFLAGS="$CPPFLAGS" | |
273 | if test "$enable_crash" != "yes"; then | |
274 | staplog_CPPFLAGS=-I$enable_crash | |
275 | CPPFLAGS="${staplog_CPPFLAGS} $CPPFLAGS" | |
276 | AC_SUBST([staplog_CPPFLAGS]) | |
277 | fi | |
278 | AC_CHECK_HEADERS([crash/defs.h], [], | |
279 | [AC_MSG_ERROR([cannot find required crash header (crash-devel may need to be installed)])], | |
280 | [ | |
e8f3c2c2 | 281 | #define NR_CPUS 256 |
564eb0a8 DS |
282 | ]) |
283 | CPPFLAGS="$save_CPPFLAGS" | |
284 | fi], | |
285 | [enable_crash="no"]) | |
286 | AM_CONDITIONAL([BUILD_CRASHMOD], [test "$enable_crash" != "no"]) | |
e6c086bb | 287 | |
465e8fbf | 288 | dnl Handle the option to build the documentation |
92aff3c7 | 289 | building_docs="no" |
465e8fbf FCE |
290 | AC_ARG_ENABLE([docs], |
291 | AS_HELP_STRING([--enable-docs], | |
292 | [enable building documentation (default on if latex etc. found).]), | |
293 | [enable_docs=$enableval], | |
294 | [enable_docs="check"]) | |
295 | AC_CHECK_PROG(have_latex, latex, yes, no) | |
296 | AC_CHECK_PROG(have_dvips, dvips, yes, no) | |
297 | AC_CHECK_PROG(have_ps2pdf, ps2pdf, yes, no) | |
7012fdd5 | 298 | if test "x${have_latex}${have_dvips}${have_ps2pdf}" != "xyesyesyes"; then |
2d4b8ddf | 299 | if test "$enable_docs" == "yes"; then |
465e8fbf FCE |
300 | AC_MSG_ERROR([cannot find all tools for building documentation]) |
301 | fi | |
2d4b8ddf MW |
302 | if test "$enable_docs" == "check"; then |
303 | AC_MSG_WARN([will not build documentation, cannot find all tools]) | |
304 | fi | |
465e8fbf | 305 | fi |
7012fdd5 | 306 | if test "x${have_latex}${have_dvips}${have_ps2pdf}" == "xyesyesyes" -a "$enable_docs" != "no"; then |
92aff3c7 WC |
307 | building_docs="yes" |
308 | fi | |
309 | AM_CONDITIONAL([BUILD_DOCS], [test "$building_docs" == "yes"]) | |
310 | ||
53ade4da | 311 | |
92aff3c7 WC |
312 | dnl Handle the option to build the reference documentation |
313 | building_refdocs="no" | |
314 | AC_ARG_ENABLE([refdocs], | |
315 | AS_HELP_STRING([--enable-refdocs], | |
1ed33130 | 316 | [enable building reference documentation (default on if other documentation built).]), |
92aff3c7 WC |
317 | [enable_refdocs=$enableval], |
318 | [enable_refdocs="check"]) | |
319 | if test "$building_docs" == "no" -a "$enable_refdocs" == "yes" ; then | |
320 | AC_MSG_ERROR([must use --enable-docs with --enable-refdocs]) | |
321 | fi | |
1ed33130 | 322 | if test "$enable_refdocs" != "no" -a "${building_docs}" == "yes"; then |
023337aa EM |
323 | building_refdocs="yes" |
324 | fi | |
325 | AM_CONDITIONAL([BUILD_REFDOCS], [test "$building_refdocs" == "yes"]) | |
326 | ||
d9c42357 | 327 | AC_CHECK_PROG(have_xmlto, xmlto, yes, no) |
327a760e | 328 | AC_CHECK_PROG(have_fop, fop, yes, no) |
61598deb FCE |
329 | if test "x${have_fop}" == "xyes"; then |
330 | # Due to rhbz505364 / 830266, we must actually test-run fop, not just | |
331 | # hope that it works. | |
434e049c | 332 | AC_MSG_CHECKING([to see if xmlto --with-fop actually works]) |
61598deb | 333 | if xmlto --with-fop pdf ${srcdir}/doc/SystemTap_Tapset_Reference/dummy-tapsets.xml >/dev/null 2>&1; then |
434e049c | 334 | AC_MSG_RESULT([yes]) |
61598deb | 335 | else |
434e049c | 336 | AC_MSG_RESULT([it's dead, Jim]) |
61598deb FCE |
337 | have_fop="broken" |
338 | fi | |
72862170 | 339 | rm -f dummy-tapsets.pdf |
61598deb | 340 | fi |
327a760e | 341 | AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" == "yes"]) |
a98010af | 342 | AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" == "yes"]) |
327a760e | 343 | |
d9c42357 FL |
344 | dnl Handle the option to build the html documentation |
345 | building_htmldocs="no" | |
346 | AC_ARG_ENABLE([htmldocs], | |
347 | AS_HELP_STRING([--enable-htmldocs], | |
348 | [enable building html documentation (default off).]), | |
617829c9 | 349 | [building_htmldocs=$enableval], |
d9c42357 | 350 | [building_htmldocs="no"]) |
617829c9 FL |
351 | if test "$have_xmlto" == "no" -a "$building_htmldocs" == "yes"; then |
352 | AC_MSG_ERROR([xmlto required for building html documentation]) | |
353 | fi | |
d9c42357 FL |
354 | |
355 | AM_CONDITIONAL([BUILD_HTMLDOCS], [test "$building_htmldocs" == "yes"]) | |
356 | ||
a8fcf687 MW |
357 | dnl There is a strange bug in older versions of xmlto when generating pdf. |
358 | dnl https://bugzilla.redhat.com/show_bug.cgi?id=526273 | |
359 | dnl So make sure to have a chapter title starting with L plus an refentry. | |
360 | dnl This will make sure the xmlto pdf support test fails on buggy versions. | |
468abaf4 | 361 | cat > conftest.xml << 'EOF' |
aa5951be WC |
362 | <?xml version="1.0" encoding="UTF-8"?> |
363 | <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" | |
364 | "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []> | |
468abaf4 FCE |
365 | <book lang="en"> |
366 | <bookinfo><title>foo</title></bookinfo> | |
a8fcf687 MW |
367 | <chapter id="logging.stp"><title>Logging Tapset</title> |
368 | <refentry id="API-log"><refnamediv><refname>log</refname> | |
369 | <refpurpose>logging</refpurpose></refnamediv> | |
370 | <refsect1><title>Description</title> | |
371 | <para>baz</para></refsect1></refentry></chapter> | |
aa5951be WC |
372 | </book> |
373 | EOF | |
468abaf4 FCE |
374 | |
375 | if test "x${have_xmlto}" == "xyes"; then | |
376 | AC_MSG_CHECKING([for xmlto --stringparam support]) | |
b653135b | 377 | xmlto --stringparam man.authors.section.enabled=0 html-nochunks conftest.xml >/dev/null 2>&1 |
468abaf4 FCE |
378 | if test $? == 0; then |
379 | have_xmlto_stringparam="yes" | |
380 | AC_MSG_RESULT([yes]) | |
381 | else | |
382 | AC_MSG_RESULT([no]) | |
383 | fi | |
b653135b | 384 | rm -f conftest.html |
468abaf4 FCE |
385 | fi |
386 | AM_CONDITIONAL([XMLTO_STRINGPARAM], [test "$have_xmlto_stringparam" == "yes"]) | |
387 | ||
468abaf4 FCE |
388 | rm -f conftest.xml |
389 | ||
a0e2728a | 390 | dnl See if we have the nss/nspr headers and libraries |
28f121c3 DEP |
391 | AC_ARG_WITH([nss], |
392 | AS_HELP_STRING([--without-nss], | |
393 | [Do not use NSS even if present])) | |
394 | ||
395 | AS_IF([test "x$with_nss" != "xno"], [ | |
396 | PKG_CHECK_MODULES([nss], [nss >= 3], | |
397 | [have_nss=yes | |
398 | AC_DEFINE([HAVE_NSS], [1], [Define to 1 if you have the nss libraries.]) | |
399 | ], [have_nss=no]) | |
400 | ], [have_nss=no]) | |
401 | ||
f5a118c0 | 402 | AM_CONDITIONAL([HAVE_NSS], [test "${have_nss}" = "yes"]) |
468abaf4 | 403 | |
2323b028 FCE |
404 | dnl Handle dracut directory configuration. Note we hard-code /usr by default, |
405 | dnl instead of $prefix, because dracut is a system service that doesn't listen | |
406 | dnl at relocatable directories. | |
407 | AC_ARG_WITH([dracutstap], | |
408 | AS_HELP_STRING([--with-dracutstap=DIR], | |
409 | [Install dracut module files in DIR])) | |
410 | AS_IF([test "x$with_dracutstap" != "x"],[dracutstap="$with_dracutstap"], | |
411 | [dracutstap=/usr/lib/dracut/modules.d/99stap]) | |
412 | AC_MSG_NOTICE([using dracut module directory $dracutstap]) | |
413 | AC_SUBST(dracutstap) | |
414 | ||
b8d6168f MC |
415 | dnl PR20850 Fix the boot time probing feature for fedora too. Typical rhel |
416 | dnl location is /sbin, typical fedora location is /usr/bin. | |
417 | AC_ARG_WITH([dracutbindir], | |
418 | AS_HELP_STRING([--with-dracutbindir=DIR], | |
419 | [Use the dracut binary located in DIR])) | |
420 | AS_IF([test "x$with_dracutbindir" != "x"],[dracutbindir="$with_dracutbindir"], | |
421 | [dracutbindir=/sbin]) | |
422 | AC_MSG_NOTICE([using dracut binary $dracutbindir]) | |
423 | AC_SUBST(dracutbindir) | |
424 | ||
a0e2728a | 425 | dnl Handle the option to build the compile server. |
19a0d4b6 | 426 | AC_ARG_ENABLE([server], |
6275c8d7 | 427 | AS_HELP_STRING([--enable-server], |
a0e2728a | 428 | [enable building of stap-server (default on if nss etc. found).]), |
19a0d4b6 MW |
429 | [enable_server=$enableval], |
430 | [enable_server="check"]) | |
a0e2728a | 431 | |
161f9ed6 | 432 | if test "$enable_server" != "no"; then |
a0e2728a | 433 | dnl See if we have enough libraries and tools to build the compile server |
f5a118c0 DEP |
434 | if test "x${have_nss}" != "xyes"; then |
435 | AC_MSG_WARN([will not build systemtap compile server, cannot find nss headers]) | |
a0e2728a | 436 | fi |
19a0d4b6 | 437 | fi |
f5a118c0 | 438 | AM_CONDITIONAL([BUILD_SERVER], [test "${have_nss}" == "yes" -a "$enable_server" != "no"]) |
a0e2728a | 439 | |
f5a118c0 | 440 | if test "${have_nss}" != "yes"; then |
c4fd15b4 | 441 | AC_MSG_WARN([compile-server client functionality will be disabled, cannot find nss development files]) |
a0e2728a | 442 | fi |
a0e2728a DB |
443 | |
444 | dnl See if we have the avahi libraries and headers | |
28f121c3 DEP |
445 | AC_ARG_WITH([avahi], |
446 | AS_HELP_STRING([--without-avahi], | |
447 | [Do not use Avahi even if present])) | |
448 | ||
449 | AS_IF([test "x$with_avahi" != "xno"], [ | |
450 | PKG_CHECK_MODULES([avahi], [avahi-client], | |
451 | [have_avahi=yes | |
452 | AC_DEFINE([HAVE_AVAHI], [1], [Define to 1 if you have the avahi libraries.]) | |
453 | ], [have_avahi=no]) | |
454 | ], [have_avahi=no]) | |
455 | ||
f5a118c0 DEP |
456 | AM_CONDITIONAL([HAVE_AVAHI], [test "${have_avahi}" = "yes"]) |
457 | ||
458 | if test "${have_avahi}" != "yes"; then | |
459 | AC_MSG_WARN([some compile-server functionality will be restricted, cannot find avahi development files]) | |
a0e2728a | 460 | fi |
43498922 | 461 | |
1087b83f | 462 | |
bcfa72ed | 463 | dnl Look for librpm. |
2ed04863 WC |
464 | AC_ARG_WITH([rpm], |
465 | [AS_HELP_STRING([--with-rpm], | |
bcfa72ed FCE |
466 | [query rpm database for missing debuginfos])], [], [with_rpm="auto"]) |
467 | if test "$with_rpm" != "no"; then | |
12c1a007 FCE |
468 | AC_CHECK_LIB(rpm, rpmtsInitIterator, [ |
469 | AC_DEFINE([HAVE_LIBRPM],[1],[have librpm]) | |
f02c2e47 | 470 | stap_LIBS="$stap_LIBS -lc -lrpm" |
12c1a007 | 471 | have_librpm="yes"], [have_librpm="no"]) |
529073d0 FCE |
472 | dnl explicit -lrpmdb is a separate requirement on some older librpms |
473 | AC_CHECK_LIB(rpmdb, rpmdbNextIterator, [ | |
474 | stap_LIBS="$stap_LIBS -lrpmdb"]) | |
44edbcd6 JS |
475 | AC_CHECK_LIB(rpmio, rpmFreeCrypto, [ |
476 | AC_DEFINE([HAVE_LIBRPMIO],[1],[have librpmio]) | |
f02c2e47 | 477 | stap_LIBS="$stap_LIBS -lc -lrpmio" |
44edbcd6 | 478 | have_librpmio="yes"], [have_librpmio="no"]) |
bcfa72ed FCE |
479 | if test "x$have_librpm" != "xyes" -a "$with_rpm" == "yes"; then |
480 | AC_MSG_ERROR([cannot find librpm]) | |
2ed04863 | 481 | fi |
44edbcd6 JS |
482 | if test "x$have_librpmio" != "xyes" -a "$with_rpm" == "yes"; then |
483 | AC_MSG_WARN([cannot find librpmio]) | |
484 | fi | |
2ed04863 WC |
485 | fi |
486 | ||
9ac12b89 DS |
487 | dnl Look for readline. |
488 | dnl | |
489 | dnl First save the orignal value of LIBS. | |
490 | LIBS_no_readline=$LIBS | |
491 | ||
492 | dnl Check how for readline presence and how to link with it. On some | |
493 | dnl systems you need to add a termcap compatible library. | |
494 | have_libreadline="no" | |
495 | AC_MSG_CHECKING([how to link readline libs]) | |
496 | for libtermcap in "" tinfo ncursesw ncurses curses termcap; do | |
497 | if test -z "$libtermcap"; then | |
498 | READLINE_LIBS="-lreadline" | |
499 | else | |
500 | READLINE_LIBS="-lreadline -l$libtermcap" | |
501 | fi | |
502 | LIBS="$READLINE_LIBS $LIBS_no_readline" | |
503 | AC_LINK_IFELSE( | |
504 | [AC_LANG_CALL([],[readline])], | |
505 | [have_libreadline="yes"]) | |
506 | if test "$have_libreadline" = "yes"; then | |
507 | break | |
508 | fi | |
509 | done | |
510 | if test "$have_libreadline" = "no"; then | |
511 | AC_MSG_RESULT([none]) | |
16314eed | 512 | READLINE_LIBS="" |
9ac12b89 DS |
513 | else |
514 | AC_MSG_RESULT([$READLINE_LIBS]) | |
9ac12b89 DS |
515 | AC_DEFINE(HAVE_LIBREADLINE, [1], |
516 | [Define if you have the readline library (-lreadline).]) | |
517 | fi | |
16314eed | 518 | AC_SUBST([READLINE_LIBS]) |
9ac12b89 DS |
519 | AM_CONDITIONAL([HAVE_LIBREADLINE], [test "$have_libreadline" == "yes"]) |
520 | ||
521 | dnl End of readline checks: restore LIBS | |
522 | LIBS=$LIBS_no_readline | |
2ed04863 | 523 | |
0a742545 FCE |
524 | dnl Allow user to choose python3 for /usr/bin/dtrace |
525 | AC_ARG_WITH([python3], | |
526 | AS_HELP_STRING([--with-python3],[prefer /usr/bin/python3])) | |
527 | AS_IF([test "x$with_python3" = "xyes"], | |
e5d623b1 DS |
528 | [AS_IF([test -z "$PYTHON3"], |
529 | [AC_MSG_ERROR([python version 3 is required])], | |
530 | [AC_SUBST(preferred_python,[$PYTHON3])])], | |
531 | [AS_IF([test "x$PYTHON" = "x:"], | |
532 | [AC_MSG_ERROR([python version 2 is required])], | |
533 | [AC_SUBST(preferred_python,[$PYTHON])])]) | |
0a742545 | 534 | |
e8f3c2c2 DS |
535 | dnl Handle elfutils. If '--with-elfutils=DIR' wasn't specified, used |
536 | dnl the system's elfutils. | |
4d9087fc RM |
537 | build_elfutils=no |
538 | AC_ARG_WITH([elfutils], | |
e8f3c2c2 DS |
539 | AS_HELP_STRING([--with-elfutils=DIRECTORY], |
540 | [find elfutils source code in DIRECTORY]), | |
541 | [ | |
4d9087fc RM |
542 | case "$with_elfutils" in |
543 | yes) AC_MSG_ERROR([--with-elfutils requires an argument]) ;; | |
544 | ''|no) ;; | |
545 | *) build_elfutils=yes ;; | |
546 | esac]) | |
547 | AM_CONDITIONAL(BUILD_ELFUTILS, test $build_elfutils = yes) | |
fa1d05cd RM |
548 | AC_SUBST(elfutils_abs_srcdir, `AS_IF([test $build_elfutils = yes], |
549 | [cd $with_elfutils && pwd])`) | |
550 | ||
efa6ba96 PP |
551 | if test $enable_translator = yes; then |
552 | if test $build_elfutils = no; then | |
7e8210ae | 553 | # Need libdwfl-capable recent elfutils http://elfutils.org/ |
c14263d8 FCE |
554 | |
555 | # On modern debian/ubuntu, libebl has been merged into libdw | |
556 | # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=457543 | |
557 | save_LIBS="$LIBS" | |
558 | AC_CHECK_LIB(ebl, ebl_get_elfmachine,[ebl_LIBS=-lebl],[ebl_LIBS=]) | |
559 | LIBS="$save_LIBS" | |
560 | ||
efa6ba96 PP |
561 | save_LIBS="$LIBS" |
562 | AC_CHECK_LIB(dw, dwfl_module_getsym,[],[ | |
563 | AC_MSG_ERROR([missing elfutils development headers/libraries (install elfutils-devel, libebl-dev, libdw-dev and/or libebl-devel)])], | |
c14263d8 | 564 | [-Wl,--start-group -ldw $ebl_LIBS -Wl,--end-group -lelf]) |
2a885a4a MW |
565 | AC_CHECK_LIB(dw, dwarf_next_unit,[],[ |
566 | AC_MSG_ERROR([elfutils, libdw too old, need 0.148+])], | |
c14263d8 FCE |
567 | [-Wl,--start-group -ldw $ebl_LIBS -Wl,--end-group -lelf]) |
568 | stap_LIBS="$stap_LIBS -Wl,--start-group -ldw $ebl_LIBS -Wl,--end-group -lelf" | |
efa6ba96 PP |
569 | LIBS="$save_LIBS" |
570 | else | |
571 | # We built our own and stap_LDFLAGS points at the install. | |
12c1a007 | 572 | stap_LIBS="$stap_LIBS -Wl,--start-group -ldw -lebl -Wl,--end-group -lelf" |
efa6ba96 | 573 | fi |
4d9087fc | 574 | fi |
a74dd276 | 575 | |
6b1a0274 WC |
576 | AC_SUBST(stap_LIBS) |
577 | AC_MSG_NOTICE([stap will link $stap_LIBS]) | |
c3a3c0c9 | 578 | |
97859b9d JS |
579 | # staprun has more modest libelf needs |
580 | if test $build_elfutils = no; then | |
97859b9d JS |
581 | save_LIBS="$LIBS" |
582 | dnl this will only succeed with elfutils 0.142+ | |
94eb87d1 DS |
583 | AC_CHECK_LIB(elf,elf_getshdrstrndx,[],[ |
584 | AC_MSG_FAILURE([libelf too old, need 0.142+])]) | |
585 | staprun_LIBS="$staprun_LIBS -lelf" | |
97859b9d JS |
586 | LIBS="$save_LIBS" |
587 | else | |
588 | # We built our own and staprun_LDFLAGS points at the install. | |
589 | staprun_LIBS="$staprun_LIBS -lelf" | |
590 | fi | |
591 | ||
592 | AC_SUBST(staprun_LIBS) | |
593 | AC_MSG_NOTICE([staprun will link $staprun_LIBS]) | |
594 | ||
cbe7ea07 | 595 | |
69c68955 FCE |
596 | dnl Plop in the build (configure) date |
597 | date=`date +%Y-%m-%d` | |
598 | AC_DEFINE_UNQUOTED(DATE, "$date", [Configuration/build date]) | |
82fab474 | 599 | AC_SUBST(DATE, "$date") |
69c68955 | 600 | |
47f390f9 FCE |
601 | # Before PR4037, we used to arrange to pass CFLAGS+=-m64 for a staprun |
602 | # being compiled on 32-bit userspace but running against 64-bit kernels. | |
603 | # This is no longer necessary. | |
5566993b | 604 | |
3bf6ac45 | 605 | AC_LANG_PUSH(C++) |
a85f96f9 | 606 | # Use boost::string_ref if available |
3dd76f53 | 607 | AC_CHECK_HEADERS([boost/utility/string_ref.hpp]) |
3bf6ac45 TM |
608 | AC_LANG_POP(C++) |
609 | ||
4d9087fc | 610 | |
138bbe90 | 611 | # Check for Dyninst headers and libraries |
138bbe90 JS |
612 | AC_ARG_WITH([dyninst], |
613 | AS_HELP_STRING([--with-dyninst=DIRECTORY], | |
eab44db5 FCE |
614 | [find dyninst headers/libraries in DIRECTORY])) |
615 | ||
138bbe90 | 616 | case "$with_dyninst" in |
eab44db5 FCE |
617 | no) ;; |
618 | ''|yes) # Try a simple-minded distro search | |
ffbe6348 JS |
619 | DYNINST_CXXFLAGS="-I/usr/include/dyninst" |
620 | DYNINST_LDFLAGS="-L/usr/lib64/dyninst -L/usr/lib/dyninst" # XXX both lib paths!?! | |
621 | ;; | |
622 | *) # Use paths in the user-specified prefix | |
623 | DYNINST_CXXFLAGS="-I$with_dyninst/include" | |
3aeea85c | 624 | DYNINST_LDFLAGS="-L$with_dyninst/lib/" # XXX need lib64 too? |
138bbe90 | 625 | ;; |
ffbe6348 | 626 | esac |
e0a17c00 | 627 | if test "$with_dyninst" != "no"; then |
ffbe6348 JS |
628 | AC_LANG_PUSH(C++) |
629 | old_CPPFLAGS="$CPPFLAGS" | |
630 | CPPFLAGS="$CPPFLAGS $DYNINST_CXXFLAGS" | |
2494675c | 631 | AC_MSG_NOTICE([checking dyninst support]) |
ffbe6348 JS |
632 | AC_CHECK_HEADERS([BPatch_object.h], [ |
633 | AC_SUBST(DYNINST_CXXFLAGS) | |
634 | AC_SUBST(DYNINST_LDFLAGS) | |
a3524565 | 635 | AC_DEFINE([HAVE_DYNINST],[1],[Define to 1 if Dyninst is enabled]) |
ffbe6348 | 636 | have_dyninst=yes |
2494675c | 637 | AC_MSG_NOTICE([dyninst support available])]) |
e0a17c00 | 638 | if test -n "$with_dyninst" -a "$have_dyninst" != "yes"; then |
2494675c DS |
639 | AC_MSG_ERROR([Dyninst does not appear to be usable]) |
640 | fi | |
ffbe6348 JS |
641 | CPPFLAGS="$old_CPPFLAGS" |
642 | AC_LANG_POP(C++) | |
643 | fi | |
138bbe90 JS |
644 | AM_CONDITIONAL([HAVE_DYNINST], [test "${have_dyninst}" = "yes"]) |
645 | ||
b0c670f4 | 646 | |
64b53440 JL |
647 | dnl Check for the libvirt and libxml2 devel packages |
648 | ||
b0c670f4 FCE |
649 | AC_ARG_ENABLE([virt], |
650 | AS_HELP_STRING([--enable-virt], | |
651 | [enable building of stapvirt support (default on if libvirt etc. found).]), | |
652 | [enable_virt=$enableval], | |
653 | [enable_virt="check"]) | |
654 | ||
64b53440 JL |
655 | dnl We require libvirt >= 1.0.2 because stapvirt relies on the |
656 | dnl virDomainOpenChannel function, which was implemented in 1.0.2. | |
c17539a5 JL |
657 | PKG_CHECK_MODULES([libvirt], [libvirt >= 1.0.2], [ |
658 | have_libvirt=yes | |
659 | AC_DEFINE([HAVE_LIBVIRT],[1],[Define to 1 if libvirt development libraries are installed]) | |
660 | ], [have_libvirt=no]) | |
64b53440 | 661 | AM_CONDITIONAL([HAVE_LIBVIRT], [test "${have_libvirt}" = "yes"]) |
c17539a5 JL |
662 | PKG_CHECK_MODULES([libxml2], [libxml-2.0], [ |
663 | have_libxml2=yes | |
664 | AC_DEFINE([HAVE_LIBXML2],[1],[Define to 1 if libxml2 development libraries are installed]) | |
665 | ], [have_libxml2=no]) | |
64b53440 | 666 | AM_CONDITIONAL([HAVE_LIBXML2], [test "${have_libxml2}" = "yes"]) |
138bbe90 | 667 | |
b0c670f4 FCE |
668 | if test "$enable_virt" != "no"; then |
669 | dnl See if we have enough libraries and tools to build the virt server | |
670 | if test "x${have_libvirt}" != "xyes"; then | |
671 | AC_MSG_WARN([will not build systemtap virt support, cannot find libvirt headers]) | |
672 | fi | |
673 | if test "x${have_libxml2}" != "xyes"; then | |
674 | AC_MSG_WARN([will not build systemtap virt support, cannot find xml2 headers]) | |
675 | fi | |
676 | fi | |
677 | AM_CONDITIONAL([BUILD_VIRT], [test "${have_libvirt}" == "yes" -a "${have_libxml2}" == "yes" -a "$enable_virt" != "no"]) | |
678 | ||
d7f07c29 DS |
679 | dnl Handle the option to build python2 probe support |
680 | AC_ARG_WITH([python2-probes], | |
681 | AS_HELP_STRING([--without-python2-probes], | |
682 | [Disable building python version 2 probe support, even if it is available])) | |
683 | have_python2_support=no | |
684 | AS_IF([test "x$with_python2_probes" != "xno"], | |
685 | [dnl First, check to make sure we have the 'python-config' script. | |
686 | pathless_python=$(basename "$PYTHON") | |
687 | AC_PATH_PROG([PYTHON_CONFIG], [${pathless_python}-config], [no]) | |
688 | AS_IF([test "x$PYTHON_CONFIG" != "xno"], | |
689 | [dnl Use the 'python-config' script to find the python | |
690 | dnl include directories. | |
691 | PYTHON_CPPFLAGS=`$PYTHON_CONFIG --includes 2> /dev/null` | |
692 | AC_SUBST([PYTHON_CPPFLAGS], [$PYTHON_CPPFLAGS]) | |
693 | save_CPPFLAGS="$CPPFLAGS" | |
694 | CPPFLAGS="$PYTHON_CPPFLAGS $CPPFLAGS" | |
695 | dnl Now make sure we can find the python 2 Python.h file. We | |
696 | dnl need to clear the cached result, since this might be a | |
697 | dnl cached result from the python 3 header file (since they | |
698 | dnl share the same name). | |
699 | AS_UNSET([ac_cv_header_Python_h]) | |
700 | AC_CHECK_HEADERS([Python.h], [have_python2_support=yes]) | |
701 | CPPFLAGS="$save_CPPFLAGS"])]) | |
effb39de | 702 | AS_IF([test "x$have_python2_support" = "xyes"], |
d7f07c29 | 703 | [AC_DEFINE([HAVE_PYTHON2_PROBES], [1], |
effb39de | 704 | [Define to 1 to enable python version 2 probe support in systemtap.])], |
d7f07c29 DS |
705 | [AS_IF([test "x$with_python2_probes" = "xyes"], |
706 | [AC_MSG_ERROR([python version 2 probe support requested but not found])]) | |
c16501a1 | 707 | ]) |
d7f07c29 DS |
708 | AM_CONDITIONAL([HAVE_PYTHON2_PROBES], [test "x$have_python2_support" = "xyes"]) |
709 | ||
710 | dnl Handle the option to build python3 probe support | |
711 | AC_ARG_WITH([python3-probes], | |
712 | AS_HELP_STRING([--without-python3-probes], | |
713 | [Disable building python version 3 probe support, even if it is available])) | |
714 | have_python3_support=no | |
715 | AS_IF([test "x$with_python3_probes" != "xno"], | |
716 | [dnl First, check to make sure we have the 'python3-config' script. | |
717 | pathless_python3=$(basename "$PYTHON3") | |
1d200591 DS |
718 | if test "x${pathless_python3}" == "x"; then |
719 | pathless_python3="python3" | |
720 | fi | |
d7f07c29 DS |
721 | AC_PATH_PROG([PYTHON3_CONFIG], [${pathless_python3}-config], [no]) |
722 | AS_IF([test "x$PYTHON3_CONFIG" != "xno"], | |
723 | [dnl Use the 'python3-config' script to find the python | |
724 | dnl include directories. | |
725 | PYTHON3_CPPFLAGS=`$PYTHON3_CONFIG --includes 2> /dev/null` | |
726 | AC_SUBST([PYTHON3_CPPFLAGS], [$PYTHON3_CPPFLAGS]) | |
727 | save_CPPFLAGS="$CPPFLAGS" | |
728 | CPPFLAGS="$PYTHON3_CPPFLAGS $CPPFLAGS" | |
729 | dnl Now make sure we can find the python 3 Python.h | |
730 | dnl file. However, we've got a problem. AC_CHECK_HEADERS | |
731 | dnl was called above for the python 2 version of | |
732 | dnl Python.h. But, autoconf doesn't really know the | |
733 | dnl difference between the two files, since they both have | |
734 | dnl the same name. So, we'll unset the cache variable. | |
735 | AS_UNSET([ac_cv_header_Python_h]) | |
736 | AC_CHECK_HEADERS([Python.h], [have_python3_support=yes]) | |
737 | CPPFLAGS="$save_CPPFLAGS"])]) | |
738 | AS_IF([test "x$have_python3_support" = "xyes"], | |
739 | [AC_DEFINE([HAVE_PYTHON3_PROBES], [1], | |
740 | [Define to 1 to enable python version 3 probe support in systemtap.])], | |
741 | [AS_IF([test "x$with_python3_probes" = "xyes"], | |
742 | [AC_MSG_ERROR([python version 3 probe support requested but not found])]) | |
743 | ]) | |
744 | AM_CONDITIONAL([HAVE_PYTHON3_PROBES], [test "x$have_python3_support" = "xyes"]) | |
745 | ||
746 | dnl We want either (or both) python probe support. | |
747 | AM_CONDITIONAL([HAVE_PYTHON_PROBES], | |
748 | [test "x$have_python2_support" = "xyes" -o "x$have_python3_support" = "xyes"]) | |
c16501a1 | 749 | |
11ea78d6 | 750 | dnl Check for presence of json-c and ncurses for use in monitor mode |
863e1237 | 751 | PKG_CHECK_MODULES([jsonc], [json-c >= 0.12], [have_jsonc=yes], [have_jsonc=no]) |
11ea78d6 FL |
752 | PKG_CHECK_MODULES([ncurses], [ncurses], [have_ncurses=yes], [have_ncurses=no]) |
753 | AM_CONDITIONAL([HAVE_MONITOR_LIBS], [test "${have_jsonc}" == "yes" -a "${have_ncurses}" == "yes"]) | |
754 | if test "${have_jsonc}" == "yes" -a "${have_ncurses}" == yes; then | |
755 | AC_DEFINE([HAVE_MONITOR_LIBS],[1],[Define to 1 if json-c and ncurses libraries are installed]) | |
756 | fi | |
b0c670f4 | 757 | |
f9794ee4 RM |
758 | AC_CACHE_CHECK([for assembler .section "?" flags support], stap_cv_sectionq, [ |
759 | old_CFLAGS="$CFLAGS" | |
760 | CFLAGS="$CFLAGS -Wa,--fatal-warnings" | |
5d4aa1f5 | 761 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([asm(".section .note.foo,\"?\",\"note\"\n" |
f9794ee4 RM |
762 | ".byte 1, 2, 3\n" |
763 | ".previous\n" | |
764 | ".section .text,\"axG\",\"progbits\",foogroup,comdat\n" | |
765 | ".byte 1\n" | |
766 | ".pushsection .note.foo,\"?\",\"note\"\n" | |
767 | ".byte 4, 5, 6\n" | |
768 | ".popsection\n" | |
5d4aa1f5 | 769 | ".byte 2\n");])], |
f9794ee4 | 770 | stap_cv_sectionq=yes, stap_cv_sectionq=no) |
a530cfe0 | 771 | CFLAGS="$old_CFLAGS"]) |
f9794ee4 RM |
772 | AC_SUBST(support_section_question) |
773 | support_section_question=0 | |
774 | if test $stap_cv_sectionq = yes; then | |
775 | support_section_question=1 | |
776 | fi | |
8f223b3e | 777 | AC_CONFIG_FILES([includes/sys/sdt-config.h po/Makefile.in]) |
f9794ee4 | 778 | |
efa6ba96 | 779 | if test $build_elfutils = yes -a $enable_translator = yes; then |
d2bd25ac | 780 | here=`pwd` |
4d9087fc RM |
781 | case "$with_elfutils" in |
782 | /*) elfutils_srcdir="$with_elfutils" ;; | |
d2bd25ac | 783 | *) elfutils_srcdir="${here}/$with_elfutils" ;; |
4d9087fc | 784 | esac |
d2bd25ac MW |
785 | |
786 | if ! test -f ${elfutils_srcdir}/configure; then | |
787 | AC_MSG_ERROR([No ${elfutils_srcdir}/configure, forgot to run autoreconf -i?]) | |
788 | fi | |
4d9087fc | 789 | AC_MSG_NOTICE([running ${elfutils_srcdir}/configure]) |
29b694a7 DS |
790 | |
791 | save_CFLAGS="$CFLAGS" | |
792 | save_CXXFLAGS="$CXXFLAGS" | |
793 | CXXFLAGS="$CXXFLAGS -fgnu89-inline" | |
794 | CFLAGS="$CFLAGS -fgnu89-inline" | |
795 | gnu89_inline_flag="" | |
5d4aa1f5 | 796 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([int something ();])], [ |
29b694a7 DS |
797 | AC_MSG_NOTICE([Compiling elfutils with gcc -fgnu89-inline]) |
798 | gnu89_inline_flag="-fgnu89-inline"],[ | |
799 | AC_MSG_NOTICE([Compiler does not support -fgnu89-inline])]) | |
800 | CFLAGS="$save_CFLAGS" | |
801 | CXXFLAGS="$save_CXXFLAGS" | |
802 | ||
b7165f65 RM |
803 | # Our libdw.so's libebl will look in $ORIGIN/../lib/... but that |
804 | # $ORIGIN is where libdw.so resides, which is not where there is a ../lib. | |
fa1d05cd RM |
805 | # Note that $libdir might be using a quoted use of $exec_prefix or $prefix. |
806 | # So we must make sure to pass those settings to elfutils configure. | |
b7165f65 | 807 | elfutils_rpath="-Wl,--enable-new-dtags,-rpath,${libdir}/${PACKAGE_NAME}" |
33ee059c MW |
808 | # Check whether this is a source release, or a source checkout. |
809 | # We need --enable-maintainer-mode if it isn't a source release. | |
810 | # elfutils.spec is only distributed in source releases. | |
811 | if test -f ${elfutils_srcdir}/elfutils.spec; then | |
812 | need_maintainer_option="" | |
813 | else | |
814 | need_maintainer_option="--enable-maintainer-mode" | |
815 | fi | |
4d9087fc | 816 | (mkdir -p build-elfutils && cd build-elfutils && |
412e1bf7 | 817 | bash ${elfutils_srcdir}/configure --enable-libebl-subdir=${PACKAGE_NAME} \ |
4d9087fc | 818 | --includedir="${here}/include-elfutils" \ |
b7165f65 | 819 | --libdir="${here}/lib-elfutils" \ |
fa1d05cd RM |
820 | --exec-prefix="$exec_prefix" \ |
821 | --prefix="$prefix" \ | |
90491495 | 822 | --enable-dwz \ |
33ee059c | 823 | ${need_maintainer_option} \ |
c2444a96 | 824 | CFLAGS="${CFLAGS/-Wall/} $gnu89_inline_flag -fexceptions" \ |
e016a49a | 825 | LDFLAGS="$LDFLAGS $elfutils_rpath" && |
e3633556 | 826 | if test -f ${elfutils_srcdir}/config/version.h.in; then |
e050d62f MW |
827 | echo Found elfutils/version.h header... |
828 | else | |
829 | echo elfutils/version.h header not found, need elfutils 0.142+... | |
830 | exit -1 | |
e3633556 | 831 | fi |
4d9087fc | 832 | ) |
e050d62f | 833 | if test $? != 0; then exit -1; fi |
4d9087fc | 834 | fi |
5566993b | 835 | |
51030d84 JS |
836 | dnl Optional libselinux support allows stapdyn to check |
837 | dnl for booleans that would prevent Dyninst from working. | |
838 | AC_ARG_WITH([selinux], | |
839 | AS_HELP_STRING([--without-selinux], | |
840 | [Do not use libselinux even if present])) | |
841 | ||
842 | AS_IF([test "x$with_selinux" != "xno"], [ | |
843 | PKG_CHECK_MODULES([selinux], [libselinux], | |
844 | [have_selinux=yes | |
845 | AC_DEFINE([HAVE_SELINUX], [1], [Define to 1 if you have the SELinux libraries.]) | |
846 | ], [have_selinux=no]) | |
847 | ], [have_selinux=no]) | |
848 | ||
849 | AM_CONDITIONAL([HAVE_SELINUX], [test "${have_selinux}" = "yes"]) | |
850 | ||
0820bd9a FL |
851 | dnl Used in monitor mode. Only available on kernel versions >= 2.6.35 |
852 | AC_CHECK_DECL([F_SETPIPE_SZ], | |
853 | [AC_DEFINE(HAVE_F_SETPIPE_SZ,[1], Define to 1 if F_SETPIPE_SZ is available.)], | |
854 | [], | |
855 | [#include <fcntl.h>]) | |
856 | ||
95835e2c | 857 | dnl Handle java+byteman support |
e9b0aba1 SM |
858 | AC_CHECK_PROG(have_javac, javac, yes, no) |
859 | AC_CHECK_PROG(have_jar, jar, yes, no) | |
860 | if test "$have_javac" != no -a "$have_jar" != no; then | |
861 | echo java found, will try to configure Byteman support | |
95835e2c | 862 | |
26703c63 SM |
863 | AC_ARG_WITH([java], |
864 | [AS_HELP_STRING([--with-java=DIRECTORY], | |
865 | [Specify JDK directory to compile libHelperSDT.so against (default is /usr/lib/jvm/java)])], | |
93933baa | 866 | [], |
26703c63 | 867 | [with_java=/usr/lib/jvm/java]) |
ef50e368 | 868 | dnl don't use AC_CHECK_FILE here, as that blocks cross-compiling |
a71e842d | 869 | if test ! -d "$with_java"; then |
ef50e368 FCE |
870 | with_java=no |
871 | fi | |
26703c63 | 872 | AC_SUBST(JAVADIR, "${with_java}") # always needed to compile |
95835e2c | 873 | |
26703c63 SM |
874 | if test "$with_java" != "no"; then |
875 | AC_DEFINE_UNQUOTED(HAVE_JAVA, "1", [Flag indicating that libHelperSDT.so is available (can be found in PKGLIBDIR)]) | |
13c19b49 | 876 | fi |
275cd71a | 877 | |
26703c63 | 878 | AM_CONDITIONAL([HAVE_JAVA], [test "$with_java" != "no"]) |
7fe06356 | 879 | |
95835e2c SM |
880 | else |
881 | AC_MSG_WARN([will not run per-method java probing, missing byteman or java requirements]) | |
26703c63 | 882 | AM_CONDITIONAL([HAVE_JAVA],false) |
93933baa | 883 | fi # java+byteman support |
7fe06356 | 884 | |
62c8a962 FCE |
885 | AC_SUBST(ENABLE_NLS, "$USE_NLS") |
886 | AC_SUBST(localedir, "$localedir") | |
887 | AC_SUBST(LOCALEDIR, "$localedir") | |
888 | ||
85b62eab FCE |
889 | AC_ARG_WITH([extra-version], |
890 | AS_HELP_STRING([--with-extra-version=STRING], | |
891 | [Add STRING to stap -V version])) | |
892 | AS_IF([test "x$with_extra_version" != "xno"], [ | |
893 | stap_extra_version="$with_extra_version" | |
894 | AC_MSG_NOTICE([Adding extra version $stap_extra_version])], [ | |
895 | stap_extra_version=""]) | |
896 | AC_DEFINE_UNQUOTED(STAP_EXTRA_VERSION, "$stap_extra_version", [extra stap version code]) | |
897 | AC_SUBST(STAP_EXTRA_VERSION, "$stap_extra_version") | |
898 | ||
5c5a0bf2 DS |
899 | dnl Handle the option to build httpd web compiliation service |
900 | AC_ARG_ENABLE([http], | |
901 | AS_HELP_STRING([--disable-http], | |
902 | [Disable building http web compilation service, even if we could])) | |
903 | have_http_support=no | |
904 | AS_IF([test "x$enable_http" != "xno"], | |
905 | [dnl Do we have the microhttpd library? | |
906 | PKG_CHECK_MODULES([libmicrohttpd], [libmicrohttpd > 0.9.0], [have_libmicrohttpd=true], [have_libmicrohttpd=false]) | |
907 | ||
908 | dnl Do we have the uuid library? | |
bccff213 | 909 | PKG_CHECK_MODULES([uuid], [uuid >= 2.17.0], [have_libuuid=true], [have_libuuid=false]) |
5c5a0bf2 | 910 | |
585b5c35 DS |
911 | dnl If we have both libraries (and the json-c library), we could |
912 | dnl build the httpd web complilation service. | |
913 | AS_IF([test "x$have_libmicrohttpd" == "xtrue" -a "x$have_libuuid" == "xtrue" -a "x$have_jsonc" == "xyes"], [have_http_support=yes])]) | |
5c5a0bf2 DS |
914 | |
915 | AS_IF([test "x$have_http_support" = "xyes"], | |
916 | [AC_DEFINE([HAVE_HTTP_SUPPORT], [1], | |
917 | [Define to 1 to enable http web service support in systemtap.])], | |
918 | [AS_IF([test "x$enable_http" = "xyes"], | |
919 | [AC_MSG_ERROR([http service support requested but not found])]) | |
920 | ]) | |
921 | AM_CONDITIONAL([HAVE_HTTP_SUPPORT], [test "x$have_http_support" = "xyes"]) | |
922 | ||
50431f30 MW |
923 | dnl This is here mainly to make sure that configure --prefix=... changes |
924 | dnl the config.h files so files depending on it are recompiled | |
925 | dnl prefix is passed through indirectly in the Makefile.am AM_CPPFLAGS. | |
2a1c9b5d FCE |
926 | dnl Formerly: Don't use this directly (when not given it is set to NONE). |
927 | dnl Currently: inline autoconf's later defaulting | |
802cd104 | 928 | |
2a1c9b5d FCE |
929 | stap_prefix=$prefix |
930 | test "$stap_prefix" = NONE && stap_prefix=$ac_default_prefix | |
931 | AC_DEFINE_UNQUOTED(STAP_PREFIX, "$stap_prefix", [configure prefix location]) | |
62c8a962 | 932 | AC_SUBST(STAP_PREFIX, "$stap_prefix") |
50431f30 | 933 | |
e016a49a | 934 | AC_CONFIG_HEADERS([config.h:config.in]) |
d679d193 | 935 | AC_CONFIG_FILES([Makefile doc/Makefile man/Makefile man/cs/Makefile \ |
c24a9d9a | 936 | doc/beginners/Makefile doc/SystemTap_Tapset_Reference/Makefile \ |
0b03204e | 937 | man/stap.1 man/stappaths.7 man/systemtap.8 \ |
24ef0e88 | 938 | man/cs/stap.1 man/cs/stappaths.7 man/cs/systemtap.8 \ |
29fe12e4 | 939 | initscript/config.systemtap initscript/config.stap-server \ |
e6c842d9 | 940 | initscript/systemtap initscript/stap-server \ |
b8d6168f MC |
941 | initscript/99stap/module-setup.sh \ |
942 | initscript/99stap/install \ | |
943 | initscript/99stap/check ]) | |
97859b9d | 944 | AC_CONFIG_SUBDIRS(testsuite) |
6d14a4a9 EB |
945 | if test $enable_translator == "yes"; then |
946 | AC_CONFIG_FILES([run-stap], [chmod +x run-stap]) | |
947 | fi | |
e4aaabda | 948 | AC_CONFIG_FILES([dtrace], [chmod +x dtrace]) |
66c3c633 | 949 | AC_CONFIG_FILES(stapdyn/Makefile) |
7fe06356 | 950 | AC_CONFIG_FILES(java/Makefile) |
d885563b | 951 | AC_CONFIG_FILES([java/stapbm], [chmod +x java/stapbm]) |
cf8a58fc | 952 | AC_CONFIG_FILES(python/Makefile) |
97859b9d | 953 | AC_CONFIG_FILES(staprun/Makefile) |
5c5a0bf2 | 954 | AC_CONFIG_FILES(httpd/Makefile) |
97859b9d | 955 | AC_CONFIG_FILES([staprun/run-staprun], [chmod +x staprun/run-staprun]) |
bf61ca10 JL |
956 | AC_CONFIG_FILES([staprun/guest/stapshd], [chmod +x staprun/guest/stapshd]) |
957 | AC_CONFIG_FILES([staprun/guest/stapsh-daemon], [chmod +x staprun/guest/stapsh-daemon]) | |
958 | AC_CONFIG_FILES([staprun/guest/stapsh@.service]) | |
53ade4da | 959 | |
a98010af AJ |
960 | # Setup "shadow" directory doc/beginners that has the basic directories setup for |
961 | # xmlto in one directory (through directory links if necessary). | |
53ade4da MW |
962 | # It would be nice to use AC_CONFIG_LINKS, but automake complains when |
963 | # the src is a directory and not a file. | |
53ade4da | 964 | AC_CONFIG_COMMANDS([doc/beginners], |
d9c42357 | 965 | [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]) |
53ade4da | 966 | |
e016a49a FCE |
967 | AC_OUTPUT |
968 | ||
af29024d FCE |
969 | if test "${prefix}" = "/usr/local"; then |
970 | AC_MSG_NOTICE([]) | |
971 | AC_MSG_NOTICE([For a private or temporary build of systemtap, we recommend]) | |
972 | AC_MSG_NOTICE([configuring with a prefix. For example, try]) | |
973 | AC_MSG_NOTICE([$0 $ac_configure_args --prefix=$HOME/systemtap-${PACKAGE_VERSION}-$$]) | |
974 | AC_MSG_NOTICE([Running systemtap uninstalled, entirely out of the build tree,]) | |
975 | AC_MSG_NOTICE([is not supported.]) | |
976 | fi |