This is the mail archive of the
automake@gnu.org
mailing list for the automake project.
Re: Plan: Wednesday
On 22 Aug 2001 16:41:09 +0200, Akim Demaille wrote:
> This is what I would advise. It *has* to be done by Sh, M4 cannot.
>
> # 2.13 compatibility
> ifndef([m4_wrap],
> [define([m4_wrap], [defn([m4wrap])])])
>
> AC_DEFUN([AM_CONDITIONAL],
> [ifelse([$1], [TRUE],
> [errprint(__file__:__line__: [$0: invalid condition: $1
> ])dnl
> m4exit(1)])dnl
> ifelse([$1], [FALSE],
> [errprint(__file__:__line__: [$0: invalid condition: $1
> ])dnl
> m4exit(1)])dnl
> AC_SUBST([$1_TRUE], ['#'])
> AC_SUBST([$1_FALSE], ['#'])
> if $2; then
> $1_TRUE=
> $1_FALSE='#'
> else
> $1_TRUE='#'
> $1_FALSE=
> fi
>
> m4_wrap([test "${$1_TRUE}${$1_FALSE}" = '#' ||
> AC_MSG_ERROR([yeeeks: the condition $1 was not properly set!])
> ])
> ])
>
> AC_INIT
> AM_CONDITIONAL([FOO], [true])
> if false; then
> AM_CONDITIONAL([BAR], [true])
> fi
Cool... expect for 1 last bug. with ac 2.13 AC_MSG_ERROR doesn't seem to
be defined :].
Rob