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