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