From 577d3577cdb7222420b93de2d3b55a746609f335 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Fri, 26 Oct 2001 09:59:59 +0000 Subject: [PATCH] Now that stamp-h's are created by config.status, we don't need to handle them in Makefile's. * lib/am/remake-hdr.am (%STAMP%): Just run config.status. * m4/header.m4 (_AM_STAMP): New. (_AM_CONFIG_HEADER): Use it. --- ChangeLog | 9 +++++++++ lib/am/remake-hdr.am | 28 +++++++++++++------------- m4/header.m4 | 56 ++++++++++++++++++++++++++++++---------------------- 3 files changed, 55 insertions(+), 38 deletions(-) diff --git a/ChangeLog b/ChangeLog index ae2cb74..e07e849 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2001-10-26 Akim Demaille + Now that stamp-h's are created by config.status, we don't need to + handle them in Makefile's. + + * lib/am/remake-hdr.am (%STAMP%): Just run config.status. + * m4/header.m4 (_AM_STAMP): New. + (_AM_CONFIG_HEADER): Use it. + +2001-10-26 Akim Demaille + * automake.in (&generate_makefile, &handle_texinfo_helper) (&handle_man_pages, &handle_dist, &handle_configure, &handle_all) (&define_pretty_variable, &read_am_file, &file_contents_internal) diff --git a/lib/am/remake-hdr.am b/lib/am/remake-hdr.am index af75359..37fbffa 100644 --- a/lib/am/remake-hdr.am +++ b/lib/am/remake-hdr.am @@ -16,32 +16,32 @@ ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. + +## Explicitly look in srcdir for benefit of non-GNU makes. + + %CONFIG_HEADER%: %STAMP% ## Recover from removal of CONFIG_HEADER @if test ! -f $@; then \ - rm -f %STAMP%; \ - $(MAKE) %STAMP%; \ + rm -f %STAMP%; \ + $(MAKE) %STAMP%; \ else :; fi -## Explicitly look in srcdir for benefit of non-GNU makes. + + %STAMP%: $(srcdir)/%CONFIG_HEADER_IN% $(top_builddir)/config.status - @rm -f %STAMP% %STAMP%T -## 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 + @rm -f %STAMP% 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. - @mv %STAMP%T %STAMP% -## Explicitly look in srcdir for benefit of non-GNU makes. + ## 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; \ + 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 diff --git a/m4/header.m4 b/m4/header.m4 index a574c05..63b90e5 100644 --- a/m4/header.m4 +++ b/m4/header.m4 @@ -19,51 +19,59 @@ AC_PREREQ([2.52]) -# serial 5 +# serial 6 # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. We must strip everything past the first ":", # and everything past the last "/". +# _AM_DIRNAME(PATH) +# ----------------- +# Like AS_DIRNAME, only do it during macro expansion +AC_DEFUN([_AM_DIRNAME], + [m4_if(regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1, + m4_if(regexp([$1], [^//\([^/]\|$\)]), -1, + m4_if(regexp([$1], [^/.*]), -1, + [.], + patsubst([$1], [^\(/\).*], [\1])), + patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])), + patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl +])# _AM_DIRNAME + + # The stamp files are numbered to have different names. # We could number them on a directory basis, but that's additional # complications, let's have a unique counter. -m4_define([_AM_Config_Header_Index], [0]) +m4_define([_AM_STAMP_Count], [0]) + + +# _AM_STAMP(HEADER) +# ----------------- +# The name of the stamp file for HEADER. +AC_DEFUN([_AM_STAMP], +[m4_define([_AM_STAMP_Count], m4_incr(_AM_STAMP_Count))dnl +AS_ESCAPE(_AM_DIRNAME(patsubst([$1], + [:.*])))/stamp-h[]_AM_STAMP_Count]) # _AM_CONFIG_HEADER(HEADER[:SOURCES], COMMANDS, INIT-COMMANDS) # ------------------------------------------------------------ +# We used to try to get a real timestamp in stamp-h. But the fear is that +# that will cause unnecessary cvs conflicts. AC_DEFUN([_AM_CONFIG_HEADER], -[m4_pushdef([_AM_Dest], patsubst([$1], [:.*])) -m4_define([_AM_Config_Header_Index], m4_incr(_AM_Config_Header_Index)) -# Add the stamp file to the list of files AC keeps track of, -# along with our hook +[# Add the stamp file to the list of files AC keeps track of, +# along with our hook. AC_CONFIG_HEADERS([$1], [# update the timestamp -echo timestamp >"AS_ESCAPE(_AM_DIRNAME(]_AM_Dest[))/stamp-h]_AM_Config_Header_Index[" +echo 'timestamp for $1' >"_AM_STAMP([$1])" $2], [$3]) -m4_popdef([_AM_Dest]) -])# # _AM_CONFIG_HEADER +])# _AM_CONFIG_HEADER # AM_CONFIG_HEADER(HEADER[:SOURCES]..., COMMANDS, INIT-COMMANDS) # -------------------------------------------------------------- AC_DEFUN([AM_CONFIG_HEADER], [AC_FOREACH([_AM_File], [$1], [_AM_CONFIG_HEADER(_AM_File, [$2], [$3])]) -]) # AM_CONFIG_HEADER - - -# _AM_DIRNAME(PATH) -# ----------------- -# Like AS_DIRNAME, only do it during macro expansion -AC_DEFUN([_AM_DIRNAME], - [m4_if(regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1, - m4_if(regexp([$1], [^//\([^/]\|$\)]), -1, - m4_if(regexp([$1], [^/.*]), -1, - [.], - patsubst([$1], [^\(/\).*], [\1])), - patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])), - patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl -]) # _AM_DIRNAME +])# AM_CONFIG_HEADER -- 2.7.4