そしてついにFreeBSD4クロスコンパイラ
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14626
------- Additional Comment #7 From Andrew Pinski 2004-03-18 19:23 [reply] -------
You cannot use "make gnatlib_and_tools" on a cross compiler, use "make cross-gnattools" and "make
gnatlib" to build a cross Ada compiler.
おーい、そんなことはどこにも書いてなかったぞー。
で、最終的な手順です。
$ cd /usr/src/ $ tar jxf /cygdrive/.../gcc-3.4.2.tar.bz2 $ cd ../gcc-3.4.2/ $ ./configure --enable-languages=c,ada --prefix=/usr/ --target=i386-pc-freebsd4 --host=i686-pc-cygwin $ make all $ cd gcc $ make gnatlib $ make cross-gnattools $ cd .. $ make install
で、クロス版gnatmakeとかは"gcc"というコマンドがクロス版gccということを前提に動いているみたいですので、そのままではうまくいきません。まあコマンド名をオーバーライドする方法なんていくらでもあるんでしょうが…。
with Ada.Text_IO; procedure Test is use Ada.Text_IO; begin Put("content-type: text/html"); New_Line; New_Line; Put("<html>Hell World</html>"); New_Line; end;
を、gnatlink -vとかやってどんなコマンドを実行すればいいのかを教えてもらってgccをi386-pc-freebsd4-gccに置き換えて
i386-pc-freebsd4-gcc -c test.adb i386-pc-freebsd4-gnatbind -x test.ali i386-pc-freebsd4-gcc -c -gnatA -gnatWb -gnatiw -gnatws b~test.adb i386-pc-freebsd4-gcc b~test.o ./test.o -o test.exe -L./ -L/usr/lib/gcc/i386-pc-freebsd4/3.4.2/adalib/ /usr/lib/gcc/i386-pc-freebsd4/3.4.2/adalib/libgnat.a
できたtest.exeをtest.cgiにリネームしてアップロードして実行可能属性を付けて
http://f22.aaa.livedoor.jp/~qwerty/private/gcc/test.cgi
うごいたー!!