[cfe-dev] [patch] Add configure option for C include search path

Chandler Carruth chandlerc at google.com
Tue Nov 10 14:34:07 PST 2009


On Mon, Nov 9, 2009 at 6:14 AM, Rafael Espindola <espindola at google.com> wrote:
>> Personally, I'd rather a separate flag for each semantic
>> interpretation. I would expect a comma separated list to simply all be
>> interpreted the same way.
>>
>> Also, does something break if we intuit "arch" from the target
>> architecture of the configuration? Combined, this might look like:
>
> I thought about using the target arch, but I am not sure it is
> correct. It should be possible to build a i686 targeting clang that
> uses a i386 compiled libstdc++, no?

Sure, but that sounds to me like a flag which defaults to the target
architecture. I'd rather not have to specify it in the common case.

>
>> ../llvm/configure --with-cxx-include-root=/foo
>> --with-cxx-include-32bit-suffix=32 --with-cxx-include-64bit-suffix=64
>>
>> Verbose, but clear to me. A '--with-cxx-include-arch-suffix' could
>> work as well, but it does muddy the waters some as to which suffix is
>> applied first.
>
> This works nicely if clang is to search a single libstdc++ install
> dir. I think this is the most common pattern, but maybe someone wants
> to build a clang binary that works on two different versions of OS X
> for example.

I had assumed that each of the above individual flags could have a
list (either comma or space separated) where it makes sense.
Specifically the install root makes sense to me here.

> With the current patch the syntax would be:
>
> ../llvm/configure
> --with-cxx-include-dir=/usr/include/c++/4.2.1,i686-apple-darwin10,,x86_64:/usr/include/c++/4.0.0/,i686-apple-darwin8,,

I still vastly prefer the above. I'd rather avoid counting commas
*and* colons in the same option...

My 2 cents.
-Chandler

>
>> -Chandler
>
> Cheers,
> --
> Rafael Ávila de Espíndola
>




More information about the cfe-dev mailing list