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]

Re: [PATCH] Improve C++ header location detection


On 9/2/2012 11:12 PM, Allan McRae wrote:
> 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)

Does this work for all versions of compilers that we support?

Does this work for gcc 4.8, which Andreas indicates has 
problems with the original code?

OK to checkin if the answers are Yes, and Yes.

Cheers,
Carlos.
-- 
Carlos O'Donell
Mentor Graphics / CodeSourcery
carlos_odonell@mentor.com
carlos@codesourcery.com
+1 (613) 963 1026


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