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