--- build_gcc.orig	Mon Apr 11 18:55:16 2005
+++ build_gcc	Tue Apr 12 02:08:30 2005
@@ -95,6 +95,9 @@
   --prefix=$DEST_ROOT \
   --mandir=\${prefix}/share/man \
   --enable-languages=c,objc,c++,obj-c++ \
+  --with-local-prefix=$DEST_ROOT \
+  --with-as=$DEST_ROOT/bin/odas \
+  --with-ld=$DEST_ROOT/bin/odld \
   --program-transform-name=/^[cg][^+.-]*$/s/$/-$MAJ_VERS/ \
   --with-gxx-include-dir=\${prefix}/include/gcc/darwin/$MAJ_VERS/c++ \
   --build=$BUILD-apple-darwin$DARWIN_VERS"
@@ -136,10 +139,10 @@
   CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" || exit 1
 
 # Add the compiler we just built to the path, giving it appropriate names.
-D=$DIR/dst-$BUILD-$BUILD/usr/bin
+D=$DIR/dst-$BUILD-$BUILD$DEST_ROOT/bin
 ln -f $D/gcc-$MAJ_VERS $D/gcc || exit 1
 ln -f $D/gcc $D/$BUILD-apple-darwin$DARWIN_VERS-gcc || exit 1
-PATH=$DIR/dst-$BUILD-$BUILD/usr/bin:$PATH
+PATH=$DIR/dst-$BUILD-$BUILD$DEST_ROOT/bin:$PATH
 
 # The cross-tools' build process expects to find certain programs
 # under names like 'i386-apple-darwin$DARWIN_VERS-ar'; so make them.
@@ -151,7 +154,7 @@
   for t in `echo $TARGETS $HOSTS | sort -u`; do
     P=$DIR/bin/${t}-apple-darwin$DARWIN_VERS-${prog}
     echo '#!/bin/sh' > $P || exit 1
-    echo 'exec /usr/bin/'${prog}' $*' >> $P || exit 1
+    echo 'exec $DEST_ROOT/bin/'${prog}' $*' >> $P || exit 1
     chmod a+x $P || exit 1
   done
 done
@@ -170,24 +173,24 @@
      CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" || exit 1
 
     # Add the compiler we just built to the path.
-   PATH=$DIR/dst-$BUILD-$t/usr/bin:$PATH
+   PATH=$DIR/dst-$BUILD-$t$DEST_ROOT/bin:$PATH
  fi
 done
 
 # Rearrange various libraries, for no really good reason.
 for t in $TARGETS ; do
   DT=$DIR/dst-$BUILD-$t
-  D=`echo $DT/usr/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS`
+  D=`echo $DT$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS`
   if [ $t == $BUILD ] ; then
-    mv $DT/usr/lib/libstdc++.a $D || exit 1
-    mv $DT/usr/lib/libsupc++.a $D || exit 1
+    mv $DT$DEST_ROOT/lib/libstdc++.a $D || exit 1
+    mv $DT$DEST_ROOT/lib/libsupc++.a $D || exit 1
     # 64-bit bringup
-    if [ -f $DT/usr/lib/ppc64/libstdc++.a ]; then
-	mv $DT/usr/lib/ppc64/libstdc++.a $D/ppc64 || exit 1
-	mv $DT/usr/lib/ppc64/libsupc++.a $D/ppc64 || exit 1
+    if [ -f $DT$DEST_ROOT/lib/ppc64/libstdc++.a ]; then
+	mv $DT$DEST_ROOT/lib/ppc64/libstdc++.a $D/ppc64 || exit 1
+	mv $DT$DEST_ROOT/lib/ppc64/libsupc++.a $D/ppc64 || exit 1
     fi
   else
-    DD=$DT/usr/${t}-apple-darwin$DARWIN_VERS/lib
+    DD=$DT$DEST_ROOT/${t}-apple-darwin$DARWIN_VERS/lib
     mv $DD/libstdc++.a $D || exit 1
     mv $DD/libsupc++.a $D || exit 1
     # 64-bit bringup
@@ -205,7 +208,7 @@
 # and should be removed after we merge with mainline 4.0 final.
 for t in $TARGETS ; do
   DT=$DIR/dst-$BUILD-$t
-  D=`echo $DT/usr/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS`
+  D=`echo $DT$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS`
   D64=$D/ppc64
 
   for lib in $D/libgcc.a $D/libgcc_eh.a $D/libgcc_static.a $D/libgcc_eh.a $D64/libgcc.a $D64/libgcc_eh.a $D/libcc_kext.a ; do
@@ -395,7 +398,7 @@
 # providing them.
 cd $SRC_DIR/more-hdrs
 for h in `echo *.h` ; do
-  if [ ! -f /usr/include/$h -o -L /usr/include/$h ] ; then
+  if [ ! -f $DEST_ROOT/include/$h -o -L $DEST_ROOT/include/$h ] ; then
     cp -R $h $DEST_DIR$HEADERPATH/$h || exit 1
     for t in $TARGETS ; do
       THEADERPATH=$DEST_DIR$DEST_ROOT/lib/gcc/${t}-apple-darwin$DARWIN_VERS/$VERS/include
@@ -407,7 +410,7 @@
 done
 mkdir -p $DEST_DIR$HEADERPATH/machine
 for h in `echo */*.h` ; do
-  if [ ! -f /usr/include/$h -o -L /usr/include/$h ] ; then
+  if [ ! -f $DEST_ROOT/include/$h -o -L $DEST_ROOT/include/$h ] ; then
     cp -R $h $DEST_DIR$HEADERPATH/$h || exit 1
     for t in $TARGETS ; do
       THEADERPATH=$DEST_DIR$DEST_ROOT/lib/gcc/${t}-apple-darwin$DARWIN_VERS/$VERS/include
