[ Main Page ]

Mac OS X cross compile on Linux

必要なもの

方法1 - precompiled packageを利用

あらかじめLinux/x86用にビルドされたGCC(gcc-4.0.1 / Apple gcc 5247)があるのでそれを利用する。 ここから入手可能。freeverb3vst@sourceforge.jpでミラーしている。 /opt/mac/SDKs/MacOSX10.4u.sdkにAppleから入手したSDKを展開するだけでできる。 Macといっても所詮UNIX + (ObjectiveC + NeXTSTEP Framework)の塊だから、適宜リンクしてあげれば良い。Freeverb3では、この方法で 32bit Mac用のバイナリを作っているが、64bit版は下の方法を使っている。

方法2 - odcctoolsとgccをビルド

くわしくはapple-darwin9.txtを参照してください。

odcctoolsをビルド

odcctools-9.2-ld-r280.tgzにパッチ群をあてたものがodcctools-9.2-ld-r280_patched.tgz。x86/x64/ppc/ppc64の4種類を作れるが、 全部別のディレクトリprefixにインストールするのが無難。x86/ppcは共存できそう。以下は、x64/ppc64の二つのビルドの例。

aptitude install subversion #if it is not installed already
mkdir ~/svn #store our repositories here, change according to taste
cd ~/svn
svn checkout http://svn.macosforge.org/repository/odcctools/trunk/ odcctools
./configure --prefix=/opt/mac/x64 --target=x86_64-apple-darwin9 --with-sysroot=/opt/mac/SDKs/MacOSX10.5.sdk --enable-ld64
make; make install
./configure --prefix=/opt/mac/p64 --target=powerpc64-apple-darwin9 --with-sysroot=/opt/mac/SDKs/MacOSX10.4u.sdk --enable-ld64 make; make install

Apple gccをビルド

gcc-workなりをつくってビルドしたほうが、ゴミを消しやすい。

../gcc-5490/configure --prefix=/opt/mac/x64 --disable-checking --enable-languages=c,objc,c++,obj-c++ \
--with-as=/opt/mac/x64/bin/x86_64-apple-darwin9-as --with-ld=/opt/mac/x64/bin/x86_64-apple-darwin9-ld64 \
--target=x86_64-apple-darwin9 --with-sysroot=/opt/mac/SDKs/MacOSX10.5.sdk --enable-static --enable-shared --disable-nls --disable-multilib
make; make install

../gcc-5490/configure --prefix=/opt/mac/p64 --disable-checking --enable-languages=c,objc,c++,obj-c++ \
--with-as=/opt/mac/p64/bin/powerpc64-apple-darwin9-as --with-ld=/opt/mac/p64/bin/powerpc64-apple-darwin9-ld64 \
--target=powerpc64-apple-darwin9 --with-sysroot=/opt/mac/SDKs/MacOSX10.4u.sdk --enable-static --enable-shared --disable-nls --disable-multilib
make; make install
I only discovered this myself quite recently. When Yahoo bought Viaweb, they
asked me what I wanted to do. I had never liked the business side very much,
and said that I just wanted to hack. When I got to Yahoo, I found that what
hacking meant to them was implementing software, not designing it. Programmers
were seen as technicians who translated the visions (if that is the word) of
product managers into code.

This seems to be the default plan in big companies. They do it because it
decreases the standard deviation of the outcome. Only a small percentage of
hackers can actually design software, and it's hard for the people running a
company to pick these out. So instead of entrusting the future of the software
to one brilliant hacker, most companies set things up so that it is designed
by committee, and the hackers merely implement the design.

If you want to make money at some point, remember this, because this is one of
the reasons startups win. Big companies want to decrease the standard
deviation of design outcomes because they want to avoid disasters. But when
you damp oscillations, you lose the high points as well as the low. This is
not a problem for big companies, because they don't win by making great
products. Big companies win by sucking less than other big companies.

    -- Paul Graham
    -- Hackers and Painters ( http://www.paulgraham.com/hp.html )

  <convivial>  high-rez, but I don't know enough to help you because I am
               a newbie to perl programming and although I am in deep luv
               with perl and planning on marrying perl, I still have a lot
               to learn.
    <rindolf>  convivial: you can only marry Perl if polygamy is legal
               where you live.
    <rindolf>  convivial: because Perl and I are already married. :-D
  <convivial>  why is that? i'm single :)
    <rindolf>  convivial: but Perl isn't.
  <convivial>  oh crap !
  <convivial>  all the good languages are already married :(
    <rindolf>  convivial: COBOL is still single.
    <rindolf>  convivial: but I heard she's a total bitch.
  <convivial>  ewwwwwwwwwwww, so is JCL and no one is knocking down either
               of their doors
  <convivial>  rindolf, janet reno is single!
    <rindolf>  convivial: what kind of programming language is "Janet
               Reno"?
  <convivial>  :)
  <convivial>  she is a person
    <rindolf>  convivial: I'm not interested in people, I'm only
               interested in programming languages.
 <shaldannon>  rindolf: you should try Ada
    <rindolf>  shaldannon: Ada 95?
 <shaldannon>  yeah
 <shaldannon>  the syntax of Pascal, the power of Basic and the
               friendliness of Java

    -- Commiting yourself to a programming language on Freenode's #perl.
    -- #perl, Freenode


Powered by UNIX fortune(6)
[ Main Page ]