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