Stepan Kasal wrote:
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
Hi,
It works now thanks. I'm actually setting defaults for floating point numbers
like:
/configure --with-default-size=5.8
Maybe a new macro should be made for setting numerical defaults rather
than aimed at package defaults.
_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf