[PATCH] Improve C++ header detection in configure

Carlos O'Donell carlos@systemhalted.org
Fri Nov 23 21:31:00 GMT 2012


On Fri, Nov 23, 2012 at 4:26 PM, Carlos O'Donell
<carlos@systemhalted.org> wrote:
> On Fri, Nov 23, 2012 at 4:19 PM, Adam Conrad <adconrad@0c3.net> wrote:
>> On Fri, Nov 23, 2012 at 03:59:15PM -0500, Carlos O'Donell wrote:
>>>
>>> Some systems, namely gentoo, uses `g++-v4' (on hppa at least) as the
>>> C++ header path segment. This leads me to believe that the path is
>>> less likely to always be `c++'. However, there has always been a
>>> `/.++' in the C++ header path, so lets stick with that. Therefore it
>>> looks like what we want is 's/^ \(\/.*\/.++.*\)/\1/p'
>>
>> That last .* is unnecessary, it's implied without a $-termination.  As
>> for the single-char match, I'm having a hard time believing anyone
>> installed headers to, say, /path/to/q++-v3, so perhaps a more restrictive
>> match would be sane, like:
>>
>> 's/^ \(\/.*\/[cg]++\)/\1/p'
>>
>> Or, if you meant your last .* to match, say, -v4, but still allow the
>> closing / that I had:
>>
>> 's/^ \(\/.*\/[cg]++.*\/\)/\1/p'
>
> It's safer to go with the latter, since we *always* expect a directory
> after the c++.

I was wrong.

/usr/lib/gcc/hppa2.0-unknown-linux-gnu/4.5.3/include/g++-v4
/usr/lib/gcc/hppa2.0-unknown-linux-gnu/4.5.3/include/g++-v4/hppa2.0-unknown-linux-gnu
/usr/lib/gcc/hppa2.0-unknown-linux-gnu/4.5.3/include/g++-v4/backward

So leave off the closing slash detection.

Cheers,
Carlos.



More information about the Libc-alpha mailing list