[PATCH] Improve C++ header detection in configure

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


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++.

Please check this in on Tuesday as long as nobody objects.

I'd like people to have the weekend to chew on the c++ header
autodetection and voice any concerns.

Cheers,
Carlos.



More information about the Libc-alpha mailing list