This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Improve C++ header detection in configure


In Debian and Ubuntu, we recently shuffled around some of the
C++ header locations to help multilib and multiarch co-exist
more pleasantly.  In the process, the configure magic to try
to find headers broke, as it assumed a rather rigid directory
structure.

The following patch replaces the rigid assumptions with
instead grabbing the full include list, and then grepping
for /c++/ and using the return.  This is working in current
Ubuntu and Debian, and was further tested by Carlos to return
correct results with older compilers back to gcc 4.2.

2012-11-22  Adam Conrad  <adconrad@0c3.net>

	* configure.in: Improve search for C++ headers by not
	assuming a uniform directory structure on all hosts.
	* configure: Regenerated.

--
--- a/configure.in	2012-11-21 12:37:04.000000000 -0700
+++ b/configure.in	2012-11-21 13:07:44.075825970 -0700
@@ -1033,12 +1033,11 @@
 -isystem `echo $sysheaders | sed 's/:/ -isystem /g'`"
   if test -n "$CXX"; then
     CXX_SYSINCLUDES=
-    cxxmachine=`$CXX -dumpmachine 2>&AS_MESSAGE_LOG_FD` &&
-    cxxheaders=`$CXX -v -S -x c++ /dev/null -o /dev/null 2>&1 \
-	| sed -n -e '1,/#include/d' -e '/^ \//{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"
+    for cxxheaders in `$CXX -v -S -x c++ /dev/null -o /dev/null 2>&1 \
+    | sed -n -e '1,/#include/d' -e '/^ \//{p;}' | tr -d ' ' | grep '/c++/'`; do
+      test "x$cxxheaders" != x &&
+      CXX_SYSINCLUDES="$CXX_SYSINCLUDES -isystem $cxxheaders"
+    done
   fi
 fi
 AC_SUBST(SYSINCLUDES)
-- 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]