This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Improve C++ header location detection
On 05/09/12 08:09, Carlos O'Donell wrote:
> On 9/4/2012 6:03 PM, Allan McRae wrote:
>> On 05/09/12 00:35, Carlos O'Donell wrote:
>>> 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.
>>>
>>
>> I tested with my gcc-4.8 build so that is fixed.
>>
>> What other compilers beyond gcc are supported?
>
> My apologies I should have been more precise.
>
> I should have said "Does this work for all
> versions of GCC that we support?"
>
> I know that this is hard to answer, but a
> scatter-gun approach of testing compilers
> from 4.3 and up should suffice.
>
Ah... In that case the answer is yes. This works will all gcc-4.x releases.
Allan