update for cross building

This commit is contained in:
Dave Murphy 2012-04-03 20:00:47 +01:00
parent 97c19adf87
commit c480c92ced
3 changed files with 80 additions and 86 deletions

View File

@ -8,8 +8,25 @@ export DEVKITPRO=$TOOLPATH
#---------------------------------------------------------------------------------
echo "installing linkscripts ..."
cp $BUILDSCRIPTDIR/dkppc/crtls/*.ld $DEVKITPPC/$target/lib/
cp $BUILDSCRIPTDIR/dkppc/crtls/*.ld $prefix/$target/lib/
#---------------------------------------------------------------------------------
# copy base rulesets
#---------------------------------------------------------------------------------
cp $BUILDSCRIPTDIR/dkppc/rules/* $DEVKITPPC
cp $BUILDSCRIPTDIR/dkppc/rules/* $prefix
cd $BUILDDIR/libogc-$LIBOGC_VER
if [ ! -f installed ]; then
echo "Building & installing libogc"
$MAKE install || { echo "libogc install failed"; exit 1; }
touch installed
fi
cd $BUILDDIR/libfat-$LIBFAT_VER
if [ ! -f installed ]; then
echo "Building & installing libfat"
$MAKE ogc-install || { echo "libfat install failed"; exit 1; }
touch installed
fi

View File

@ -3,22 +3,6 @@
# Check Parameters
#---------------------------------------------------------------------------------
prefix=$INSTALLDIR/devkitPPC
PLATFORM=`uname -s`
case $PLATFORM in
Darwin )
cflags="-mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc"
ldflags="-mmacosx-version-min=10.4 -arch i386 -arch ppc -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk"
;;
MINGW32* )
cflags="-D__USE_MINGW_ACCESS"
# horrid hack to get -flto to work on windows
plugin_ld="--with-plugin-ld=ld"
;;
esac
#---------------------------------------------------------------------------------
# build and install ppc binutils
#---------------------------------------------------------------------------------
@ -28,25 +12,25 @@ cd $target/binutils
if [ ! -f configured-binutils ]
then
CFLAGS=$cflags LDFLAGS=$ldflags ../../binutils-$BINUTILS_VER/configure \
CFLAGS=$cflags LDFLAGS=$ldflags ../../binutils-$BINUTILS_VER/configure \
--prefix=$prefix --target=$target --disable-nls --disable-shared --disable-debug \
--disable-werror \
--with-gcc --with-gnu-as --with-gnu-ld --disable-dependency-tracking \
--disable-werror \
--enable-plugins --enable-lto --disable-dependency-tracking \
--disable-werror $CROSS_PARAMS \
|| { echo "Error configuing ppc binutils"; exit 1; }
touch configured-binutils
fi
if [ ! -f built-binutils ]
then
$MAKE || { echo "Error building ppc binutils"; exit 1; }
touch built-binutils
$MAKE || { echo "Error building ppc binutils"; exit 1; }
touch built-binutils
fi
if [ ! -f installed-binutils ]
then
$MAKE install || { echo "Error installing ppc binutils"; exit 1; }
touch installed-binutils
$MAKE install || { echo "Error installing ppc binutils"; exit 1; }
touch installed-binutils
fi
cd $BUILDDIR
@ -60,32 +44,26 @@ cd mn10200/binutils
if [ ! -f configured-binutils ]
then
CFLAGS=$cflags LDFLAGS=$ldflags ../../binutils-$BINUTILS_VER/configure \
--prefix=$prefix --target=mn10200 --disable-nls --disable-shared --disable-debug \
--disable-werror \
--disable-dependency-tracking --with-gcc --with-gnu-as --with-gnu-ld \
--disable-werror \
CFLAGS=$cflags LDFLAGS=$ldflags ../../binutils-$BINUTILS_VER/configure \
--prefix=$prefix --target=mn10200 --disable-nls --disable-debug \
--disable-dependency-tracking \
--disable-werror $CROSS_PARAMS \
|| { echo "Error configuing mn10200 binutils"; exit 1; }
touch configured-binutils
touch configured-binutils
fi
if [ ! -f built-binutils ]
then
$MAKE || { echo "Error building mn10200 binutils"; exit 1; }
touch built-binutils
$MAKE || { echo "Error building mn10200 binutils"; exit 1; }
touch built-binutils
fi
if [ ! -f installed-binutils ]
then
$MAKE install || { echo "Error installing mn10200 binutils"; exit 1; }
touch installed-binutils
$MAKE install || { echo "Error installing mn10200 binutils"; exit 1; }
touch installed-binutils
fi
for f in $INSTALLDIR/devkitPPC/mn10200/bin/*
do
strip $f
done
cd $BUILDDIR
#---------------------------------------------------------------------------------
@ -96,34 +74,35 @@ cd $target/gcc
if [ ! -f configured-gcc ]
then
CFLAGS="$cflags" LDFLAGS="$ldflags" CFLAGS_FOR_TARGET="-O2" LDFLAGS_FOR_TARGET="" ../../gcc-$GCC_VER/configure \
--enable-languages=c,c++,objc \
--enable-lto $plugin_ld\
--with-cpu=750 \
--disable-nls --disable-shared --enable-threads --disable-multilib \
--disable-win32-registry \
--disable-libstdcxx-pch \
--target=$target \
--with-newlib \
--with-headers=$BUILDDIR/newlib-$NEWLIB_VER/newlib/libc/include \
--prefix=$prefix\
--disable-dependency-tracking \
--with-bugurl="http://wiki.devkitpro.org/index.php/Bug_Reports" --with-pkgversion="devkitPPC release 26" \
2>&1 | tee gcc_configure.log
touch configured-gcc
CFLAGS="$cflags" LDFLAGS="$ldflags" CFLAGS_FOR_TARGET="-O2" LDFLAGS_FOR_TARGET="" ../../gcc-$GCC_VER/configure \
--enable-languages=c,c++,objc \
--enable-lto $plugin_ld \
--with-cpu=750 \
--disable-nls --disable-shared --enable-threads --disable-multilib \
--disable-win32-registry \
--disable-libstdcxx-pch \
--target=$target \
--with-newlib \
--with-headers=$BUILDDIR/newlib-$NEWLIB_VER/newlib/libc/include \
--prefix=$prefix\
--disable-dependency-tracking \
--with-bugurl="http://wiki.devkitpro.org/index.php/Bug_Reports" --with-pkgversion="devkitPPC release 26" \
$CROSS_PARAMS \
2>&1 | tee gcc_configure.log
touch configured-gcc
fi
if [ ! -f built-gcc-stage1 ]
then
$MAKE all-gcc || { echo "Error building gcc stage1"; exit 1; }
touch built-gcc-stage1
$MAKE all-gcc || { echo "Error building gcc stage1"; exit 1; }
touch built-gcc-stage1
fi
if [ ! -f installed-gcc-stage1 ]
then
$MAKE install-gcc || { echo "Error installing gcc stage1"; exit 1; }
touch installed-gcc-stage1
rm -fr $INSTALLDIR/devkitPPC/$target/sys-include
$MAKE install-gcc || { echo "Error installing gcc stage1"; exit 1; }
touch installed-gcc-stage1
rm -fr $INSTALLDIR/devkitPPC/$target/sys-include
fi
#---------------------------------------------------------------------------------
@ -138,28 +117,26 @@ unset LDFLAGS
if [ ! -f configured-newlib ]
then
../../newlib-$NEWLIB_VER/configure \
--target=$target \
--prefix=$prefix \
--enable-newlib-mb \
--enable-newlib-hw-fp \
|| { echo "Error configuring newlib"; exit 1; }
touch configured-newlib
../../newlib-$NEWLIB_VER/configure \
--target=$target \
--prefix=$prefix \
--enable-newlib-mb \
--enable-newlib-hw-fp \
|| { echo "Error configuring newlib"; exit 1; }
touch configured-newlib
fi
if [ ! -f built-newlib ]
then
$MAKE || { echo "Error building newlib"; exit 1; }
touch built-newlib
$MAKE || { echo "Error building newlib"; exit 1; }
touch built-newlib
fi
if [ ! -f installed-newlib ]
then
$MAKE install || { echo "Error installing newlib"; exit 1; }
touch installed-newlib
$MAKE install || { echo "Error installing newlib"; exit 1; }
touch installed-newlib
fi
cd $BUILDSCRIPTDIR
#---------------------------------------------------------------------------------
# build and install the final compiler
#---------------------------------------------------------------------------------
@ -168,14 +145,14 @@ cd $BUILDDIR/$target/gcc
if [ ! -f built-gcc-stage2 ]
then
$MAKE all || { echo "Error building gcc stage2"; exit 1; }
touch built-gcc-stage2
$MAKE all || { echo "Error building gcc stage2"; exit 1; }
touch built-gcc-stage2
fi
if [ ! -f installed-gcc-stage2 ]
then
$MAKE install || { echo "Error installing gcc stage2"; exit 1; }
touch installed-gcc-stage2
$MAKE install || { echo "Error installing gcc stage2"; exit 1; }
touch installed-gcc-stage2
fi
@ -189,21 +166,21 @@ cd $target/gdb
if [ ! -f configured-gdb ]
then
CFLAGS="$cflags" LDFLAGS="$ldflags" ../../gdb-$GDB_VER/configure \
--disable-nls --prefix=$prefix --target=$target --disable-werror --disable-dependency-tracking\
|| { echo "Error configuring gdb"; exit 1; }
touch configured-gdb
CFLAGS="$cflags" LDFLAGS="$ldflags" ../../gdb-$GDB_VER/configure \
--disable-nls --prefix=$prefix --target=$target --disable-werror --disable-dependency-tracking\
$CROSS_PARAMS || { echo "Error configuring gdb"; exit 1; }
touch configured-gdb
fi
if [ ! -f built-gdb ]
then
$MAKE || { echo "Error building gdb"; exit 1; }
touch built-gdb
$MAKE || { echo "Error building gdb"; exit 1; }
touch built-gdb
fi
if [ ! -f installed-gdb ]
then
$MAKE install || { echo "Error installing gdb"; exit 1; }
touch installed-gdb
$MAKE install || { echo "Error installing gdb"; exit 1; }
touch installed-gdb
fi

View File

@ -6,7 +6,7 @@ do
dir=$(echo $archive | sed -e 's/\(.*\)\.tar\.bz2/\1/' )
cd $BUILDDIR/$dir
if [ ! -f configured ]; then
CXXFLAGS=$cflags CFLAGS=$cflags LDFLAGS=$ldflags ./configure --prefix=$prefix --disable-dependency-tracking || { echo "error configuring $archive"; exit 1; }
CXXFLAGS=$cflags CFLAGS=$cflags LDFLAGS=$ldflags ./configure --prefix=$prefix --disable-dependency-tracking $CROSS_PARAMS || { echo "error configuring $archive"; exit 1; }
touch configured
fi
if [ ! -f built ]; then