Problems with cpp (in wxWidgets-devel)

Joshua Root jmr at macports.org
Tue May 29 04:17:43 PDT 2012


On 2012-5-29 20:51 , Mojca Miklavec wrote:
> On Tue, May 29, 2012 at 12:24 PM, Joshua Root wrote:
>> On 2012-5-29 19:57 , Mojca Miklavec wrote:
>>> Hello,
>>>
>>> if I try to build wxWidgets with a patch that enables building with
>>> clang. But if I try to build +universal, it seems that I hit the
>>> problem of "looks like it's using parts of QuickDraw that are gone in
>>> Lion", so I need to build with SDK for 10.6.
>>
>> But wxWidgets doesn't have a universal variant?
> 
> I'm sorry, I meant wxWidgets-devel. I also wrote that in Subject, but
> failed to be more clear in the body.

Ah OK. So it's probably assuming it can use the Carbon stuff just
because it's building 32-bit.

>>> But then it fails with an equivalent of
>>>     > touch a.c
>>>     > cpp -isysroot /Developer/SDKs/MacOSX10.6.sdk a.c
>>>     i686-apple-darwin11-llvm-gcc-4.2: c: No such file or directory
>>> (replacing with /Applications/Xcode.app/.../MacOSX10.6.sdk doesn't
>>> solve anything; a.c has some contents, but it doesn't make any
>>> difference to cpp either)
>>>
>>> My question is: does that work for others? I had Xcode 4.2 installed
>>> and installed 4.3 on top. Is only my system that is messed up or is
>>> there something else that I'm missing? The file /usr/bin/cpp is a
>>> shell script.
>>
>> Looks like /usr/bin/cpp doesn't understand options that take an argument
>> that's separated by a space. You're not really meant to use it anyway;
>> as the comments say, it's just there for compatibility with really old
>> stuff and is deprecated.
>>
>> You can always achieve the same thing with "$CC -E" (as the cpp script
>> itself demonstrates), it just needs to be invoked a little differently.
> 
> I just realized that removing
>     configure.env-append CPP=${configure.cpp}
>     configure.env-append CXXCPP=${configure.cpp}
> from Portfile solves the problem and I'm able to build wxWidgets-devel
> with clang without any problems. I also discovered another patch that
> probably removes the need to build against 10.6 altogether:
>     http://trac.wxwidgets.org/changeset/70737
> 
> But then I have two questions:
> - Why was this explicit setting needed in the first place? (Maybe I
> only need to search through tickets)

Trac's annotate button or svn blame will show you it was added here:
<https://trac.macports.org/changeset/86138>

> - Why doesn't configure.cpp return "clang -E" instead of /usr/bin/cpp?

It doesn't contain /usr/bin/cpp, it's empty because clang doesn't have a
separate preprocessor executable. As I alluded to above, it would be
incorrect for it to be 'clang -E' because that can't be invoked the same
way as cpp.

Configure scripts usually figure out on their own that they can use '$CC
-E'.

- Josh


More information about the macports-dev mailing list