diff options
author | Akim Demaille <akim@epita.fr> | 2001-10-26 09:59:59 +0000 |
---|---|---|
committer | Akim Demaille <akim@epita.fr> | 2001-10-26 09:59:59 +0000 |
commit | 577d3577cdb7222420b93de2d3b55a746609f335 (patch) | |
tree | e366f97385fe71480b3859a97fa5b9bf6d4622b1 /m4/header.m4 | |
parent | f2abc4b3df2708615ae083b998aaeaa4c82632e3 (diff) | |
download | automake-577d3577cdb7222420b93de2d3b55a746609f335.tar.gz |
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.
Diffstat (limited to 'm4/header.m4')
-rw-r--r-- | m4/header.m4 | 56 |
1 files changed, 32 insertions, 24 deletions
diff --git a/m4/header.m4 b/m4/header.m4 index a574c05db..63b90e5af 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 |