From 18c9df91589153674cf2f156e0f80f4b617b75e1 Mon Sep 17 00:00:00 2001 From: Francis Deslauriers Date: Thu, 27 Feb 2020 16:51:38 -0500 Subject: [PATCH] Cleanup: configure.ac: remove redundant `AC_ARG_ENABLE` parameters According to the documentation [1], the last parameter of the `AC_ARG_ENABLE()` macro (`action-if-not-given`) is executed only if neither `--enable-foo` nor `--disable-foo` is provided. So in cases where the feature is disabled by default, there is no need to turn if off explicitly in the `action-if-not-given` parameter as the macro will simply not set the `enable_foo` to `yes`. Also, I fixed up the comment for the `enable_man_pages` variable. [1] https://www.gnu.org/software/autoconf/manual/autoconf-2.66/html_node/Package-Options.html Signed-off-by: Francis Deslauriers Change-Id: I7416bed88ed1e719ef896f0ca0117b382d99f68f Reviewed-on: https://review.lttng.org/c/babeltrace/+/3151 Tested-by: jenkins Reviewed-by: Michael Jeanson --- configure.ac | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/configure.ac b/configure.ac index a7a094a4..02f4b7ca 100644 --- a/configure.ac +++ b/configure.ac @@ -361,17 +361,15 @@ AS_IF([test "x$BABELTRACE_DEBUG_MODE" = x1], [ # Python bindings # Disabled by default AC_ARG_ENABLE([python-bindings], - [AC_HELP_STRING([--enable-python-bindings], [build the Python bindings])], - [], dnl AC_ARG_ENABLE will fill enable_python_bindings with the user choice - [enable_python_bindings=no] + [AC_HELP_STRING([--enable-python-bindings], [build the Python bindings])] + dnl AC_ARG_ENABLE will fill enable_python_bindings with the user choice ) # Python plugins # Disabled by default AC_ARG_ENABLE([python-plugins], - [AC_HELP_STRING([--enable-python-plugins], [enable the Python plugins support for the library and converter])], - [], dnl AC_ARG_ENABLE will fill enable_python_plugins with the user choice - [enable_python_plugins=no] + [AC_HELP_STRING([--enable-python-plugins], [enable the Python plugins support for the library and converter])] + dnl AC_ARG_ENABLE will fill enable_python_plugins with the user choice ) # Debug info @@ -386,31 +384,28 @@ AC_ARG_ENABLE([debug-info], # Disabled by default AC_ARG_ENABLE([api-doc], [AC_HELP_STRING([--enable-api-doc], [build the HTML API documentation])], - [enable_api_doc=$enableval], - [enable_api_doc=no] + [enable_api_doc=$enableval] ) # Built-in plugins # Disabled by default AC_ARG_ENABLE([built-in-plugins], - [AC_HELP_STRING([--enable-built-in-plugins], [Statically-link in-tree plug-ins into the babeltrace2 executable])], - [], dnl AC_ARG_ENABLE will fill enable_built_in_plugins with the user choice - [enable_built_in_plugins=no] + [AC_HELP_STRING([--enable-built-in-plugins], [Statically-link in-tree plug-ins into the babeltrace2 executable])] + dnl AC_ARG_ENABLE will fill enable_built_in_plugins with the user choice ) # Built-in python plugin support # Disabled by default AC_ARG_ENABLE([built-in-python-plugin-support], - [AC_HELP_STRING([--enable-built-in-python-plugin-support], [Statically-link Python plugin support into the babeltrace library])], - [], dnl AC_ARG_ENABLE will fill enable_built_in_python_plugin_support with the user choice - [enable_built_in_python_plugin_support=no] + [AC_HELP_STRING([--enable-built-in-python-plugin-support], [Statically-link Python plugin support into the babeltrace library])] + dnl AC_ARG_ENABLE will fill enable_built_in_python_plugin_support with the user choice ) # Man pages # Enabled by default AC_ARG_ENABLE([man-pages], [AS_HELP_STRING([--disable-man-pages], [Do not build and install man pages (already built in a distributed tarball])], - [], dnl AC_ARG_ENABLE will fill enable_built_in_plugins with the user choice + [], dnl AC_ARG_ENABLE will fill enable_man_pages with the user choice [enable_man_pages=yes] ) @@ -464,7 +459,7 @@ AS_IF([test "x$enable_built_in_plugins" = xyes], AS_IF([test "x$enable_built_in_python_plugin_support" = xyes], [ - AS_IF([test "x$enable_python_plugins" = xno], [AC_MSG_ERROR([--enable-python-plugins must be used to bundle Python plugin support in the babeltrace2 executable])]) + AS_IF([test "x$enable_python_plugins" != xyes], [AC_MSG_ERROR([--enable-python-plugins must be used to bundle Python plugin support in the babeltrace2 executable])]) # Built-in plug-ins are only available when the --disable-shared --enable-static options are used. AS_IF([test "x$enable_static" != xyes], [AC_MSG_ERROR(--enable-static must be used to bundle Python plugin support in the babeltrace2 executable)]) AS_IF([test "x$enable_shared" = xyes], [AC_MSG_ERROR(--disable-shared must be used to bundle Python plugin support in the babeltrace2 executable)]) -- 2.34.1