automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AM_COND_IF for earlier Automake


From: Stefano Lattarini
Subject: Re: AM_COND_IF for earlier Automake
Date: Sat, 18 Dec 2010 11:18:04 +0100
User-agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; )

On Saturday 18 December 2010, Dave Hart wrote:
> I'd like a package I depend on to use AM_COND_IF, but it does not want
> to demand Automake 1.11 at this point.  Does this seem like a
> reasonable solution?
> 
> m4_ifndef([AM_COND_IF], [AC_DEFUN([AM_COND_IF],
> [m4_ifndef([_AM_COND_VALUE_$1],
>          [m4_fatal([$0: no such condition "$1"])])dnl
> if _AM_COND_VALUE_$1; then
>   m4_default([$2], [:])
> m4_ifval([$3],
> else
>   $3
> ])dnl
> fi[]dnl
> ])])
>
Only if you also "patch" AM_CONDITIONAL to have it define
`_AM_COND_VALUE_$1' properly; for example (untested!):

m4_ifndef([AM_COND_IF], [AC_DEFUN([AM_CONDITIONAL],
m4_defn([AM_CONDITIONAL])dnl
m4_define([_AM_COND_VALUE_$1], [$2])])

BTW, I see that automake 1.11 also traces the macros _AM_COND_IF,
_AM_COND_ELSE and _AM_COND_ENDIF, which are not present nor traced in
1.10, so my suggestion above might still be insufficient in some
situations (if not all).

My advice is: just require Automake 1.11.  That's not unreasonable,
since that's anyway a requirement for developers, not for users.

HTH,
  Stefano



reply via email to

[Prev in Thread] Current Thread [Next in Thread]