diff options
author | klarlund <klarlund@gmail.com> | 2008-05-09 18:15:18 +0000 |
---|---|---|
committer | klarlund <klarlund@gmail.com> | 2008-05-09 18:15:18 +0000 |
commit | a31b5d6a22150bc54c93166910ba9f351081c659 (patch) | |
tree | 30374f419a5f86ad3f4357694162f8c248b611d1 /configure.ac | |
parent | e76bb3a5577f9077249b32dea98ebfa45ccc497c (diff) | |
download | distcc-git-a31b5d6a22150bc54c93166910ba9f351081c659.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
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index 861269a..b3589f4 100644 --- a/configure.ac +++ b/configure.ac @@ -320,7 +320,7 @@ then AC_MSG_RESULT($srcdir/popt) # popt_OBJS gets appended to distccd object list BUILD_POPT='$(popt_OBJS)' - CPPFLAGS="$CPPFLAGS -I$srcdir/popt" + POPT_INCLUDES="$srcdir/popt" else LIBS="$LIBS -lpopt" AC_MSG_RESULT(no) @@ -335,7 +335,13 @@ AC_TYPE_SIGNAL ######################################################################## # Checks for library functions, using libraries discovered above -CPPFLAGS="$CPPFLAGS -I$srcdir/src" + +# The line below was commented out: it should not be necessary for the +# AC_CHECK_FUNCS, which link against libraries on the host. For the subsequent +# explicit compilation tests below, no distcc libraries are used. +# TODO(klarlund): remove the line. + +# CPPFLAGS="$CPPFLAGS -I$srcdir/src" AC_CHECK_FUNCS([getpagesize]) AC_CHECK_FUNCS([sendfile setsid flock lockf hstrerror strerror setuid setreuid]) @@ -451,6 +457,7 @@ AC_SUBST(docdir) AC_SUBST(CFLAGS) AC_SUBST(LDFLAGS) AC_SUBST(CPPFLAGS) +AC_SUBST(POPT_INCLUDES) AC_SUBST(BUILD_POPT) AC_SUBST(GNOME_BIN) AC_DEFINE_UNQUOTED(GNU_HOST, ["$host"], [Your gnu-style host triple]) |