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