]> sourceware.org Git - systemtap.git/blob - configure.ac
Merge branch 'master' into autocast
[systemtap.git] / configure.ac
1 dnl configure.ac --- autoconf input file for systemtap
2 dnl Process this file with autoconf to produce a configure script.
3
4 AC_INIT([systemtap], 2.6, systemtap@sourceware.org, systemtap)
5 dnl ^^^ see also NEWS, systemtap.spec, testsuite/configure.ac
6 dnl doc/SystemTap_Beginners_Guide/en-US/Book_Info.xml
7
8 dnl Get the target arch for libHelperSDT.so
9 AC_CANONICAL_TARGET
10
11 AC_PREREQ(2.63)
12 dnl We don't maintain a ChangeLog, which makes us non-GNU -> foreign.
13 AM_INIT_AUTOMAKE([no-dist foreign])
14 AM_MAINTAINER_MODE
15
16 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
17
18 AC_USE_SYSTEM_EXTENSIONS
19 AC_PROG_MKDIR_P
20 AC_SUBST(MKDIR_P)
21 AC_PROG_LN_S
22 AC_PROG_CC
23 AC_PROG_CXX
24 AC_PROG_CPP
25 AM_PROG_CC_STDC
26 AM_PROG_CC_C_O
27 AC_PROG_RANLIB
28 AC_OBJEXT
29 AC_EXEEXT
30 AC_PROG_INSTALL
31 AC_PROG_MAKE_SET
32 AC_SUBST(CFLAGS)
33 AC_SUBST(CXXFLAGS)
34 AC_SYS_LARGEFILE
35 AM_GNU_GETTEXT(external)
36 AM_GNU_GETTEXT_VERSION([0.18.2])
37 AC_CHECK_FUNCS(ppoll)
38 AC_CHECK_FUNCS(openat)
39
40 dnl Handle the prologues option.
41 dnl
42 dnl If the user didn't specify --enable-prologues/--disable-prologues
43 dnl and the x86 system has a version of gcc less than version 4,
44 dnl automatically enable prologues.
45 if test "${enable_prologues+set}" != set; then
46 AC_MSG_CHECKING([to see if prologue searching should be the default])
47 if { echo '#if __i386__ == 1 && __GNUC__ < 4'
48 echo ' yes '
49 echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
50 enable_prologues=yes
51 AC_MSG_RESULT([yes])
52 else
53 AC_MSG_RESULT([no])
54 fi
55 fi
56 AC_ARG_ENABLE([prologues],
57 AS_HELP_STRING([--enable-prologues], [make -P prologue-searching default]),
58 [
59 if test "$enable_prologues" = yes; then
60 AC_DEFINE([ENABLE_PROLOGUES],[],[make -P prologue-searching default])
61 fi])
62
63 dnl Handle the disable-sdt-probes option.
64 dnl
65 dnl Default to --disable-sdt-probes if --enable-sdt-probes/--disable-prologues
66 dnl was not specified and the gcc version is less than version 4,
67
68 if test "${enable_sdt_probes+set}" != set; then
69 AC_MSG_CHECKING([to see if sdt probes should be the default])
70 if { echo '#if __GNUC__ < 4'
71 echo ' yes '
72 echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
73 enable_sdt_probes=no
74 AC_MSG_RESULT([no])
75 else
76 AC_MSG_RESULT([yes])
77 fi
78 fi
79 AC_ARG_ENABLE([sdt-probes],
80 [AS_HELP_STRING([--disable-sdt-probes],
81 [disable process.mark probes in stap, staprun, stapio])])
82 AS_IF([test "x$enable_sdt_probes" != xno], [
83 AC_DEFINE([ENABLE_SDT_PROBES], [1],
84 [Define to 1 to enable process.mark probes in stap, staprun, stapio.])
85 ])
86
87 AC_ARG_ENABLE([ssp],
88 [AS_HELP_STRING([--disable-ssp], [disable gcc stack-protector])])
89 AS_IF([test "x$enable_ssp" != xno],[
90 save_CFLAGS="$CFLAGS"
91 save_CXXFLAGS="$CXXFLAGS"
92 CXXFLAGS="$CXXFLAGS -Werror -fstack-protector-all -D_FORTIFY_SOURCE=2"
93 CFLAGS="$CFLAGS -Werror -fstack-protector-all -D_FORTIFY_SOURCE=2"
94 AC_COMPILE_IFELSE([AC_LANG_SOURCE([int something ();])], [
95 AC_MSG_NOTICE([Compiling with gcc -fstack-protector-all et al.])
96 CFLAGS="$save_CFLAGS -fstack-protector-all -D_FORTIFY_SOURCE=2"
97 CXXFLAGS="$save_CXXFLAGS -fstack-protector-all -D_FORTIFY_SOURCE=2"],[
98 AC_MSG_NOTICE([Compiler does not support -fstack-protector-all et al.])
99 CFLAGS="$save_CFLAGS"
100 CXXFLAGS="$save_CXXFLAGS"])])
101
102
103 dnl Link with gold if possible
104 dnl but: https://bugzilla.redhat.com/show_bug.cgi?id=636603
105 dnl
106 dnl AC_PATH_PROG(GOLD, [ld.gold], [no])
107 dnl if test "x$GOLD" != "xno"
108 dnl then
109 dnl mkdir -p Bdir
110 dnl ln -sf $GOLD Bdir/ld
111 dnl LDFLAGS="$LDFLAGS -B`pwd`/Bdir/"
112 dnl AC_MSG_NOTICE([using ld.gold to link])
113 dnl fi
114
115
116 # Compiling without fPIE by default (see PR 9922)
117 AC_ARG_ENABLE([pie],
118 [AS_HELP_STRING([--enable-pie], [enable position-independent-executable])])
119 AS_IF([test "x$enable_pie" == xyes],[
120 PIECFLAGS='-fPIE'
121 PIECXXFLAGS='-fPIE'
122 PIELDFLAGS='-pie -Wl,-z,relro -Wl,-z,now'
123 save_CFLAGS="$CFLAGS"
124 save_CXXFLAGS="$CXXFLAGS"
125 save_LDFLAGS="$LDFLAGS"
126 CFLAGS="$CFLAGS $PIECFLAGS"
127 CXXFLAGS="$CXXFLAGS $PIECXXFLAGS"
128 LDFLAGS="$LDFLAGS $PIELDFLAGS"
129 AC_LINK_IFELSE([AC_LANG_SOURCE([void main () {}])], [
130 AC_MSG_NOTICE([Compiling with gcc pie et al.])
131 ], [
132 AC_MSG_NOTICE([Compiler does not support -pie et al.])
133 PIECFLAGS=""
134 PIECXXFLAGS=""
135 PIELDFLAGS=""
136 ])
137 CFLAGS="$save_CFLAGS"
138 CXXFLAGS="$save_CXXFLAGS"
139 LDFLAGS="$save_LDFLAGS"
140 ])
141 AC_SUBST(PIELDFLAGS)
142 AC_SUBST(PIECFLAGS)
143 AC_SUBST(PIECXXFLAGS)
144
145 dnl Handle optional sqlite support. If enabled/disabled by the user,
146 dnl do the right thing. If not specified by the user, use it if
147 dnl present.
148 AC_ARG_ENABLE([sqlite],
149 AS_HELP_STRING([--enable-sqlite], [build with sqlite support]),
150 [], dnl ACTION-IF-GIVEN
151 [enable_sqlite=check]) dnl ACTION-IF-NOT-GIVEN
152 sqlite3_LIBS=
153 AS_IF([test "x$enable_sqlite" != xno],
154 [AC_CHECK_LIB([sqlite3], [sqlite3_open],
155 [AC_SUBST([sqlite3_LIBS], [-lsqlite3])
156 AC_DEFINE([HAVE_LIBSQLITE3], [1], [Define to 1 if you have the 'sqlite3' library (-lsqlite3).])],
157 [if test "x$enable_sqlite" != xcheck; then
158 AC_MSG_FAILURE([--enable-sqlite was given, but test for sqlite failed])
159 fi])])
160
161 dnl Handle the option to only build runtime
162 AC_ARG_ENABLE([translator],
163 AS_HELP_STRING([--disable-translator], [build only runtime utilities]),
164 [],
165 [enable_translator="yes"])
166 AM_CONDITIONAL([BUILD_TRANSLATOR], [test "$enable_translator" == "yes"])
167
168 dnl Handle the option to build the crash extension
169 AC_ARG_ENABLE([crash],
170 AS_HELP_STRING([--enable-crash@<:@=DIRECTORY@:>@],
171 [enable crash extension (default is disabled). Optional DIRECTORY
172 is the path to the crash header file (needed if installed in a
173 non-standard location).]),
174 [if test "$enable_crash" != "no"; then
175 dnl Handle custom install dir (if needed)
176 save_CPPFLAGS="$CPPFLAGS"
177 if test "$enable_crash" != "yes"; then
178 staplog_CPPFLAGS=-I$enable_crash
179 CPPFLAGS="${staplog_CPPFLAGS} $CPPFLAGS"
180 AC_SUBST([staplog_CPPFLAGS])
181 fi
182 AC_CHECK_HEADERS([crash/defs.h], [],
183 [AC_MSG_ERROR([cannot find required crash header (crash-devel may need to be installed)])],
184 [
185 #define NR_CPUS 256
186 ])
187 CPPFLAGS="$save_CPPFLAGS"
188 fi],
189 [enable_crash="no"])
190 AM_CONDITIONAL([BUILD_CRASHMOD], [test "$enable_crash" != "no"])
191
192 dnl Handle the option to build the documentation
193 building_docs="no"
194 AC_ARG_ENABLE([docs],
195 AS_HELP_STRING([--enable-docs],
196 [enable building documentation (default on if latex etc. found).]),
197 [enable_docs=$enableval],
198 [enable_docs="check"])
199 AC_CHECK_PROG(have_xvfb, xvfb-run, yes, no)
200 AM_CONDITIONAL([HAVE_XVFB], [test "$have_xvfb" == "yes"])
201 AC_CHECK_PROG(have_latex, latex, yes, no)
202 AC_CHECK_PROG(have_dvips, dvips, yes, no)
203 AC_CHECK_PROG(have_ps2pdf, ps2pdf, yes, no)
204 AC_CHECK_PROG(have_latex2html, latex2html, yes, no)
205 if test "x${have_latex}${have_dvips}${have_ps2pdf}${have_latex2html}" != "xyesyesyesyes"; then
206 if test "$enable_docs" == "yes"; then
207 AC_MSG_ERROR([cannot find all tools for building documentation])
208 fi
209 if test "$enable_docs" == "check"; then
210 AC_MSG_WARN([will not build documentation, cannot find all tools])
211 fi
212 fi
213 if test "x${have_latex}${have_dvips}${have_ps2pdf}${have_latex2html}" == "xyesyesyesyes" -a "$enable_docs" != "no"; then
214 building_docs="yes"
215 fi
216 AM_CONDITIONAL([BUILD_DOCS], [test "$building_docs" == "yes"])
217
218 dnl Handle the options to build the publican options
219 building_publican="no"
220 AC_ARG_ENABLE([publican],
221 AS_HELP_STRING([--enable-publican],
222 [enable building publican documentation guides (default on if publican found and other documentation built).]),
223 [enable_publican=$enableval],
224 [enable_publican="check"])
225 if test "$building_docs" == "no" -a "$enable_publican" == "yes" ; then
226 AC_MSG_ERROR([must use --enable-docs with --enable-publican])
227 fi
228 AC_CHECK_PROG(have_publican, publican, yes, no)
229 if test "$enable_publican" == "yes"; then
230 if test "x${have_publican}" != "xyes"; then
231 AC_MSG_ERROR([cannot find publican for building publican guides])
232 fi
233 fi
234 if test "x${have_publican}" == "xyes" -a "$enable_publican" != "no" -a "${building_docs}" == "yes"; then
235 building_publican="yes"
236 fi
237 AM_CONDITIONAL([BUILD_PUBLICAN], [test "$building_publican" == "yes"])
238 publican_brand="common"
239 AC_ARG_WITH([publican-brand],
240 AS_HELP_STRING([--with-publican-brand=BRAND],
241 [building publican documentation guides using given brand (defaults to "common").]),
242 [publican_brand=$withval],
243 [publican_brand="common"])
244 PUBLICAN_BRAND=$publican_brand
245 AC_SUBST(PUBLICAN_BRAND)
246
247 dnl Handle the option to build the reference documentation
248 building_refdocs="no"
249 AC_ARG_ENABLE([refdocs],
250 AS_HELP_STRING([--enable-refdocs],
251 [enable building reference documentation (default on if xmlto etc. found and other documentation built).]),
252 [enable_refdocs=$enableval],
253 [enable_refdocs="check"])
254 if test "$building_docs" == "no" -a "$enable_refdocs" == "yes" ; then
255 AC_MSG_ERROR([must use --enable-docs with --enable-refdocs])
256 fi
257 AC_CHECK_PROG(have_xmlto, xmlto, yes, no)
258 if test "$enable_refdocs" == "yes"; then
259 if test "x${have_xmlto}" != "xyes"; then
260 AC_MSG_ERROR([cannot find xmlto for building reference documentation])
261 fi
262 fi
263 if test "x${have_xmlto}" == "xyes" -a "$enable_refdocs" != "no" -a "${building_docs}" == "yes"; then
264 building_refdocs="yes"
265 fi
266 AM_CONDITIONAL([BUILD_REFDOCS], [test "$building_refdocs" == "yes"])
267
268 AC_CHECK_PROG(have_fop, fop, yes, no)
269 if test "x${have_fop}" == "xyes"; then
270 # Due to rhbz505364 / 830266, we must actually test-run fop, not just
271 # hope that it works.
272 AC_MSG_CHECKING([to see if xmlto --with-fop actually works])
273 if xmlto --with-fop pdf ${srcdir}/doc/SystemTap_Tapset_Reference/dummy-tapsets.xml >/dev/null 2>&1; then
274 AC_MSG_RESULT([yes])
275 else
276 AC_MSG_RESULT([it's dead, Jim])
277 have_fop="broken"
278 fi
279 rm -f dummy-tapsets.pdf
280 fi
281 AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" == "yes"])
282
283 dnl There is a strange bug in older versions of xmlto when generating pdf.
284 dnl https://bugzilla.redhat.com/show_bug.cgi?id=526273
285 dnl So make sure to have a chapter title starting with L plus an refentry.
286 dnl This will make sure the xmlto pdf support test fails on buggy versions.
287 cat > conftest.xml << 'EOF'
288 <?xml version="1.0" encoding="UTF-8"?>
289 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
290 "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []>
291 <book lang="en">
292 <bookinfo><title>foo</title></bookinfo>
293 <chapter id="logging.stp"><title>Logging Tapset</title>
294 <refentry id="API-log"><refnamediv><refname>log</refname>
295 <refpurpose>logging</refpurpose></refnamediv>
296 <refsect1><title>Description</title>
297 <para>baz</para></refsect1></refentry></chapter>
298 </book>
299 EOF
300
301 if test "x${have_xmlto}" == "xyes"; then
302 AC_MSG_CHECKING([for xmlto --stringparam support])
303 xmlto --stringparam man.authors.section.enabled=0 html-nochunks conftest.xml >/dev/null 2>&1
304 if test $? == 0; then
305 have_xmlto_stringparam="yes"
306 AC_MSG_RESULT([yes])
307 else
308 AC_MSG_RESULT([no])
309 fi
310 rm -f conftest.html
311 fi
312 AM_CONDITIONAL([XMLTO_STRINGPARAM], [test "$have_xmlto_stringparam" == "yes"])
313
314 if test "x${building_refdocs}" == "xyes"; then
315 AC_MSG_CHECKING([for xmlto pdf support])
316 # xmlto pdf may work *only* with --with-fop
317 # XXX: To an extent this test is redundant in that the --with-fop test
318 # already ran xmlto --with-fop pdf ....
319 if test "x$have_fop" == "xyes"; then
320 XMLTOPDF_FOP=--with-fop
321 else
322 XMLTOPDF_FOP=
323 fi
324 xmlto $XMLTOPDF_FOP pdf conftest.xml >& /dev/null
325 if test $? == 0; then
326 have_xmlto_pdf="yes"
327 AC_MSG_RESULT([yes])
328 else
329 AC_MSG_RESULT([no])
330 AC_MSG_WARN([Not building reference documentation in PDF format])
331 fi
332 rm -f conftest.pdf
333 fi
334 AM_CONDITIONAL([BUILD_PDFREFDOCS], [test "$have_xmlto_pdf" == "yes"])
335
336 rm -f conftest.xml
337
338 dnl See if we have the nss/nspr headers and libraries
339 AC_ARG_WITH([nss],
340 AS_HELP_STRING([--without-nss],
341 [Do not use NSS even if present]))
342
343 AS_IF([test "x$with_nss" != "xno"], [
344 PKG_CHECK_MODULES([nss], [nss >= 3],
345 [have_nss=yes
346 AC_DEFINE([HAVE_NSS], [1], [Define to 1 if you have the nss libraries.])
347 ], [have_nss=no])
348 ], [have_nss=no])
349
350 AM_CONDITIONAL([HAVE_NSS], [test "${have_nss}" = "yes"])
351
352 dnl Handle the option to build the compile server.
353 AC_ARG_ENABLE([server],
354 AS_HELP_STRING([--enable-server],
355 [enable building of stap-server (default on if nss etc. found).]),
356 [enable_server=$enableval],
357 [enable_server="check"])
358
359 if test "$enable_server" != "no"; then
360 dnl See if we have enough libraries and tools to build the compile server
361 if test "x${have_nss}" != "xyes"; then
362 AC_MSG_WARN([will not build systemtap compile server, cannot find nss headers])
363 fi
364 fi
365 AM_CONDITIONAL([BUILD_SERVER], [test "${have_nss}" == "yes" -a "$enable_server" != "no"])
366
367 if test "${have_nss}" != "yes"; then
368 AC_MSG_WARN([compile-server client functionality will be disabled, cannot find nss development files])
369 fi
370
371 dnl See if we have the avahi libraries and headers
372 AC_ARG_WITH([avahi],
373 AS_HELP_STRING([--without-avahi],
374 [Do not use Avahi even if present]))
375
376 AS_IF([test "x$with_avahi" != "xno"], [
377 PKG_CHECK_MODULES([avahi], [avahi-client],
378 [have_avahi=yes
379 AC_DEFINE([HAVE_AVAHI], [1], [Define to 1 if you have the avahi libraries.])
380 ], [have_avahi=no])
381 ], [have_avahi=no])
382
383 AM_CONDITIONAL([HAVE_AVAHI], [test "${have_avahi}" = "yes"])
384
385 if test "${have_avahi}" != "yes"; then
386 AC_MSG_WARN([some compile-server functionality will be restricted, cannot find avahi development files])
387 fi
388
389
390 dnl Look for librpm.
391 AC_ARG_WITH([rpm],
392 [AS_HELP_STRING([--with-rpm],
393 [query rpm database for missing debuginfos])], [], [with_rpm="auto"])
394 if test "$with_rpm" != "no"; then
395 AC_CHECK_LIB(rpm, rpmtsInitIterator, [
396 AC_DEFINE([HAVE_LIBRPM],[1],[have librpm])
397 stap_LIBS="$stap_LIBS -lc -lrpm"
398 have_librpm="yes"], [have_librpm="no"])
399 AC_CHECK_LIB(rpmio, rpmFreeCrypto, [
400 AC_DEFINE([HAVE_LIBRPMIO],[1],[have librpmio])
401 stap_LIBS="$stap_LIBS -lc -lrpmio"
402 have_librpmio="yes"], [have_librpmio="no"])
403 if test "x$have_librpm" != "xyes" -a "$with_rpm" == "yes"; then
404 AC_MSG_ERROR([cannot find librpm])
405 fi
406 if test "x$have_librpmio" != "xyes" -a "$with_rpm" == "yes"; then
407 AC_MSG_WARN([cannot find librpmio])
408 fi
409 fi
410
411
412 dnl Handle elfutils. If '--with-elfutils=DIR' wasn't specified, used
413 dnl the system's elfutils.
414 build_elfutils=no
415 AC_ARG_WITH([elfutils],
416 AS_HELP_STRING([--with-elfutils=DIRECTORY],
417 [find elfutils source code in DIRECTORY]),
418 [
419 case "$with_elfutils" in
420 yes) AC_MSG_ERROR([--with-elfutils requires an argument]) ;;
421 ''|no) ;;
422 *) build_elfutils=yes ;;
423 esac])
424 AM_CONDITIONAL(BUILD_ELFUTILS, test $build_elfutils = yes)
425 AC_SUBST(elfutils_abs_srcdir, `AS_IF([test $build_elfutils = yes],
426 [cd $with_elfutils && pwd])`)
427
428 if test $enable_translator = yes; then
429 if test $build_elfutils = no; then
430 # Need libdwfl-capable recent elfutils http://elfutils.fedorahosted.org/
431
432 # On modern debian/ubuntu, libebl has been merged into libdw
433 # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=457543
434 save_LIBS="$LIBS"
435 AC_CHECK_LIB(ebl, ebl_get_elfmachine,[ebl_LIBS=-lebl],[ebl_LIBS=])
436 LIBS="$save_LIBS"
437
438 save_LIBS="$LIBS"
439 AC_CHECK_LIB(dw, dwfl_module_getsym,[],[
440 AC_MSG_ERROR([missing elfutils development headers/libraries (install elfutils-devel, libebl-dev, libdw-dev and/or libebl-devel)])],
441 [-Wl,--start-group -ldw $ebl_LIBS -Wl,--end-group -lelf])
442 AC_CHECK_LIB(dw, dwarf_next_unit,[],[
443 AC_MSG_ERROR([elfutils, libdw too old, need 0.148+])],
444 [-Wl,--start-group -ldw $ebl_LIBS -Wl,--end-group -lelf])
445 stap_LIBS="$stap_LIBS -Wl,--start-group -ldw $ebl_LIBS -Wl,--end-group -lelf"
446 LIBS="$save_LIBS"
447 else
448 # We built our own and stap_LDFLAGS points at the install.
449 stap_LIBS="$stap_LIBS -Wl,--start-group -ldw -lebl -Wl,--end-group -lelf"
450 fi
451 fi
452
453 AC_SUBST(stap_LIBS)
454 AC_MSG_NOTICE([stap will link $stap_LIBS])
455
456 # staprun has more modest libelf needs
457 if test $build_elfutils = no; then
458 save_LIBS="$LIBS"
459 dnl this will only succeed with elfutils 0.142+
460 AC_CHECK_LIB(elf,elf_getshdrstrndx,[],[
461 AC_MSG_FAILURE([libelf too old, need 0.142+])])
462 staprun_LIBS="$staprun_LIBS -lelf"
463 LIBS="$save_LIBS"
464 else
465 # We built our own and staprun_LDFLAGS points at the install.
466 staprun_LIBS="$staprun_LIBS -lelf"
467 fi
468
469 AC_SUBST(staprun_LIBS)
470 AC_MSG_NOTICE([staprun will link $staprun_LIBS])
471
472
473 dnl Plop in the build (configure) date
474 date=`date +%Y-%m-%d`
475 AC_DEFINE_UNQUOTED(DATE, "$date", [Configuration/build date])
476 AC_SUBST(DATE, "$date")
477
478 # Before PR4037, we used to arrange to pass CFLAGS+=-m64 for a staprun
479 # being compiled on 32-bit userspace but running against 64-bit kernels.
480 # This is no longer necessary.
481
482 # Use tr1/unordered_map if available
483 AC_LANG_PUSH(C++)
484 AC_CHECK_HEADERS([tr1/unordered_map])
485 AC_CHECK_HEADERS([tr1/memory])
486 AC_CHECK_HEADERS([boost/shared_ptr.hpp])
487 AC_LANG_POP(C++)
488
489
490 # Check for Dyninst headers and libraries
491 AC_ARG_WITH([dyninst],
492 AS_HELP_STRING([--with-dyninst=DIRECTORY],
493 [find dyninst headers/libraries in DIRECTORY]))
494
495 case "$with_dyninst" in
496 no) ;;
497 ''|yes) # Try a simple-minded distro search
498 DYNINST_CXXFLAGS="-I/usr/include/dyninst"
499 DYNINST_LDFLAGS="-L/usr/lib64/dyninst -L/usr/lib/dyninst" # XXX both lib paths!?!
500 ;;
501 *) # Use paths in the user-specified prefix
502 DYNINST_CXXFLAGS="-I$with_dyninst/include"
503 DYNINST_LDFLAGS="-L$with_dyninst/lib/" # XXX need lib64 too?
504 ;;
505 esac
506 if test "$with_dyninst" != "no"; then
507 AC_LANG_PUSH(C++)
508 old_CPPFLAGS="$CPPFLAGS"
509 CPPFLAGS="$CPPFLAGS $DYNINST_CXXFLAGS"
510 AC_MSG_NOTICE([checking dyninst support])
511 AC_CHECK_HEADERS([BPatch_object.h], [
512 AC_SUBST(DYNINST_CXXFLAGS)
513 AC_SUBST(DYNINST_LDFLAGS)
514 AC_DEFINE([HAVE_DYNINST],[1],[Define to 1 if Dyninst is enabled])
515 have_dyninst=yes
516 AC_MSG_NOTICE([dyninst support available])])
517 if test -n "$with_dyninst" -a "$have_dyninst" != "yes"; then
518 AC_MSG_ERROR([Dyninst does not appear to be usable])
519 fi
520 CPPFLAGS="$old_CPPFLAGS"
521 AC_LANG_POP(C++)
522 fi
523 AM_CONDITIONAL([HAVE_DYNINST], [test "${have_dyninst}" = "yes"])
524
525 dnl Check for the libvirt and libxml2 devel packages
526
527 dnl We require libvirt >= 1.0.2 because stapvirt relies on the
528 dnl virDomainOpenChannel function, which was implemented in 1.0.2.
529 PKG_CHECK_MODULES([libvirt], [libvirt >= 1.0.2], [
530 have_libvirt=yes
531 AC_DEFINE([HAVE_LIBVIRT],[1],[Define to 1 if libvirt development libraries are installed])
532 ], [have_libvirt=no])
533 AM_CONDITIONAL([HAVE_LIBVIRT], [test "${have_libvirt}" = "yes"])
534 PKG_CHECK_MODULES([libxml2], [libxml-2.0], [
535 have_libxml2=yes
536 AC_DEFINE([HAVE_LIBXML2],[1],[Define to 1 if libxml2 development libraries are installed])
537 ], [have_libxml2=no])
538 AM_CONDITIONAL([HAVE_LIBXML2], [test "${have_libxml2}" = "yes"])
539
540 AC_CACHE_CHECK([for assembler .section "?" flags support], stap_cv_sectionq, [
541 old_CFLAGS="$CFLAGS"
542 CFLAGS="$CFLAGS -Wa,--fatal-warnings"
543 AC_COMPILE_IFELSE([AC_LANG_SOURCE([asm(".section .note.foo,\"?\",\"note\"\n"
544 ".byte 1, 2, 3\n"
545 ".previous\n"
546 ".section .text,\"axG\",\"progbits\",foogroup,comdat\n"
547 ".byte 1\n"
548 ".pushsection .note.foo,\"?\",\"note\"\n"
549 ".byte 4, 5, 6\n"
550 ".popsection\n"
551 ".byte 2\n");])],
552 stap_cv_sectionq=yes, stap_cv_sectionq=no)
553 CFLAGS="$old_CFLAGS"])
554 AC_SUBST(support_section_question)
555 support_section_question=0
556 if test $stap_cv_sectionq = yes; then
557 support_section_question=1
558 fi
559 AC_CONFIG_FILES([includes/sys/sdt-config.h po/Makefile.in])
560
561 if test $build_elfutils = yes -a $enable_translator = yes; then
562 case "$with_elfutils" in
563 /*) elfutils_srcdir="$with_elfutils" ;;
564 *) elfutils_srcdir="../$with_elfutils" ;;
565 esac
566 AC_MSG_NOTICE([running ${elfutils_srcdir}/configure])
567
568 save_CFLAGS="$CFLAGS"
569 save_CXXFLAGS="$CXXFLAGS"
570 CXXFLAGS="$CXXFLAGS -fgnu89-inline"
571 CFLAGS="$CFLAGS -fgnu89-inline"
572 gnu89_inline_flag=""
573 AC_COMPILE_IFELSE([AC_LANG_SOURCE([int something ();])], [
574 AC_MSG_NOTICE([Compiling elfutils with gcc -fgnu89-inline])
575 gnu89_inline_flag="-fgnu89-inline"],[
576 AC_MSG_NOTICE([Compiler does not support -fgnu89-inline])])
577 CFLAGS="$save_CFLAGS"
578 CXXFLAGS="$save_CXXFLAGS"
579
580 # Our libdw.so's libebl will look in $ORIGIN/../lib/... but that
581 # $ORIGIN is where libdw.so resides, which is not where there is a ../lib.
582 # Note that $libdir might be using a quoted use of $exec_prefix or $prefix.
583 # So we must make sure to pass those settings to elfutils configure.
584 elfutils_rpath="-Wl,--enable-new-dtags,-rpath,${libdir}/${PACKAGE_NAME}"
585 here=`pwd`
586 # Check whether this is a source release, or a source checkout.
587 # We need --enable-maintainer-mode if it isn't a source release.
588 # elfutils.spec is only distributed in source releases.
589 if test -f ${elfutils_srcdir}/elfutils.spec; then
590 need_maintainer_option=""
591 else
592 need_maintainer_option="--enable-maintainer-mode"
593 fi
594 (mkdir -p build-elfutils && cd build-elfutils &&
595 bash ${elfutils_srcdir}/configure --enable-libebl-subdir=${PACKAGE_NAME} \
596 --includedir="${here}/include-elfutils" \
597 --libdir="${here}/lib-elfutils" \
598 --exec-prefix="$exec_prefix" \
599 --prefix="$prefix" \
600 --enable-dwz \
601 ${need_maintainer_option} \
602 CFLAGS="${CFLAGS/-Wall/} $gnu89_inline_flag -fexceptions" \
603 LDFLAGS="$LDFLAGS $elfutils_rpath" &&
604 if test -f ${elfutils_srcdir}/config/version.h.in; then
605 echo Found elfutils/version.h header...
606 else
607 echo elfutils/version.h header not found, need elfutils 0.142+...
608 exit -1
609 fi
610 )
611 if test $? != 0; then exit -1; fi
612 fi
613
614 dnl Optional libselinux support allows stapdyn to check
615 dnl for booleans that would prevent Dyninst from working.
616 AC_ARG_WITH([selinux],
617 AS_HELP_STRING([--without-selinux],
618 [Do not use libselinux even if present]))
619
620 AS_IF([test "x$with_selinux" != "xno"], [
621 PKG_CHECK_MODULES([selinux], [libselinux],
622 [have_selinux=yes
623 AC_DEFINE([HAVE_SELINUX], [1], [Define to 1 if you have the SELinux libraries.])
624 ], [have_selinux=no])
625 ], [have_selinux=no])
626
627 AM_CONDITIONAL([HAVE_SELINUX], [test "${have_selinux}" = "yes"])
628
629 dnl Handle java+byteman support
630 AC_CHECK_PROG(have_javac, javac, yes, no)
631 AC_CHECK_PROG(have_jar, jar, yes, no)
632 if test "$have_javac" != no -a "$have_jar" != no; then
633 echo java found, will try to configure Byteman support
634
635 AC_ARG_WITH([java],
636 [AS_HELP_STRING([--with-java=DIRECTORY],
637 [Specify JDK directory to compile libHelperSDT.so against (default is /usr/lib/jvm/java)])],
638 [],
639 [with_java=/usr/lib/jvm/java])
640 dnl don't use AC_CHECK_FILE here, as that blocks cross-compiling
641 if test ! -d "$with_java"; then
642 with_java=no
643 fi
644 AC_SUBST(JAVADIR, "${with_java}") # always needed to compile
645
646 if test "$with_java" != "no"; then
647 AC_DEFINE_UNQUOTED(HAVE_JAVA, "1", [Flag indicating that libHelperSDT.so is available (can be found in PKGLIBDIR)])
648 fi
649
650 AM_CONDITIONAL([HAVE_JAVA], [test "$with_java" != "no"])
651
652 else
653 AC_MSG_WARN([will not run per-method java probing, missing byteman or java requirements])
654 AM_CONDITIONAL([HAVE_JAVA],false)
655 fi # java+byteman support
656
657 AC_SUBST(ENABLE_NLS, "$USE_NLS")
658 AC_SUBST(localedir, "$localedir")
659 AC_SUBST(LOCALEDIR, "$localedir")
660
661 AC_ARG_WITH([extra-version],
662 AS_HELP_STRING([--with-extra-version=STRING],
663 [Add STRING to stap -V version]))
664 AS_IF([test "x$with_extra_version" != "xno"], [
665 stap_extra_version="$with_extra_version"
666 AC_MSG_NOTICE([Adding extra version $stap_extra_version])], [
667 stap_extra_version=""])
668 AC_DEFINE_UNQUOTED(STAP_EXTRA_VERSION, "$stap_extra_version", [extra stap version code])
669 AC_SUBST(STAP_EXTRA_VERSION, "$stap_extra_version")
670
671 dnl This is here mainly to make sure that configure --prefix=... changes
672 dnl the config.h files so files depending on it are recompiled
673 dnl prefix is passed through indirectly in the Makefile.am AM_CPPFLAGS.
674 dnl Formerly: Don't use this directly (when not given it is set to NONE).
675 dnl Currently: inline autoconf's later defaulting
676
677 stap_prefix=$prefix
678 test "$stap_prefix" = NONE && stap_prefix=$ac_default_prefix
679 AC_DEFINE_UNQUOTED(STAP_PREFIX, "$stap_prefix", [configure prefix location])
680 AC_SUBST(STAP_PREFIX, "$stap_prefix")
681
682 AC_CONFIG_HEADERS([config.h:config.in])
683 AC_CONFIG_FILES([Makefile doc/Makefile man/Makefile \
684 doc/beginners/Makefile doc/SystemTap_Tapset_Reference/Makefile \
685 man/stappaths.7 man/systemtap.8 \
686 initscript/config.systemtap initscript/config.stap-server \
687 initscript/systemtap initscript/stap-server \
688 initscript/99stap/module-setup.sh ])
689 AC_CONFIG_SUBDIRS(testsuite)
690 if test $enable_translator == "yes"; then
691 AC_CONFIG_FILES([run-stap], [chmod +x run-stap])
692 fi
693 AC_CONFIG_FILES([dtrace], [chmod +x dtrace])
694 AC_CONFIG_FILES(stapdyn/Makefile)
695 AC_CONFIG_FILES(java/Makefile)
696 AC_CONFIG_FILES([java/stapbm], [chmod +x java/stapbm])
697 AC_CONFIG_FILES(staprun/Makefile)
698 AC_CONFIG_FILES([staprun/run-staprun], [chmod +x staprun/run-staprun])
699 AC_CONFIG_FILES([staprun/guest/stapshd], [chmod +x staprun/guest/stapshd])
700 AC_CONFIG_FILES([staprun/guest/stapsh-daemon], [chmod +x staprun/guest/stapsh-daemon])
701 AC_CONFIG_FILES([staprun/guest/stapsh@.service])
702
703 # Setup "shadow" directory doc/beginners that has everything setup for
704 # publican in one directory (through directory links if necessary).
705 # It would be nice to use AC_CONFIG_LINKS, but automake complains when
706 # the src is a directory and not a file.
707 AC_CONFIG_FILES([doc/beginners/publican.cfg:doc/SystemTap_Beginners_Guide/publican.cfg.in])
708 AC_CONFIG_COMMANDS([doc/beginners],
709 [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])
710
711 AC_OUTPUT
712
713 if test "${prefix}" = "/usr/local"; then
714 AC_MSG_NOTICE([])
715 AC_MSG_NOTICE([For a private or temporary build of systemtap, we recommend])
716 AC_MSG_NOTICE([configuring with a prefix. For example, try])
717 AC_MSG_NOTICE([$0 $ac_configure_args --prefix=$HOME/systemtap-${PACKAGE_VERSION}-$$])
718 AC_MSG_NOTICE([Running systemtap uninstalled, entirely out of the build tree,])
719 AC_MSG_NOTICE([is not supported.])
720 fi
This page took 0.072443 seconds and 6 git commands to generate.