2012-01-01 15 views
3

私はiPhoneのオープンソースプロジェクトに取り組んでおり、プロジェクトをARCとApple LLVM 3.0コンパイラを使用するように変換しました。しかし、このプロジェクトは、Cで書かれているようにmakefileを使ってビルドされた外部ライブラリに依存しています。現在、GCCを使用してコンパイルしていますが、ARC-ified Objective-Cコードを参照すると、 @autoreleaseとして)は、LLVM前のコンパイラには存在しません。GCC makefileスクリプトをLLVM 3.0コンパイラに変換する

しかし、それについては十分です。 LLVMコンパイラを使用する

VERSION=4.3 
COPT = -F/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${VERSION}.sdk/System/Library/Frameworks -F/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${VERSION}.sdk/System/Library/PrivateFrameworks -I../../ -I../../Classes/ -I/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/usr/lib/gcc/arm-apple-darwin9/4.2.1/include -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${VERSION}.sdk -L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${VERSION}.sdk/usr/lib -I/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${VERSION}.sdk/usr/include/ 
COPT += -march=armv7-a -miphoneos-version-min=${VERSION} -I. -O3 -D__IPHONE__ -D_SNESPPC -DASM_SPC700 -DZLIB -DUNZIP_SUPPORT -DOLD_COLOUR_BLENDING -DUSE_SA1 -DSUPER_FX -DLSB_FIRST -DCPU_SHUTDOWN -DVAR_CYCLES 
COPT += -fnested-functions -funsigned-char -ffast-math -fexpensive-optimizations -ftemplate-depth-36 -mstructure-size-boundary=32 -falign-functions=32 -falign-loops -falign-labels -falign-jumps -finline -finline-functions -fno-builtin -fno-common -fomit-frame-pointer -fpeel-loops -fstrength-reduce -funroll-loops -fstrict-aliasing 
GCC = /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-gcc-4.2.1 
GXX = /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-g++-4.2.1 
STRIP = /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/strip 

:私の質問は、私はこのコードのスニペットを変換することができる方法ですか?私はこれまで、それを修正しようとしました:

VERSION=5.0 
COPT = -F/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${VERSION}.sdk/System/Library/Frameworks -F/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${VERSION}.sdk/System/Library/PrivateFrameworks -I../../ -I../../Classes/ -I/Developer/Platforms/iPhoneOS.platform/Developer/usr/lib/clang/3.0/include -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${VERSION}.sdk -L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${VERSION}.sdk/usr/lib -I/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${VERSION}.sdk/usr/include/ 
COPT += -march=armv7-a -miphoneos-version-min=${VERSION} -I. -O3 -D__IPHONE__ -D_SNESPPC -DASM_SPC700 -DZLIB -DUNZIP_SUPPORT -DOLD_COLOUR_BLENDING -DUSE_SA1 -DSUPER_FX -DLSB_FIRST -DCPU_SHUTDOWN -DVAR_CYCLES 
COPT += -fnested-functions -funsigned-char -ffast-math -fexpensive-optimizations -ftemplate-depth-36 -mstructure-size-boundary=32 -falign-functions=32 -falign-loops -falign-labels -falign-jumps -finline -finline-functions -fno-builtin -fno-common -fomit-frame-pointer -fpeel-loops -fstrength-reduce -funroll-loops -fstrict-aliasing 
GCC = /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang 
GXX = /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang++ 
STRIP = /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/strip 

しかし、これは代わりに、iOS用のARMアーキテクチャの、のi386アーキテクチャをターゲットにしたので、私のようなエラーが出ます:

"i386/types.h" not found 

を特別なバージョンがありますARMのためのclangの?あるいは、私は何かを完全に欠いていますか?

+0

iPhoneOS3.0.sdkとgccがインクルードパスにあります.ARCは高レベルのOSでのみ動作しますか? – Mark

+0

はい、それはコードには影響しませんでしたが、私はとにかく質問を更新しました。 –

答えて

3

Try -arch armv7; clangでARM用に構築するターゲットを明示的に指定する必要があります。

+1

それが問題でした。コンパイル時に新しいエラーが発生しましたが、エラーの正確な内容をさらに調査する必要があります。 –

関連する問題