2 m4_define([bt_version_major], [2])
3 m4_define([bt_version_minor], [0])
4 m4_define([bt_version_patch], [0])
5 m4_define([bt_version_extra], [-pre])
6 m4_define([bt_version], bt_version_major[.]bt_version_minor[.]bt_version_patch[]bt_version_extra)
7 AC_INIT([babeltrace],bt_version,[jeremie dot galarneau at efficios dot com])
9 # Following the numbering scheme proposed by libtool for the library version
10 # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
11 AC_SUBST([BABELTRACE_LIBRARY_VERSION], bt_version_major[:]bt_version_minor[:]bt_version_patch)
13 AC_CONFIG_HEADERS([config.h])
14 AC_CONFIG_AUX_DIR([config])
15 AC_CONFIG_MACRO_DIR([m4])
17 AC_DEFINE([BT_VERSION_MAJOR], bt_version_major, [Babeltrace library major version])
18 AC_DEFINE([BT_VERSION_MINOR], bt_version_minor, [Babeltrace library minor version])
19 AC_DEFINE([BT_VERSION_PATCH], bt_version_patch, [Babeltrace library patch version])
20 AC_DEFINE([BT_VERSION_EXTRA], ["]bt_version_extra["], [Babeltrace library extra version])
25 AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip tar-ustar])
26 AM_MAINTAINER_MODE([enable])
28 # Enable silent rules if available (Introduced in AM 1.11)
29 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
31 AC_REQUIRE_AUX_FILE([tap-driver.sh])
33 # Checks for C compiler
34 AC_USE_SYSTEM_EXTENSIONS
39 # Checks for programs.
48 AS_IF([test "x$ax_cv___attribute__" = "xyes"],
50 [AC_MSG_ERROR([The compiler does not support __attribute__ extensions])])
52 AX_PTHREAD(,[AC_MSG_ERROR([Could not configure pthreads support])])
53 LIBS="$PTHREAD_LIBS $LIBS"
54 CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
58 AX_APPEND_LINK_FLAGS([-Wl,--no-as-needed], [LD_NO_AS_NEEDED])
59 AC_SUBST([LD_NO_AS_NEEDED])
74 if test ! -f "$srcdir/plugins/ctf/common/metadata/parser.h"; then
75 if test x"$(basename "$YACC")" != "xbison -y"; then
76 AC_MSG_ERROR([[bison not found and is required when building from git.
77 Please install bison]])
79 AC_PATH_PROG([BISON],[bison])
80 AX_PROG_BISON_VERSION([2.4], [],[
81 AC_MSG_ERROR([[Bison >= 2.4 is required when building from git]])
85 if test ! -f "$srcdir/plugins/ctf/common/metadata/lexer.c"; then
86 if test x"$LEX" != "xflex"; then
87 AC_MSG_ERROR([[flex not found and is required when building from git.
88 Please install flex]])
90 AC_PATH_PROG([FLEX],[flex])
91 AX_PROG_FLEX_VERSION([2.5.35], [],[
92 AC_MSG_ERROR([[Flex >= 2.5.35 is required when building from git]])
97 AM_PATH_GLIB_2_0(2.22.0, ,AC_MSG_ERROR([glib is required in order to compile BabelTrace - download it from ftp://ftp.gtk.org/pub/gtk]) , gmodule)
99 # Check what libraries are required on this platform to link sockets programs.
102 # Checks for typedefs, structures, and compiler characteristics.
117 # Checks for library functions.
155 DEFAULT_ENABLE_DEBUG_INFO=yes
159 DEFAULT_ENABLE_DEBUG_INFO=no
167 AM_CONDITIONAL([BABELTRACE_BUILD_WITH_MINGW], [test "x$MINGW32" = "xyes"])
169 # Check for uuid in system libs
170 AC_CHECK_FUNCS([uuid_generate],
172 AC_DEFINE_UNQUOTED([BABELTRACE_HAVE_LIBUUID], 1, [Has libuuid support.])
176 # First, check the pkg-config module is available, otherwise explicitly check
177 # for libuuid, or uuid support in the C-library.
178 PKG_CHECK_MODULES([UUID], [uuid],
180 LIBS="${UUID_LIBS} ${LIBS}"
181 CFLAGS="${CFLAGS} ${UUID_CFLAGS}"
182 AC_DEFINE_UNQUOTED([BABELTRACE_HAVE_LIBUUID], 1, [Has libuuid support.])
183 link_with_libuuid=yes
187 AC_CHECK_LIB([uuid], [uuid_generate],
189 AC_DEFINE_UNQUOTED([BABELTRACE_HAVE_LIBUUID], 1, [Has libuuid support.])
190 link_with_libuuid=yes
193 # libuuid not found, check for uuid_create in libc.
194 AC_CHECK_LIB([c], [uuid_create],
196 AC_DEFINE_UNQUOTED([BABELTRACE_HAVE_LIBC_UUID], 1, [Has libc uuid support.])
197 link_with_libc_uuid=yes
200 # for MinGW32 we have our own internal implementation of uuid using Windows functions.
201 if test "x$MINGW32" = xno; then
202 AC_MSG_ERROR([Cannot find libuuid uuid_generate nor libc uuid_create. Use [LDFLAGS]=-Ldir to specify their location.])
209 AM_CONDITIONAL([BABELTRACE_BUILD_WITH_LIBUUID], [test "x$link_with_libuuid" = "xyes"])
210 AM_CONDITIONAL([BABELTRACE_BUILD_WITH_LIBC_UUID], [test "x$link_with_libc_uuid" = "xyes"])
213 AC_CHECK_LIB([c], [fmemopen],
215 AC_DEFINE_UNQUOTED([BABELTRACE_HAVE_FMEMOPEN], 1, [Has fmemopen support.])
219 # Check for open_memstream
220 AC_CHECK_LIB([c], [open_memstream],
222 AC_DEFINE_UNQUOTED([BABELTRACE_HAVE_OPEN_MEMSTREAM], 1, [Has open_memstream support.])
226 # Check for posix_fallocate
227 AC_CHECK_LIB([c], [posix_fallocate],
229 AC_DEFINE_UNQUOTED([BABELTRACE_HAVE_POSIX_FALLOCATE], 1, [Has posix_fallocate support.])
233 # Check for faccessat
234 AC_CHECK_LIB([c], [faccessat],
236 AC_DEFINE_UNQUOTED([BABELTRACE_HAVE_FACCESSAT], 1, [Has faccessat support.])
240 AC_CHECK_LIB([popt], [poptGetContext], [],
241 [AC_MSG_ERROR([Cannot find popt.])]
245 AC_ARG_VAR([PLUGINSDIR], [built-in plugins install directory [LIBDIR/babeltrace/plugins]])
246 AS_IF([test "x$PLUGINSDIR" = x], [PLUGINSDIR='$(libdir)/babeltrace/plugins'])
249 # SWIG version needed or newer:
252 AC_ARG_ENABLE([python-bindings],
253 [AC_HELP_STRING([--enable-python-bindings],
254 [generate Python bindings])],
255 [enable_python_bindings=yes], [enable_python_bindings=no])
257 AM_CONDITIONAL([USE_PYTHON], [test "x${enable_python_bindings:-yes}" = xyes])
262 [--enable-python-plugins],
263 [add support for the Babeltrace library and converter to load Python plugins])
265 [enable_python_plugins=yes],
266 [enable_python_plugins=no]
269 if test "x${enable_python_bindings:-yes}" = xyes; then
270 AX_PKG_SWIG($swig_version, [], [ AC_MSG_ERROR([SWIG $swig_version or newer is needed]) ])
272 AC_MSG_NOTICE([You may configure with --enable-python-bindings ]dnl
273 [if you want Python bindings.])
276 if test "x$enable_python_bindings" != xno || test "x$enable_python_plugins" != xno; then
277 AM_PATH_PYTHON([3.0], , [AC_MSG_ERROR(Python3 is not available or is not the default Python interpreter on your system. See the README file to learn how to override your distribution's default Python interpreter.)])
279 AM_PATH_PYTHON_MODULES([PYTHON])
280 # pythondir is the path where extra modules are to be installed
281 pythondir=$PYTHON_PREFIX/$PYTHON_MODULES_PATH
282 # pyexecdir is the path that contains shared objects used by the extra modules
283 pyexecdir=$PYTHON_EXEC_PREFIX/$PYTHON_MODULES_PATH
284 AC_ARG_VAR([PYTHON_INCLUDE], [Include flags for Python, bypassing python-config])
285 AC_ARG_VAR([PYTHON_LIBS], [Library flags for Python, bypassing python-config])
286 AC_ARG_VAR([PYTHON_CONFIG], [Path to python-config])
287 AS_IF([test -z "$PYTHON_INCLUDE"], [
288 AS_IF([test -z "$PYTHON_CONFIG"], [
289 AC_PATH_PROGS([PYTHON_CONFIG],
290 [python$PYTHON_VERSION-config python-config],
293 AS_IF([test "$PYTHON_CONFIG" = no], [AC_MSG_ERROR([cannot find python-config for $PYTHON. Do you have python-dev installed?])])
295 AC_MSG_CHECKING([Python include flags])
296 PYTHON_INCLUDE=`$PYTHON_CONFIG --includes`
297 AC_MSG_RESULT([$PYTHON_INCLUDE])
299 AS_IF([test -z "$PYTHON_LIBS"], [
300 AS_IF([test -z "$PYTHON_CONFIG"], [
301 AC_PATH_PROGS([PYTHON_CONFIG],
302 [python$PYTHON_VERSION-config python-config],
305 AS_IF([test "$PYTHON_CONFIG" = no], [AC_MSG_ERROR([cannot find python-config for $PYTHON. Do you have python-dev installed?])])
307 AC_MSG_CHECKING([Python library flags])
308 PYTHON_LIBS=`$PYTHON_CONFIG --libs`
309 AC_MSG_RESULT([$PYTHON_LIBS])
313 AM_CONDITIONAL([WITH_PYTHON_PLUGINS], [test "x$enable_python_plugins" != xno])
315 [test "x$enable_python_plugins" != xno],
316 AC_DEFINE_UNQUOTED([WITH_PYTHON_PLUGINS], [1], [Python plugin support.])
319 AC_ARG_ENABLE([python-bindings-doc],
320 [AC_HELP_STRING([--enable-python-bindings-doc],
321 [generate Python bindings documentation])],
322 [enable_python_bindings_doc=yes], [enable_python_bindings_doc=no])
324 AM_CONDITIONAL([BUILD_PYTHON_BINDINGS_DOC], [test "x${enable_python_bindings_doc:-yes}" = xyes])
326 AC_ARG_ENABLE([python-bindings-tests],
327 [AC_HELP_STRING([--enable-python-bindings-tests],
328 [test Python bindings])],
329 [enable_python_bindings_tests=yes], [enable_python_bindings_tests=no])
331 AM_CONDITIONAL([ENABLE_PYTHON_BINDINGS_TESTS], [test "x${enable_python_bindings_tests:-yes}" = xyes])
333 if test "x${enable_python_bindings:-no}" = xno; then
334 if test "x${enable_python_bindings_doc:-yes}" = xyes; then
335 AC_MSG_ERROR([--enable-python-bindings-doc was specified without --enable-python-bindings])
338 if test "x${enable_python_bindings_tests:-yes}" = xyes; then
339 AC_MSG_ERROR([--enable-python-bindings-tests was specified without --enable-python-bindings])
343 if test "x${enable_python_bindings_doc:-yes}" = xyes; then
344 AM_CHECK_PYTHON_SPHINX([PYTHON])
345 AS_IF([test "x$PYTHON_SPHINX_EXISTS" = xno],
346 AC_MSG_ERROR([The Sphinx package for Python 3 is required to build Python bindings documentation])
350 if test "x${enable_python_bindings_tests:-yes}" = xyes; then
351 AM_CHECK_PYTHON_TAPPY([PYTHON])
352 AS_IF([test "x$PYTHON_TAPPY_EXISTS" = xno],
353 AC_MSG_ERROR([You need the tappy Python project to test the Python bindings (see <https://github.com/python-tap/tappy>)])
357 # Set default enable state for debug info.
358 # The _enable_debug_info variable is prepended with an underscore to
359 # avoid clashing with the one generated by AC_ARG_ENABLE.
360 AS_IF([test "x$DEFAULT_ENABLE_DEBUG_INFO" = xyes], [_enable_debug_info=yes], [_enable_debug_info=no])
362 # Optional debug info feature
363 # Do _not_ indent the help string below (appears in the configure --help
365 AC_ARG_ENABLE([debug-info],
366 [AC_HELP_STRING([--enable-debug-info], [enable the debug info feature (default on Linux)])]
367 [AC_HELP_STRING([--disable-debug-info], [disable the debug info feature (default on OS X and Solaris)])],
368 [AS_IF([test "x$enableval" = xyes], [_enable_debug_info=yes], [_enable_debug_info=no])], [])
370 AM_CONDITIONAL([ENABLE_DEBUG_INFO], [test "x$_enable_debug_info" = xyes])
371 AS_IF([test "x$_enable_debug_info" = xyes], [
372 # Check if libelf and libdw are present
373 AC_CHECK_LIB([elf], [elf_version], [], [AC_MSG_ERROR(Missing libelf (from elfutils >= 0.154) which is required by debug info. You can disable this feature using --disable-debug-info.)])
374 AC_CHECK_LIB([dw], [dwarf_begin], [], [AC_MSG_ERROR(Missing libdw (from elfutils >= 0.154) which is required by debug info. You can disable this feature using --disable-debug-info.)])
375 BT_LIB_ELFUTILS([0], [154], [:], [AC_MSG_ERROR(elfutils >= 0.154 is required to use the debug info feature. You can disable this feature using --disable-debug-info.)])
376 AC_DEFINE([ENABLE_DEBUG_INFO], [1], [Define to 1 if you enable the 'debug info' feature])
379 AC_ARG_VAR([BUILT_IN_PLUGINS], [Statically-link in-tree plug-ins into the babeltrace binary])
380 AS_IF([test "x$BUILT_IN_PLUGINS" != x], [
381 # Built-in plug-ins are only available when the --disable-shared --enable-static options are used.
382 AS_IF([test "x$enable_static" != "xyes"], [AC_MSG_ERROR(--enable-static must be used to bundle plug-ins in the babeltrace executable)])
383 AS_IF([test "x$enable_shared" = "xyes"], [AC_MSG_ERROR(--disable-shared must be used to bundle plug-ins in the babeltrace executable)])
385 AC_DEFINE([BT_BUILT_IN_PLUGINS], [1], [Define to 1 to register plug-in attributes in static executable sections])
387 AM_CONDITIONAL([BUILT_IN_PLUGINS], [test "x$built_in_plugins" = "xyes"])
389 AC_ARG_VAR([BUILT_IN_PYTHON_PLUGIN_SUPPORT], [Statically-link Python plugin support into the babeltrace binary])
390 AS_IF([test "x$BUILT_IN_PYTHON_PLUGIN_SUPPORT" != x], [
391 # Built-in plug-ins are only available when the --disable-shared --enable-static options are used.
392 AS_IF([test "x$enable_static" != "xyes"], [AC_MSG_ERROR(--enable-static must be used to bundle Python plugin support in the babeltrace executable)])
393 AS_IF([test "x$enable_shared" = "xyes"], [AC_MSG_ERROR(--disable-shared must be used to bundle Python plugin support in the babeltrace executable)])
394 built_in_python_plugin_support=yes
395 AC_DEFINE([BT_BUILT_IN_PYTHON_PLUGIN_SUPPORT], [1], [Define to 1 to register plug-in attributes in static executable sections])
397 AM_CONDITIONAL([BUILT_IN_PYTHON_PLUGIN_SUPPORT], [test "x$built_in_python_plugin_support" = "xyes"])
399 PKG_CHECK_MODULES(GMODULE, [gmodule-2.0 >= 2.0.0])
401 LIBS="$LIBS $GMODULE_LIBS"
402 PACKAGE_CFLAGS="$GMODULE_CFLAGS -Wall -Wformat"
403 AC_SUBST(PACKAGE_CFLAGS)
405 DEFAULT_INCLUDES="-I\$(top_srcdir) -I\$(top_builddir) -I\$(top_builddir)/include -include config.h"
406 AC_SUBST(DEFAULT_INCLUDES)
408 babeltraceincludedir="${includedir}/babeltrace"
409 AC_SUBST(babeltraceincludedir)
411 babeltracectfwriterincludedir="${includedir}/babeltrace/ctf-writer"
412 AC_SUBST(babeltracectfwriterincludedir)
414 babeltracectfincludedir="${includedir}/babeltrace/ctf"
415 AC_SUBST(babeltracectfincludedir)
417 babeltracectfirincludedir="${includedir}/babeltrace/ctf-ir"
418 AC_SUBST(babeltracectfirincludedir)
420 babeltracepluginincludedir="${includedir}/babeltrace/plugin"
421 AC_SUBST(babeltracepluginincludedir)
423 babeltracegraphincludedir="${includedir}/babeltrace/graph"
424 AC_SUBST(babeltracegraphincludedir)
426 program_transform_name="s&babeltrace\.bin&babeltrace&;$program_transform_name"
427 AC_SUBST(program_transform_name)
434 [generate and install HTML API documentation]
436 [enable_api_doc=$enableval],
439 AM_CONDITIONAL([ENABLE_API_DOC], [test "x$enable_api_doc" = "xyes"])
441 AS_IF([test "x$enable_api_doc" = "xyes"], [
442 DX_DOXYGEN_FEATURE(ON)
452 DX_INIT_DOXYGEN([Babeltrace], [$(srcdir)/Doxyfile], [output])
463 doc/bindings/Makefile
464 doc/bindings/python/Makefile
467 lib/prio_heap/Makefile
470 lib/graph/notification/Makefile
472 lib/ctf-writer/Makefile
475 bindings/python/Makefile
476 bindings/python/babeltrace/Makefile
477 bindings/python/bt2/Makefile
478 bindings/python/bt2/__init__.py
481 tests/bin/intersection/Makefile
483 tests/lib/writer/Makefile
484 tests/lib/test-plugin-plugins/Makefile
486 tests/utils/tap/Makefile
487 tests/bindings/Makefile
488 tests/bindings/python/Makefile
489 tests/bindings/python/bt2/Makefile
491 extras/valgrind/Makefile
494 plugins/ctf/common/Makefile
495 plugins/ctf/common/btr/Makefile
496 plugins/ctf/common/metadata/Makefile
497 plugins/ctf/common/notif-iter/Makefile
498 plugins/ctf/fs/Makefile
499 plugins/ctf/lttng-live/Makefile
500 plugins/muxer/Makefile
501 plugins/text/Makefile
502 plugins/text/pretty/Makefile
503 plugins/writer/Makefile
504 plugins/utils/Makefile
505 plugins/utils/dummy/Makefile
506 plugins/utils/trimmer/Makefile
507 python-plugin-provider/Makefile
508 plugins/libctfcopytrace/Makefile
509 plugins/debug-info/Makefile
514 #AC_CONFIG_FILES([converter/babeltrace], [chmod +x converter/babeltrace])
515 AC_CONFIG_FILES([tests/lib/test_ctf_writer_complete], [chmod +x tests/lib/test_ctf_writer_complete])
516 AC_CONFIG_FILES([tests/lib/test_plugin_complete], [chmod +x tests/lib/test_plugin_complete])
517 AC_CONFIG_FILES([tests/lib/test_seek_big_trace], [chmod +x tests/lib/test_seek_big_trace])
518 AC_CONFIG_FILES([tests/lib/test_seek_empty_packet], [chmod +x tests/lib/test_seek_empty_packet])
519 AC_CONFIG_FILES([tests/lib/test_dwarf_complete], [chmod +x tests/lib/test_dwarf_complete])
520 AC_CONFIG_FILES([tests/lib/test_bin_info_complete], [chmod +x tests/lib/test_bin_info_complete])
522 AC_CONFIG_FILES([tests/bin/test_trace_read], [chmod +x tests/bin/test_trace_read])
523 AC_CONFIG_FILES([tests/bin/intersection/test_intersection], [chmod +x tests/bin/intersection/test_intersection])
524 AC_CONFIG_FILES([tests/bin/intersection/bt_python_helper.py])
525 AC_CONFIG_FILES([tests/lib/writer/bt_python_helper.py])
526 AC_CONFIG_FILES([tests/bin/test_packet_seq_num], [chmod +x tests/bin/test_packet_seq_num])
528 AS_IF([test "x$enable_python" = "xyes"], [
530 [tests/bindings/python/bt2/testall.sh],
531 [chmod +x tests/bindings/python/bt2/testall.sh]
538 # Mini-report on what will be built.
546 AS_ECHO("${PPRINT_COLOR_BLDBLU}Babeltrace $PACKAGE_VERSION$PPRINT_COLOR_RST")
549 PPRINT_SUBTITLE([Features])
551 # Target architecture we're building for.
552 target_arch=$host_cpu
555 if test $f = "-m32"; then
557 elif test $f = "-m64"; then
562 PPRINT_PROP_STRING([Target architecture], $target_arch)
565 test "x$enable_api_doc" = "xyes" && value=1 || value=0
566 PPRINT_PROP_BOOL([HTML API documentation], $value)
568 # python bindings enabled/disabled
569 test "x$enable_python_bindings" = "xyes" && value=1 || value=0
570 PPRINT_PROP_BOOL([Python bindings], $value)
572 # python bindings doc enabled/disabled
573 test "x$enable_python_bindings_doc" = "xyes" && value=1 || value=0
574 PPRINT_PROP_BOOL([Python bindings doc], $value)
576 # python bindings tests enabled/disabled
577 test "x$enable_python_bindings_tests" = "xyes" && value=1 || value=0
578 PPRINT_PROP_BOOL([Python bindings tests], $value)
580 # python plugins enabled/disabled
581 test "x$enable_python_plugins" = "xyes" && value=1 || value=0
582 PPRINT_PROP_BOOL([Python plugin support], $value)
584 # built-in Python plugin support enabled/disabled
585 test "x$built_in_python_plugin_support" = "xyes" && value=1 || value=0
586 PPRINT_PROP_BOOL([Built-in Python plugin support], $value)
588 # debug info enabled/disabled
589 test "x$_enable_debug_info" = "xyes" && value=1 || value=0
590 PPRINT_PROP_BOOL([Debug information output], $value)
592 # built-in plug-ins enabled/disabled
593 test "x$built_in_plugins" = "xyes" && value=1 || value=0
594 PPRINT_PROP_BOOL([Built-in plug-ins], $value)
596 report_bindir="`eval eval echo $bindir`"
597 report_libdir="`eval eval echo $libdir`"
599 # Print the bindir and libdir this `make install' will install into.
601 PPRINT_SUBTITLE([Install directories])
602 PPRINT_PROP_STRING([Binaries], [$report_bindir])
603 PPRINT_PROP_STRING([Libraries], [$report_libdir])