g77 Building Procedure (gcc-3.3 based)
gcc-3.3 that comes with Apple's standard DevTools does not include "g77".
However, its source tree does include one. This makes g77 support much easier
than before. Nevertheless, the source code that Apple used to build the gcc-3.3
compiler suite for 10.3 has some problem: g77 built from it fails to compile
a trivial single line fortran code like
$ cat test.F
end$ g77 test.F
Then build libg2c.a
$ cd obj/ppc
$ mkdir libf2c
$ cd libf2c
$ CFLAGS='-no-cpp-precomp' $SRCROOT/libf2c/configure --srcdir=$SRCROOT/libf2c
--host=ppc --target=ppc
$ make >& make.log &
$ tail -f install.log
......
^C (control +C to get out of tail)
What follows is only a packaging issue, useless for most people:^)
$ cp -p .libs/libg2c.a libfrtbegin.a ../../../dst/usr/lib/gcc/darwin/3.3/
$ cp g2c.h ../../../dst/usr/include/gcc/darwin/3.3/
$ ln -s gcc/darwin/default/g2c.h ../../../dst/usr/include/.
$ ln -s gcc/darwin/default/libg2c.a ../../../dst/usr/lib/libg2c.a
$ cd ../../cc-ppc-on-ppc/
$ cp g77 ../../dst/usr/bin/g77-3.3
$ cp f771 ../../dst/usr/libexec/gcc/darwin/ppc/3.3/
$ cd ../../dst
$ pushd usr/bin
$ ln -s g++-3.3 g++
$ ln -s gcc-3.3 gcc
$ ln -s g77-3.3 g77
$ ln -s g++ c++
$ ln -s gcc cc
$ ln -s g77 f77
$ cd ../include
$ pushd gcc/darwin/
$ ln -s 3.3 default
$ popd
$ for i in gcc/darwin/default/*.h; do ln -s $i .; done
$ rm ppc_intrinsics.h
$ cd ../lib
$ pushd gcc/darwin
$ ln -s 3.3 default
$ popd
$ for i in gcc/darwin/default/lib*.a; do ln -s $i .; done
$ rm libcc_noc++.a libgcc_static.a libstdc++_ZeroLink.a
$ cd ../libexec
$ pushd gcc/darwin/ppc
$ ln -s 3.3 default
$ popd
$ cd ../..
$ su
# chown -R root:wheel usr
# gnutar -zcvf <somewhere>/gcc-with-g77-1495-2b.tar.gz
usr/
#exit
How to Install a Precompiled Binary Package
A binary package is available as an RPM which can be installed as
# rpm -Uvh gcc-with-g77-1495-2b.ppc.rpm
# rpm -Uvh gcc-with-g77-symlinks-1495-2b.ppc.rpm
The last "symlinks" packages makes gcc-3.3 based compilers as default
compilers to be referred to as gcc, g++, and g77.
REMARKS
FCFLAGS = -fno-automatic -fno-second-underscore -fno-f90
-fugly-complex -fno-globals -fugly-init -Wno-globals