1 dnl Process this file with autoconf to produce a configure script.
3 dnl Copyright (c) 2017 EfficiOS, Inc.
5 dnl Permission is hereby granted, free of charge, to any person obtaining a copy
6 dnl of this software and associated documentation files (the "Software"), to deal
7 dnl in the Software without restriction, including without limitation the rights
8 dnl to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 dnl copies of the Software, and to permit persons to whom the Software is
10 dnl furnished to do so, subject to the following conditions:
12 dnl The above copyright notice and this permission notice shall be included in
13 dnl all copies or substantial portions of the Software.
15 dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 dnl AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 dnl OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 ## Autoconf base setup ##
29 m4_define([bt_version_major], [2])
30 m4_define([bt_version_minor], [0])
31 m4_define([bt_version_patch], [0])
32 m4_define([bt_version_extra], [-pre4])
33 m4_define([bt_version], bt_version_major[.]bt_version_minor[.]bt_version_patch[]bt_version_extra)
35 AC_INIT([babeltrace], bt_version, [jeremie dot galarneau at efficios dot com], [], [https://efficios.com/babeltrace/])
37 # Following the numbering scheme proposed by libtool for the library version
38 # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
39 AC_SUBST([BABELTRACE_LIBRARY_VERSION], bt_version_major[:]bt_version_minor[:]bt_version_patch)
41 AC_CONFIG_HEADERS([include/config.h])
42 AC_CONFIG_AUX_DIR([config])
43 AC_CONFIG_MACRO_DIR([m4])
44 AC_REQUIRE_AUX_FILE([tap-driver.sh])
46 AC_DEFINE([BT_VERSION_MAJOR], bt_version_major, [Babeltrace library major version])
47 AC_DEFINE([BT_VERSION_MINOR], bt_version_minor, [Babeltrace library minor version])
48 AC_DEFINE([BT_VERSION_PATCH], bt_version_patch, [Babeltrace library patch version])
49 AC_DEFINE([BT_VERSION_EXTRA], ["]bt_version_extra["], [Babeltrace library extra version])
56 ## Automake base setup ##
59 AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip tar-ustar nostdinc])
60 AM_MAINTAINER_MODE([enable])
62 # Enable silent rules if available (Introduced in AM 1.11)
63 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
67 ## OS specific defaults ##
71 DEFAULT_ENABLE_DEBUG_INFO=no
76 DEFAULT_ENABLE_DEBUG_INFO=no
80 DEFAULT_ENABLE_DEBUG_INFO=no
81 LT_NO_UNDEFINED="-no-undefined"
86 DEFAULT_ENABLE_DEBUG_INFO=no
87 LT_NO_UNDEFINED="-no-undefined"
91 AM_CONDITIONAL([BABELTRACE_BUILD_WITH_MINGW], [test "x$MINGW32" = "xyes"])
92 AC_SUBST(LT_NO_UNDEFINED)
96 ## C compiler checks ##
99 AC_USE_SYSTEM_EXTENSIONS
102 # Choose the c compiler
105 # Make sure the c compiler supports C99
106 AC_PROG_CC_C99([], [AC_MSG_ERROR([The compiler does not support C99])])
108 # Make sure the c compiler supports __attributes__
110 AS_IF([test "x$ax_cv___attribute__" != "xyes"],
111 [AC_MSG_ERROR([The compiler does not support __attribute__ extensions])])
113 # Make sur we have pthread support
114 AX_PTHREAD([], [AC_MSG_ERROR([Could not configure pthread support])])
116 # Checks for typedefs, structures, and compiler characteristics.
131 AC_CHECK_TYPES([ptrdiff_t])
158 # Check if the linker supports no-as-needed
159 AX_APPEND_LINK_FLAGS([-Wl,--no-as-needed], [LD_NO_AS_NEEDED])
160 AC_SUBST([LD_NO_AS_NEEDED])
162 # Check if the linker supports whole-archive
163 AX_CHECK_LINK_FLAG([-Wl,--whole-archive,--no-whole-archive],
165 AC_SUBST([LD_WHOLE_ARCHIVE], [-Wl,--whole-archive,])
166 AC_SUBST([LD_NO_WHOLE_ARCHIVE], [,--no-whole-archive])
168 # Fallback to force_load for the macOS linker
169 AX_CHECK_LINK_FLAG([-Wl,-force_load],
171 AC_SUBST([LD_WHOLE_ARCHIVE], [-Wl,-force_load,])
172 AC_SUBST([LD_NO_WHOLE_ARCHIVE], [])
174 AC_MSG_WARN([Can't find a linker option to force the inclusion of the static plugin archive objects.])
180 # Initialize and configure libtool
185 ## Programs checks ##
192 # set $IN_GIT_REPO if we're in the Git repository; the `bootstrap` file
193 # is not distributed in tarballs
194 AS_IF([test -f "$srcdir/bootstrap"], [in_git_repo=yes], [in_git_repo=no])
195 AM_CONDITIONAL([IN_GIT_REPO], [test "x$in_git_repo" = "xyes"])
199 AX_PROG_BISON_VERSION([2.4], [have_bison=yes])
201 AS_IF([test "x$have_bison" != "xyes"], [
202 AS_IF([test "x$in_git_repo" = "xyes"], [
204 Bison >= 2.4 is required when building from the Git repository. You can
205 set the YACC variable to override automatic detection.
209 Missing Bison >= 2.4. Note that the parser files are already built in
210 this distribution tarball, so Bison is only needed if you intend to
211 modify their sources. You can set the YACC variable to override automatic
216 AM_CONDITIONAL([HAVE_BISON], [test "x$have_bison" = "xyes"])
220 AX_PROG_FLEX_VERSION([2.5.35], [have_flex=yes])
222 AS_IF([test "x$have_flex" != "xyes"], [
223 AS_IF([test "x$in_git_repo" = "xyes"], [
225 Flex >= 2.5.35 is required when building from the Git repository. You can
226 set the LEX variable to override automatic detection.
230 Missing Flex >= 2.5.35. Note that the lexer files are already built in
231 this distribution tarball, so Flex is only needed if you intend to
232 modify their sources. You can set the LEX variable to override automatic
237 AM_CONDITIONAL([HAVE_FLEX], [test "x$have_flex" = "xyes"])
244 # Check what libraries are required on this platform to link sockets programs.
247 # Check for glib >= 2.22 with gmodule support
248 AM_PATH_GLIB_2_0([2.22.0], [],
249 AC_MSG_ERROR([glib >= 2.22 is required - download it from ftp://ftp.gtk.org/pub/gtk]),
253 # Checks for library functions.
287 # AC_FUNC_MALLOC causes problems when cross-compiling.
291 # First, check for uuid in system libs
292 AH_TEMPLATE([BABELTRACE_HAVE_LIBUUID], [Define if you have libuuid support])
293 AC_CHECK_FUNCS([uuid_generate],
295 AC_DEFINE([BABELTRACE_HAVE_LIBUUID], [1])
299 # Then, check if the pkg-config module is available, otherwise explicitly check
300 # for libuuid, or uuid support in the C-library.
301 PKG_CHECK_MODULES([UUID], [uuid],
303 AC_DEFINE([BABELTRACE_HAVE_LIBUUID], [1])
304 dnl PKG_CHECK_MODULES defines UUID_LIBS
307 AC_MSG_WARN([pkg-config was unable to find a valid .pc for libuuid. Set PKG_CONFIG_PATH to specify the pkgconfig configuration file location])
308 AC_MSG_WARN([Finding libuuid without pkg-config.])
309 AC_CHECK_LIB([uuid], [uuid_generate],
311 AC_DEFINE([BABELTRACE_HAVE_LIBUUID], [1])
315 # libuuid not found, check for uuid_create in libc.
316 AC_CHECK_LIB([c], [uuid_create],
318 AC_DEFINE([BABELTRACE_HAVE_LIBUUID], [1])
322 # for MinGW32 we have our own internal implementation of uuid using Windows functions.
323 AS_IF([test "x$MINGW32" = xno],
324 [AC_MSG_FAILURE([Cannot find libuuid uuid_generate nor libc uuid_create. Either set PKG_CONFIG_PATH to the configuration file location or use LDFLAGS=-Ldir to specify the library location])]
337 AC_CHECK_LIB([c], [fmemopen],
338 [AC_DEFINE_UNQUOTED([BABELTRACE_HAVE_FMEMOPEN], 1, [Has fmemopen support.])]
341 # Check for open_memstream
342 AC_CHECK_LIB([c], [open_memstream],
343 [AC_DEFINE_UNQUOTED([BABELTRACE_HAVE_OPEN_MEMSTREAM], 1, [Has open_memstream support.])]
346 # Check for posix_fallocate
347 AC_CHECK_LIB([c], [posix_fallocate],
348 [AC_DEFINE_UNQUOTED([BABELTRACE_HAVE_POSIX_FALLOCATE], 1, [Has posix_fallocate support.])]
352 PKG_CHECK_MODULES([POPT], [popt],
354 dnl PKG_CHECK_MODULES defines POPT_LIBS
357 AC_MSG_WARN([pkg-config was unable to find a valid .pc for libpopt. Set PKG_CONFIG_PATH to specify the pkgconfig configuration file location])
358 AC_MSG_WARN([Finding libpopt without pkg-config.])
361 [POPT_LIBS="-lpopt"],
363 AC_MSG_FAILURE([Cannot find libpopt. Either set PKG_CONFIG_PATH to the configuration file location or use LDFLAGS=-Ldir to specify the library location])
375 AC_ARG_VAR([PYTHON_INCLUDE], [Include flags for Python, bypassing python-config])
376 AC_ARG_VAR([PYTHON_LIBS], [Library flags for Python, bypassing python-config])
377 AC_ARG_VAR([PYTHON_CONFIG], [Path to python-config])
379 # PLUGINSDIR: Plugins directory
380 AC_ARG_VAR([PLUGINSDIR], [built-in plugins install directory [LIBDIR/babeltrace/plugins]])
381 AS_IF([test "x$PLUGINSDIR" = x], [PLUGINSDIR='$(libdir)/babeltrace/plugins'])
383 # BABELTRACE_MINIMAL_LOG_LEVEL:
384 AC_ARG_VAR([BABELTRACE_MINIMAL_LOG_LEVEL], [Minimal log level for Babeltrace program, library, and plugins (VERBOSE, DEBUG, INFO, WARN, ERROR (default), FATAL, or NONE)])
385 AS_IF([test "x$BABELTRACE_MINIMAL_LOG_LEVEL" = x], [BABELTRACE_MINIMAL_LOG_LEVEL="VERBOSE"])
386 AS_IF([test "$BABELTRACE_MINIMAL_LOG_LEVEL" != "VERBOSE" && \
387 test "$BABELTRACE_MINIMAL_LOG_LEVEL" != "DEBUG" && \
388 test "$BABELTRACE_MINIMAL_LOG_LEVEL" != "INFO" && \
389 test "$BABELTRACE_MINIMAL_LOG_LEVEL" != "WARN" && \
390 test "$BABELTRACE_MINIMAL_LOG_LEVEL" != "ERROR" && \
391 test "$BABELTRACE_MINIMAL_LOG_LEVEL" != "FATAL" && \
392 test "$BABELTRACE_MINIMAL_LOG_LEVEL" != "NONE"],
393 [AC_MSG_ERROR([Invalid BABELTRACE_MINIMAL_LOG_LEVEL value ($BABELTRACE_MINIMAL_LOG_LEVEL): use VERBOSE, DEBUG, INFO, WARN, ERROR, FATAL, or NONE.])]
395 AC_DEFINE_UNQUOTED([BT_LOG_LEVEL], [BT_LOG_$BABELTRACE_MINIMAL_LOG_LEVEL], [Minimal log level])
397 # BABELTRACE_DEV_MODE:
398 AC_ARG_VAR([BABELTRACE_DEV_MODE], [Set to 1 to enable the Babeltrace developer mode (enables run-time checks for plugin developers)])
399 AS_IF([test "x$BABELTRACE_DEV_MODE" = x1], [
400 AS_IF([test "x$BABELTRACE_MINIMAL_LOG_LEVEL" = "xNONE"], [
401 AC_MSG_ERROR([Babeltrace developer mode (\$BABELTRACE_DEV_MODE) needs \$BABELTRACE_MINIMAL_LOG_LEVEL to be at least FATAL.])
403 AC_DEFINE([BT_DEV_MODE], 1, [Babeltrace developer mode])
404 ], [BABELTRACE_DEV_MODE=0])
406 # BABELTRACE_DEBUG_MODE:
407 AC_ARG_VAR([BABELTRACE_DEBUG_MODE], [Set to 1 to enable the Babeltrace debug mode (enables internal assertions for Babeltrace maintainers)])
408 AS_IF([test "x$BABELTRACE_DEBUG_MODE" = x1], [
409 AC_DEFINE([BT_DEBUG_MODE], 1, [Babeltrace debug mode])
410 ], [BABELTRACE_DEBUG_MODE=0])
414 ## Optionnal features selection ##
418 # Disabled by default
419 AC_ARG_ENABLE([python-bindings],
420 [AC_HELP_STRING([--enable-python-bindings], [build the Python bindings])],
421 [], dnl AC_ARG_ENABLE will fill enable_python_bindings with the user choice
422 [enable_python_bindings=no]
425 # Python bindings documentation
426 # Disabled by default
427 AC_ARG_ENABLE([python-bindings-doc],
428 [AC_HELP_STRING([--enable-python-bindings-doc], [build the Python bindings documentation])],
429 [], dnl AC_ARG_ENABLE will fill enable_python_bindings_doc with the user choice
430 [enable_python_bindings_doc=no]
434 # Disabled by default
435 AC_ARG_ENABLE([python-plugins],
436 [AC_HELP_STRING([--enable-python-plugins], [enable the Python plugins support for the library and converter])],
437 [], dnl AC_ARG_ENABLE will fill enable_python_plugins with the user choice
438 [enable_python_plugins=no]
442 # Enabled by default, except on some platforms
443 AC_ARG_ENABLE([debug-info],
444 [AC_HELP_STRING([--disable-debug-info], [disable the debug info support (default on macOS, Solaris and Windows)])],
445 [], dnl AC_ARG_ENABLE will fill enable_debug_info with the user choice
446 [enable_debug_info="$DEFAULT_ENABLE_DEBUG_INFO"]
450 # Disabled by default
451 AC_ARG_ENABLE([api-doc],
452 [AC_HELP_STRING([--enable-api-doc], [build the HTML API documentation])],
453 [enable_api_doc=$enableval],
458 # Disabled by default
459 AC_ARG_ENABLE([built-in-plugins],
460 [AC_HELP_STRING([--enable-built-in-plugins], [Statically-link in-tree plug-ins into the babeltrace binary])],
461 [], dnl AC_ARG_ENABLE will fill enable_built_in_plugins with the user choice
462 [enable_built_in_plugins=no]
465 # Built-in python plugin support
466 # Disabled by default
467 AC_ARG_ENABLE([built-in-python-plugin-support],
468 [AC_HELP_STRING([--enable-built-in-python-plugin-support], [Statically-link Python plugin support into the babeltrace library])],
469 [], dnl AC_ARG_ENABLE will fill enable_built_in_python_plugin_support with the user choice
470 [enable_built_in_python_plugin_support=no]
475 AC_ARG_ENABLE([man-pages],
476 [AS_HELP_STRING([--disable-man-pages], [Do not build and install man pages (already built in a distributed tarball])],
477 [], dnl AC_ARG_ENABLE will fill enable_built_in_plugins with the user choice
478 [enable_man_pages=yes]
482 # Set automake variables for optionnal feature conditionnals in Makefile.am
483 AM_CONDITIONAL([ENABLE_PYTHON_BINDINGS], [test "x$enable_python_bindings" = xyes])
484 AM_CONDITIONAL([ENABLE_PYTHON_BINDINGS_DOC], [test "x$enable_python_bindings_doc" = xyes])
485 AM_CONDITIONAL([ENABLE_PYTHON_PLUGINS], [test "x$enable_python_plugins" = xyes])
486 AM_CONDITIONAL([ENABLE_DEBUG_INFO], [test "x$enable_debug_info" = xyes])
487 AM_CONDITIONAL([ENABLE_API_DOC], [test "x$enable_api_doc" = xyes])
488 AM_CONDITIONAL([ENABLE_BUILT_IN_PLUGINS], [test "x$enable_built_in_plugins" = xyes])
489 AM_CONDITIONAL([ENABLE_BUILT_IN_PYTHON_PLUGIN_SUPPORT], [test "x$enable_built_in_python_plugin_support" = xyes])
490 AM_CONDITIONAL([ENABLE_MAN_PAGES], [test "x$enable_man_pages" = xyes])
493 # Set defines for optionnal features conditionnals in the source code
495 ## jgalar: still used?
496 AS_IF([test "x$enable_python_plugins" = xyes],
497 [AC_DEFINE([PYTHON_PLUGINS], [1], [Python plugin support.])]
500 AS_IF([test "x$enable_debug_info" = xyes],
501 [AC_DEFINE([ENABLE_DEBUG_INFO], [1], [Define to 1 if you enable the 'debug info' feature])]
504 AS_IF([test "x$enable_built_in_plugins" = xyes],
505 [AC_DEFINE([BT_BUILT_IN_PLUGINS], [1], [Define to 1 to register plug-in attributes in static executable sections])]
508 AS_IF([test "x$enable_built_in_python_plugin_support" = xyes],
509 [AC_DEFINE([BT_BUILT_IN_PYTHON_PLUGIN_SUPPORT], [1], [Define to 1 to register plug-in attributes in static executable sections])]
512 AS_IF([test "x$enable_debug_info" = xyes],
513 [ENABLE_DEBUG_INFO_VAL=1],
514 [ENABLE_DEBUG_INFO_VAL=0]
517 AC_SUBST([ENABLE_DEBUG_INFO_VAL])
520 # Check for conflicting optional features user choices
522 AS_IF([test "x$enable_python_bindings" = xno],
524 AS_IF([test "x$enable_python_bindings_doc" = xyes], [AC_MSG_ERROR([--enable-python-bindings-doc was specified without --enable-python-bindings])])
528 AS_IF([test "x$enable_built_in_plugins" = xyes],
530 # Built-in plug-ins are only available when the --disable-shared --enable-static options are used.
531 AS_IF([test "x$enable_static" != xyes], [AC_MSG_ERROR(--enable-static must be used to bundle plug-ins in the babeltrace executable)])
532 AS_IF([test "x$enable_shared" = xyes], [AC_MSG_ERROR(--disable-shared must be used to bundle plug-ins in the babeltrace executable)])
536 AS_IF([test "x$enable_built_in_python_plugin_support" = xyes],
538 AS_IF([test "x$enable_python_plugins" = xno], [AC_MSG_ERROR([--enable-python-plugins must be used to bundle Python plugin support in the babeltrace executable])])
539 # Built-in plug-ins are only available when the --disable-shared --enable-static options are used.
540 AS_IF([test "x$enable_static" != xyes], [AC_MSG_ERROR(--enable-static must be used to bundle Python plugin support in the babeltrace executable)])
541 AS_IF([test "x$enable_shared" = xyes], [AC_MSG_ERROR(--disable-shared must be used to bundle Python plugin support in the babeltrace executable)])
546 # Check for optionnal features dependencies
548 AS_IF([test "x$enable_python_bindings" = xyes],
549 [AX_PKG_SWIG(2.0.0, [], [AC_MSG_ERROR([SWIG 2.0.0 or newer is required to build the python bindings])])]
552 AS_IF([test "x$enable_python_bindings" = xyes || test "x$enable_python_plugins" = xyes],
554 AM_PATH_PYTHON([3.0], [], [AC_MSG_ERROR(Python 3 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.)])
556 AM_PATH_PYTHON_MODULES([PYTHON])
557 # pythondir is the path where extra modules are to be installed
558 pythondir=$PYTHON_PREFIX/$PYTHON_MODULES_PATH
559 # pyexecdir is the path that contains shared objects used by the extra modules
560 pyexecdir=$PYTHON_EXEC_PREFIX/$PYTHON_MODULES_PATH
561 AS_IF([test -z "$PYTHON_INCLUDE"], [
562 AS_IF([test -z "$PYTHON_CONFIG"], [
563 AC_PATH_PROGS([PYTHON_CONFIG],
564 [python$PYTHON_VERSION-config python-config],
567 AS_IF([test "$PYTHON_CONFIG" = no], [AC_MSG_ERROR([cannot find python-config for $PYTHON. Is python-dev installed?])])
569 AC_MSG_CHECKING([Python include flags])
570 PYTHON_INCLUDE=`$PYTHON_CONFIG --includes`
571 AC_MSG_RESULT([$PYTHON_INCLUDE])
573 AS_IF([test -z "$PYTHON_LIBS"], [
574 AS_IF([test -z "$PYTHON_CONFIG"], [
575 AC_PATH_PROGS([PYTHON_CONFIG],
576 [python$PYTHON_VERSION-config python-config],
579 AS_IF([test "$PYTHON_CONFIG" = no], [AC_MSG_ERROR([cannot find python-config for $PYTHON. Is python-dev installed?])])
581 AC_MSG_CHECKING([Python library flags])
582 PYTHON_LIBS=`$PYTHON_CONFIG --libs`
583 AC_MSG_RESULT([$PYTHON_LIBS])
588 AS_IF([test "x$enable_python_bindings_doc" = xyes],
590 AM_CHECK_PYTHON_SPHINX([PYTHON])
591 AS_IF([test "x$PYTHON_SPHINX_EXISTS" = xno],
592 [AC_MSG_ERROR([The Sphinx package for Python 3 is required to build the Python bindings documentation])]
597 AS_IF([test "x$enable_debug_info" = xyes],
599 # Check if libelf and libdw are present
600 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.)])
601 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.)])
602 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.)])
603 ELFUTILS_LIBS="-lelf -ldw"
606 AC_SUBST([ELFUTILS_LIBS])
608 AS_IF([test "x$enable_api_doc" = "xyes"],
610 DX_DOXYGEN_FEATURE(ON)
620 DX_INIT_DOXYGEN([Babeltrace], [$(srcdir)/Doxyfile], [output])
621 AS_IF([test -z "$DX_DOXYGEN"],
622 [AC_MSG_ERROR([You need doxygen to enable the API documentation])]
627 have_asciidoc_xmlto=no
628 warn_prebuilt_man_pages=no
630 AS_IF([test "x$enable_man_pages" = "xyes"], [
631 AC_PATH_PROG([ASCIIDOC], [asciidoc], [no])
632 AC_PATH_PROG([XMLTO], [xmlto], [no])
634 AS_IF([test "x$ASCIIDOC" = "xno" || test "x$XMLTO" = "xno"], [
635 AS_IF([test "x$in_git_repo" = "xyes"], [
636 # this is an error because we're in the Git repo, which
637 # means the man pages are not already generated for us,
638 # thus asciixmlto are required because we were asked
639 # to build the man pages
641 You need asciidoc and xmlto to build the Babeltrace man pages. Use
642 --disable-man-pages to disable building the man pages, in which case
643 they will not be installed.
646 # only warn here: since we're in the tarball, the man
647 # pages should already be generated at this point, thus
648 # asciidoc/xmlto are not strictly required
649 warn_prebuilt_man_pages=yes
652 have_asciidoc_xmlto=yes
656 # export AsciiDoc and xmlto existence
657 AM_CONDITIONAL([HAVE_ASCIIDOC_XMLTO], [test "x$have_asciidoc_xmlto" = "xyes"])
659 # a wonderful hack that seems necessary because $libdir is
660 # literally `${exec_prefix}/lib`, and $exec_prefix is set to `NONE`
661 # by autoconf when it's not specified by the user
662 AS_IF([test "x$exec_prefix" = xNONE], [
663 AS_IF([test "x$prefix" = xNONE], [
664 PREFIX="$ac_default_prefix"
677 # Set global CFLAGS in AM_CFLAGS
678 AM_CFLAGS="-Wall -Wformat $PTHREAD_CFLAGS $GLIB_CFLAGS"
681 # Set global CPPFLAGS in AM_CPPFLAGS
682 AM_CPPFLAGS="-I\$(top_builddir)/include -I\$(top_srcdir)/include -include config.h"
683 AC_SUBST(AM_CPPFLAGS)
685 # Add glib to global link libs
686 LIBS="$LIBS $GLIB_LIBS"
688 # Check that the current size_t matches the size that glib thinks it should
689 # be. This catches problems on multi-arch where people try to do a 32-bit
690 # build while pointing at 64-bit glib headers. This is a common error because
691 # glib.h is not platform specific but it includes glibconfig.h which is and
692 # is usually installed in a non-standard path.
694 # Older versions of the pkg-config macros disallows PKG_* in the autoconf
695 # output. Specifically allow pkg_config_libdir to be able to print the
697 m4_pattern_allow([PKG_CONFIG_LIBDIR])
699 save_CFLAGS=${CFLAGS}
700 CFLAGS="${CFLAGS} ${AM_CFLAGS}"
706 G_STATIC_ASSERT(sizeof(size_t) == GLIB_SIZEOF_SIZE_T);
710 sizeof(size_t) doesn't match GLIB_SIZEOF_SIZE_T. You probably need to set
711 PKG_CONFIG_LIBDIR to point to the right pkg-config files for your build
715 CFLAGS=${save_CFLAGS}
717 # Abuse autoconf's AC_ARG_PROGRAM output variable 'program_transform_name'
718 # to rename babeltrace.bin to babeltrace at install time.
719 program_transform_name="s&babeltrace\.bin&babeltrace&;s&babeltrace-log\.bin&babeltrace-log&;$program_transform_name"
720 AC_SUBST(program_transform_name)
724 bindings/python/Makefile
725 bindings/python/babeltrace/Makefile
726 bindings/python/babeltrace/setup.py
727 bindings/python/babeltrace/babeltrace/__init__.py
728 bindings/python/bt2/Makefile
729 bindings/python/bt2/setup.py
730 bindings/python/bt2/bt2/__init__.py
737 doc/bindings/Makefile
738 doc/bindings/python/Makefile
739 doc/contributing-images/Makefile
741 doc/man/asciidoc-attrs.conf
743 lib/prio_heap/Makefile
746 lib/graph/message/Makefile
747 lib/trace-ir/Makefile
748 lib/ctf-writer/Makefile
754 tests/cli/intersection/Makefile
756 tests/lib/test-plugin-plugins/Makefile
757 tests/lib/trace-ir/Makefile
758 tests/lib/ctf-writer/Makefile
759 tests/utils/common.sh
761 tests/utils/tap/Makefile
762 tests/bindings/Makefile
763 tests/bindings/python/Makefile
764 tests/bindings/python/bt2/Makefile
765 tests/bindings/python/babeltrace/Makefile
766 tests/plugins/Makefile
767 tests/python-plugin-provider/Makefile
769 extras/valgrind/Makefile
772 plugins/ctf/common/Makefile
773 plugins/ctf/common/bfcr/Makefile
774 plugins/ctf/common/metadata/Makefile
775 plugins/ctf/common/msg-iter/Makefile
776 plugins/ctf/common/utils/Makefile
777 plugins/ctf/fs-src/Makefile
778 plugins/ctf/fs-sink/Makefile
779 plugins/ctf/lttng-live/Makefile
780 plugins/text/Makefile
781 plugins/text/dmesg/Makefile
782 plugins/text/pretty/Makefile
783 plugins/utils/Makefile
784 plugins/utils/dummy/Makefile
785 plugins/utils/counter/Makefile
786 plugins/utils/trimmer/Makefile
787 plugins/utils/muxer/Makefile
788 python-plugin-provider/Makefile
789 plugins/libctfcopytrace/Makefile
790 plugins/lttng-utils/Makefile
795 AC_CONFIG_FILES([tests/cli/intersection/test_intersection], [chmod +x tests/cli/intersection/test_intersection])
796 AC_CONFIG_FILES([tests/cli/test_convert_args], [chmod +x tests/cli/test_convert_args])
797 AC_CONFIG_FILES([tests/cli/test_packet_seq_num], [chmod +x tests/cli/test_packet_seq_num])
798 AC_CONFIG_FILES([tests/cli/test_trace_copy], [chmod +x tests/cli/test_trace_copy])
799 AC_CONFIG_FILES([tests/cli/test_trace_read], [chmod +x tests/cli/test_trace_read])
800 AC_CONFIG_FILES([tests/cli/test_trimmer], [chmod +x tests/cli/test_trimmer])
801 AC_CONFIG_FILES([tests/lib/test_ctf_writer_complete], [chmod +x tests/lib/test_ctf_writer_complete])
802 AC_CONFIG_FILES([tests/lib/test_plugin_complete], [chmod +x tests/lib/test_plugin_complete])
803 AC_CONFIG_FILES([tests/lib/trace-ir/test_trace_ir], [chmod +x tests/lib/trace-ir/test_trace_ir])
804 AC_CONFIG_FILES([tests/lib/ctf-writer/test_ctf_writer], [chmod +x tests/lib/ctf-writer/test_ctf_writer])
805 AC_CONFIG_FILES([tests/plugins/test-utils-muxer-complete], [chmod +x tests/plugins/test-utils-muxer-complete])
806 AC_CONFIG_FILES([tests/plugins/test_lttng_utils_debug_info], [chmod +x tests/plugins/test_lttng_utils_debug_info])
807 AC_CONFIG_FILES([tests/plugins/test_dwarf_complete], [chmod +x tests/plugins/test_dwarf_complete])
808 AC_CONFIG_FILES([tests/plugins/test_bin_info_complete], [chmod +x tests/plugins/test_bin_info_complete])
810 AS_IF([test "x$enable_python_bindings" = xyes],
812 AC_CONFIG_FILES([tests/bindings/python/bt2/test_python_bt2], [chmod +x tests/bindings/python/bt2/test_python_bt2])
813 AC_CONFIG_FILES([tests/bindings/python/babeltrace/test_python_babeltrace], [chmod +x tests/bindings/python/babeltrace/test_python_babeltrace])
817 AS_IF([test "x$enable_python_plugins" = "xyes"],
818 [AC_CONFIG_FILES([tests/python-plugin-provider/test_python_plugin_provider], [chmod +x tests/python-plugin-provider/test_python_plugin_provider])]
824 # Mini-report on what will be built.
832 AS_ECHO("${PPRINT_COLOR_BLDBLU}Babeltrace $PACKAGE_VERSION$PPRINT_COLOR_RST")
835 PPRINT_SUBTITLE([System])
837 # Target architecture we're building for.
838 target_arch=$host_cpu
841 if test $f = "-m32"; then
843 elif test $f = "-m64"; then
849 PPRINT_PROP_STRING([Target architecture], $target_arch)
852 PPRINT_SUBTITLE([Python 3 language support])
853 test "x$enable_python_bindings" = "xyes" && value=1 || value=0
854 PPRINT_PROP_BOOL([Python bindings], $value)
855 test "x$enable_python_plugins" = "xyes" && value=1 || value=0
856 PPRINT_PROP_BOOL([Python plugin support], $value)
857 AS_IF([test "x$enable_python_bindings" = "xyes" || test "x$enable_python_plugins" = "xyes"], [
858 PPRINT_PROP_STRING([Python include paths], [$PYTHON_INCLUDE])
859 PPRINT_PROP_STRING([Python libraries], [$PYTHON_LIBS])
863 PPRINT_SUBTITLE([Plugins])
864 PPRINT_PROP_BOOL(['ctf' plugin], 1)
865 test "x$enable_debug_info" = "xyes" && value=1 || value=0
866 PPRINT_PROP_BOOL(['lttng-utils' plugin], $value)
867 PPRINT_PROP_BOOL(['text' plugin], 1)
868 PPRINT_PROP_BOOL(['utils' plugin], 1)
871 PPRINT_SUBTITLE([Built-in features])
872 test "x$enable_built_in_plugins" = "xyes" && value=1 || value=0
873 PPRINT_PROP_BOOL([Built-in plugins], $value)
874 test "x$enable_built_in_python_plugin_support" = "xyes" && value=1 || value=0
875 PPRINT_PROP_BOOL([Built-in Python plugin support], $value)
878 PPRINT_SUBTITLE([Documentation])
880 # man pages build enabled/disabled
881 m4_pushdef([build_man_pages_msg], [Build and install man pages])
883 AS_IF([test "x$enable_man_pages" != "xno"], [
884 AS_IF([test "x$in_git_repo" = "xyes"], [
885 PPRINT_PROP_BOOL([build_man_pages_msg], 1)
887 AS_IF([test "x$have_asciidoc_xmlto" = "xyes"], [
888 PPRINT_PROP_BOOL([build_man_pages_msg], 1)
890 PPRINT_PROP_STRING([build_man_pages_msg],
891 [${PPRINT_COLOR_BLDGRN}yes (already built)],
892 $PPRINT_COLOR_SUBTITLE)
896 PPRINT_PROP_BOOL([build_man_pages_msg], 0)
899 m4_popdef([build_man_pages_msg])
901 test "x$enable_api_doc" = "xyes" && value=1 || value=0
902 PPRINT_PROP_BOOL([HTML API documentation], $value)
903 test "x$enable_python_bindings_doc" = "xyes" && value=1 || value=0
904 PPRINT_PROP_BOOL([Python bindings documentation], $value)
907 PPRINT_SUBTITLE([Logging])
908 PPRINT_PROP_STRING([Minimal log level], $BABELTRACE_MINIMAL_LOG_LEVEL)
911 PPRINT_SUBTITLE([Special build modes])
912 PPRINT_PROP_BOOL([Debug mode], $BABELTRACE_DEBUG_MODE)
913 PPRINT_PROP_BOOL([Developer mode], $BABELTRACE_DEV_MODE)
915 report_bindir="`eval eval echo $bindir`"
916 report_libdir="`eval eval echo $libdir`"
917 report_sysconfdif="`eval eval echo $sysconfdir`"
919 # Print the bindir and libdir this `make install' will install into.
921 PPRINT_SUBTITLE([Install directories])
922 PPRINT_PROP_STRING([Binaries], [$report_bindir])
923 PPRINT_PROP_STRING([Libraries], [$report_libdir])
924 PPRINT_PROP_STRING([Plugins], [$report_libdir/babeltrace/plugins])
925 PPRINT_PROP_STRING([Configuration], [$report_sysconfdif])