This is the mail archive of the
automake@gnu.org
mailing list for the automake project.
Re: Plan: Wednesday
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