On Wed, Jun 11, 2003 at 09:47:59AM +0200, Tim Van Holder wrote: > A more canonical approach to using AC_ARG_* is to use a shell var to > hold the switch: > > AC_ARG_ENABLE(foo > AC_HELP_STRING([--disable-foo], [Disable the use of foo]), > [use_foo=$enableval], [use_foo=yes]) > if test $use_foo = yes; then > AC_DEFINE(USE_FOO, 1, [Define if your system has a foo.]) > else > AC_DEFINE(USE_FAKE_FOO, 1, [Define if you want faked foo functionality]) > fi
I guess that works well. Okay. > Note that it seems odd to define two different macros - why not use > AC_DEFINE only if foo is enabled, or use a two-valued macro (0 or 1)? > > (As an aside, 'usage' is 'the way something is used' - so you're not > disabling foo's usage, but its use.) I completely BS'd the sample code, only attempting to illustrate my point. :) Regards Josh -- New PGP public key: 0x27AFC3EE
pgp00000.pgp
Description: PGP signature
