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