diff options
author | Akim Demaille <akim@epita.fr> | 2001-10-26 09:56:43 +0000 |
---|---|---|
committer | Akim Demaille <akim@epita.fr> | 2001-10-26 09:56:43 +0000 |
commit | 60a93569e1c10c95a88f1e6b1bdb02b8dc665ef4 (patch) | |
tree | 1d87c7e6280662287aff28402ae566a39500e9cd | |
parent | 9738d7d6bba871738e08a37913da1628ec7fda4e (diff) | |
download | automake-60a93569e1c10c95a88f1e6b1bdb02b8dc665ef4.tar.gz |
* automake.in (&handle_configure): Use the config.status 2.50
invocation syntax for config files and headers.
autoheader needs the name of the file to create, not from what it
must be created, hence CONFIG_HEADER_FULL is $one_name, not
$one_fullname.
* lib/am/configure.am, lib/am/remake-hdr.am: Likewise.
* tests/confsub.test (SUBDIRS): Adjust to the new config.status
invocation.
Strengthen: Use the non-default config.hin source.
Strengthen: Make sure config.h is properly updated when config.hin
is changed.
-rw-r--r-- | ChangeLog | 14 | ||||
-rwxr-xr-x | automake.in | 23 | ||||
-rw-r--r-- | lib/am/configure.am | 4 | ||||
-rw-r--r-- | lib/am/remake-hdr.am | 5 | ||||
-rwxr-xr-x | tests/confsub.test | 25 |
5 files changed, 44 insertions, 27 deletions
@@ -1,5 +1,19 @@ 2001-10-26 Akim Demaille <akim@epita.fr> + * automake.in (&handle_configure): Use the config.status 2.50 + invocation syntax for config files and headers. + autoheader needs the name of the file to create, not from what it + must be created, hence CONFIG_HEADER_FULL is $one_name, not + $one_fullname. + * lib/am/configure.am, lib/am/remake-hdr.am: Likewise. + * tests/confsub.test (SUBDIRS): Adjust to the new config.status + invocation. + Strengthen: Use the non-default config.hin source. + Strengthen: Make sure config.h is properly updated when config.hin + is changed. + +2001-10-26 Akim Demaille <akim@epita.fr> + * automake.in (&handle_configure): Seeing Automake files in @other_input_files is a programming error, not merely something to ignore. diff --git a/automake.in b/automake.in index 5b68ef35e..58100fd70 100755 --- a/automake.in +++ b/automake.in @@ -3782,7 +3782,7 @@ sub handle_configure ('FILES' => join (' ', @files), 'CONFIG_HEADER' => $cn_sans_dir, 'CONFIG_HEADER_IN' => $ch_sans_dir, - 'CONFIG_HEADER_FULL' => $one_fullname, + 'CONFIG_HEADER_FULL' => $one_name, 'STAMP' => "$stamp_dir$stamp_name", 'SRC_STAMP' => "$out_dir/$stamp_name")); @@ -3836,30 +3836,26 @@ sub handle_configure my @actual_other_files = (); foreach my $lfile (@other_input_files) { - my ($file, $local); - my (@inputs, @rewritten_inputs); - my ($need_rewritten); + my $file; + my @inputs; if ($lfile =~ /^([^:]*):(.*)$/) { # This is the ":" syntax of AC_OUTPUT. $file = $1; @inputs = split (':', $2); - $need_rewritten = 1; } else { # Normal usage. $file = $lfile; @inputs = $file . '.in'; - $need_rewritten = 0; } # Automake files should not be stored in here, but in %MAKE_LIST. prog_error ("$lfile in \@other_input_files") if -f $file . '.am'; - $local = basename ($file); - @rewritten_inputs = rewrite_inputs_into_dependencies (1, @inputs); + my $local = basename ($file); # Make sure the dist directory for each input file is created. # We only have to do this at the topmost level though. This @@ -3902,16 +3898,15 @@ sub handle_configure next; } + my @rewritten_inputs = rewrite_inputs_into_dependencies (1, @inputs); $output_rules .= ($local . ': ' . '$(top_builddir)/config.status ' - . join (' ', @rewritten_inputs) . "\n" + . "@rewritten_inputs\n" . "\t" - . 'cd $(top_builddir) && CONFIG_FILES=' + . 'cd $(top_builddir) && ' + . '$(SHELL) ./config.status ' . ($relative_dir eq '.' ? '' : '$(subdir)/') - . '$@' . ($need_rewritten - ? (':' . join (':', @inputs)) - : '') - . ' CONFIG_HEADERS= CONFIG_LINKS= $(SHELL) ./config.status' + . '$@' . "\n"); push (@actual_other_files, $local); diff --git a/lib/am/configure.am b/lib/am/configure.am index bd2de242d..fe106179d 100644 --- a/lib/am/configure.am +++ b/lib/am/configure.am @@ -28,9 +28,7 @@ ## This rule remakes the Makefile. %MAKEFILE%: %MAINTAINER-MODE% %MAKEFILE-IN% %MAKEFILE-DEPS% $(top_builddir)/config.status - cd $(top_builddir) && \ - CONFIG_HEADERS= CONFIG_LINKS= \ - CONFIG_FILES=%CONFIG-MAKEFILE% $(SHELL) ./config.status + cd $(top_builddir) && $(SHELL) ./config.status %CONFIG-MAKEFILE% diff --git a/lib/am/remake-hdr.am b/lib/am/remake-hdr.am index c6d5c3304..af7535945 100644 --- a/lib/am/remake-hdr.am +++ b/lib/am/remake-hdr.am @@ -28,9 +28,8 @@ ## We used to try to get a real timestamp here. But the fear is that ## that will cause unnecessary cvs conflicts @echo timestamp > %STAMP%T 2> /dev/null - cd $(top_builddir) \ - && CONFIG_FILES= CONFIG_HEADERS=%CONFIG_HEADER_FULL% \ - $(SHELL) ./config.status + cd $(top_builddir) && $(SHELL) ./config.status %CONFIG_HEADER_FULL% + ## Creating the timestamp first, and moving it later, helps ensure that ## it will be older than the header file, avoiding needless triggering ## of the rebuild rule. diff --git a/tests/confsub.test b/tests/confsub.test index f80327712..4796965d8 100755 --- a/tests/confsub.test +++ b/tests/confsub.test @@ -1,16 +1,14 @@ #! /bin/sh # Test to make sure config.h can be in subdir. +# Also, make sure config.h is properly rebuilt. . $srcdir/defs || exit 1 cat > configure.in << 'END' AC_INIT AM_INIT_AUTOMAKE(nonesuch, nonesuch) -AM_CONFIG_HEADER(subdir/config.h) -PACKAGE=nonesuch -VERSION=nonesuch -AC_PROG_CC +AM_CONFIG_HEADER(subdir/config.h:subdir/config.hin) AC_OUTPUT(Makefile subdir/Makefile) END @@ -20,14 +18,27 @@ END mkdir subdir cat > subdir/Makefile.am << 'END' -bin_PROGRAMS = fred END -: > subdir/config.h.in +echo 'Before.' > subdir/config.hin $ACLOCAL || exit 1 $AUTOMAKE || exit 1 # Make sure subdir Makefile.in doesn't itself look in the subdir. -(grep 'subdir/config.h' subdir/Makefile.in | grep -v CONFIG_HEADERS) && exit 1 +# One line is allowed though: +# +# cd $(top_builddir) && $(SHELL) ./config.status subdir/config.h +(fgrep 'subdir/config.h' subdir/Makefile.in | + fgrep -v 'cd $(top_builddir)') && exit 1 + +autoconf || exit 1 +./configure || exit 1 +fgrep 'Before.' subdir/config.h + +sleep 1 +echo 'After.' > subdir/config.hin +make || exit 1 +fgrep 'After.' subdir/config.h || exit 1 + exit 0 |