我一直在为iOS进行大量的不同库的交叉编译,直到iOS5没有问题.好吧,显然我的问题是,iOS5 SDK不再包含GNU gcc编译器了.只有llvm和clang可用.
我的问题是,我无法完成运行任何库的'configure'脚本.它始终失败:
configure: error: C preprocessor
"/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc" fails sanity check
Run Code Online (Sandbox Code Playgroud)
gcc只是llvm编译器的符号链接.如果我将其设置为clang,则会产生相同的错误.(只是使用更好的语法错误表示)
这是config.log的重要部分:
configure:3338: checking how to recognise dependent libraries
configure:3514: result: pass_all
configure:3993: checking how to run the C preprocessor
configure:4111: result: /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc
configure:4135: /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc -B/Developer/Platforms/iPhoneOS.platform/Developer/usr -arch armv7 -miphoneos-version-min=5.0 -gdwarf-2 -mthumb -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk -L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/usr/lib/system conftest.c
conftest.c:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'error'
configure:4141: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "expat"
| #define PACKAGE_TARNAME "expat"
| …Run Code Online (Sandbox Code Playgroud)