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

Chandler Carruth chandlerc at google.com
Sun Nov 8 12:31:18 PST 2009


On Sun, Nov 8, 2009 at 9:16 AM, Rafael Espindola <espindola at google.com> wrote:
> 2009/11/4 Rafael Espindola <espindola at google.com>:
>> The attached patches adds support defining the C search paths with configure:
>>
>> ../src/configure --with-include-dirs=foo:bar:zed
>>
>> Will create a clang binary that searches for C headers in foo, bar and
>> zed. If the
>> option is not given, the current runtime search is done.
>
> Attached are updated versions of the patches. I have also included
> patches for c++. With it it is possible to run configure as
>
> ../llvm/configure --with-cxx-include-dir=/foo,bar,32,64
>
> To get the directories /foo, /foo/backward and /foo/bar/(32|64)
> searched depending on -m32 or -m64. In cases where there are no
> multilib dirs (darwin8 for example), the option looks like
> --with-cxx-include-dir=/usr/include/c++/4.0.0/,i686-apple-darwin8,,

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:

../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.
-Chandler

>
> The llvm patch also includes a new utility function:
> llvm::SplitStringWithEmpty. It is similar to SplitString, but empty
> elements are not removed. I find its semantics more intuitive. That is
> what python implements in string.split() :-). Maybe I should just
> change SplitString and update its users?
>
> Cheers,
> --
> Rafael Ávila de Espíndola
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>




More information about the cfe-dev mailing list