原文地址:http://www.mulle-kybernetik.com/weblog/2011/10/how_to_build_libobjc_for_os_x.html
Max OS X 版本:10.6.8
待编译运行时版本:437.3
刚刚自己试了一下,可以编译。
另:文章中提到头文件的包含路径为绝对路径,这样不好,可以改为相对路径,
比如:以 $(SRCROOT) 为参考。
附自己修改的工程打包:http://files.cnblogs.com/Proteas/objc-runtime_10.6.8_437.3.zip
下载后应该可以直接编译,有问题可以留言。
原文内容: This builds and links and work for me, but it hasn't been tested much so I don't make any guarantees. Preparation
Create a directory where to store all the stuff. I chose /usr/local/src/darwin-10.6.8.
Download and Unpack
Download the following packages:
Libc-594.9.5.z
dyld-132.13
libauto-141.2
libclosure-38
libdispatch-84.5.5
objc4-437.3.
xnu-1504.15.3
download
cd /usr/local/src/darwin-10.6.8/
curl -O http://www.opensource.apple.com/tarballs/Libc/Libc-594.9.5.tar.gz
curl -O http://www.opensource.apple.com/tarballs/dyld/dyld-132.13.tar.gz
curl -O http://www.opensource.apple.com/tarballs/libauto/libauto-141.2.tar.gz
curl -O http://www.opensource.apple.com/tarballs/libclosure/libclosure-38.tar.gz
curl -O http://www.opensource.apple.com/tarballs/libdispatch/libdispatch-84.5.5.tar.gz
curl -O http://www.opensource.apple.com/tarballs/objc4/objc4-437.3.tar.gz
curl -O http://www.opensource.apple.com/tarballs/xnu/xnu-1504.15.3.tar.gz
tar xfz Libc-594.9.5.tar.gz
tar xfz dyld-132.13.tar.gz
tar xfz libauto-141.2.tar.gz
tar xfz libclosure-38.tar.gz
tar xfz libdispatch-84.5.5.tar.gz
tar xfz objc4-437.3.tar.gz
You can also manually download stuff fromhttp://www.opensource.apple.com/release/mac-os-x-1068/. Installation of Headers
Copy the needed headere into /usr/local/include/darwin-10.6.8. The versioning of the destination directory is important, otherwise you might get some strange bugs later on in life.
Then you should go into the objc target's Compile sources settings and move the fileobjc-probes.d to the top, so that it gets compiled first.
And now it should build and link without errors.
Go ahead and trash your system with the debug linked version :)