]> sourceware.org Git - systemtap.git/blob - configure.ac
dtrace python i18n: make work with autoconf wackyness
[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 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([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([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 client 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 client 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 Handle the optional pcp support
415 AC_ARG_ENABLE([pcp],
416 AS_HELP_STRING([--enable-pcp],
417 [enable building PCP support (default on if needed requirements are found).]),
418 [], dnl ACTION-IF-GIVEN
419 [enable_pcp="check"]) dnl ACTION-IF-NOT-GIVEN
420 dnl If the user didn't disable pcp support, check the requirements.
421 AS_IF([test "x$enable_pcp" != xno],
422 [
423 dnl Check for pcp headers
424 AC_CHECK_HEADERS([pcp/pmapi.h], [have_pcp_headers="yes"],
425 [have_pcp_headers="no"])
426 AS_IF([test "x${have_pcp_headers}" == "xno" -a x"$enable_pcp" == "xyes"],
427 AC_MSG_WARN([cannot find required pcp headers (pcp-libs-devel may need to be installed)]))
428 dnl Check for pcp event support (if we have pcp headers)
429 have_pcp_event="no"
430 AS_IF([test "x${have_pcp_headers}" == "xyes"],
431 [AC_CHECK_LIB([pcp_pmda], [pmdaEventNewArray], [have_pcp_event="yes"])
432 AS_IF([test "x${have_pcp_event}" == "xno" -a x"$enable_pcp" == "xyes"],
433 AC_MSG_WARN([cannot find required pcp pmda event support (pcp-libs-devel version 3.5.0 or higher may need be installed)]))
434 ])
435 ])
436 dnl If the user explicitly said to enable pcp support, but we can't
437 dnl (since its requirements aren't installed), error.
438 AS_IF([test "x${have_pcp_event}" == "xno" -a x"$enable_pcp" == "xyes"],
439 AC_MSG_ERROR([systemtap cannot find pcp build requirements]))
440 dnl If the user didn't say to disable pcp support, and all the
441 dnl requirements are installed, enable pcp support (and later run
442 dnl pcp's configure).
443 AM_CONDITIONAL([BUILD_PCP], [test "x${have_pcp_event}" == "xyes" -a x"$enable_pcp" != "xno"])
444 AS_IF([test "x${have_pcp_event}" == "xyes" -a x"$enable_pcp" != "xno"],
445 [run_pcp_config="yes"], [run_pcp_config="no"])
446
447 dnl Look for librpm.
448 AC_ARG_WITH([rpm],
449 [AS_HELP_STRING([--with-rpm],
450 [query rpm database for missing debuginfos])], [], [with_rpm="auto"])
451 if test "$with_rpm" != "no"; then
452 AC_CHECK_LIB(rpm, rpmtsInitIterator, [
453 AC_DEFINE([HAVE_LIBRPM],[1],[have librpm])
454 stap_LIBS="$stap_LIBS -lrpm"
455 have_librpm="yes"], [have_librpm="no"])
456 AC_CHECK_LIB(rpmio, rpmFreeCrypto, [
457 AC_DEFINE([HAVE_LIBRPMIO],[1],[have librpmio])
458 stap_LIBS="$stap_LIBS -lrpmio"
459 have_librpmio="yes"], [have_librpmio="no"])
460 if test "x$have_librpm" != "xyes" -a "$with_rpm" == "yes"; then
461 AC_MSG_ERROR([cannot find librpm])
462 fi
463 if test "x$have_librpmio" != "xyes" -a "$with_rpm" == "yes"; then
464 AC_MSG_WARN([cannot find librpmio])
465 fi
466 fi
467
468
469 dnl Handle elfutils. If '--with-elfutils=DIR' wasn't specified, used
470 dnl the system's elfutils.
471 build_elfutils=no
472 AC_ARG_WITH([elfutils],
473 AS_HELP_STRING([--with-elfutils=DIRECTORY],
474 [find elfutils source code in DIRECTORY]),
475 [
476 case "$with_elfutils" in
477 yes) AC_MSG_ERROR([--with-elfutils requires an argument]) ;;
478 ''|no) ;;
479 *) build_elfutils=yes ;;
480 esac])
481 AM_CONDITIONAL(BUILD_ELFUTILS, test $build_elfutils = yes)
482 AC_SUBST(elfutils_abs_srcdir, `AS_IF([test $build_elfutils = yes],
483 [cd $with_elfutils && pwd])`)
484
485 if test $enable_translator = yes; then
486 if test $build_elfutils = no; then
487 # Need libdwfl-capable recent elfutils http://elfutils.fedorahosted.org/
488
489 # On modern debian/ubuntu, libebl has been merged into libdw
490 # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=457543
491 save_LIBS="$LIBS"
492 AC_CHECK_LIB(ebl, ebl_get_elfmachine,[ebl_LIBS=-lebl],[ebl_LIBS=])
493 LIBS="$save_LIBS"
494
495 save_LIBS="$LIBS"
496 AC_CHECK_LIB(dw, dwfl_module_getsym,[],[
497 AC_MSG_ERROR([missing elfutils development headers/libraries (install elfutils-devel, libebl-dev, libdw-dev and/or libebl-devel)])],
498 [-Wl,--start-group -ldw $ebl_LIBS -Wl,--end-group -lelf])
499 AC_CHECK_LIB(dw, dwarf_getelf,[],[
500 AC_MSG_ERROR([elfutils, libdw too old, need 0.126+])],
501 [-Wl,--start-group -ldw $ebl_LIBS -Wl,--end-group -lelf])
502 stap_LIBS="$stap_LIBS -Wl,--start-group -ldw $ebl_LIBS -Wl,--end-group -lelf"
503 LIBS="$save_LIBS"
504 else
505 # We built our own and stap_LDFLAGS points at the install.
506 stap_LIBS="$stap_LIBS -Wl,--start-group -ldw -lebl -Wl,--end-group -lelf"
507 fi
508 fi
509
510 AC_SUBST(stap_LIBS)
511 AC_MSG_NOTICE([stap will link $stap_LIBS])
512
513
514 dnl Plop in the build (configure) date
515 date=`date +%Y-%m-%d`
516 AC_DEFINE_UNQUOTED(DATE, "$date", [Configuration/build date])
517 AC_SUBST(DATE, "$date")
518
519 # Before PR4037, we used to arrange to pass CFLAGS+=-m64 for a staprun
520 # being compiled on 32-bit userspace but running against 64-bit kernels.
521 # This is no longer necessary.
522
523 # Use tr1/unordered_map if available
524 AC_LANG_PUSH(C++)
525 AC_CHECK_HEADERS([tr1/unordered_map])
526 AC_CHECK_HEADERS([tr1/memory])
527 AC_CHECK_HEADERS([boost/shared_ptr.hpp])
528 AC_LANG_POP(C++)
529
530
531 AC_CACHE_CHECK([for assembler .section "?" flags support], stap_cv_sectionq, [
532 old_CFLAGS="$CFLAGS"
533 CFLAGS="$CFLAGS -Wa,--fatal-warnings"
534 AC_COMPILE_IFELSE([asm(".section .note.foo,\"?\",\"note\"\n"
535 ".byte 1, 2, 3\n"
536 ".previous\n"
537 ".section .text,\"axG\",\"progbits\",foogroup,comdat\n"
538 ".byte 1\n"
539 ".pushsection .note.foo,\"?\",\"note\"\n"
540 ".byte 4, 5, 6\n"
541 ".popsection\n"
542 ".byte 2\n");],
543 stap_cv_sectionq=yes, stap_cv_sectionq=no)
544 CFLAGS="$old_CFLAGS"])
545 AC_SUBST(support_section_question)
546 support_section_question=0
547 if test $stap_cv_sectionq = yes; then
548 support_section_question=1
549 fi
550 AC_CONFIG_FILES([includes/sys/sdt-config.h po/Makefile.in])
551
552
553 if test $build_elfutils = yes -a $enable_translator = yes; then
554 case "$with_elfutils" in
555 /*) elfutils_srcdir="$with_elfutils" ;;
556 *) elfutils_srcdir="../$with_elfutils" ;;
557 esac
558 AC_MSG_NOTICE([running ${elfutils_srcdir}/configure])
559
560 save_CFLAGS="$CFLAGS"
561 save_CXXFLAGS="$CXXFLAGS"
562 CXXFLAGS="$CXXFLAGS -fgnu89-inline"
563 CFLAGS="$CFLAGS -fgnu89-inline"
564 gnu89_inline_flag=""
565 AC_COMPILE_IFELSE([int something ();], [
566 AC_MSG_NOTICE([Compiling elfutils with gcc -fgnu89-inline])
567 gnu89_inline_flag="-fgnu89-inline"],[
568 AC_MSG_NOTICE([Compiler does not support -fgnu89-inline])])
569 CFLAGS="$save_CFLAGS"
570 CXXFLAGS="$save_CXXFLAGS"
571
572 # Our libdw.so's libebl will look in $ORIGIN/../lib/... but that
573 # $ORIGIN is where libdw.so resides, which is not where there is a ../lib.
574 # Note that $libdir might be using a quoted use of $exec_prefix or $prefix.
575 # So we must make sure to pass those settings to elfutils configure.
576 elfutils_rpath="-Wl,--enable-new-dtags,-rpath,${libdir}/${PACKAGE_NAME}"
577 here=`pwd`
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 CFLAGS="${CFLAGS/-Wall/} $gnu89_inline_flag" \
585 LDFLAGS="$LDFLAGS $elfutils_rpath" &&
586 if test -f ${elfutils_srcdir}/config/version.h.in; then
587 echo Trying to install elfutils version header...
588 make install-pkgincludeHEADERS
589 fi
590 # so that elfutils/version.h - available from 0.138 - may be found.
591 # Don't use install-data because that will fail (installing in $prefix).
592 )
593 if test $? != 0; then exit; fi
594 save_CPPFLAGS=${CPPFLAGS}
595 CPPFLAGS="${CPPFLAGS} -Iinclude-elfutils" # in case bundled elfutils
596 AC_CHECK_HEADERS([elfutils/version.h])
597 CPPFLAGS="$save_CPPFLAGS"
598 else
599 AC_CHECK_HEADERS([elfutils/version.h])
600 fi
601
602 AC_SUBST(ENABLE_NLS, "$USE_NLS")
603 AC_SUBST(localedir, "$localedir")
604 AC_SUBST(LOCALEDIR, "$localedir")
605
606 dnl This is here mainly to make sure that configure --prefix=... changes
607 dnl the config.h files so files depending on it are recompiled
608 dnl prefix is passed through indirectly in the Makefile.am AM_CPPFLAGS.
609 dnl Formerly: Don't use this directly (when not given it is set to NONE).
610 dnl Currently: inline autoconf's later defaulting
611
612 stap_prefix=$prefix
613 test "$stap_prefix" = NONE && stap_prefix=$ac_default_prefix
614 AC_DEFINE_UNQUOTED(STAP_PREFIX, "$stap_prefix", [configure prefix location])
615 AC_SUBST(STAP_PREFIX, "$stap_prefix")
616
617 AC_CONFIG_HEADERS([config.h:config.in])
618 AC_CONFIG_FILES([Makefile doc/Makefile \
619 doc/beginners/Makefile doc/SystemTap_Tapset_Reference/Makefile \
620 grapher/Makefile \
621 grapher/stapgraph.1 \
622 stappaths.7 \
623 initscript/systemtap initscript/stap-server ])
624 AC_CONFIG_SUBDIRS(testsuite runtime/staprun)
625 AS_IF([test "x${run_pcp_config}" == "xyes"],
626 AC_CONFIG_SUBDIRS(pcp))
627 if test $enable_translator == "yes"; then
628 AC_CONFIG_FILES([run-stap], [chmod +x run-stap])
629 fi
630 AC_CONFIG_FILES([dtrace], [chmod +x dtrace])
631
632 # Setup "shadow" directory doc/beginners that has everything setup for
633 # publican in one directory (through directory links if necessary).
634 # It would be nice to use AC_CONFIG_LINKS, but automake complains when
635 # the src is a directory and not a file.
636 AC_CONFIG_FILES([doc/beginners/publican.cfg:doc/SystemTap_Beginners_Guide/publican.cfg.in])
637 AC_CONFIG_COMMANDS([doc/beginners],
638 [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])
639
640 AC_OUTPUT
641
642 if test "${prefix}" = "/usr/local"; then
643 AC_MSG_NOTICE([])
644 AC_MSG_NOTICE([For a private or temporary build of systemtap, we recommend])
645 AC_MSG_NOTICE([configuring with a prefix. For example, try])
646 AC_MSG_NOTICE([$0 $ac_configure_args --prefix=$HOME/systemtap-${PACKAGE_VERSION}-$$])
647 AC_MSG_NOTICE([Running systemtap uninstalled, entirely out of the build tree,])
648 AC_MSG_NOTICE([is not supported.])
649 fi
This page took 0.063665 seconds and 6 git commands to generate.