diff options
author | klarlund <klarlund@01de4be4-8c4a-0410-9132-4925637da917> | 2008-05-09 18:15:18 +0000 |
---|---|---|
committer | klarlund <klarlund@01de4be4-8c4a-0410-9132-4925637da917> | 2008-05-09 18:15:18 +0000 |
commit | 9dd498f86c7179a1c9642a3d9fd9b9323d6c10d3 (patch) | |
tree | 30374f419a5f86ad3f4357694162f8c248b611d1 /src/safeguard.c | |
parent | 8acf0c1215996e2d5ece310080a2d23a007c6f61 (diff) | |
download | distcc-9dd498f86c7179a1c9642a3d9fd9b9323d6c10d3.tar.gz |
Make handling of config.h sound.
(1) Correct order of -Is in Makefile.
(2) remove unnessary PATH modification in configure.ac (this is fergus's
suggestion -- hopefully this will do, this replaces a circumvention mechanism I
had originally concocted.
(3) Fix place of the include of popt in CPPFLAGS.
(4) Convert quoted includes of config.h to angle bracket includes so that the
build version, not the source version, of this file is picked up.
The order of -Is in the build system is wrong: it contradicts the
VPATH mechanism.
This means that builds in a build directory different from that
of the source (distribution) directory will find wrong files even
after the hapless developer has issued only a 'configure' command
in the source directory (but not actually 'made' any thing
there). For in that case, the src/config.h will be generated in
the source directory and this will be the file picked in the
build directory even if that directory has it's own src/config.h.
This can lead to wrong builds and it can be hard to diagnose the
problem.
Currently, this what CPPFLAGS end up being (as found in the
generated Makefile):
CPPFLAGS = -DHAVE_CONFIG_H -D_GNU_SOURCE \
-I../distcc/popt -I../distcc/src \
${DIR_DEFS} \
-Isrc -Ilzo \
-I"$(srcdir)/src" -I"$(srcdir)/lzo" \
Here my source dir was ../distcc.
The presence of '-I../distcc/popt' in front of -Isrc is the exact
opposite of the semantics of VPATH mechanism, which looks for
files in the build directory, then in the source directory.
Also, note the remarks in:
http://www.gnu.org/software/autoconf/manual/autoconf.html#Configuration-Headers
(they do not quite correctly discuss the search path, btw).
TESTING: I verified that with a corrupted config.h file in the source directory,
building now succeeds.
Also: make distcheck (it fails the same place as before: this is corrected in
another change of mine --- I'll verify that with that change in place, this
change makes 'make distcheck' succeed.)
REVIEWERS: fergus@google.com, csilvers@google.com
git-svn-id: http://distcc.googlecode.com/svn/trunk@148 01de4be4-8c4a-0410-9132-4925637da917
Diffstat (limited to 'src/safeguard.c')
-rw-r--r-- | src/safeguard.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/safeguard.c b/src/safeguard.c index 204484e..37e39fb 100644 --- a/src/safeguard.c +++ b/src/safeguard.c @@ -20,7 +20,7 @@ * USA */ -#include "config.h" +#include <config.h> #include <stdio.h> #include <stdlib.h> |