[lttng-dev] [PATCH] Fix: debug-info feature enable/disable

Philippe Proulx eeppeliteloop at gmail.com
Fri May 6 16:04:09 UTC 2016


On Fri, May 6, 2016 at 11:47 AM, Mathieu Desnoyers
<mathieu.desnoyers at efficios.com> wrote:
> Explicitly enabling the debug-info feature should not disable the
> feature.
>
> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>
> ---
>  configure.ac | 19 ++++++++++++++-----

I guess this is for Babeltrace, but it's hard to tell without the
usual [PATCH babeltrace] subject prefix!

>  1 file changed, 14 insertions(+), 5 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index db0adb6..bc34272 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -278,11 +278,20 @@ if test "x${enable_python_bindings_doc:-yes}" = xyes; then
>      )
>  fi
>
> -# Optional debuginfo feature (enabled by default)
> -AS_IF([test "x$DEFAULT_ENABLE_DEBUGINFO" = xyes],
> -    [AC_ARG_ENABLE([debug-info], [AC_HELP_STRING([--disable-debug-info], [disable the debug-info feature (default on OS X and Solaris)])], [], [enable_debuginfo=yes])],
> -    [AC_ARG_ENABLE([debug-info], [AC_HELP_STRING([--enable-debug-info], [enable the debug-info feature (default on Linux)])], [], [enable_debuginfo=no])]
> -)
> +# Set default enable state for debug info
> +if test "x$DEFAULT_ENABLE_DEBUGINFO" = xyes; then
> +       enable_debuginfo=yes
> +else
> +       enable_debuginfo=no
> +fi

You should use AS_IF().

Otherwise you can use this form:

    test "x$DEFAULT_ENABLE_DEBUGINFO" = xyes && enable_debuginfo=yes
|| enable_debuginfo=no

> +
> +# Optional debuginfo feature
> +# Do _not_ indent the help string below (appears in the configure --help
> +# output).
> +AC_ARG_ENABLE([debug-info],
> +[AC_HELP_STRING([--enable-debug-info], [enable the debug-info feature (default on Linux)])]
> +[AC_HELP_STRING([--disable-debug-info], [disable the debug-info feature (default on OS X and Solaris)])],

I know this is unrelated to this patch, but what about a
better description than "debug-info", like
"enable printing debugging information"?

> +       [ if test "x$enableval" = xyes; then enable_debuginfo=yes; else enable_debuginfo=no; fi ], [] )

You should use AS_IF(), or the aforementioned alternative form.

Phil

>
>  AM_CONDITIONAL([ENABLE_DEBUGINFO], [test "x$enable_debuginfo" = xyes])
>  AS_IF([test "x$enable_debuginfo" = xyes], [
> --
> 2.1.4
>
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev


More information about the lttng-dev mailing list