From c931eeb80ec68f48527538ea4718eb1a062d1c7d Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Mon, 5 Nov 2001 09:24:06 +0000 Subject: [PATCH] * automake.in (@common_sometimes, &handle_configure): No longer use stamp-hin. * lib/am/remake-hdr.am: Adjust. * tests/confh.test: There is no stamp.hin. --- ChangeLog | 7 +++++++ automake.in | 44 +++++++++++++++++++------------------------- lib/am/remake-hdr.am | 31 ++++++++++--------------------- tests/confh.test | 4 ---- 4 files changed, 36 insertions(+), 50 deletions(-) diff --git a/ChangeLog b/ChangeLog index d4b2a87..c95c740 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2001-11-05 Akim Demaille + + * automake.in (@common_sometimes, &handle_configure): No longer + use stamp-hin. + * lib/am/remake-hdr.am: Adjust. + * tests/confh.test: There is no stamp.hin. + 2001-11-01 Akim Demaille * lib/am/lex.am, lib/am/yacc.am: Use the output file name in diff --git a/automake.in b/automake.in index 18cbdc4..d45a8d2 100755 --- a/automake.in +++ b/automake.in @@ -215,7 +215,7 @@ my @common_files = my @common_sometimes = ( 'aclocal.m4', 'acconfig.h', 'config.h.top', - 'config.h.bot', 'stamp-h.in', 'stamp-vti' + 'config.h.bot', 'stamp-vti' ); # Copyright on generated Makefile.ins. @@ -3676,33 +3676,34 @@ sub handle_configure my @distclean_config; foreach my $spec (@config_headers) { - my ($out, @ins) = split_config_file_spec ($spec); $hdr_index += 1; - my $header_dir = dirname ($out); + # $CONFIG_H_PATH: config.h from top level. + my ($config_h_path, @ins) = split_config_file_spec ($spec); + my $config_h_dir = dirname ($config_h_path); # If the header is in the current directory we want to build # the header here. Otherwise, if we're at the topmost # directory and the header's directory doesn't have a # Makefile, then we also want to build the header. - if ($relative_dir eq $header_dir - || ($relative_dir eq '.' && ! &is_make_dir ($header_dir))) + if ($relative_dir eq $config_h_dir + || ($relative_dir eq '.' && ! &is_make_dir ($config_h_dir))) { my ($cn_sans_dir, $stamp_dir); - if ($relative_dir eq $header_dir) + if ($relative_dir eq $config_h_dir) { - $cn_sans_dir = basename ($out); + $cn_sans_dir = basename ($config_h_path); $stamp_dir = ''; } else { - $cn_sans_dir = $out; - if ($header_dir eq '.') + $cn_sans_dir = $config_h_path; + if ($config_h_dir eq '.') { $stamp_dir = ''; } else { - $stamp_dir = $header_dir . '/'; + $stamp_dir = $config_h_dir . '/'; } } @@ -3723,11 +3724,11 @@ sub handle_configure # Header defined and in this directory. my @files; - if (-f $out . '.top') + if (-f $config_h_path . '.top') { push (@files, "$cn_sans_dir.top"); } - if (-f $out . '.bot') + if (-f $config_h_path . '.bot') { push (@files, "$cn_sans_dir.bot"); } @@ -3740,21 +3741,14 @@ sub handle_configure push (@files, '$(top_srcdir)/acconfig.h'); } - my $stamp_name = "stamp-h$hdr_index"; - my $out_dir = dirname ($in0_sans_dir); - + my $stamp = "${stamp_dir}stamp-h${hdr_index}"; $output_rules .= file_contents ('remake-hdr', - ('FILES' => "@files", - 'CONFIG_HEADER' => $cn_sans_dir, - 'CONFIG_HEADER_IN' => $in0_sans_dir, - 'CONFIG_HEADER_FULL' => $out, - 'STAMP' => "$stamp_dir$stamp_name", - 'SRC_STAMP' => "$out_dir/$stamp_name")); - - create ("$relative_dir/$out_dir/$stamp_name.in"); - require_file ($config_header_location, $FOREIGN, - "$out_dir/$stamp_name.in"); + ('FILES' => "@files", + 'CONFIG_H' => $cn_sans_dir, + 'CONFIG_HIN' => $in0_sans_dir, + 'CONFIG_H_PATH' => $config_h_path, + 'STAMP' => "$stamp")); push @distclean_config, $cn_sans_dir; } diff --git a/lib/am/remake-hdr.am b/lib/am/remake-hdr.am index 37fbffa..dec58de 100644 --- a/lib/am/remake-hdr.am +++ b/lib/am/remake-hdr.am @@ -20,7 +20,7 @@ ## Explicitly look in srcdir for benefit of non-GNU makes. -%CONFIG_HEADER%: %STAMP% +%CONFIG_H%: %STAMP% ## Recover from removal of CONFIG_HEADER @if test ! -f $@; then \ rm -f %STAMP%; \ @@ -28,27 +28,16 @@ else :; fi -%STAMP%: $(srcdir)/%CONFIG_HEADER_IN% $(top_builddir)/config.status +%STAMP%: $(srcdir)/%CONFIG_HIN% $(top_builddir)/config.status @rm -f %STAMP% - cd $(top_builddir) && $(SHELL) ./config.status %CONFIG_HEADER_FULL% + cd $(top_builddir) && $(SHELL) ./config.status %CONFIG_H_PATH% -## SRC_STAMP takes into account a possible subdir where CONFIG_HEADER_IN is -$(srcdir)/%CONFIG_HEADER_IN%: %MAINTAINER-MODE% $(srcdir)/%SRC_STAMP%.in -## Recover from removal of CONFIG_HEADER_IN - @if test ! -f $@; then \ - rm -f $(srcdir)/%SRC_STAMP%.in; \ - $(MAKE) $(srcdir)/%SRC_STAMP%.in; \ - else :; fi - - -$(srcdir)/%SRC_STAMP%.in: $(top_srcdir)/%CONFIGURE-AC% $(ACLOCAL_M4) %FILES% - @rm -f $(srcdir)/%SRC_STAMP%.in $(srcdir)/%SRC_STAMP%.inT -## We used to try to get a real timestamp here. But the fear is that -## that will cause unnecessary cvs conflicts - @echo timestamp > $(srcdir)/%SRC_STAMP%.inT 2> /dev/null +$(srcdir)/%CONFIG_HIN%: %MAINTAINER-MODE% $(top_srcdir)/%CONFIGURE-AC% $(ACLOCAL_M4) %FILES% cd $(top_srcdir) && $(AUTOHEADER) -## 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. - @mv $(srcdir)/%SRC_STAMP%.inT $(srcdir)/%SRC_STAMP%.in +## Autoheader has the bad habit of not changing the time stamp if +## config.hin is unchanged, which breaks Make targets. Since what +## must not changed gratuitiously is config.h, which is already handled +## by config.status, there is no reason to make things complex for +## config.hin. + touch $(srcdir)/%CONFIG_HIN% diff --git a/tests/confh.test b/tests/confh.test index 45f3b2d..d2b482d 100755 --- a/tests/confh.test +++ b/tests/confh.test @@ -8,8 +8,6 @@ cat > configure.in << 'END' AC_INIT AM_INIT_AUTOMAKE(nonesuch, nonesuch) -PACKAGE=nonesuch -VERSION=nonesuch AM_CONFIG_HEADER(include/config.h) AC_OUTPUT(Makefile include/Makefile) END @@ -33,8 +31,6 @@ $AUTOMAKE || exit 1 n }' -e '/^DIST_COMMON =/ p' Makefile.in | grep acconfig.h) || exit 1 -grep 'stamp-h1\.in:.*acconfig.h' include/Makefile.in || exit 1 - # Make sure re-running automake in a different way generates same # Makefile.in. mv Makefile.in save -- 2.7.4