| On Thu, Feb 17, 2000 at 02:12:19PM +0100, Akim Demaille wrote:
| : It'd be much easier if you could send what you have, and how it fails.
| 
| Well, since I figured out the problem but didn't know how to implement
| "compile-time" autoconf macros, I don't really have anything that fails...
| I'm reading up on m4 at the moment, and will hopefully be able to implement
| it afterwards.
| 
| Before I saw the order of things I thought I could do something like this:
| 
| AC_DEFUN(SIM_CHECK_COIN,[
| AC_PREREQ([2.14.1])

2.14.1 doesn't exist!

| 
| dnl set up default attributes
| default=yes
| 
| for attribute in dummy $3; do
|   case $attribute in
|     dummy)      ;;
|     default)    default=yes ;;
|     nodefault)  default=no ;;
|     *)          AC_MSG_ERROR(invalid attribute \"$attribute\" for `SIM_CHECK_COIN') 
|;;
|   esac
| done
| 
| AC_ARG_WITH(coin, AC_HELP_STRING([--with-coin=DIR], [set the prefix directory wh
| ere Coin resides [default=$default]]), , [with_coin=$default])
| 
| [...]
| 
| then I would be able to use something like this when libCoin was a non-default
| option:
| 
| SIM_CHECK_COIN( , , nodefault)

Maybe I misunderstood your point, but I don't understand why you have
sh code here (maybe that's what you meant with m4 compile time), and I
don't understand why you don't use `yes' and `no' for $3.  Is this OK?

define(_SIM_CHECK_COIN_HELP,
[AC_HELP_STRING([--with-coin=DIR], 
                [set the prefix directory where Coin resides [default=$1]])])

AC_DEFUN(SIM_CHECK_COIN,
[AC_PREREQ([2.14a])dnl
ifelse([$3], [],
       [$3], [yes],
       [$3], [no],
       [AC_FATAL([$0: invalid attribute `$3'])])dnl
AC_ARG_WITH(coin, 
            _SIM_CHECK_COIN_HELP(m4_default([$3], [yes]))

etc.


Part of the problem is that AC_ENABLE_ are yet another series of
macros which double quote :(

        Akim

Reply via email to