+AC_DEFINE_UNQUOTED([BT_MINIMAL_LOG_LEVEL], [BT_LOG_$BABELTRACE_MINIMAL_LOG_LEVEL], [Minimal log level])
+
+# BABELTRACE_DEV_MODE:
+AC_ARG_VAR([BABELTRACE_DEV_MODE], [Set to 1 to enable the Babeltrace developer mode (enables run-time checks for plugin developers)])
+AS_IF([test "x$BABELTRACE_DEV_MODE" = x1], [
+ AC_DEFINE([BT_DEV_MODE], 1, [Babeltrace developer mode])
+], [BABELTRACE_DEV_MODE=0])
+AM_CONDITIONAL([DEV_MODE], [test "x$BABELTRACE_DEV_MODE" = x1])
+
+# BABELTRACE_DEBUG_MODE:
+AC_ARG_VAR([BABELTRACE_DEBUG_MODE], [Set to 1 to enable the Babeltrace debug mode (enables internal assertions for Babeltrace maintainers)])
+AS_IF([test "x$BABELTRACE_DEBUG_MODE" = x1], [
+ AC_DEFINE([BT_DEBUG_MODE], 1, [Babeltrace debug mode])
+], [BABELTRACE_DEBUG_MODE=0])
+
+
+## ##
+## Optionnal features selection ##
+## ##
+
+# Python bindings
+# Disabled by default
+AE_FEATURE_DEFAULT_DISABLE
+AE_FEATURE([python-bindings],[build the Python bindings])
+
+# Python bindings documentation
+# Disabled by default
+AE_FEATURE_DEFAULT_DISABLE
+AE_FEATURE([python-bindings-doc],[build the Python bindings documentation])
+
+# Python plugins
+# Disabled by default
+AE_FEATURE_DEFAULT_DISABLE
+AE_FEATURE([python-plugins],[enable the Python plugins support for the library and converter])
+
+# Debug info
+# Enabled by default, except on some platforms
+AE_FEATURE_DEFAULT_ENABLE
+AE_FEATURE([debug-info],[disable the debug info support (default on macOS, Solaris and Windows)])
+
+# API documentation
+# Disabled by default
+AE_FEATURE_DEFAULT_DISABLE
+AE_FEATURE([api-doc],[build the HTML API documentation])
+
+# Built-in plugins
+# Disabled by default
+AE_FEATURE_DEFAULT_DISABLE
+AE_FEATURE([built-in-plugins],[Statically-link in-tree plug-ins into the babeltrace2 executable])
+
+# Built-in python plugin support
+# Disabled by default
+AE_FEATURE_DEFAULT_DISABLE
+AE_FEATURE([built-in-python-plugin-support],[Statically-link Python plugin support into the babeltrace library])
+
+# Man pages
+# Enabled by default
+AE_FEATURE_DEFAULT_ENABLE
+AE_FEATURE([man-pages],[Do not build and install man pages (already built in a distributed tarball])
+
+# When given, add -Werror to WARN_CFLAGS and WARN_CXXFLAGS.
+# Disabled by default
+AE_FEATURE_DEFAULT_DISABLE
+AE_FEATURE([Werror],[Treat compiler warnings as errors.])
+
+
+## ##
+## Check for conflicting features selection ##
+## ##
+
+# Check for conflicting Python related features user choices.
+AE_IF_FEATURE_ENABLED([python-plugins], [
+ AE_IF_FEATURE_UNDEF([python-bindings], [
+ # --enable-python-plugins was provided but --enable-python-bindings was
+ # omitted. Turn the Python bindings ON anyway because it's needed to
+ # use the Python plugins.
+ AE_FEATURE_ENABLE([python-bindings])
+ ], [
+ AE_IF_FEATURE_DISABLED([python-bindings], [
+ # --enable-python-plugins _and_ --disable-python-bindings were
+ # used. This is invalid because Python plugins need the Python
+ # bindings to be useful.
+ AC_MSG_ERROR(--enable-python-bindings must be used to support Python plugins)
+ ])
+ ])
+])