diff options
author | Stefano Lattarini <stefano.lattarini@gmail.com> | 2012-09-28 21:27:41 +0200 |
---|---|---|
committer | Stefano Lattarini <stefano.lattarini@gmail.com> | 2012-10-02 17:12:51 +0200 |
commit | 25ffe7d54d557a056a1c00332a2fea2bbf8ba532 (patch) | |
tree | 0d2b4d70152c9d6567f7eb2295704414e9cc6483 /lib/am/remake-hdr.am | |
parent | 58ec9d74d9001246b222320f2a9dfe8ecb71bb52 (diff) | |
download | automake-25ffe7d54d557a056a1c00332a2fea2bbf8ba532.tar.gz |
config headers: don't emit rules for headers not generated by autoheader
This change fixed automake bug#12495.
Even if an AC_CONFIG_HEADERS invocation is passed a list of several files
as the first argument, only the first one of those file is considered by
autoheader for automatic generation of the corresponding '.in' template.
This is done on purpose, and is clearly documented in the Autoconf manual,
which (as of the 2.69 version) reads something like this:
The autoheader program searches for the first invocation of
AC_CONFIG_HEADERS in configure sources to determine the name of
the template. If the first call of AC_CONFIG_HEADERS specifies
more than one input file name, autoheader uses the first one.
That is, an invocation like:
AC_CONFIG_HEADERS([config.h config2.h])
should cause autoheader to generate only a 'config.h.in' template,
and not also a 'config2.h.in' one.
Accordingly, automake, when tracing AC_CONFIG_HEADERS, should generate
remake rules only for the template associated to the first input file
name passed to that macro. In some situations, however, automake failed
to properly limit itself in this way; for example, with an input like:
AC_CONFIG_HEADERS([config.h sub/foo.h])
in configure.ac, and with the 'sub' directory listed in the SUBDIRS
variable of the top-level Makefile, automake would erroneously generate
in 'sub/Makefile.in' a rule to remake the 'foo.h.in' template by
invoking autoheader.
This issue was likely introduced in commit 'Release-1-8-23-g262bb92'
of 2004-01-05.
* NEWS: Update.
* doc/automake.texi (Optional): Improve wording in the description of
hat rules automake generates in response to an 'AC_CONFIG_HEADERS'
invocation.
* lib/am/remake-hdr.am: Only emit autoheader-invoking remake rules for
the %CONFIG_HIN% template if that corresponds to the first argument of
AC_CONFIG_HEADERS, as explaned above. Do so using the automake-time
conditional %?FIRST-HDR%, that is properly passed ...
* automake.in (handle_configure): ... from a 'file_contents' invocation
in here.
* t/autohdr-subdir-pr12495.sh: New test.
* t/list-of-tests.mk: Add it.
* THANKS: Update.
Helped-by: Hib Eris <hib@hiberis.nl>
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Diffstat (limited to 'lib/am/remake-hdr.am')
-rw-r--r-- | lib/am/remake-hdr.am | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/am/remake-hdr.am b/lib/am/remake-hdr.am index f61400a79..3c7e346d4 100644 --- a/lib/am/remake-hdr.am +++ b/lib/am/remake-hdr.am @@ -30,7 +30,7 @@ ## Only the first file of AC_CONFIG_HEADERS is assumed to be generated ## by autoheader. -if %?FIRST% +if %?FIRST-HDR% %CONFIG_HIN%: %MAINTAINER-MODE% $(am__configure_deps) %FILES% ## Cater to parallel BSD make. ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) @@ -71,4 +71,4 @@ if %?FIRST% ## by config.status, there is no reason to make things complex for ## config.hin. touch $@ -endif %?FIRST% +endif %?FIRST-HDR% |