greetings autoconf folks,
please find below a sketch of some abstractions on AC_ARG_ENABLE. they
are useful to express simple "on/off" tests. present implementation
suffers from "double eval" of args, but that can be reworked. i'm
posting this to guage receptivity for a full-blown patch effort (w/ docs
and w/ analogous AC_ARG_WITH support).
sample usage:
dnl This means you have to pass --disable-wow or --enable-wow=no to
dnl see the pleasant message, otherwise subdir wow/ is recursed into
dnl by default.
TTN_DEFAULT_ENABLE(wow,[the wow feature],
AC_CONFIG_SUBDIR(wow),
echo 'yeah who cares about wow anyway?')
please cc me on reply as i'm not subscribed to the list.
thi
__________________________________________________________
dnl $1 = feature
dnl $2 = 2nd arg to AC_HELP_STRING
dnl $3 = enable action
dnl $4 = disable action
AC_DEFUN([TTN_DEFAULT_ENABLE],[
AC_ARG_ENABLE([$1],
[AC_HELP_STRING([--disable-$1],[disable $2 (default: enabled)])],[
if test $enableval = no ; then
[$4]
else
[$3]
fi
],[
[$3]
])
])
dnl $1 = feature
dnl $2 = 2nd arg to AC_HELP_STRING
dnl $3 = enable action
dnl $4 = disable action
AC_DEFUN([TTN_DEFAULT_DISABLE],[
AC_ARG_ENABLE([$1],
[AC_HELP_STRING([--enable-$1],[enable $2 (default: disabled)])],[
if test $enableval = no ; then
[$4]
else
[$3]
fi
],[
[$4]
])
])