[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[0152] Re: MacOS X で mod_encording



Taisuke Yamada <tai@xxxxxxxxx> writes:

> # でも gcc なのに LOG(...) マクロでこける理由がいまいち不明…

http://fink.sourceforge.net/doc/porting/porting.html#basics.compiler

を見ると、Apple がプリプロセッサに手をいれているようなので、GNU の
cpp を使うためには -no-cpp-precomp か -traditional-cpp オプション
がいるんじゃないでしょうか。

1.2 The Compiler and Tools

Short story: The compiler is a gcc derivate, but installed as cc; you
may have to patch Makefiles. Most packages won't build shared
libraries. If you get errors related to macros, use the
-no-cpp-precomp option.

Long story: The compiler tool chain in the Mac OS X Developer Tools is
a strange beast. The compiler is based on the gcc 2.95.2 suite, with
modifications to support the Objective C language and some Darwin
quirks. The preprocessor (cpp) is available in two versions. One is
the standard precompiler (from gcc 2.95.2), the other one is a special
precompiler written by Apple, with support for precompiled
headers. The latter one is used by default, because it is
faster. However, some code doesn't compile with Apple's precompiler,
so you must use the -no-cpp-precomp option to get the standard
precompiler. (Note: I previously recommended the -traditional-cpp
option. The semantics of this option have changed slightly with GCC 3,
breaking most packages that use it. -no-cpp-precomp has the desired
effect on both the current Developer Tools and future compilers based
on GCC 3.)

-- やまの