autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AC_ARG_WITH


From: Stepan Kasal
Subject: Re: AC_ARG_WITH
Date: Thu, 21 Oct 2004 09:32:48 +0200
User-agent: Mutt/1.4.1i

Hello,

On Thu, Oct 21, 2004 at 04:53:06PM +1000, Russell Shaw wrote:
> AC_DEFINE(DEFAULT_SZ,$default_size)

you already have the short hint.  Thus you should do:

AC_ARG_WITH(border-size,
        [AS_HELP_STRING(--with-border-size=n,
                [Set default border size to `n'.])],
        [[default_size=$withval]],
        [[default_size=3]]
)
AC_DEFINE_UNQUOTED(DEFAULT_SZ, $default_size, [Default border size.])

But there still is some space for improvement.
What if the user gives --without-border-size?
The code should be more failsafe.

And --with-* arguments configure usage of external packages.
Though it sounds somewhat weird, you should use --enable for configuring
options within the package itself.

Like this:

AC_ARG_ENABLE(border-size,
        [AS_HELP_STRING(--enable-border-size=n,
                [Set default border size to `n'.])])

case $enable_border_size in
[0-9]*) ;;
*) enable_border_size=3 ;;
esac

AC_DEFINE_UNQUOTED(DEFAULT_SZ, $enable_border_size,
        [Default border size.])

Hope this helps,
        Stepan Kasal




reply via email to

[Prev in Thread] Current Thread [Next in Thread]