conditionals.
(&by_condition): Adjust.
(&conditional_string): Recognize `TRUE' and `FALSE'.
(&make_condition): Use it.
* m4/cond.m4: Reject TRUE and FALSE as conditionals.
* automake.texi (Conditionals): Adjust.
* tests/cond9.test: s/FALSE/WRONG/.
+2001-03-23 Akim Demaille <akim@epita.fr>
+
+ * automake.in (read_am_file): TRUE and FALSE are predefined
+ conditionals.
+ (&by_condition): Adjust.
+ (&conditional_string): Recognize `TRUE' and `FALSE'.
+ (&make_condition): Use it.
+ * m4/cond.m4: Reject TRUE and FALSE as conditionals.
+ * automake.texi (Conditionals): Adjust.
+ * tests/cond9.test: s/FALSE/WRONG/.
+
2001-03-12 Pavel Roskin <proski@gnu.org>
* tests/Makefile.am (XFAIL_TESTS): Remove cond3.test, it passes
PRE_UNINSTALL = :
POST_UNINSTALL = :
-host_alias = @host_alias@
-host_triplet = @host@
-
@SET_MAKE@
AMDEP = @AMDEP@
AMTAR = @AMTAR@
-# aclocal.m4 generated automatically by aclocal 1.4c
+# aclocal.m4 generated automatically by aclocal 1.4e
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000
# Free Software Foundation, Inc.
# Autoconf 2.50 wants to disallow AM_ names. We explicitly allow
# the ones we care about.
-ifdef([m4_pattern_allow], [m4_pattern_allow([AM_CFLAGS])])
-ifdef([m4_pattern_allow], [m4_pattern_allow([AM_CPPFLAGS])])
-ifdef([m4_pattern_allow], [m4_pattern_allow([AM_CXXFLAGS])])
-ifdef([m4_pattern_allow], [m4_pattern_allow([AM_OBJCFLAGS])])
-ifdef([m4_pattern_allow], [m4_pattern_allow([AM_FFLAGS])])
-ifdef([m4_pattern_allow], [m4_pattern_allow([AM_RFLAGS])])
-ifdef([m4_pattern_allow], [m4_pattern_allow([AM_GCJFLAGS])])
+ifdef([m4_pattern_allow],
+ [m4_pattern_allow([^AM_(C|CPP|CXX|OBJC|F|R|GCJ)FLAGS])])dnl
# Some tools Automake needs.
AC_REQUIRE([AM_SANITY_CHECK])dnl
AC_DEFUN([AM_PROG_INSTALL_STRIP],
[AC_REQUIRE([AM_MISSING_INSTALL_SH])
dnl Don't test for $cross_compiling = yes, it might be `maybe'...
-if test "$cross_compiling" != no; then
- # since we are cross-compiling, we need to check for a suitable `strip'
- AM_PROG_STRIP
- if test -z "$STRIP"; then
- AC_MSG_WARN([strip missing, install-strip will not strip binaries])
- fi
-fi
+# We'd like to do this but we can't because it will unconditionally
+# require config.guess. One way would be if autoconf had the capability
+# to let us compile in this code only when config.guess was already
+# a possibility.
+#if test "$cross_compiling" != no; then
+# # since we are cross-compiling, we need to check for a suitable `strip'
+# AM_PROG_STRIP
+# if test -z "$STRIP"; then
+# AC_MSG_WARN([strip missing, install-strip will not strip binaries])
+# fi
+#fi
# If $STRIP is defined (either by the user, or by AM_PROG_STRIP),
# instruct install-strip to use install-sh and the given $STRIP program.
INSTALL_STRIP_PROGRAM_ENV=''
else
_am_dirpart="`echo $install_sh | sed -e 's,//*[[^/]]*$,,'`"
- INSTALL_STRIP_PROGRAM="\${SHELL} \`cd $_am_dirpart && pwd\`/install-sh -c -s"
- INSTALL_STRIP_PROGRAM_ENV="STRIPPROG='$STRIP'"
+ INSTALL_STRIP_PROGRAM="\${SHELL} \`CDPATH=: && cd $_am_dirpart && pwd\`/install-sh -c -s"
+ INSTALL_STRIP_PROGRAM_ENV="STRIPPROG='\$(STRIP)'"
fi
+AC_SUBST([STRIP])
AC_SUBST([INSTALL_STRIP_PROGRAM])
AC_SUBST([INSTALL_STRIP_PROGRAM_ENV])])
-AC_DEFUN([AM_PROG_STRIP],
-[# Check for `strip', unless the installer
+#AC_DEFUN([AM_PROG_STRIP],
+#[# Check for `strip', unless the installer
# has set the STRIP environment variable.
# Note: don't explicitly check for -z "$STRIP" here because
# that will cause problems if AC_CANONICAL_* is AC_REQUIREd after
# this macro, and anyway it doesn't have an effect anyway.
-AC_CHECK_TOOL([STRIP],[strip])
-])
+#AC_CHECK_TOOL([STRIP],[strip])
+#])
# serial 3
# Correctly returns the empty string when there are no conditions.
sub make_condition
{
- my $res = join ('@@', @_);
- return ''
- unless $res;
+ my $res = conditional_string (@_);
+
+ return $res
+ if $res eq '' or $res eq '#' ;
$res = '@' . $res . '@';
$res =~ s/ /@@/g;
}
else
{
- return join (' ', uniq (sort (grep (!/^TRUE$/, @stack))));
+ return join (' ', uniq sort grep (!/^TRUE$/, @stack));
}
}
# If the variable is defined in terms of any variables which are
# defined conditionally, then this returns a full set of permutations
# of the subvariable conditions. For example, if the variable is
-# defined in terms of a variable which is defined for @COND_TRUE@,
-# then this returns both @COND_TRUE@ and @COND_FALSE@. This is
+# defined in terms of a variable which is defined for COND_TRUE,
+# then this returns both COND_TRUE and COND_FALSE. This is
# because we will need to define the variable under both conditions.
sub variable_conditions
# Issue them in alphabetical order, foo_TRUE before foo_FALSE.
sub by_condition
{
+ # Be careful we might be comparing `' or `#'.
$a =~ /^(.*)_(TRUE|FALSE)$/;
- my ($aname, $abool) = ($1, $2);
+ my ($aname, $abool) = ($1 || '', $2 || '');
$b =~ /^(.*)_(TRUE|FALSE)$/;
- my ($bname, $bbool) = ($1, $2);
+ my ($bname, $bbool) = ($1 || '', $2 || '');
return ($aname cmp $bname
# Don't bother with IFs, given that TRUE is after FALSE
# just cmp in the reverse order.
}
elsif (/$IF_PATTERN/o)
{
- &am_line_error ($., "$1 does not appear in AM_CONDITIONAL")
- if (! $configure_cond{$1});
- push (@conditional_stack, "$1_TRUE");
+ my $cond = $1;
+ &am_line_error ($., "$cond does not appear in AM_CONDITIONAL")
+ if ! $configure_cond{$cond} && $cond !~ /^TRUE|FALSE$/;
+ push (@conditional_stack,
+ ($cond =~ /^TRUE|FALSE$/) ? "$cond" : "${cond}_TRUE");
}
elsif (/$ELSE_PATTERN/o)
{
{
&am_line_error ($., "else without if");
}
- elsif ($conditional_stack[$#conditional_stack] =~ /_FALSE$/)
+ elsif ($conditional_stack[$#conditional_stack] =~ /^(.*_)?FALSE$/)
{
&am_line_error ($., "else after else");
}
else
{
$conditional_stack[$#conditional_stack]
- =~ s/_TRUE$/_FALSE/;
+ =~ s/TRUE$/FALSE/;
}
}
elsif (/$ENDIF_PATTERN/o)
@cvindex AM_CONDITIONAL
Before using a conditional, you must define it by using
@code{AM_CONDITIONAL} in the @code{configure.in} file (@pxref{Macros}).
-The @code{AM_CONDITIONAL} macro takes two arguments.
-The first argument to @code{AM_CONDITIONAL} is the name of the
-conditional. This should be a simple string starting with a letter and
-containing only letters, digits, and underscores.
+@defmac AM_CONDITIONAL (@var{conditional}, @var{condition})
+The conditional name, @var{conditional}, should be a simple string
+starting with a letter and containing only letters, digits, and
+underscores. It must be different from @samp{TRUE} and @samp{FALSE}
+which are reserved by Automake.
-The second argument to @code{AM_CONDITIONAL} is a shell condition,
-suitable for use in a shell @code{if} statement. The condition is
-evaluated when @code{configure} is run.
+The shell @var{condition} (suitable for use in a shell @code{if}
+statement) is evaluated when @code{configure} is run.
+@end defmac
@cindex --enable-debug, example
@cindex Example conditional --enable-debug
ac_config_sub=$ac_aux_dir/config.sub
ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
-
-# Make sure we can run config.sub.
-if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
-else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
-fi
-
-echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:555: checking host system type" >&5
-
-host_alias=$host
-case "$host_alias" in
-NONE)
- case $nonopt in
- NONE)
- if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
- else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
- fi ;;
- *) host_alias=$nonopt ;;
- esac ;;
-esac
-
-host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
-host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-echo "$ac_t""$host" 1>&6
-
-echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:576: checking build system type" >&5
-
-build_alias=$build
-case "$build_alias" in
-NONE)
- case $nonopt in
- NONE) build_alias=$host_alias ;;
- *) build_alias=$nonopt ;;
- esac ;;
-esac
-
-build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
-build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-echo "$ac_t""$build" 1>&6
-
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
# incompatible versions:
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:605: checking for a BSD compatible install" >&5
+echo "configure:560: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:658: checking whether build environment is sane" >&5
+echo "configure:613: checking whether build environment is sane" >&5
# Just in case
sleep 1
echo timestamp > conftest.file
echo "configure: warning: ${am_backtick}missing' script is too old or missing" 1>&2
fi
-if test $host != $build; then
- ac_tool_prefix=${host_alias}-
-else
- ac_tool_prefix=
-fi
-
-for ac_prog in gawk mawk nawk awk
+for ac_prog in mawk gawk nawk awk
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:736: checking for $ac_word" >&5
+echo "configure:685: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
done
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:766: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:715: checking whether ${MAKE-make} sets \${MAKE}" >&5
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
# Autoconf 2.50 wants to disallow AM_ names. We explicitly allow
# the ones we care about.
-
-
-
-
-
-
-
# Some tools Automake needs.
ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal"}
fi
-if test "$cross_compiling" != no; then
- # since we are cross-compiling, we need to check for a suitable `strip'
- # Check for `strip', unless the installer
-# has set the STRIP environment variable.
-# Note: don't explicitly check for -z "$STRIP" here because
-# that will cause problems if AC_CANONICAL_* is AC_REQUIREd after
-# this macro, and anyway it doesn't have an effect anyway.
-# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:899: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -n "$STRIP"; then
- ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_STRIP="${ac_tool_prefix}strip"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_prog_STRIP" && ac_cv_prog_STRIP="strip"
-fi
-fi
-STRIP="$ac_cv_prog_STRIP"
-if test -n "$STRIP"; then
- echo "$ac_t""$STRIP" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-
-
-
- if test -z "$STRIP"; then
- echo "configure: warning: strip missing, install-strip will not strip binaries" 1>&2
- fi
-fi
+# We'd like to do this but we can't because it will unconditionally
+# require config.guess. One way would be if autoconf had the capability
+# to let us compile in this code only when config.guess was already
+# a possibility.
+#if test "$cross_compiling" != no; then
+# # since we are cross-compiling, we need to check for a suitable `strip'
+# AM_PROG_STRIP
+# if test -z "$STRIP"; then
+# AC_MSG_WARN([strip missing, install-strip will not strip binaries])
+# fi
+#fi
# If $STRIP is defined (either by the user, or by AM_PROG_STRIP),
# instruct install-strip to use install-sh and the given $STRIP program.
INSTALL_STRIP_PROGRAM_ENV=''
else
_am_dirpart="`echo $install_sh | sed -e 's,//*[^/]*$,,'`"
- INSTALL_STRIP_PROGRAM="\${SHELL} \`cd $_am_dirpart && pwd\`/install-sh -c -s"
- INSTALL_STRIP_PROGRAM_ENV="STRIPPROG='$STRIP'"
+ INSTALL_STRIP_PROGRAM="\${SHELL} \`CDPATH=: && cd $_am_dirpart && pwd\`/install-sh -c -s"
+ INSTALL_STRIP_PROGRAM_ENV="STRIPPROG='\$(STRIP)'"
fi
+
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
# Extract the first word of "perl", so it can be a program name with args.
set dummy perl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:963: checking for $ac_word" >&5
+echo "configure:873: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
s%@MAKEINFO@%$MAKEINFO%g
s%@AMTAR@%$AMTAR%g
s%@install_sh@%$install_sh%g
-s%@host@%$host%g
-s%@host_alias@%$host_alias%g
-s%@host_cpu@%$host_cpu%g
-s%@host_vendor@%$host_vendor%g
-s%@host_os@%$host_os%g
-s%@build@%$build%g
-s%@build_alias@%$build_alias%g
-s%@build_cpu@%$build_cpu%g
-s%@build_vendor@%$build_vendor%g
-s%@build_os@%$build_os%g
s%@STRIP@%$STRIP%g
s%@INSTALL_STRIP_PROGRAM@%$INSTALL_STRIP_PROGRAM%g
s%@INSTALL_STRIP_PROGRAM_ENV@%$INSTALL_STRIP_PROGRAM_ENV%g
PRE_UNINSTALL = :
POST_UNINSTALL = :
-host_alias = @host_alias@
-host_triplet = @host@
-
@SET_MAKE@
AMDEP = @AMDEP@
AMTAR = @AMTAR@
-# serial 2
+# serial 3
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
# -------------------------------------
# Define a conditional.
+#
+# FIXME: Once using 2.50, use this:
+# m4_match([$1], [^TRUE\|FALSE$], [AC_FATAL([$0: invalid condition: $1])])dnl
AC_DEFUN([AM_CONDITIONAL],
-[AC_SUBST([$1_TRUE])
+[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=
-@set UPDATED 26 February 2001
-@set UPDATED-MONTH February 2001
+@set UPDATED 23 March 2001
+@set UPDATED-MONTH March 2001
@set EDITION 1.4e
@set VERSION 1.4e
PRE_UNINSTALL = :
POST_UNINSTALL = :
-host_alias = @host_alias@
-host_triplet = @host@
-
@SET_MAKE@
AMDEP = @AMDEP@
AMTAR = @AMTAR@
cat > configure.in << 'END'
AC_INIT(Makefile.am)
AM_INIT_AUTOMAKE(foo,0.0)
-AM_CONDITIONAL(FALSE, [test x = y])
+AM_CONDITIONAL(WRONG, [test x = y])
AC_OUTPUT(Makefile)
END
cat > Makefile.am << 'END'
-if FALSE
+if WRONG
this=
else
this=is_something_interesting
-@set UPDATED 26 February 2001
-@set UPDATED-MONTH February 2001
+@set UPDATED 23 March 2001
+@set UPDATED-MONTH March 2001
@set EDITION 1.4e
@set VERSION 1.4e