enable lto, error if cross building (for now)

This commit is contained in:
Dave Murphy 2012-04-03 19:59:06 +01:00
parent 0975571570
commit 97c19adf87

View File

@ -1,6 +1,9 @@
#!/bin/sh #!/bin/sh
prefix=$INSTALLDIR/devkitPSP if [ ! -z $CROSSBUILD ]; then
echo "canadian cross not yet supported"
exit 1
fi
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
# build and install binutils # build and install binutils
@ -11,25 +14,25 @@ cd $target/binutils
if [ ! -f configured-binutils ] if [ ! -f configured-binutils ]
then 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 \ --prefix=$prefix --target=$target --disable-nls --disable-debug \
--disable-threads --with-gcc --with-gnu-as --with-gnu-ld --with-stabs \ --enable-lto --enable-plugins \
--disable-dependency-tracking --disable-werror \ --disable-dependency-tracking --disable-werror \
|| { echo "Error configuring binutils"; exit 1; } || { echo "Error configuring binutils"; exit 1; }
touch configured-binutils touch configured-binutils
fi fi
if [ ! -f built-binutils ] if [ ! -f built-binutils ]
then then
$MAKE || { echo "Error building binutils"; exit 1; } $MAKE || { echo "Error building binutils"; exit 1; }
touch built-binutils touch built-binutils
fi fi
if [ ! -f installed-binutils ] if [ ! -f installed-binutils ]
then then
$MAKE install || { echo "Error installing binutils"; exit 1; } $MAKE install || { echo "Error installing binutils"; exit 1; }
touch installed-binutils touch installed-binutils
fi fi
cd $BUILDDIR cd $BUILDDIR
@ -42,7 +45,7 @@ cd $target/gcc
if [ ! -f configured-gcc ] if [ ! -f configured-gcc ]
then then
CFLAGS="$cflags" LDFLAGS="$ldflags" CFLAGS_FOR_TARGET="-O2" LDFLAGS_FOR_TARGET="" ../../gcc-$GCC_VER/configure \ CFLAGS="$cflags" LDFLAGS="$ldflags" CFLAGS_FOR_TARGET="-O2" LDFLAGS_FOR_TARGET="" ../../gcc-$GCC_VER/configure \
--enable-languages=c,c++,objc \ --enable-languages=c,c++,objc \
--disable-multilib\ --disable-multilib\
--with-gcc --with-gnu-ld --with-gnu-as\ --with-gcc --with-gnu-ld --with-gnu-as\
@ -51,46 +54,48 @@ then
--disable-libstdcxx-pch \ --disable-libstdcxx-pch \
--target=$target \ --target=$target \
--with-newlib \ --with-newlib \
--enable-lto $plugin_ld \
--with-headers=../../newlib-$NEWLIB_VER/newlib/libc/include \ --with-headers=../../newlib-$NEWLIB_VER/newlib/libc/include \
--prefix=$prefix \ --prefix=$prefix \
--disable-dependency-tracking \ --disable-dependency-tracking \
--with-bugurl="http://wiki.devkitpro.org/index.php/Bug_Reports" --with-pkgversion="devkitPSP release 17" \ --with-bugurl="http://wiki.devkitpro.org/index.php/Bug_Reports" --with-pkgversion="devkitPSP release 17" \
|| { echo "Error configuring gcc"; exit 1; } || { echo "Error configuring gcc"; exit 1; }
touch configured-gcc touch configured-gcc
fi fi
if [ ! -f built-gcc ] if [ ! -f built-gcc ]
then then
$MAKE all-gcc || { echo "Error building gcc"; exit 1; } $MAKE all-gcc || { echo "Error building gcc"; exit 1; }
touch built-gcc touch built-gcc
fi fi
if [ ! -f installed-gcc ] if [ ! -f installed-gcc ]
then then
$MAKE install-gcc || { echo "Error installing gcc"; exit 1; } $MAKE install-gcc || { echo "Error installing gcc"; exit 1; }
touch installed-gcc touch installed-gcc
fi fi
unset CFLAGS unset CFLAGS
cd $BUILDDIR/pspsdk-$PSPSDK_VER cd $BUILDDIR/pspsdk-$PSPSDK_VER
if [ ! -f bootstrap-sdk ] if [ ! -f bootstrap-sdk ]
then then
./bootstrap || { echo "ERROR RUNNING PSPSDK BOOTSTRAP"; exit 1; } ./bootstrap || { echo "ERROR RUNNING PSPSDK BOOTSTRAP"; exit 1; }
touch bootstrap-sdk touch bootstrap-sdk
fi fi
if [ ! -f configure-sdk ] if [ ! -f configure-sdk ]
then then
./configure --with-pspdev="$prefix" || { echo "ERROR RUNNING PSPSDK CONFIGURE"; exit 1; } ./configure --with-pspdev="$prefix" || { echo "ERROR RUNNING PSPSDK CONFIGURE"; exit 1; }
touch configure-sdk touch configure-sdk
fi fi
if [ ! -f install-sdk-data ] if [ ! -f install-sdk-data ]
then then
$MAKE install-data || { echo "ERROR INSTALLING PSPSDK HEADERS"; exit 1; } $MAKE install-data || { echo "ERROR INSTALLING PSPSDK HEADERS"; exit 1; }
touch install-sdk-data touch install-sdk-data
fi fi
cd $BUILDDIR cd $BUILDDIR
@ -103,24 +108,24 @@ cd $target/newlib
if [ ! -f configured-newlib ] if [ ! -f configured-newlib ]
then then
../../newlib-$NEWLIB_VER/configure \ ../../newlib-$NEWLIB_VER/configure \
--target=$target \ --target=$target \
--prefix=$prefix \ --prefix=$prefix \
--disable-dependency-tracking \ --disable-dependency-tracking \
|| { echo "Error configuring newlib"; exit 1; } || { echo "Error configuring newlib"; exit 1; }
touch configured-newlib touch configured-newlib
fi fi
if [ ! -f built-newlib ] if [ ! -f built-newlib ]
then then
$MAKE || { echo "Error building newlib"; exit 1; } $MAKE || { echo "Error building newlib"; exit 1; }
touch built-newlib touch built-newlib
fi fi
if [ ! -f installed-newlib ] if [ ! -f installed-newlib ]
then then
$MAKE install || { echo "Error installing newlib"; exit 1; } $MAKE install || { echo "Error installing newlib"; exit 1; }
touch installed-newlib touch installed-newlib
fi fi
cd $BUILDDIR cd $BUILDDIR
@ -134,14 +139,14 @@ cd $target/gcc
if [ ! -f built-g++ ] if [ ! -f built-g++ ]
then then
$MAKE || { echo "Error building g++"; exit 1; } $MAKE || { echo "Error building g++"; exit 1; }
touch built-g++ touch built-g++
fi fi
if [ ! -f installed-g++ ] if [ ! -f installed-g++ ]
then then
$MAKE install || { echo "Error installing g++"; exit 1; } $MAKE install || { echo "Error installing g++"; exit 1; }
touch installed-g++ touch installed-g++
fi fi
cd $BUILDDIR/pspsdk-$PSPSDK_VER cd $BUILDDIR/pspsdk-$PSPSDK_VER
@ -153,14 +158,14 @@ echo "building pspsdk ..."
if [ ! -f built-sdk ] if [ ! -f built-sdk ]
then then
$MAKE || { echo "ERROR BUILDING PSPSDK"; exit 1; } $MAKE || { echo "ERROR BUILDING PSPSDK"; exit 1; }
touch built-sdk touch built-sdk
fi fi
if [ ! -f installed-sdk ] if [ ! -f installed-sdk ]
then then
$MAKE install || { echo "ERROR INSTALLING PSPSDK"; exit 1; } $MAKE install || { echo "ERROR INSTALLING PSPSDK"; exit 1; }
touch installed-sdk touch installed-sdk
fi fi
cd $BUILDDIR cd $BUILDDIR
@ -173,21 +178,22 @@ cd $target/gdb
if [ ! -f configured-gdb ] if [ ! -f configured-gdb ]
then then
CFLAGS=$cflags LDFLAGS=$ldflags ../../gdb-$GDB_VER/configure \ CFLAGS=$cflags LDFLAGS=$ldflags ../../gdb-$GDB_VER/configure \
--disable-nls --prefix=$prefix --target=$target --disable-werror \ --disable-nls --prefix=$prefix --target=$target --disable-werror \
--disable-dependency-tracking \ --disable-dependency-tracking \
|| { echo "Error configuring gdb"; exit 1; } || { echo "Error configuring gdb"; exit 1; }
touch configured-gdb touch configured-gdb
fi fi
if [ ! -f built-gdb ] if [ ! -f built-gdb ]
then then
$MAKE || { echo "Error building gdb"; exit 1; } $MAKE || { echo "Error building gdb"; exit 1; }
touch built-gdb touch built-gdb
fi fi
if [ ! -f installed-gdb ] if [ ! -f installed-gdb ]
then then
$MAKE install || { echo "Error installing gdb"; exit 1; } $MAKE install || { echo "Error installing gdb"; exit 1; }
touch installed-gdb touch installed-gdb
fi fi