-# Set automake variables for optionnal feature conditionnals in Makefile.am
-AM_CONDITIONAL([ENABLE_PYTHON_BINDINGS], [test "x$enable_python_bindings" = xyes])
-AM_CONDITIONAL([ENABLE_PYTHON_BINDINGS_DOC], [test "x$enable_python_bindings_doc" = xyes])
-AM_CONDITIONAL([ENABLE_PYTHON_PLUGINS], [test "x$enable_python_plugins" = xyes])
-AM_CONDITIONAL([ENABLE_DEBUG_INFO], [test "x$enable_debug_info" = xyes])
-AM_CONDITIONAL([ENABLE_API_DOC], [test "x$enable_api_doc" = xyes])
-AM_CONDITIONAL([ENABLE_BUILT_IN_PLUGINS], [test "x$enable_built_in_plugins" = xyes])
-AM_CONDITIONAL([ENABLE_BUILT_IN_PYTHON_PLUGIN_SUPPORT], [test "x$enable_built_in_python_plugin_support" = xyes])
-AM_CONDITIONAL([ENABLE_MAN_PAGES], [test "x$enable_man_pages" = xyes])
-AM_CONDITIONAL([ENABLE_PYTHON_COMMON_DEPS], [test "x$enable_python_bindings" = xyes || test "x$enable_python_plugins" = xyes])
+# When given, build with AddressSanitizer.
+AE_FEATURE_DEFAULT_DISABLE
+AE_FEATURE([asan],[Build with AddressSanitizer.])
-AS_IF([test "x$enable_debug_info" = xyes],
- [
- # Check if libelf and libdw are present
- 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.)])
- 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.)])
- 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.)])
- ELFUTILS_LIBS="-lelf -ldw"
- ]
-)
+AE_IF_FEATURE_ENABLED([debug-info], [
+ # Check if libelf and libdw are present
+ PKG_CHECK_MODULES([ELFUTILS], [libelf >= 0.154 libdw >= 0.154],
+ [
+ dnl PKG_CHECK_MODULES defines ELFUTILS_LIBS
+ ],
+ [
+ AC_MSG_WARN([pkg-config was unable to find a valid .pc for libelf/libdw. Set PKG_CONFIG_PATH to specify the pkg-config configuration file location.])
+
+ # Turns out SLES12 doesn't bother shipping .pc file for libelf
+ AC_MSG_WARN([Finding libelf without pkg-config.])
+ 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.)])
+ 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.)])
+ AE_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.)])
+ ELFUTILS_LIBS="-lelf -ldw"
+ ])
+])
+m4_define([WARN_FLAGS_LIST], [ dnl
+ -Wall dnl
+ -Wextra dnl
+ -Wmissing-prototypes dnl
+ -Wmissing-declarations dnl
+ -Wnull-dereference dnl
+ -Wundef dnl
+ -Wredundant-decls dnl
+ -Wshadow dnl
+ -Wjump-misses-init dnl
+ -Wsuggest-attribute=format dnl
+ -Wtautological-constant-out-of-range-compare dnl
+ -Wnested-externs dnl
+ -Wwrite-strings dnl
+ -Wformat=2 dnl
+ -Wstrict-aliasing dnl
+ -Wmissing-noreturn dnl
+ -Winit-self dnl
+ -Wduplicated-cond dnl
+ -Wduplicated-branches dnl
+ -Wlogical-op dnl
+ -Wno-unused-parameter dnl
+ -Wno-sign-compare dnl
+ dnl
+ dnl Some versions of SWIG (like 3.0.12) generate code that produces
+ dnl -Wcast-function-type warnings. This warning is present in gcc >= 8. This
+ dnl combo happens on RHEL/Centos 8, for example. Later versions of SWIG (like
+ dnl 4.0.1) have the correct function signatures to not produce this warning.
+ dnl It's simpler to just disable the warning globally.
+ dnl
+ dnl Note that the Debian/Ubuntu SWIG package 3.0.12-2 contains a local patch to
+ dnl fix this (python-fix-function-cast-warnings.patch), so you won't be able to
+ dnl reproduce the warning using that package.
+ dnl
+ dnl Ref: https://github.com/swig/swig/issues/1259
+ -Wno-cast-function-type dnl
+ -Wno-missing-field-initializers dnl
+])
+
-AX_APPEND_COMPILE_FLAGS([ dnl
- -Wall dnl
- -Wextra dnl
- -Wmissing-prototypes dnl
- -Wmissing-declarations dnl
- -Wnull-dereference dnl
- -Wundef dnl
- -Wredundant-decls dnl
- -Wshadow dnl
- -Wjump-misses-init dnl
- -Wsuggest-attribute=format dnl
- -Wtautological-constant-out-of-range-compare dnl
- -Wnested-externs dnl
- -Wwrite-strings dnl
- -Wformat=2 dnl
- -Wstrict-aliasing dnl
- -Wmissing-noreturn dnl
- -Winit-self dnl
- -Wduplicated-cond dnl
- -Wduplicated-branches dnl
- -Wlogical-op dnl
- -Wno-unused-parameter dnl
- -Wno-sign-compare dnl
- dnl
- dnl Some versions of SWIG (like 3.0.12) generate code that produces
- dnl -Wcast-function-type warnings. This warning is present in gcc >= 8. This
- dnl combo happens on RHEL/Centos 8, for example. Later versions of SWIG (like
- dnl 4.0.1) have the correct function signatures to not produce this warning.
- dnl It's simpler to just disable the warning globally.
- dnl
- dnl Note that the Debian/Ubuntu SWIG package 3.0.12-2 contains a local patch to
- dnl fix this (python-fix-function-cast-warnings.patch), so you won't be able to
- dnl reproduce the warning using that package.
- dnl
- dnl Ref: https://github.com/swig/swig/issues/1259
- -Wno-cast-function-type dnl
- -Wno-missing-field-initializers dnl
- ],
- [WARN_CFLAGS],
- [-Werror])
-
-# When given, add -Werror to WARN_CFLAGS.
-AC_ARG_ENABLE([Werror],
- [AS_HELP_STRING([--enable-Werror], [Treat compiler warnings as errors.])]
-)
-AS_IF([test "x$enable_Werror" = "xyes"],
- [WARN_CFLAGS="${WARN_CFLAGS} -Werror"]
-)
+AC_LANG([C++])
+AX_APPEND_COMPILE_FLAGS([WARN_FLAGS_LIST], [WARN_CXXFLAGS], [-Werror])
+AC_LANG([C])
+AX_APPEND_COMPILE_FLAGS([WARN_FLAGS_LIST], [WARN_CFLAGS], [-Werror])
+
+AE_IF_FEATURE_ENABLED([Werror], [WARN_CXXFLAGS="${WARN_CXXFLAGS} -Werror"])
+AE_IF_FEATURE_ENABLED([Werror], [WARN_CFLAGS="${WARN_CFLAGS} -Werror"])
- doc/api/Makefile
- doc/api/libbabeltrace2/Doxyfile
- doc/api/libbabeltrace2/Makefile
- doc/bindings/Makefile
- doc/bindings/python/Makefile
- doc/contributing-images/Makefile
- doc/Makefile
- doc/man/asciidoc-attrs.conf
- doc/man/Makefile
- include/Makefile
- Makefile
- src/argpar/Makefile
- src/autodisc/Makefile
- src/babeltrace2-ctf-writer.pc
- src/babeltrace2.pc
- src/bindings/Makefile
- src/bindings/python/bt2/bt2/version.py
- src/bindings/python/bt2/Makefile
- src/bindings/python/bt2/setup.py
- src/bindings/python/Makefile
- src/cli/Makefile
- src/common/Makefile
- src/compat/Makefile
- src/ctfser/Makefile
- src/ctf-writer/Makefile
- src/fd-cache/Makefile
- src/lib/graph/Makefile
- src/lib/graph/message/Makefile
- src/lib/Makefile
- src/lib/plugin/Makefile
- src/lib/prio-heap/Makefile
- src/lib/trace-ir/Makefile
- src/logging/Makefile
- src/Makefile
- src/plugins/common/Makefile
- src/plugins/common/muxing/Makefile
- src/plugins/common/param-validation/Makefile
- src/plugins/ctf/common/bfcr/Makefile
- src/plugins/ctf/common/Makefile
- src/plugins/ctf/common/metadata/Makefile
- src/plugins/ctf/common/msg-iter/Makefile
- src/plugins/ctf/fs-sink/Makefile
- src/plugins/ctf/fs-src/Makefile
- src/plugins/ctf/lttng-live/Makefile
- src/plugins/ctf/Makefile
- src/plugins/lttng-utils/debug-info/Makefile
- src/plugins/lttng-utils/Makefile
- src/plugins/Makefile
- src/plugins/text/dmesg/Makefile
- src/plugins/text/Makefile
- src/plugins/text/pretty/Makefile
- src/plugins/text/details/Makefile
- src/plugins/utils/counter/Makefile
- src/plugins/utils/dummy/Makefile
- src/plugins/utils/Makefile
- src/plugins/utils/muxer/Makefile
- src/plugins/utils/trimmer/Makefile
- src/py-common/Makefile
- src/python-plugin-provider/Makefile
- src/param-parse/Makefile
- src/string-format/Makefile
- tests/bitfield/Makefile
- tests/ctf-writer/Makefile
- tests/lib/Makefile
- tests/lib/test-plugin-plugins/Makefile
- tests/lib/conds/Makefile
- tests/Makefile
- tests/param-validation/Makefile
- tests/plugins/Makefile
- tests/plugins/src.ctf.fs/Makefile
- tests/plugins/src.ctf.fs/succeed/Makefile
- tests/plugins/sink.ctf.fs/Makefile
- tests/plugins/sink.ctf.fs/succeed/Makefile
- tests/plugins/flt.lttng-utils.debug-info/Makefile
- tests/plugins/flt.utils.muxer/Makefile
- tests/plugins/flt.utils.muxer/succeed/Makefile
- tests/plugins/flt.utils.trimmer/Makefile
- tests/plugins/sink.text.pretty/Makefile
- tests/utils/Makefile
- tests/utils/tap/Makefile
+ doc/api/Makefile
+ doc/api/libbabeltrace2/Doxyfile
+ doc/api/libbabeltrace2/Makefile
+ doc/bindings/Makefile
+ doc/bindings/python/Makefile
+ doc/contributing-images/Makefile
+ doc/Makefile
+ doc/man/asciidoc-attrs.conf
+ doc/man/Makefile
+ include/Makefile
+ Makefile
+ src/argpar/Makefile
+ src/autodisc/Makefile
+ src/babeltrace2-ctf-writer.pc
+ src/babeltrace2.pc
+ src/bindings/Makefile
+ src/bindings/python/bt2/bt2/version.py
+ src/bindings/python/bt2/Makefile
+ src/bindings/python/bt2/setup.py
+ src/bindings/python/Makefile
+ src/cli/Makefile
+ src/common/Makefile
+ src/compat/Makefile
+ src/ctfser/Makefile
+ src/ctf-writer/Makefile
+ src/fd-cache/Makefile
+ src/lib/graph/Makefile
+ src/lib/graph/message/Makefile
+ src/lib/Makefile
+ src/lib/plugin/Makefile
+ src/lib/prio-heap/Makefile
+ src/lib/trace-ir/Makefile
+ src/logging/Makefile
+ src/Makefile
+ src/plugins/common/Makefile
+ src/plugins/common/muxing/Makefile
+ src/plugins/common/param-validation/Makefile
+ src/plugins/ctf/common/bfcr/Makefile
+ src/plugins/ctf/common/Makefile
+ src/plugins/ctf/common/metadata/Makefile
+ src/plugins/ctf/common/msg-iter/Makefile
+ src/plugins/ctf/fs-sink/Makefile
+ src/plugins/ctf/fs-src/Makefile
+ src/plugins/ctf/lttng-live/Makefile
+ src/plugins/ctf/Makefile
+ src/plugins/lttng-utils/debug-info/Makefile
+ src/plugins/lttng-utils/Makefile
+ src/plugins/Makefile
+ src/plugins/text/dmesg/Makefile
+ src/plugins/text/Makefile
+ src/plugins/text/pretty/Makefile
+ src/plugins/text/details/Makefile
+ src/plugins/utils/counter/Makefile
+ src/plugins/utils/dummy/Makefile
+ src/plugins/utils/Makefile
+ src/plugins/utils/muxer/Makefile
+ src/plugins/utils/trimmer/Makefile
+ src/py-common/Makefile
+ src/python-plugin-provider/Makefile
+ src/param-parse/Makefile
+ src/string-format/Makefile
+ tests/bitfield/Makefile
+ tests/ctf-writer/Makefile
+ tests/lib/Makefile
+ tests/lib/test-plugin-plugins/Makefile
+ tests/lib/conds/Makefile
+ tests/Makefile
+ tests/param-validation/Makefile
+ tests/plugins/Makefile
+ tests/plugins/src.ctf.fs/Makefile
+ tests/plugins/src.ctf.fs/succeed/Makefile
+ tests/plugins/sink.ctf.fs/Makefile
+ tests/plugins/sink.ctf.fs/succeed/Makefile
+ tests/plugins/flt.lttng-utils.debug-info/Makefile
+ tests/plugins/flt.utils.muxer/Makefile
+ tests/plugins/flt.utils.muxer/succeed/Makefile
+ tests/plugins/flt.utils.trimmer/Makefile
+ tests/plugins/sink.text.pretty/Makefile
+ tests/utils/Makefile
+ tests/utils/tap/Makefile