automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

47-fyi-stamp-h.patch


From: Akim Demaille
Subject: 47-fyi-stamp-h.patch
Date: Fri, 26 Oct 2001 11:39:31 +0200

Why do we have a stamp for config.hin too?  After all, why not just
touching config.hin, since config.h is updated only when needed even
if config.hin changed.  That seems like too much hair to me, we want
to avoid gratuitous recompilation for updated config.h, this is OK,
hairy but understandable.  But then, it is on config.h only that we
should focus, not config.hin too.

In fact, I'm tempted to have autoheader stop not recreating config.hin
when asked to.

Index: ChangeLog
from  Akim Demaille  <address@hidden>

        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.

Index: lib/am/remake-hdr.am
--- lib/am/remake-hdr.am Thu, 25 Oct 2001 18:23:07 +0200 akim
+++ lib/am/remake-hdr.am Thu, 25 Oct 2001 19:56:50 +0200 akim
@@ -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
Index: m4/header.m4
--- m4/header.m4 Thu, 25 Oct 2001 19:26:07 +0200 akim
+++ m4/header.m4 Thu, 25 Oct 2001 20:15:08 +0200 akim
@@ -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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]