From 2f086d9b7beca21b1f43fbea272c07107695e903 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Sat, 23 Jun 2001 15:04:14 +0000 Subject: [PATCH] 2001-06-23 Paolo Bonzini * acgeneral.m4 (_AC_OUTPUT_CONFIG_STATUS): Defer parsing of config.status targets to after the evaluation of the INIT-CMDS. Double quote config.status targets (used to be single quoted). 2001-06-23 Akim Demaille * tests/torture.at (CONFIG_FILES, HEADERS, LINKS and COMMANDS): Check the content of the created file. Check the ./config.status command line invocation. --- ChangeLog | 12 ++++++ acgeneral.m4 | 71 +++++++++++++++++++---------------- lib/autoconf/general.m4 | 71 +++++++++++++++++++---------------- tests/torture.at | 82 +++++++++++++++++++++++++++++++---------- 4 files changed, 154 insertions(+), 82 deletions(-) diff --git a/ChangeLog b/ChangeLog index 53b08b94..ba95e942 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2001-06-23 Paolo Bonzini + + * acgeneral.m4 (_AC_OUTPUT_CONFIG_STATUS): Defer parsing of + config.status targets to after the evaluation of the INIT-CMDS. + Double quote config.status targets (used to be single quoted). + +2001-06-23 Akim Demaille + + * tests/torture.at (CONFIG_FILES, HEADERS, LINKS and COMMANDS): + Check the content of the created file. + Check the ./config.status command line invocation. + 2001-06-23 Akim Demaille * tests/foreign.at (Libtool): Reject prehistoric versions. diff --git a/acgeneral.m4 b/acgeneral.m4 index 32dc636a..d12d9bf7 100644 --- a/acgeneral.m4 +++ b/acgeneral.m4 @@ -3669,28 +3669,12 @@ Try `$[0] --help' for more information.]);; CONFIG_HEADERS="$CONFIG_HEADERS $[1]" ac_need_defaults=false;; - # Handling of arguments. -AC_FOREACH([AC_File], AC_LIST_FILES, -[ 'm4_patsubst(AC_File, [:.*])' )dnl - CONFIG_FILES="$CONFIG_FILES AC_File" ;; -])dnl -AC_FOREACH([AC_File], AC_LIST_LINKS, -[ 'm4_patsubst(AC_File, [:.*])' )dnl - CONFIG_LINKS="$CONFIG_LINKS AC_File" ;; -])dnl -AC_FOREACH([AC_File], AC_LIST_COMMANDS, -[ 'm4_patsubst(AC_File, [:.*])' )dnl - CONFIG_COMMANDS="$CONFIG_COMMANDS AC_File" ;; -])dnl -AC_FOREACH([AC_File], AC_LIST_HEADERS, -[ 'm4_patsubst(AC_File, [:.*])' )dnl - CONFIG_HEADERS="$CONFIG_HEADERS AC_File" ;; -])dnl - # This is an error. -*) AC_MSG_ERROR([unrecognized option: $[1] Try `$[0] --help' for more information.]) ;; - *) AC_MSG_ERROR([invalid argument: $[1]]);; + + *) ac_config_targets="$ac_config_targets $[1]" ;; + esac shift done @@ -3710,11 +3694,47 @@ on `(hostname || uname -n) 2>/dev/null | sed 1q` _ACEOF EOF +dnl We output the INIT-CMDS first for obvious reasons :) +m4_ifset([_AC_OUTPUT_COMMANDS_INIT], +[cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF +[ +cat >>$CONFIG_STATUS <<\EOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. +AC_FOREACH([AC_File], AC_LIST_FILES, +[ "m4_patsubst(AC_File, [:.*])" )dnl + CONFIG_FILES="$CONFIG_FILES AC_File" ;; +])dnl +AC_FOREACH([AC_File], AC_LIST_LINKS, +[ "m4_patsubst(AC_File, [:.*])" )dnl + CONFIG_LINKS="$CONFIG_LINKS AC_File" ;; +])dnl +AC_FOREACH([AC_File], AC_LIST_COMMANDS, +[ "m4_patsubst(AC_File, [:.*])" )dnl + CONFIG_COMMANDS="$CONFIG_COMMANDS AC_File" ;; +])dnl +AC_FOREACH([AC_File], AC_LIST_HEADERS, +[ "m4_patsubst(AC_File, [:.*])" )dnl + CONFIG_HEADERS="$CONFIG_HEADERS AC_File" ;; +])dnl + *) AC_MSG_ERROR([invalid argument: $ac_config_target]);; + esac +done + # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely @@ -3739,17 +3759,6 @@ AS_TMPDIR(cs) EOF ])[]dnl m4_ifval -dnl We output the INIT-CMDS first for obvious reasons :) -m4_ifset([_AC_OUTPUT_COMMANDS_INIT], -[cat >>$CONFIG_STATUS </dev/null | sed 1q` _ACEOF EOF +dnl We output the INIT-CMDS first for obvious reasons :) +m4_ifset([_AC_OUTPUT_COMMANDS_INIT], +[cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF +[ +cat >>$CONFIG_STATUS <<\EOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. +AC_FOREACH([AC_File], AC_LIST_FILES, +[ "m4_patsubst(AC_File, [:.*])" )dnl + CONFIG_FILES="$CONFIG_FILES AC_File" ;; +])dnl +AC_FOREACH([AC_File], AC_LIST_LINKS, +[ "m4_patsubst(AC_File, [:.*])" )dnl + CONFIG_LINKS="$CONFIG_LINKS AC_File" ;; +])dnl +AC_FOREACH([AC_File], AC_LIST_COMMANDS, +[ "m4_patsubst(AC_File, [:.*])" )dnl + CONFIG_COMMANDS="$CONFIG_COMMANDS AC_File" ;; +])dnl +AC_FOREACH([AC_File], AC_LIST_HEADERS, +[ "m4_patsubst(AC_File, [:.*])" )dnl + CONFIG_HEADERS="$CONFIG_HEADERS AC_File" ;; +])dnl + *) AC_MSG_ERROR([invalid argument: $ac_config_target]);; + esac +done + # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely @@ -3739,17 +3759,6 @@ AS_TMPDIR(cs) EOF ])[]dnl m4_ifval -dnl We output the INIT-CMDS first for obvious reasons :) -m4_ifset([_AC_OUTPUT_COMMANDS_INIT], -[cat >>$CONFIG_STATUS <input + +# Be sure to also stress the associated INIT-CMDS. case $what_to_test in - header) AC_CONFIG_HEADERS(header:header.in);; - file) AC_CONFIG_FILES(file:file.in);; - command) AC_CONFIG_COMMANDS(command:command.in, [cp command.in command]);; - link) AC_CONFIG_LINKS(link:link.in);; + header) + AC_CONFIG_HEADERS(header:input);; + var-header) + AC_CONFIG_HEADERS(var-header:$header_in, [], [header_in=input]);; + + file) + AC_CONFIG_FILES(file:input);; + var-file) + AC_CONFIG_FILES(var-file:$file_in, [], [file_in=input]);; + + command) + AC_CONFIG_COMMANDS(command:input, + [cp input command]);; + var-command) + AC_CONFIG_COMMANDS(var-command:$command_in, + [cp $command_in var-command], [command_in=input]);; + + link) + AC_CONFIG_LINKS(link:input);; + var-link) + AC_CONFIG_LINKS(var-link:$link_in, [], [link_in=input]);; esac AC_OUTPUT ]]) AT_CHECK_AUTOCONF -# Create a header -AT_CHECK_CONFIGURE([what_to_test=header]) -AT_CHECK([ls header file command link], [ignore], [header -], [ignore]) + +# AT_CHECK_CONFIG_CREATION(THING = (header | link | file | command)) +# ------------------------------------------------------------------ +# Check that THING and var-THING (which uses variables in AC_CONFIG_THING) +# are properly created, with the right content. +# Use `grep OK' instead of a simple `cat' to avoid banners such as in +# AC_CONFIG_HEADERS. +m4_define([AT_CHECK_CONFIG_CREATION], +[AT_CHECK_CONFIGURE([what_to_test=$1]) +AT_CHECK([ls header var-header file var-file command var-command link var-link 2>/dev/null], + [ignore], [$1 +]) +AT_CHECK([grep OK $1], [], [OK +]) + +AT_CHECK_CONFIGURE([what_to_test=var-$1 --no-create]) +# config.status might be stupidly expecting data on stdin, if it's +# really broken... +AT_CHECK([./config.status var-$1 /dev/null], + [ignore], [var-$1 +]) +AT_CHECK([grep OK var-$1], [], [OK +]) +])# AT_CHECK_CONFIG_CREATION + # Create a file -AT_CHECK_CONFIGURE([what_to_test=file]) -AT_CHECK([ls header file command link], [ignore], [file -], [ignore]) +AT_CHECK_CONFIG_CREATION(file) + +# Create a header +AT_CHECK_CONFIG_CREATION(header) # Execute a command -AT_CHECK_CONFIGURE([what_to_test=command]) -AT_CHECK([ls header file command link], [ignore], [command -], [ignore]) +AT_CHECK_CONFIG_CREATION(command) # Create a link -AT_CHECK_CONFIGURE([what_to_test=link]) -AT_CHECK([ls header file command link], [ignore], [link -], [ignore]) +AT_CHECK_CONFIG_CREATION(link) -AT_CLEANUP(header file link command header.in file.in link.in command.in) +AT_CLEANUP(header file link commandvar-header var-file var-link var-command + input)