]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
2001-06-23 Paolo Bonzini <bonzini@gnu.org>
authorAkim Demaille <akim@epita.fr>
Sat, 23 Jun 2001 15:04:14 +0000 (15:04 +0000)
committerAkim Demaille <akim@epita.fr>
Sat, 23 Jun 2001 15:04:14 +0000 (15:04 +0000)
* 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  <akim@epita.fr>

* tests/torture.at (CONFIG_FILES, HEADERS, LINKS and COMMANDS):
Check the content of the created file.
Check the ./config.status command line invocation.

ChangeLog
acgeneral.m4
lib/autoconf/general.m4
tests/torture.at

index 53b08b944efaf54a07b240e6206909e32c9ab59f..ba95e9425dfe9f53df0adf957e83db05e2a8beca 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2001-06-23  Paolo Bonzini <bonzini@gnu.org>
+
+       * 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  <akim@epita.fr>
+
+       * 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  <akim@epita.fr>
 
        * tests/foreign.at (Libtool): Reject prehistoric versions.
index 32dc636a662e234d1fa9114d2357b81cb149914e..d12d9bf70736caca3ca55d6abdb56793bb0619e6 100644 (file)
@@ -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 <<EOF
+#
+# INIT-COMMANDS section.
+#
+
+_AC_OUTPUT_COMMANDS_INIT()
+EOF])
+
+
 dnl Issue this section only if there were actually config files.
 dnl This checks if one of AC_LIST_HEADERS, AC_LIST_FILES, AC_LIST_COMMANDS,
 dnl or AC_LIST_LINKS is set.
 m4_ifval(AC_LIST_HEADERS()AC_LIST_LINKS()AC_LIST_FILES()AC_LIST_COMMANDS(),
-[cat >>$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 <<EOF
-#
-# INIT-COMMANDS section.
-#
-
-_AC_OUTPUT_COMMANDS_INIT()
-EOF])
-
-
 dnl The following four sections are in charge of their own here
 dnl documenting into $CONFIG_STATUS.
 m4_ifset([AC_LIST_FILES],    [_AC_OUTPUT_FILES()])dnl
index 32dc636a662e234d1fa9114d2357b81cb149914e..d12d9bf70736caca3ca55d6abdb56793bb0619e6 100644 (file)
@@ -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 <<EOF
+#
+# INIT-COMMANDS section.
+#
+
+_AC_OUTPUT_COMMANDS_INIT()
+EOF])
+
+
 dnl Issue this section only if there were actually config files.
 dnl This checks if one of AC_LIST_HEADERS, AC_LIST_FILES, AC_LIST_COMMANDS,
 dnl or AC_LIST_LINKS is set.
 m4_ifval(AC_LIST_HEADERS()AC_LIST_LINKS()AC_LIST_FILES()AC_LIST_COMMANDS(),
-[cat >>$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 <<EOF
-#
-# INIT-COMMANDS section.
-#
-
-_AC_OUTPUT_COMMANDS_INIT()
-EOF])
-
-
 dnl The following four sections are in charge of their own here
 dnl documenting into $CONFIG_STATUS.
 m4_ifset([AC_LIST_FILES],    [_AC_OUTPUT_FILES()])dnl
index 29c48f7fe2ecbda2dd2ed993a7aca5745602cd2d..95a1b36ec69ccf007767754dad411ead45011815 100644 (file)
@@ -75,6 +75,9 @@ AT_CHECK_AC_ARG_VAR([unset a precious variable],
 AT_CHECK_AC_ARG_VAR([change a precious variable],
                     [apple of my eye], [orange of my eye])
 
+
+
+
 ## ---------------------------------------------- ##
 ## AC_CONFIG_FILES, HEADERS, LINKS and COMMANDS.  ##
 ## ---------------------------------------------- ##
@@ -83,40 +86,79 @@ AT_SETUP([AC_CONFIG_FILES, HEADERS, LINKS and COMMANDS])
 
 AT_DATA(configure.ac,
 [[AC_INIT
-rm -rf header file link command
-touch header.in file.in link.in command.in
+rm -rf header var-header file var-file link var-link command var-command
+echo 'OK' >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])
+AT_CHECK([ls header var-header file var-file command var-command link var-link 2>/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)