[Top][All Lists]

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

automake 1.7.9 : wrong order of creation config header and stamp file.

From: Carlo Wood
Subject: automake 1.7.9 : wrong order of creation config header and stamp file.
Date: Thu, 8 Apr 2004 18:48:36 +0200
User-agent: Mutt/1.4.1i

The normal (automake generated) rules for (re)generating config.h, are:

config.h: stamp-h1
        @if test ! -f $@; then \
          rm -f stamp-h1; \
          $(MAKE) stamp-h1; \
        else :; fi

stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
        @rm -f stamp-h1
        cd $(top_builddir) && $(SHELL) ./config.status config.h

This means that when the latter is executed then config.h
is generated and thus has a timestamp that is newer than
stamp-h1; causing the first rule not to trigger (anymore).

In other words, config.h must be NEWER than stamp-h1, normally.

However, config.status generates them in the reversed order:
First config.h and then stamp-h1, causing the timestamp on stamp-h1
to be wrong.

As a result, when configuring with --enable-maintainer-mode,
the first run of 'make' will redundantly generate config.h

For example,

/usr/src/gtk/eDragon/build>../configure  --enable-maintainer-mode --enable-debug
configure: creating ./config.status
config.status: creating config.h

cd .. && /bin/sh /usr/src/gtk/eDragon/missing --run autoheader
touch ../config.h.in
cd . && /bin/sh ./config.status config.h
config.status: creating config.h
config.status: config.h is unchanged
make  all-recursive
make[1]: Entering directory `/usr/src/gtk/eDragon/build'

I edited autoconf/autoconf.m4f and autoconf/status.m4
and moved the block

dnl If running for Automake, be ready to perform additional
dnl commands to set up the timestamp files.

up to just before

  # Let's still pretend it is `configure' which instantiates (i.e., don't

This fixed this problem for me.

On the other hand - it might be better to change automake,
change _AC_AM_CONFIG_HEADER_HOOK to touch [$ac_file] after
creating the timestamp:


echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])


echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count
touch $1])

in m4/init.m4

I attached a patch for that.  This also fixed the problem for me
(After configure:)

/usr/src/gtk/eDragon/build>ls -lt --time-style=+%H:%M:%S.%N
total 152
-rw-r--r--    1 carlo    carlo       41727 18:42:29.986630952 config.log
drwxr-xr-x    2 carlo    carlo        4096 18:42:29.595690384 po/
drwxr-xr-x    6 carlo    carlo        4096 18:42:29.191751792 src/
-rw-r--r--    1 carlo    carlo        6865 18:42:29.080768664 config.h
-rw-r--r--    1 carlo    carlo          23 18:42:29.078768968 stamp-h1
drwxr-xr-x    2 carlo    carlo        4096 18:42:28.930791464 doc/
drwxr-xr-x    3 carlo    carlo        4096 18:42:28.572845880 m4/
drwxr-xr-x    2 carlo    carlo        4096 18:42:28.333882208 intl/
-rw-r--r--    1 carlo    carlo       19760 18:42:27.581996512 Makefile
-rwxr-xr-x    1 carlo    carlo       50162 18:42:27.111068104 config.status*


Carlo Wood <address@hidden>

Attachment: automake-1.7.9-run.diff
Description: Text document

reply via email to

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