Cleanup: configure.ac: remove redundant `AC_ARG_ENABLE` parameters
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Thu, 27 Feb 2020 21:51:38 +0000 (16:51 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 2 Mar 2020 19:56:58 +0000 (14:56 -0500)
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 <francis.deslauriers@efficios.com>
Change-Id: I7416bed88ed1e719ef896f0ca0117b382d99f68f
Reviewed-on: https://review.lttng.org/c/babeltrace/+/3151
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Michael Jeanson <mjeanson@efficios.com>
configure.ac

index a7a094a411d5d558f7ce633f0847dc1efaa57104..02f4b7cac461baf851e47bc088ea0f9e187a8e7f 100644 (file)
@@ -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)])
This page took 0.025749 seconds and 4 git commands to generate.