bug-automake
[Top][All Lists]
Advanced

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

not touching config.h makes SGI make re-build all the sources again and


From: Toni Ronkko
Subject: not touching config.h makes SGI make re-build all the sources again and again
Date: Wed, 24 Oct 2001 18:27:20 +0300 (WET)

Makefiles generated using automake 1.5 fail to touch the `config.h' 
file on a Silicon Graphics O2 workstation making SGI's make re-build
all the sources on every occasion.  GNU make however works fine.

When configuring software using autoconf and automake, a `config.h'
file is created.  When the software is compiled for the very first
time, a `stamp-h' file is being created.  The problem is that invoking
make does not touch the `config.h' file.  This is a problem since in
generated Makefiles the `config.h' file depends on the `stamp-h' file and
since the `config.h' file is not touched by the make, the SGI make tries
to update the file on every possible occasion.  I guess that when the SGI
make is invoked it first sees that `config.h' file is not up to date and
tries to re-build it without succeeding to touch the file.  Since some
commands were executed in order to bring the file up to date, the SGI
make then re-builds all the sources depending on the `config.h' file
without checking whether the file was really changed.  All the sources
depend on `config.h' file and the SGI make ends up re-building everything
on every time.  This is makes developing software painful.

Here is how to repeat the problem using either SGI or GNU make.  At
first grab a piece of software and build it.  Then invoke make using
command `make -n' to see that the make would build `config.h' file if
given a chance.  Invoke make to update the file.  If you happen to use
SGI make, the sources are being re-build at this time.  Otherwise,
nothing special happens.  After updating the file, invoke command
`make -n' again just to see that the `config.h' file still needs to be
updated.  If you look more closely at the commands which the make
would execute if given a chance, you will notice that nothing will be
done to update the `config.h' if it already exists.  I think this is
what makes the SGI make behave badly.

There is a patch file included in this mail that fixes the problem by
explicitly touching both the `config.h' and the accompanying
`config.h.in' files.  Before creating the patch, I placed the original
source file to a directory called `yours' and then placed my modified
version to a directory called `mine'.  I then created the patch using
command `diff -c yours mine > am.diff'.  When applying the patch, you
must be in a directory containing `remake-hdr.am' file.  It is a
directory with lots of .am files in it.  To apply the patch, issue 
command  `patch -p1 < am.diff'.

Toni Ronkko

Attachment: am.diff
Description: Text document


reply via email to

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