(0) Restore DevTools to its original state $ su # rpm -e gcc2-with-g77 # rpm -e gcc-with-g77-symlinks # rpm -e gcc-with-g77 # pushd # rpm -ivh gcc-orig-1151-1a.ppc.rpm gcc-orig-symlinks-1151-1a.ppc.rpm # rpm -ivh gcc2-orig-7-1a.ppc.rpm (1) Decide the cvs-tag that corresponds to the distributed gcc3 $ mkdir tmp $ cd tmp $ cp /Volumes/December\ 2002\ Dev\ Tools/Packages/DevTools.pkg/Contents/Archive.pax.gz . $ gunzip Archive.pax.gz $ pax -r -pe -f Archive.pax $ usr/bin/gcc3 --version gcc3 (GCC) 3.1 20020420 (prerelease) Copyright (C) 2002 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ strings usr/bin/gcc3 | less .... 3.1 20020420 (prerelease) 1175 ... The tag should be gcc3-1175, which is in fearless-kitty-branch. The version number can be confirmed by examining gcc/version.c. (2) Install Dec2002 DevTools (3) Backup original gcc2 and gcc3 $ su # cd /usr/local/src/apple/SPECS # rpm -qpl ../RPMS/ppc/gcc2-orig-7-1a.ppc.rpm > list.gcc2 # cat backup.sh #!/bin/sh list=$1 mkdir -p usr/{bin,include,lib,libexec} mkdir -p usr/share/man/man1 for i in `cat $list`; do to=`echo $i | sed -e 's;^/;;'` if [ -d $i -a ! -h $i ]; then mkdir -p $to else cp -RPp $i $to fi done exit 0 # sh backup.sh list.gcc2 # tar -zcvf /usr/local/src/apple/SOURCES/gcc2-orig-7-1b-bin.tar.gz usr # rm -rf usr # rpmbuild -ba gcc2-orig.spec # tar -ztvf gcc-with-g77-1175-1a-bin.tar.gz | cut -c49- | sed -e 's;^;/;' | sed -e 's; -> .*;;' | sort > list.gcc3 # sh backup.sh list.gcc3 # tar -zcvf /usr/local/src/apple/SOURCES/gcc-orig-1175-1a-bin.tar.gz usr # rm -rf usr # rpmbuild -ba gcc-orig.spec (4) Get source tree from CVS $ export CVSROOT=:pserver:fujiik@anoncvs.opensource.apple.com:/cvs/Darwin $ cvs login (Logging in to fujiik@anoncvs.opensource.apple.com) CVS password: ?????? $ cd $ mkdir gcc3.1-dec2002 $ cd gcc3.1-dec2002 $ cvs -z3 checkout -r gcc3-1175 gcc3 $ mv gcc3 gcc3-1175 $ tar -zcvf gcc3-1175.tar.gz gcc3-1175 (5) Build gcc3 $ cd gcc3-1175 $ export RC_ARCHS=ppc $ export RC_CFLAGS='-arch ppc' $ export RC_OS='macos' $ export TARGETS=ppc $ export HOSTS=ppc $ export SRCROOT=`pwd` $ vi build_gcc ..... ENABLE_LANGUAGES="c++,c,objc,objc++,f77" ..... $ make install >& install.log ld/obj/ppc $ obj/ppc $ mkdir libf2c $ cd libf2c $ CFLAGS='-traditional-cpp' $SRCROOT/libf2c/configure --srcdir=$SRCROOT/libf2c --host=ppc --target=ppc $ make >& make.log & $ cp g2c.h ../../../dst/usr/include/gcc/darwin/3.1/ $ 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/g773 $ cp f771 ../../dst/usr/libexec/gcc/darwin/ppc/3.1/ $ cd ../../dst $ pushd usr/bin $ ln -s g++3 g++ $ ln -s gcc3 gcc $ ln -s g773 g77 $ ln -s g++ c++ $ ln -s gcc cc $ ln -s g77 f77 $ cd ../include $ pushd gcc/darwin/ $ ln -s 3.1 default $ popd $ ln -s gcc/darwin/3.1/g++-v3 . $ for i in gcc/darwin/default/*.h; do ln -s $i .; done $ cd ../lib $ pushd gcc/darwin $ ln -s 3.1 default $ popd $ for i in gcc/darwin/default/lib*.a; do ln -s $i .; done $ rm libcc_noc++.a libgcc_static.a $ cd ../libexec $ pushd gcc/darwin/ppc $ ln -s 3.1 default $ popd $ cd ../.. $ su # chown -R root:wheel usr # tar -zcvf /usr/local/src/apple/SOURCES/gcc-with-g77-1175-1a.tar.gz usr/ # cd /usr/local/src/apple/SPECS # rpmbuild -ba gcc.spec