[PATCH] Improve C++ header detection in configure

Adam Conrad adconrad@0c3.net
Fri Nov 23 21:19:00 GMT 2012


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'

Thoughs?

... Adam



More information about the Libc-alpha mailing list