From b994348eda909ca69f8729d089d60b01e3269a45 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Fri, 23 Mar 2001 16:23:51 +0000 Subject: [PATCH] * 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/. --- ChangeLog | 11 ++++ Makefile.in | 3 - aclocal.m4 | 42 +++++++------- automake.in | 30 +++++----- automake.texi | 15 ++--- configure | 140 +++++++--------------------------------------- m4/Makefile.in | 3 - m4/cond.m4 | 15 ++++- stamp-vti | 4 +- tests/Makefile.in | 3 - tests/cond9.test | 4 +- version.texi | 4 +- 12 files changed, 96 insertions(+), 178 deletions(-) diff --git a/ChangeLog b/ChangeLog index c28a2d52..aa06c22e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2001-03-23 Akim Demaille + + * 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 * tests/Makefile.am (XFAIL_TESTS): Remove cond3.test, it passes diff --git a/Makefile.in b/Makefile.in index 85ce15a7..6bc48eff 100644 --- a/Makefile.in +++ b/Makefile.in @@ -57,9 +57,6 @@ NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -host_alias = @host_alias@ -host_triplet = @host@ - @SET_MAKE@ AMDEP = @AMDEP@ AMTAR = @AMTAR@ diff --git a/aclocal.m4 b/aclocal.m4 index 663cf238..19b384a0 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,4 +1,4 @@ -# 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. @@ -62,13 +62,8 @@ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])]) # 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 @@ -225,13 +220,17 @@ am_aux_dir=`CDPATH=:; cd $ac_aux_dir && pwd` 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. @@ -247,20 +246,21 @@ if test -z "$STRIP"; then 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 diff --git a/automake.in b/automake.in index 5c80bc91..63f4756c 100755 --- a/automake.in +++ b/automake.in @@ -5482,9 +5482,10 @@ sub target_defined # 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; @@ -5527,7 +5528,7 @@ sub conditional_string } else { - return join (' ', uniq (sort (grep (!/^TRUE$/, @stack)))); + return join (' ', uniq sort grep (!/^TRUE$/, @stack)); } } @@ -5668,8 +5669,8 @@ sub examine_variable # 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 @@ -5824,10 +5825,11 @@ sub variable_conditions_sub # 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. @@ -6276,9 +6278,11 @@ sub read_am_file } 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) { @@ -6286,14 +6290,14 @@ sub read_am_file { &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) diff --git a/automake.texi b/automake.texi index aa5fba5a..6f21e909 100644 --- a/automake.texi +++ b/automake.texi @@ -3352,15 +3352,16 @@ Automake supports a simple type of conditionals. @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 diff --git a/configure b/configure index 296f3ed0..f337169e 100755 --- a/configure +++ b/configure @@ -544,51 +544,6 @@ ac_config_guess=$ac_aux_dir/config.guess 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: @@ -601,7 +556,7 @@ echo "$ac_t""$build" 1>&6 # 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 @@ -654,7 +609,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' 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 @@ -721,18 +676,12 @@ else 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 @@ -762,7 +711,7 @@ test -n "$AWK" && break 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 @@ -845,13 +794,6 @@ EOF # 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"} @@ -885,50 +827,17 @@ if test -z "$install_sh"; then 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. @@ -944,11 +853,12 @@ if test -z "$STRIP"; then 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. @@ -959,7 +869,7 @@ AUTOMAKE="`pwd`/automake --amdir=." # 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 @@ -1155,16 +1065,6 @@ s%@AUTOHEADER@%$AUTOHEADER%g 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 diff --git a/m4/Makefile.in b/m4/Makefile.in index acadab24..66c195b1 100644 --- a/m4/Makefile.in +++ b/m4/Makefile.in @@ -57,9 +57,6 @@ NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -host_alias = @host_alias@ -host_triplet = @host@ - @SET_MAKE@ AMDEP = @AMDEP@ AMTAR = @AMTAR@ diff --git a/m4/cond.m4 b/m4/cond.m4 index 86a562c3..ed09527b 100644 --- a/m4/cond.m4 +++ b/m4/cond.m4 @@ -1,10 +1,21 @@ -# 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= diff --git a/stamp-vti b/stamp-vti index 4ddcd7fe..4014e5e9 100644 --- a/stamp-vti +++ b/stamp-vti @@ -1,4 +1,4 @@ -@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 diff --git a/tests/Makefile.in b/tests/Makefile.in index 931c103b..0373c844 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -57,9 +57,6 @@ NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -host_alias = @host_alias@ -host_triplet = @host@ - @SET_MAKE@ AMDEP = @AMDEP@ AMTAR = @AMTAR@ diff --git a/tests/cond9.test b/tests/cond9.test index ebe419c6..aeca07a9 100755 --- a/tests/cond9.test +++ b/tests/cond9.test @@ -7,12 +7,12 @@ 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 diff --git a/version.texi b/version.texi index 4ddcd7fe..4014e5e9 100644 --- a/version.texi +++ b/version.texi @@ -1,4 +1,4 @@ -@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 -- 2.43.5