diff options
author | Dan Nicholson <dbn.lists@gmail.com> | 2008-03-07 11:48:09 -0800 |
---|---|---|
committer | Dan Nicholson <dbn.lists@gmail.com> | 2008-03-07 11:48:09 -0800 |
commit | db7fc6311086b512f63ba74d7ab6cda47b662839 (patch) | |
tree | 5f238ce2207d20884dc05bfdc81892935a02aa91 | |
parent | 1e6943cf5592186c3721dfefbdcf1a519a79bd8f (diff) |
autoconf: Print GCC include path directly and be more robust using it
Rather than constructing the GCC include path from `-print-search-dirs',
we can get the path directly from `-print-file-name=include'. This is
used in the Linux kernel build, for example. If no output is returned
from the command, then we don't append a -I path the the makedepend
options.
-rw-r--r-- | configure.ac | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac index ec1bb8288ef..ca3f9171969 100644 --- a/configure.ac +++ b/configure.ac @@ -30,12 +30,13 @@ AC_PATH_PROG(MAKE, make) AC_PATH_PROG(MKDEP, makedepend) AC_PATH_PROG(SED, sed) +MKDEP_OPTIONS=-fdepend dnl Ask gcc where it's keeping its secret headers if test "x$GCC" = xyes; then - GCC_PATH=$(gcc -print-search-dirs | sed -ne 's/install: //p') - MKDEP_OPTIONS="-fdepend -I${GCC_PATH}include" -else - MKDEP_OPTIONS=-fdepend + GCC_INCLUDES=`$CC -print-file-name=include` + if test "x$GCC_INCLUDES" != x; then + MKDEP_OPTIONS="$MKDEP_OPTIONS -I$GCC_INCLUDES" + fi fi AC_SUBST(MKDEP_OPTIONS) |