rework scripts to download missing archives & use autoconfiscated tools sources

This commit is contained in:
Dave Murphy 2012-03-31 18:42:13 +01:00
parent a88a5912fe
commit ea304bc7bf
8 changed files with 211 additions and 635 deletions

581
build-devkit.sh Normal file → Executable file
View File

@ -2,11 +2,11 @@
#---------------------------------------------------------------------------------
# Build scripts for
# devkitARM release 38
# devkitPPC release 25-1
# devkitPPC release 26
# devkitPSP release 16-1
#---------------------------------------------------------------------------------
if [ 1 -eq 1 ] ; then
if [ 0 -eq 1 ] ; then
echo "Currently in release cycle, proceed with caution, do not report problems, do not ask for support."
echo "Please use the latest release buildscripts unless advised otherwise by devkitPro staff."
echo "http://sourceforge.net/projects/devkitpro/files/buildscripts/"
@ -16,43 +16,51 @@ if [ 1 -eq 1 ] ; then
exit 1
fi
#---------------------------------------------------------------------------------
# specify some urls to download the source packages from
#---------------------------------------------------------------------------------
LIBOGC_VER=1.8.9
LIBOGC_VER=1.8.10
LIBGBA_VER=20090222
LIBNDS_VER=1.5.4
DEFAULT_ARM7_VER=0.5.23
LIBNDS_VER=1.5.5
DEFAULT_ARM7_VER=0.5.24
DSWIFI_VER=0.3.13
LIBMIRKO_VER=0.9.7
MAXMOD_VER=1.0.6
MAXMOD_VER=1.0.7
FILESYSTEM_VER=0.9.9
LIBFAT_VER=1.0.10
LIBFAT_VER=1.0.11
PSPSDK_VER=20120229
GBATOOLS_VER=1.0.0
GRIT_VER=0.8.9
NDSTOOL_VER=1.50.1
GENERAL_TOOLS_VER=1.0.0
DLDITOOL_VER=1.24.0
GXTEXCONV_VER=0.1.8
GCDSPSUITE_VER=1.4.0
ELF2DOL_VER=1.0.0
WIILOAD_VER=0.5.1
LIBOGC="libogc-src-$LIBOGC_VER.tar.bz2"
LIBGBA="libgba-src-$LIBGBA_VER.tar.bz2"
LIBNDS="libnds-src-$LIBNDS_VER.tar.bz2"
DSWIFI="dswifi-src-$DSWIFI_VER.tar.bz2"
MAXMOD="maxmod-src-$MAXMOD_VER.tar.bz2"
PSPSDK="pspsdk-$PSPSDK_VER.tar.bz2"
FILESYSTEM="libfilesystem-src-$FILESYSTEM_VER.tar.bz2"
LIBFAT="libfat-src-$LIBFAT_VER.tar.bz2"
DEFAULT_ARM7="default_arm7-src-$DEFAULT_ARM7_VER.tar.bz2"
LIBMIRKO="libmirko-src-$LIBMIRKO_VER.tar.bz2"
DEVKITPRO_URL="http://downloads.sourceforge.net/devkitpro"
#---------------------------------------------------------------------------------
function extract_and_patch {
#---------------------------------------------------------------------------------
if [ ! -f extracted-$1 ]; then
echo "extracting $1"
if [ $3 == "bz2" ]; then
extractflags="-xjf"
archivetype=".tar.bz2"
elif [ $3 == "gz" ]; then
extractflags="-xzf"
archivetype=".tar.gz"
else
echo "invalid archive type"
exit 1
fi
tar $extractflags $SRCDIR/$1-$2$archivetype || { echo "Error extracting "$1; exit 1; }
touch extracted-$1
fi
if [[ ! -f patched-$1 && -f $patchdir/$1-$2.patch ]]; then
echo "patching $1"
patch -p1 -d $1-$2 -i $patchdir/$1-$2.patch || { echo "Error patching $1"; exit 1; }
touch patched-$1
fi
}
LIBOGC_URL="$DEVKITPRO_URL/$LIBOGC"
LIBGBA_URL="$DEVKITPRO_URL/$LIBGBA"
LIBNDS_URL="$DEVKITPRO_URL/$LIBNDS"
DSWIFI_URL="$DEVKITPRO_URL/$DSWIFI"
LIBMIRKO_URL="$DEVKITPRO_URL/$LIBMIRKO"
DEFAULT_ARM7_URL="$DEVKITPRO_URL/$DEFAULT_ARM7"
MAXMOD_URL="$DEVKITPRO_URL/$MAXMOD"
PSPSDK_URL="$DEVKITPRO_URL/$PSPSDK"
FILESYSTEM_URL="$DEVKITPRO_URL/$FILESYSTEM"
LIBFAT_URL="$DEVKITPRO_URL/$LIBFAT"
#---------------------------------------------------------------------------------
# Sane defaults for building toolchain
@ -72,68 +80,8 @@ if [ -f ./config.sh ]; then
else
echo "Not found"
fi
#---------------------------------------------------------------------------------
# Ask whether to download the source packages or not
#---------------------------------------------------------------------------------
VERSION=0
if [ ! -z "$BUILD_DKPRO_PACKAGE" ] ; then
VERSION="$BUILD_DKPRO_PACKAGE"
fi
. ./select_toolchain.sh
GCC_CORE="gcc-core-$GCC_VER.tar.bz2"
GCC_GPP="gcc-g++-$GCC_VER.tar.bz2"
GCC_OBJC="gcc-objc-$GCC_VER.tar.bz2"
GCC_CORE_URL="$DEVKITPRO_URL/$GCC_CORE"
GCC_GPP_URL="$DEVKITPRO_URL/gcc-g++-$GCC_VER.tar.bz2"
GCC_OBJC_URL="$DEVKITPRO_URL/$GCC_OBJC"
BINUTILS="binutils-$BINUTILS_VER.tar.bz2"
GDB="gdb-$GDB_VER.tar.bz2"
GDB_URL="$DEVKITPRO_URL/$GDB"
BINUTILS_URL="$DEVKITPRO_URL/$BINUTILS"
NEWLIB="newlib-$NEWLIB_VER.tar.gz"
NEWLIB_URL="$DEVKITPRO_URL/$NEWLIB"
DOWNLOAD=0
if [ ! -z "$BUILD_DKPRO_DOWNLOAD" ] ; then
DOWNLOAD="$BUILD_DKPRO_DOWNLOAD"
fi
while [ $DOWNLOAD -eq 0 ]
do
echo
echo "The installation requires binutils-$BINUTILS_VER, gcc-$GCC_VER, newlib-$NEWLIB_VER and gdb-$GDB_VER. Please select an option:"
echo
echo "1: I have already downloaded the source packages"
echo "2: Download the packages for me (requires curl or wget)"
read DOWNLOAD
if [ "$DOWNLOAD" -ne 1 -a "$DOWNLOAD" -ne 2 ]
then
DOWNLOAD=0
fi
done
if [ "$DOWNLOAD" -eq 2 ]; then
if test "`curl -V`"; then
FETCH="curl -f -L -O"
elif test "`wget -V`"; then
FETCH=wget
else
echo "ERROR: Please make sure you have wget or curl installed."
exit 1
fi
fi
#---------------------------------------------------------------------------------
# Get preferred installation directory and set paths to the sources
#---------------------------------------------------------------------------------
@ -152,218 +100,15 @@ fi
[ ! -z "$INSTALLDIR" ] && mkdir -p $INSTALLDIR && touch $INSTALLDIR/nonexistantfile && rm $INSTALLDIR/nonexistantfile || exit 1;
if [ $DOWNLOAD -eq 1 ]
then
FOUND=0
while [ $FOUND -eq 0 ]
do
if [ ! -z "$BUILD_DKPRO_SRCDIR" ] ; then
SRCDIR="$BUILD_DKPRO_SRCDIR"
else
echo
echo "Please enter the path to the directory that contains the source packages:"
read SRCDIR
fi
if [ ! -f $SRCDIR/$BINUTILS ]
then
echo "Error: $BINUTILS not found in $SRCDIR"
exit 1
else
FOUND=1
fi
if [ ! -f $SRCDIR/$GCC_GPP ]
then
echo "Error: $GCC_GPP not found in $SRCDIR"
exit 1
else
FOUND=1
fi
if [ ! -f $SRCDIR/$GCC_CORE ]
then
echo "Error: $GCC_CORE not found in $SRCDIR"
exit 1
else
FOUND=1
fi
if [ ! -f $SRCDIR/$GCC_OBJC ]
then
echo "Error: $GCC_OBJC not found in $SRCDIR"
exit 1
else
FOUND=1
fi
if [ ! -f $SRCDIR/$NEWLIB ]
then
echo "Error: $NEWLIB not found in $SRCDIR"
exit 1
else
FOUND=1
fi
if [ ! -f $SRCDIR/$GDB ]
then
echo "Error: $GDB not found in $SRCDIR"
exit 1
else
FOUND=1
fi
if [ $VERSION -eq 1 ]
then
if [ ! -f $SRCDIR/$LIBGBA ]
then
echo "Error: $LIBGBA not found in $SRCDIR"
exit 1
else
FOUND=1
fi
if [ ! -f $SRCDIR/$LIBNDS ]
then
echo "Error: $LIBNDS not found in $SRCDIR"
exit 1
else
FOUND=1
fi
if [ ! -f $SRCDIR/$DSWIFI ]
then
echo "Error: $DSWIFI not found in $SRCDIR"
exit 1
else
FOUND=1
fi
if [ ! -f $SRCDIR/$LIBMIRKO ]
then
echo "Error: $LIBMIRKO not found in $SRCDIR"
exit 1
else
FOUND=1
fi
if [ ! -f $SRCDIR/$DEFAULT_ARM7 ]
then
echo "Error: $DEFAULT_ARM7 not found in $SRCDIR"
exit 1
else
FOUND=1
fi
if [ ! -f $SRCDIR/$MAXMOD ]
then
echo "Error: $MAXMOD not found in $SRCDIR"
exit 1
else
FOUND=1
fi
if [ ! -f $SRCDIR/$FILESYSTEM ]
then
echo "Error: $FILESYSTEM not found in $SRCDIR"
exit 1
else
FOUND=1
fi
fi
if [ $VERSION -eq 2 ]
then
if [ ! -f $SRCDIR/$LIBOGC ]
then
echo "Error: $LIBOGC not found in $SRCDIR"
exit 1
else
FOUND=1
fi
fi
if [ $VERSION -eq 1 -o $VERSION -eq 2 ]
then
if [ ! -f $SRCDIR/$LIBFAT ]
then
echo "Error: $LIBFAT not found in $SRCDIR"
exit 1
else
FOUND=1
fi
fi
if [ $VERSION -eq 3 ]
then
if [ ! -f $SRCDIR/$PSPSDK ]
then
echo "Error: $PSPSDK not found in $SRCDIR"
exit 1
else
FOUND=1
fi
fi
done
if test "`curl -V`"; then
FETCH="curl -f -L -O"
elif test "`wget -V`"; then
FETCH=wget
else
if [ ! -f downloaded_sources ]
then
$FETCH $BINUTILS_URL || { echo "Error: Failed to download "$BINUTILS; exit 1; }
$FETCH $GCC_CORE_URL || { echo "Error: Failed to download "$GCC_CORE; exit 1; }
$FETCH $GCC_GPP_URL || { echo "Error: Failed to download "$GCC_GPP; exit 1; }
$FETCH $GCC_OBJC_URL || { echo "Error: Failed to download "$GCC_OBJC; exit 1; }
$FETCH $GDB_URL || { echo "Error: Failed to download "$GDB; exit 1; }
$FETCH $NEWLIB_URL || { echo "Error: Failed to download "$NEWLIB; exit 1; }
if [ $VERSION -eq 2 ]
then
$FETCH $LIBOGC_URL || { echo "Error: Failed to download "$LIBOGC; exit 1; }
fi
if [ $VERSION -eq 1 -o $VERSION -eq 2 ]
then
$FETCH $LIBFAT_URL || { echo "Error: Failed to download "$LIBFAT; exit 1; }
fi
if [ $VERSION -eq 1 ]
then
$FETCH $LIBNDS_URL || { echo "Error: Failed to download "$LIBNDS; exit 1; }
$FETCH $LIBGBA_URL || { echo "Error: Failed to download "$LIBGBA; exit 1; }
$FETCH $DSWIFI_URL || { echo "Error: Failed to download "$DSWIFI; exit 1; }
$FETCH $LIBMIRKO_URL || { echo "Error: Failed to download "$LIBMIRKO; exit 1; }
$FETCH $DEFAULT_ARM7_URL || { echo "Error: Failed to download "$DEFAULT_ARM7; exit 1; }
$FETCH $MAXMOD_URL || { echo "Error: Failed to download "$MAXMOD; exit 1; }
$FETCH $FILESYSTEM_URL || { echo "Error: Failed to download "$FILESYSTEM; exit 1; }
fi
if [ $VERSION -eq 3 ]
then
$FETCH $PSPSDK_URL || { echo "Error: Failed to download "$PSPSDK; exit 1; }
fi
SRCDIR=`pwd`
touch downloaded_sources
fi
echo "ERROR: Please make sure you have wget or curl installed."
exit 1
fi
BINUTILS_SRCDIR="binutils-$BINUTILS_VER"
GCC_SRCDIR="gcc-$GCC_VER"
GDB_SRCDIR="gdb-$GDB_VER"
NEWLIB_SRCDIR="newlib-$NEWLIB_VER"
LIBOGC_SRCDIR="libogc-$LIBOGC_VER"
LIBGBA_SRCDIR="libgba-$LIBGBA_VER"
LIBFAT_SRCDIR="libfat-$LIBFAT_VER"
DSWIFI_SRCDIR="dswifi-$DSWIFI_VER"
LIBNDS_SRCDIR="libnds-$LIBNDS_VER"
MAXMOD_SRCDIR="maxmod-$MAXMOD_VER"
PSPSDK_SRCDIR="pspsdk-$PSPSDK_VER"
FILESYSTEM_SRCDIR="filesystem-$FILESYSTEM_VER"
LIBMIRKO_SRCDIR="libmirko-$LIBMIRKO_VER"
DEFAULT_ARM7_SRCDIR="default_arm7-$DEFAULT_ARM7_VER"
#---------------------------------------------------------------------------------
# find proper make
@ -378,27 +123,6 @@ fi
echo use $MAKE as make
export MAKE
#---------------------------------------------------------------------------------
# find proper gawk
#---------------------------------------------------------------------------------
if [ -z "$GAWK" -a -x "$(which gawk)" ]; then GAWK=$(which gawk); fi
if [ -z "$GAWK" -a -x "$(which awk)" ]; then GAWK=$(which awk); fi
if [ -z "$GAWK" ]; then
echo no awk found
exit 1
fi
echo use $GAWK as gawk
export GAWK
#---------------------------------------------------------------------------------
# find makeinfo, needed for newlib
#---------------------------------------------------------------------------------
if [ ! -x $(which makeinfo) ]; then
echo makeinfo not found
exit 1
fi
#---------------------------------------------------------------------------------
# Add installed devkit to the path, adjusting path on minsys
#---------------------------------------------------------------------------------
@ -414,127 +138,93 @@ if [ "$BUILD_DKPRO_AUTOMATED" != "1" ] ; then
read dummy
fi
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
BUILDSCRIPTDIR=$(pwd)
BUILDDIR=$(pwd)/.$package
DEVKITPRO_URL="http://downloads.sourceforge.net/devkitpro"
patchdir=$(pwd)/$basedir/patches
scriptdir=$(pwd)/$basedir/scripts
#---------------------------------------------------------------------------------
# Extract source packages
#---------------------------------------------------------------------------------
BUILDSCRIPTDIR=$(pwd)
if [ ! -f extracted_archives ]
then
echo "Extracting $BINUTILS"
tar -xjf $SRCDIR/$BINUTILS || { echo "Error extracting "$BINUTILS; exit 1; }
echo "Extracting $GCC_CORE"
tar -xjf $SRCDIR/$GCC_CORE || { echo "Error extracting "$GCC_CORE; exit 1; }
echo "Extracting $GCC_GPP"
tar -xjf $SRCDIR/$GCC_GPP || { echo "Error extracting "$GCC_GPP; exit 1; }
echo "Extracting $GCC_OBJC"
tar -xjf $SRCDIR/$GCC_OBJC || { echo "Error extracting "$GCC_OBJC; exit 1; }
echo "Extracting $NEWLIB"
tar -xzf $SRCDIR/$NEWLIB || { echo "Error extracting "$NEWLIB; exit 1; }
echo "Extracting $GDB"
tar -xjf $SRCDIR/$GDB || { echo "Error extracting "$GCC_GPP; exit 1; }
if [ $VERSION -eq 2 ]
then
echo "Extracting $LIBOGC"
mkdir -p $LIBOGC_SRCDIR
bzip2 -cd $SRCDIR/$LIBOGC | tar -xf - -C $LIBOGC_SRCDIR || { echo "Error extracting "$LIBOGC; exit 1; }
fi
if [ $VERSION -eq 1 -o $VERSION -eq 2 ]
then
echo "Extracting $LIBFAT"
mkdir -p $LIBFAT_SRCDIR
bzip2 -cd $SRCDIR/$LIBFAT | tar -xf - -C $LIBFAT_SRCDIR || { echo "Error extracting "$LIBFAT; exit 1; }
fi
if [ $VERSION -eq 1 ]
then
echo "Extracting $LIBNDS"
mkdir -p $LIBNDS_SRCDIR
bzip2 -cd $SRCDIR/$LIBNDS | tar -xf - -C $LIBNDS_SRCDIR || { echo "Error extracting "$LIBNDS; exit 1; }
echo "Extracting $LIBGBA"
mkdir -p $LIBGBA_SRCDIR
bzip2 -cd $SRCDIR/$LIBGBA | tar -xf - -C $LIBGBA_SRCDIR || { echo "Error extracting "$LIBGBA; exit 1; }
echo "Extracting $DSWIFI"
mkdir -p $DSWIFI_SRCDIR
bzip2 -cd $SRCDIR/$DSWIFI | tar -xf - -C $DSWIFI_SRCDIR || { echo "Error extracting "$DSWIFI; exit 1; }
echo "Extracting $LIBMIRKO"
mkdir -p $LIBMIRKO_SRCDIR
bzip2 -cd $SRCDIR/$LIBMIRKO | tar -xf - -C $LIBMIRKO_SRCDIR || { echo "Error extracting "$LIBMIRKO; exit 1; }
echo "Extracting $DEFAULT_ARM7"
mkdir -p $DEFAULT_ARM7_SRCDIR
bzip2 -cd $SRCDIR/$DEFAULT_ARM7 | tar -xf - -C $DEFAULT_ARM7_SRCDIR || { echo "Error extracting "$DEFAULT_ARM7; exit 1; }
echo "Extracting $MAXMOD"
mkdir -p $MAXMOD_SRCDIR
bzip2 -cd $SRCDIR/$MAXMOD | tar -xf - -C $MAXMOD_SRCDIR || { echo "Error extracting "$MAXMOD; exit 1; }
echo "Extracting $FILESYSTEM"
mkdir -p $FILESYSTEM_SRCDIR
bzip2 -cd $SRCDIR/$FILESYSTEM | tar -xf - -C $FILESYSTEM_SRCDIR || { echo "Error extracting "$FILESYSTEM; exit 1; }
fi
if [ $VERSION -eq 3 ]
then
echo "Extracting $PSPSDK"
mkdir -p $PSPSDK_SRCDIR
bzip2 -cd $SRCDIR/$PSPSDK | tar -xf - -C $PSPSDK_SRCDIR || { echo "Error extracting "$PSPSDK; exit 1; }
fi
touch extracted_archives
archives="binutils-${BINUTILS_VER}.tar.bz2 gcc-${GCC_VER}.tar.bz2 newlib-${NEWLIB_VER}.tar.gz gdb-${GDB_VER}.tar.bz2"
if [ $VERSION -eq 1 ]; then
targetarchives="libnds-src-${LIBNDS_VER}.tar.bz2 libgba-src-${LIBGBA_VER}.tar.bz2
libmirko-src-${LIBMIRKO_VER}.tar.bz2 dswifi-src-${DSWIFI_VER}.tar.bz2 maxmod-src-${MAXMOD_VER}.tar.bz2
default-arm7-src-${DEFAULT_ARM7_VER}.tar.bz2 libfilesystem-src-${FILESYSTEM_VER}.tar.bz2
libfat-src-${LIBFAT_VER}.tar.bz2"
hostarchives="gbatools-$GBATOOLS_VER.tar.bz2 grit-$GRIT_VER.tar.bz2 ndstool-$NDSTOOL_VER.tar.bz2
general-tools-$GENERAL_TOOLS_VER.tar.bz2 dlditool-$DLDITOOL_VER.tar.bz2"
fi
#---------------------------------------------------------------------------------
# apply patches
#---------------------------------------------------------------------------------
if [ ! -f patched_sources ]
then
if [ -f $patchdir/binutils-$BINUTILS_VER.patch ]
then
patch -p1 -d $BINUTILS_SRCDIR -i $patchdir/binutils-$BINUTILS_VER.patch || { echo "Error patching binutils"; exit 1; }
fi
if [ -f $patchdir/gcc-$GCC_VER.patch ]
then
patch -p1 -d $GCC_SRCDIR -i $patchdir/gcc-$GCC_VER.patch || { echo "Error patching gcc"; exit 1; }
fi
if [ -f $patchdir/newlib-$NEWLIB_VER.patch ]
then
patch -p1 -d $NEWLIB_SRCDIR -i $patchdir/newlib-$NEWLIB_VER.patch || { echo "Error patching newlib"; exit 1; }
fi
if [ -f $patchdir/gdb-$GDB_VER.patch ]
then
patch -p1 -d $GDB_SRCDIR -i $patchdir/gdb-$GDB_VER.patch || { echo "Error patching gdb"; exit 1; }
fi
touch patched_sources
if [ $VERSION -eq 2 ]; then
targetarchives="libogc-src-${LIBOGC_VER}.tar.bz2 libfat-src-${LIBFAT_VER}.tar.bz2"
hostarchives="gxtexconv-$GXTEXCONV_VER.tar.bz2 gcdspsuite-$GCDSPSUITE_VER.tar.bz2
wiiload-$WIILOAD_VER.tar.bz2 elf2dol-$ELF2DOL_VER.tar.bz2"
fi
if [ $VERSION -eq 3 ]; then
targetarchives="pspsdk-src-${PSPSDK_VER}.tar.bz2"
fi
if [ ! -z "$BUILD_DKPRO_SRCDIR" ] ; then
SRCDIR="$BUILD_DKPRO_SRCDIR"
else
SRCDIR=`pwd`
fi
cd $SRCDIR
for archive in $archives $targetarchives $hostarchives
do
echo $archive
if [ ! -f $archive ]; then
$FETCH http://downloads.sf.net/devkitpro/$archive || { echo "Error: Failed to download $archive"; exit 1; }
fi
done
cd $BUILDSCRIPTDIR
mkdir -p $BUILDDIR
cd $BUILDDIR
extract_and_patch binutils $BINUTILS_VER bz2
extract_and_patch gcc $GCC_VER bz2
extract_and_patch newlib $NEWLIB_VER gz
extract_and_patch gdb $GDB_VER bz2
for archive in $targetarchives
do
destdir=$(echo $archive | sed -e 's/\(.*\)-src-\(.*\)\.tar\.bz2/\1-\2/' )
echo $destdir
if [ ! -d $destdir ]; then
mkdir -p $destdir
bzip2 -cd $SRCDIR/$archive | tar -xf - -C $destdir || { echo "Error extracting "$archive; exit 1; }
fi
done
for archive in $hostarchives
do
tar -xjf $SRCDIR/$archive
done
#---------------------------------------------------------------------------------
# Build and install devkit components
#---------------------------------------------------------------------------------
if [ -f $scriptdir/build-gcc.sh ]; then . $scriptdir/build-gcc.sh || { echo "Error building toolchain"; exit 1; }; cd $BUILDSCRIPTDIR; fi
if [ -f $scriptdir/build-crtls.sh ]; then . $scriptdir/build-crtls.sh || { echo "Error building crtls"; exit 1; }; cd $BUILDSCRIPTDIR; fi
if [ -f $scriptdir/build-tools.sh ]; then . $scriptdir/build-tools.sh || { echo "Error building tools"; exit 1; }; cd $BUILDSCRIPTDIR; fi
if [ -f $scriptdir/build-crtls.sh ]; then . $scriptdir/build-crtls.sh || { echo "Error building crtls"; exit 1; }; cd $BUILDSCRIPTDIR; fi
. ./strip_bins.sh
@ -555,41 +245,8 @@ if [ "$answer" != "n" -a "$answer" != "N" ]
echo "Removing patched sources and build directories"
rm -fr $target
rm -fr $BINUTILS_SRCDIR
rm -fr $NEWLIB_SRCDIR
rm -fr $GCC_SRCDIR
rm -fr $LIBOGC_SRCDIR $LIBGBA_SRCDIR $LIBNDS_SRCDIR $LIBMIRKO_SRCDIR $DSWIFI_SRCDIR $LIBFAT_SRCDIR $GDB_SRCDIR $DEFAULT_ARM7_SRCDIR $MAXMOD_SRCDIR $FILESYSTEM_SRCDIR
rm -fr mn10200
rm -fr $PSPSDK_SRCDIR
rm -fr extracted_archives patched_sources
fi
if [ "$BUILD_DKPRO_AUTOMATED" != "1" ] ; then
echo
echo "Would you like to delete the downloaded source packages? [y/N]"
read answer
else
answer=n
fi
if [ "$answer" = "y" -o "$answer" = "Y" ]
then
echo "removing archives"
rm -f $SRCDIR/$BINUTILS $SRCDIR/$GCC_CORE $SRCDIR/$GCC_GPP $SRCDIR/$NEWLIB
if [ $VERSION -eq 1 -o $VERSION -eq 4 ]
then
rm -f $SRCDIR/$LIBGBA $SRCDIR/$LIBNDS $SRCDIR/$LIBMIRKO
fi
if [ $VERSION -eq 2 ]
then
rm -f $SRCDIR/$LIBOGC
fi
rm -f downloaded_sources
fi
echo
echo "note: Add the following to your environment; DEVKITPRO=$TOOLPATH $toolchain=$TOOLPATH/$package"

