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): 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.
('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"));
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
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);
## 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%
## 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.
#! /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
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