Subject: AC_CONFIG_HEADERS with

From: Hib Eris <[email-masked]>
Date: Sun, 23 Sep 2012 17:57:39 +0200

Hi,

With AC_CONFIG_HEADERS(config.h subdir/myconfig.h) in configure.ac,
automake generates a target to build config.h.in with autoheader in
Makefile.in (as expected),
but it also generates a target in subdir/Makefile.in to build
subdir/myconfig.h.in which also runs autoheader.
This last target does not create subdir/myconfig.h as autoheader only
generates config.h, so this seems wrong.

I could not find much in the documentation of automake about what is
supposed to happen, but in the
source of  lib/am/remake-hdr.am I read:

## Only the first file of AC_CONFIG_HEADERS is assumed to be generated
## by autoheader.

So I understand that it is not the intention to have more then one
header file to trigger autoheader.
This only seems to happen when the second header file is in a subdir. With
AC_CONFIG_HEADERS(config.h myconfig.h) things work as expected, so I
guess this might be a bug that gets triggered only with header files
in subdirs.

I have attached a patch that fixes this problem for me.

Kind regards,

Hib Eris