This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] Improve C++ header location detection
- From: Allan McRae <allan at archlinux dot org>
- To: libc-alpha <libc-alpha at sourceware dot org>
- Date: Mon, 03 Sep 2012 13:12:04 +1000
- Subject: [PATCH] Improve C++ header location detection
When the C++ headers are in a non-standard location (either from using
--with-gxx-include-dir or --enable-version-specific-runtime-libs when
configuring gcc), some of the test suite fails due to the use of
-nostdinc. Use the compilers ouptut to provide the header location
rather than a hardcoded guess.
2012-09-02 Allan McRae <allan@archlinux.org>
[BS #13966]
* configure.in (CXX_SYSINCLUDES): Use compiler output to
determine header location.
* configure: Regenerated.
diff --git a/configure.in b/configure.in
index 7de4b09..a174646 100644
--- a/configure.in
+++ b/configure.in
@@ -975,13 +975,11 @@ if test -n "$sysheaders"; then
CXX_SYSINCLUDES=
cxxversion=`$CXX -dumpversion 2>&AS_MESSAGE_LOG_FD` &&
cxxmachine=`$CXX -dumpmachine 2>&AS_MESSAGE_LOG_FD` &&
- for d in include "$cxxmachine/include"; do
- i=../../../../$d/c++/$cxxversion
- cxxheaders=`$CXX -print-file-name="$i"` &&
- test "x$cxxheaders" != x && test "x$i" != "x$cxxheaders" &&
- CXX_SYSINCLUDES="$CXX_SYSINCLUDES -isystem $cxxheaders \
+ cxxplus=`$CXX -print-prog-name=cc1plus`
+ cxxheaders=`$cxxplus -v /dev/null 2>&1 | sed -n '/ \//{p;q;}' | sed
's/ //'`
+ test "x$cxxheaders" != x && test "x$i" != "x$cxxheaders" &&
+ CXX_SYSINCLUDES="$CXX_SYSINCLUDES -isystem $cxxheaders \
-isystem $cxxheaders/$cxxmachine -isystem $cxxheaders/backward"
- done
fi
fi
AC_SUBST(SYSINCLUDES)