View File

@ -1,18 +1,15 @@
#!/bin/sh
export DEVKITARM=$TOOLPATH/devkitARM
export DEVKITPRO=$TOOLPATH
#---------------------------------------------------------------------------------
# copy base rulesets
#---------------------------------------------------------------------------------
cp -v dkarm-eabi/rules/* $DEVKITARM
cp -v $BUILDSCRIPTDIR/dkarm-eabi/rules/* $DEVKITARM
#---------------------------------------------------------------------------------
# Install and build the gba crt
#---------------------------------------------------------------------------------
cp -v $(pwd)/dkarm-eabi/crtls/* $DEVKITARM/arm-eabi/lib/
cp -v $BUILDSCRIPTDIR/dkarm-eabi/crtls/* $DEVKITARM/arm-eabi/lib/
cd $DEVKITARM/arm-eabi/lib/
$MAKE CRT=gba
$MAKE CRT=gp32
@ -22,46 +19,26 @@ $MAKE CRT=ds_arm7
$MAKE CRT=ds_arm9
$MAKE CRT=ds_cart
cd $BUILDSCRIPTDIR
cd $BUILDDIR/libnds-$LIBNDS_VER
$MAKE || { echo "error building libnds"; exit 1; }
$MAKE install || { echo "error installing libnds"; exit 1; }
$MAKE -C tools/general
$MAKE -C tools/general install PREFIX=$DEVKITARM/bin
cd $BUILDDIR/default-arm7-$DEFAULT_ARM7_VER
$MAKE || { echo "error building default arm7"; exit 1; }
$MAKE install || { echo "error installing default arm7"; exit 1; }
$MAKE -C tools/gba
$MAKE -C tools/gba install PREFIX=$DEVKITARM/bin
cd $BUILDDIR/libfat-$LIBFAT_VER
$MAKE nds-install || { echo "error building nds libfat"; exit 1; }
$MAKE gba-install || { echo "error installing gba libfat"; exit 1; }
echo "building libnds ..."
cd $LIBNDS_SRCDIR
$MAKE install INSTALLDIR=$TOOLPATH
cd $BUILDSCRIPTDIR
cd $BUILDDIR/maxmod-$MAXMOD_VER
$MAKE || { echo "error building maxmod"; exit 1; }
$MAKE install || { echo "error installing maxmod"; exit 1; }
echo "building libgba ..."
cd $LIBGBA_SRCDIR
$MAKE install INSTALLDIR=$TOOLPATH
cd $BUILDSCRIPTDIR
cd $BUILDDIR/libmirko-$LIBMIRKO_VER
$MAKE || { echo "error building libmirko"; exit 1; }
$MAKE install || { echo "error installing libmirko"; exit 1; }
echo "building libfat ..."
cd $LIBFAT_SRCDIR
$MAKE nds-install INSTALLDIR=$TOOLPATH
$MAKE gba-install INSTALLDIR=$TOOLPATH
cd $BUILDSCRIPTDIR
echo "building dswifi ..."
cd $DSWIFI_SRCDIR
$MAKE install INSTALLDIR=$TOOLPATH
cd $BUILDSCRIPTDIR
echo "building maxmod ..."
cd $MAXMOD_SRCDIR
$MAKE install INSTALLDIR=$TOOLPATH
cd $BUILDSCRIPTDIR
echo "building default arm7 ..."
cd $DEFAULT_ARM7_SRCDIR
$MAKE install INSTALLDIR=$TOOLPATH
cd $BUILDSCRIPTDIR
echo "building libmirko ..."
cd $LIBMIRKO_SRCDIR
$MAKE install INSTALLDIR=$TOOLPATH
cd $BUILDSCRIPTDIR
cd $BUILDDIR/libfilesystem-$FILESYSTEM_VER
$MAKE || { echo "error building libfilesystem"; exit 1; }
$MAKE install || { echo "error installing libfilesystem"; exit 1; }

View File

@ -5,21 +5,6 @@
prefix=$INSTALLDIR/devkitARM
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 binutils
#---------------------------------------------------------------------------------
@ -29,7 +14,7 @@ cd $target/binutils
if [ ! -f configured-binutils ]
then
CFLAGS=$cflags LDFLAGS=$ldflags ../../$BINUTILS_SRCDIR/configure \
CFLAGS=$cflags LDFLAGS=$ldflags ../../binutils-$BINUTILS_VER/configure \
--prefix=$prefix --target=$target --disable-nls --disable-dependency-tracking --disable-werror \
|| { echo "Error configuring binutils"; exit 1; }
touch configured-binutils
@ -46,7 +31,7 @@ then
$MAKE install || { echo "Error installing binutils"; exit 1; }
touch installed-binutils
fi
cd $BUILDSCRIPTDIR
cd $BUILDDIR
#---------------------------------------------------------------------------------
# included zlib has issues with multilib toolchain
@ -62,8 +47,7 @@ cd $target/gcc
if [ ! -f configured-gcc ]
then
cp -r $BUILDSCRIPTDIR/$NEWLIB_SRCDIR/newlib/libc/include $INSTALLDIR/devkitARM/$target/sys-include
CFLAGS="$cflags" LDFLAGS="$ldflags" CFLAGS_FOR_TARGET="-O2" LDFLAGS_FOR_TARGET="" ../../$GCC_SRCDIR/configure \
CFLAGS="$cflags" LDFLAGS="$ldflags" CFLAGS_FOR_TARGET="-O2" LDFLAGS_FOR_TARGET="" ../../gcc-$GCC_VER/configure \
--enable-languages=c,c++,objc \
--with-march=armv4t\
--enable-interwork --enable-multilib\
@ -74,6 +58,7 @@ then
--disable-libstdcxx-pch \
--target=$target \
--with-newlib \
--with-headers=$BUILDDIR/newlib-$NEWLIB_VER/newlib/libc/include \
--prefix=$prefix\
--enable-lto $plugin_ld\
--with-bugurl="http://wiki.devkitpro.org/index.php/Bug_Reports" --with-pkgversion="devkitARM release 38" \
@ -91,11 +76,10 @@ if [ ! -f installed-gcc-stage1 ]
then
$MAKE install-gcc || { echo "Error installing gcc"; exit 1; }
touch installed-gcc-stage1
rm -fr $INSTALLDIR/devkitARM/$target/sys-include
fi
unset CFLAGS
cd $BUILDSCRIPTDIR
cd $BUILDDIR
#---------------------------------------------------------------------------------
# build and install newlib
@ -105,7 +89,7 @@ cd $target/newlib
if [ ! -f configured-newlib ]
then
CFLAGS_FOR_TARGET="-DREENTRANT_SYSCALLS_PROVIDED -D__DEFAULT_UTF8__ -O2" ../../$NEWLIB_SRCDIR/configure \
CFLAGS_FOR_TARGET="-DREENTRANT_SYSCALLS_PROVIDED -D__DEFAULT_UTF8__ -O2" ../../newlib-$NEWLIB_VER/configure \
--disable-newlib-supplied-syscalls \
--enable-newlib-mb \
--enable-newlib-io-long-long \
@ -132,7 +116,7 @@ fi
# build and install the final compiler
#---------------------------------------------------------------------------------
cd $BUILDSCRIPTDIR
cd $BUILDDIR
cd $target/gcc
if [ ! -f built-gcc-stage2 ]
@ -147,7 +131,7 @@ then
touch installed-gcc-stage2
fi
cd $BUILDSCRIPTDIR
cd $BUILDDIR
#---------------------------------------------------------------------------------
# build and install the debugger
@ -159,7 +143,7 @@ PLATFORM=`uname -s`
if [ ! -f configured-gdb ]
then
CFLAGS="$cflags" LDFLAGS="$ldflags" ../../$GDB_SRCDIR/configure \
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; }

View File

@ -1,13 +1,20 @@
#!/bin/sh
#!/bin/bash
cd $BUILDDIR
export DEVKITARM=$TOOLPATH/devkitARM
export DEVKITPRO=$TOOLPATH
$MAKE -C tools/gp32
$MAKE -C tools/gp32 install PREFIX=$DEVKITARM/bin
$MAKE -C tools/nds/
$MAKE -C tools/nds/ install PREFIX=$DEVKITARM/bin
$MAKE -C tools clean
for archive in $hostarchives
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; }
touch configured
fi
if [ ! -f built ]; then
$MAKE || { echo "error building $archive"; exit 1; }
touch built
fi
if [ ! -f installed ]; then
$MAKE install || { echo "error installing $archive"; exit 1; }
touch installed
fi
done

View File

@ -8,39 +8,8 @@ export DEVKITPRO=$TOOLPATH
#---------------------------------------------------------------------------------
echo "installing linkscripts ..."
cp `pwd`/dkppc/crtls/*.ld $DEVKITPPC/$target/lib/
cp $BUILDSCRIPTDIR/dkppc/crtls/*.ld $DEVKITPPC/$target/lib/
#---------------------------------------------------------------------------------
# copy base rulesets
#---------------------------------------------------------------------------------
cp `pwd`/dkppc/rules/* $DEVKITPPC
cd $LIBOGC_SRCDIR
if [ ! -f built-libogc ]
then
echo "building libogc ..."
$MAKE
touch built-libogc
fi
if [ ! -f installed-libogc ]
then
echo "installing libogc ..."
$MAKE install
touch installed-libogc
fi
cd $BUILDSCRIPTDIR
cd $LIBFAT_SRCDIR
if [ ! -f built-libfat ]
then
echo "building libfat ..."
$MAKE ogc-install INSTALLDIR=$TOOLPATH
touch built-libfat
fi
cd $BUILDSCRIPTDIR
cp $BUILDSCRIPTDIR/dkppc/rules/* $DEVKITPPC

View File

@ -28,7 +28,7 @@ cd $target/binutils
if [ ! -f configured-binutils ]
then
CFLAGS=$cflags LDFLAGS=$ldflags ../../$BINUTILS_SRCDIR/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 \
@ -48,7 +48,7 @@ then
$MAKE install || { echo "Error installing ppc binutils"; exit 1; }
touch installed-binutils
fi
cd $BUILDSCRIPTDIR
cd $BUILDDIR
#---------------------------------------------------------------------------------
@ -60,7 +60,7 @@ cd mn10200/binutils
if [ ! -f configured-binutils ]
then
CFLAGS=$cflags LDFLAGS=$ldflags ../../$BINUTILS_SRCDIR/configure \
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 \
@ -86,7 +86,7 @@ do
strip $f
done
cd $BUILDSCRIPTDIR
cd $BUILDDIR
#---------------------------------------------------------------------------------
# build and install just the c compiler
@ -96,8 +96,7 @@ cd $target/gcc
if [ ! -f configured-gcc ]
then
cp -r $BUILDSCRIPTDIR/$NEWLIB_SRCDIR/newlib/libc/include $INSTALLDIR/devkitPPC/$target/sys-include
CFLAGS="$cflags" LDFLAGS="$ldflags" CFLAGS_FOR_TARGET="-O2" LDFLAGS_FOR_TARGET="" ../../$GCC_SRCDIR/configure \
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 \
@ -106,9 +105,10 @@ then
--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 25" \
--with-bugurl="http://wiki.devkitpro.org/index.php/Bug_Reports" --with-pkgversion="devkitPPC release 26" \
2>&1 | tee gcc_configure.log
touch configured-gcc
fi
@ -129,7 +129,7 @@ fi
#---------------------------------------------------------------------------------
# build and install newlib
#---------------------------------------------------------------------------------
cd $BUILDSCRIPTDIR
cd $BUILDDIR
mkdir -p $target/newlib
cd $target/newlib
@ -138,7 +138,7 @@ unset LDFLAGS
if [ ! -f configured-newlib ]
then
$BUILDSCRIPTDIR/$NEWLIB_SRCDIR/configure \
../../newlib-$NEWLIB_VER/configure \
--target=$target \
--prefix=$prefix \
--enable-newlib-mb \
@ -164,9 +164,7 @@ cd $BUILDSCRIPTDIR
# build and install the final compiler
#---------------------------------------------------------------------------------
cd $BUILDSCRIPTDIR
mkdir -p $target/gcc
cd $target/gcc
cd $BUILDDIR/$target/gcc
if [ ! -f built-gcc-stage2 ]
then
@ -181,7 +179,7 @@ then
fi
cd $BUILDSCRIPTDIR
cd $BUILDDIR
#---------------------------------------------------------------------------------
# build and install the debugger
@ -189,12 +187,9 @@ cd $BUILDSCRIPTDIR
mkdir -p $target/gdb
cd $target/gdb
PLATFORM=`uname -s`
if [ ! -f configured-gdb ]
then
CFLAGS="$cflags" LDFLAGS="$ldflags" ../../$GDB_SRCDIR/configure \
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

View File

@ -1,16 +1,20 @@
#!/bin/bash
cd $BUILDDIR
export DEVKITPPC=$TOOLPATH/devkitPPC
export DEVKITPRO=$TOOLPATH
$MAKE -C tools/gamecube
$MAKE -C tools/gamecube install PREFIX=$DEVKITPPC/bin
$MAKE -C tools/wii
$MAKE -C tools/wii install PREFIX=$DEVKITPPC/bin
$MAKE -C tools/general
$MAKE -C tools/general install PREFIX=$DEVKITPPC/bin
$MAKE -C tools clean
for archive in $hostarchives
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; }
touch configured
fi
if [ ! -f built ]; then
$MAKE || { echo "error building $archive"; exit 1; }
touch built
fi
if [ ! -f installed ]; then
$MAKE install || { echo "error installing $archive"; exit 1; }
touch installed
fi
done

View File

@ -2,20 +2,6 @@
prefix=$INSTALLDIR/devkitPSP
PLATFORM=`uname -s`
case $PLATFORM in
Darwin )
cflags="-O -g -mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc"
ldflags="-arch i386 -arch ppc"
;;
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 binutils
#---------------------------------------------------------------------------------
@ -25,7 +11,7 @@ cd $target/binutils
if [ ! -f configured-binutils ]
then
CFLAGS=$cflags LDFLAGS=$ldflags ../../$BINUTILS_SRCDIR/configure \
CFLAGS=$cflags LDFLAGS=$ldflags ../../binutils-$BINUTILS_VER/configure \
--prefix=$prefix --target=$target --disable-nls --disable-shared --disable-debug \
--disable-threads --with-gcc --with-gnu-as --with-gnu-ld --with-stabs \
--disable-dependency-tracking --disable-werror \
@ -45,7 +31,7 @@ then
$MAKE install || { echo "Error installing binutils"; exit 1; }
touch installed-binutils
fi
cd $BUILDSCRIPTDIR
cd $BUILDDIR
#---------------------------------------------------------------------------------
# build and install just the c compiler
@ -56,7 +42,7 @@ cd $target/gcc
if [ ! -f configured-gcc ]
then
CFLAGS="$cflags" LDFLAGS="$ldflags" CFLAGS_FOR_TARGET="-O2" LDFLAGS_FOR_TARGET="" ../../$GCC_SRCDIR/configure \
CFLAGS="$cflags" LDFLAGS="$ldflags" CFLAGS_FOR_TARGET="-O2" LDFLAGS_FOR_TARGET="" ../../gcc-$GCC_VER/configure \
--enable-languages=c,c++,objc \
--disable-multilib\
--with-gcc --with-gnu-ld --with-gnu-as\
@ -65,9 +51,10 @@ then
--disable-libstdcxx-pch \
--target=$target \
--with-newlib \
--with-headers=../../newlib-$NEWLIB_VER/newlib/libc/include \
--prefix=$prefix \
--disable-dependency-tracking \
--with-bugurl="http://wiki.devkitpro.org/index.php/Bug_Reports" --with-pkgversion="devkitPSP release 16" \
--with-bugurl="http://wiki.devkitpro.org/index.php/Bug_Reports" --with-pkgversion="devkitPSP release 17" \
|| { echo "Error configuring gcc"; exit 1; }
touch configured-gcc
fi
@ -86,9 +73,8 @@ then
touch installed-gcc
fi
unset CFLAGS
cd $BUILDSCRIPTDIR
cd $BUILDDIR/pspsdk-$PSPSDK_VER
cd $PSPSDK_SRCDIR
if [ ! -f bootstrap-sdk ]
then
./bootstrap || { echo "ERROR RUNNING PSPSDK BOOTSTRAP"; exit 1; }
@ -107,7 +93,7 @@ then
touch install-sdk-data
fi
cd $BUILDSCRIPTDIR
cd $BUILDDIR
#---------------------------------------------------------------------------------
# build and install newlib
@ -117,7 +103,7 @@ cd $target/newlib
if [ ! -f configured-newlib ]
then
$BUILDSCRIPTDIR/$NEWLIB_SRCDIR/configure \
../../newlib-$NEWLIB_VER/configure \
--target=$target \
--prefix=$prefix \
--disable-dependency-tracking \
@ -137,7 +123,7 @@ then
touch installed-newlib
fi
cd $BUILDSCRIPTDIR
cd $BUILDDIR
#---------------------------------------------------------------------------------
@ -158,13 +144,12 @@ then
touch installed-g++
fi
cd $BUILDSCRIPTDIR
cd $BUILDDIR/pspsdk-$PSPSDK_VER
#---------------------------------------------------------------------------------
# build and install the psp sdk
#---------------------------------------------------------------------------------
echo "building pspsdk ..."
cd $PSPSDK_SRCDIR
if [ ! -f built-sdk ]
then
@ -178,7 +163,7 @@ then
touch installed-sdk
fi
cd $BUILDSCRIPTDIR
cd $BUILDDIR
#---------------------------------------------------------------------------------
# build and install the debugger
@ -186,11 +171,9 @@ cd $BUILDSCRIPTDIR
mkdir -p $target/gdb
cd $target/gdb
PLATFORM=`uname -s`
if [ ! -f configured-gdb ]
then
CFLAGS=$cflags LDFLAGS=$ldflags ../../$GDB_SRCDIR/configure \
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; }