[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
abstractions on AC_ARG_ENABLE
From: |
Thien-Thi Nguyen |
Subject: |
abstractions on AC_ARG_ENABLE |
Date: |
Thu, 29 Aug 2002 22:40:15 -0700 |
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]
])
])
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- abstractions on AC_ARG_ENABLE,
Thien-Thi Nguyen <=