Skip to content

Commit

Permalink
Update to build with devkitARM_r45.
Browse files Browse the repository at this point in the history
  • Loading branch information
rhaleblian committed Nov 23, 2018
1 parent 0bb8094 commit d55e142
Show file tree
Hide file tree
Showing 15 changed files with 172 additions and 58 deletions.
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"C_Cpp.default.includePath": [
"include"
]
}
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@ Herein lies the source for *dslibris*, an EPUB reader for the Nintendo DS.
Ubuntu 16.04 LTS is known to work as a build platform.
Other platforms might, as long as the correct toolchain can be obtained.

* devkitARM r43
* devkitARM r45
* libnds-1.5.8
* libfat-1.0.12
* a media card and a DLDI patcher, but you knew that.

devkitARM r43 is not easily found. If you need to build it,
clone the r43 branch of devkitPro/buildscripts from GitHub and patch it with the files in tool/buildscripts. Use the installer tarballs there if the source locations have disappeared.
devkitARM r45 is not easily found. If you need to build it,
clone the r45 branch of devkitPro/buildscripts from GitHub
and patch it with the files in tool/buildscripts.
You'll need to obtain the required tarball archives from each
project's release webpage; check out the version numbers in
the main build script.

After installing devkitPro/devkitARM, see

Expand Down
4 changes: 3 additions & 1 deletion etc/profile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Example environment setup for building devtools and dslibris.
export DEVKITPRO=/usr/local/devkitpro/r35
export DEVKITPRO=$HOME/Library/devkitpro/r45
export DEVKITARM=$DEVKITPRO/devkitARM
# Needed to point library build processes (in 'tool')
# to the right gcc architecture...
export PATH=$DEVKITARM/bin:$PATH

3 changes: 2 additions & 1 deletion tool/buildscripts/README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Replace corresponding files in your buildscripts repo with these.
Replace corresponding files in your devkitPro
buildscripts repo with these.

Binary file removed tool/buildscripts/binutils-2.24.tar.bz2
Binary file not shown.
16 changes: 8 additions & 8 deletions tool/buildscripts/build-crtls.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ $MAKE CRT=gp32_gpsdk
$MAKE CRT=ds_arm7
$MAKE CRT=ds_arm9
$MAKE CRT=ds_cart
$MAKE CRT=3dsx
$target-gcc -march=armv6k -mfloat-abi=hard -c 3dsx_crt0.s -o armv6k/fpu/3dsx_crt0.o

# cd $BUILDDIR/libgba-$LIBGBA_VER
# $MAKE || { echo "error building libgba"; exit 1; }
Expand All @@ -31,9 +31,9 @@ cd $BUILDDIR/libnds-$LIBNDS_VER
$MAKE || { echo "error building libnds"; exit 1; }
$MAKE install || { echo "error installing libnds"; exit 1; }

#cd $BUILDDIR/dswifi-$DSWIFI_VER
#$MAKE || { echo "error building dswifi"; exit 1; }
#$MAKE install || { echo "error installing dswifi"; exit 1; }
# cd $BUILDDIR/dswifi-$DSWIFI_VER
# $MAKE || { echo "error building dswifi"; exit 1; }
# $MAKE install || { echo "error installing dswifi"; exit 1; }

# cd $BUILDDIR/maxmod-$MAXMOD_VER
# $MAKE || { echo "error building maxmod"; exit 1; }
Expand All @@ -45,7 +45,7 @@ $MAKE install || { echo "error installing libnds"; exit 1; }

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; }
#$MAKE gba-install || { echo "error installing gba libfat"; exit 1; }

# cd $BUILDDIR/libmirko-$LIBMIRKO_VER
# $MAKE || { echo "error building libmirko"; exit 1; }
Expand All @@ -55,7 +55,7 @@ $MAKE gba-install || { echo "error installing gba libfat"; exit 1; }
# $MAKE || { echo "error building libfilesystem"; exit 1; }
# $MAKE install || { echo "error installing libfilesystem"; exit 1; }

#cd $BUILDDIR/libctru-$LIBCTRU_VER
#$MAKE || { echo "error building libctru"; exit 1; }
#$MAKE install || { echo "error installing libctru"; exit 1; }
# cd $BUILDDIR/libctru-$LIBCTRU_VER
# $MAKE || { echo "error building libctru"; exit 1; }
# $MAKE install || { echo "error installing libctru"; exit 1; }

95 changes: 58 additions & 37 deletions tool/buildscripts/build-devkit.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
#---------------------------------------------------------------------------------
# Build scripts for
# devkitARM release 43
# devkitARM release 45
# devkitPPC release 27
# devkitPSP release 17
#---------------------------------------------------------------------------------
Expand All @@ -25,30 +25,31 @@ echo "https://sourceforge.net/tracker/?group_id=114505&atid=668553"
echo

LIBOGC_VER=1.8.12
LIBGBA_VER=0.5.0
LIBNDS_VER=1.5.8
LIBCTRU_VER=0.1.0
DEFAULT_ARM7_VER=0.5.25
DSWIFI_VER=0.3.16
LIBGBA_VER=20150106
LIBNDS_VER=1.5.12
LIBCTRU_VER=0.6.0
DEFAULT_ARM7_VER=0.6.0
DSWIFI_VER=0.3.17
LIBMIRKO_VER=0.9.7
MAXMOD_VER=1.0.10
FILESYSTEM_VER=0.9.11
LIBFAT_VER=1.0.12
MAXMOD_VER=1.0.9
FILESYSTEM_VER=0.9.12
LIBFAT_VER=1.0.14
PSPSDK_VER=20120404
GBATOOLS_VER=1.0.0
DSTOOLS_VER=1.0.1
GRIT_VER=0.8.14
NDSTOOL_VER=2.0.1
DSTOOLS_VER=1.0.2
GP32_TOOLS_VER=1.0.1
GRIT_VER=0.8.13
NDSTOOL_VER=1.50.3
GENERAL_TOOLS_VER=1.0.0
DLDITOOL_VER=1.24.0
GXTEXCONV_VER=0.1.9
GCDSPSUITE_VER=1.4.0
ELF2DOL_VER=1.0.0
GAMECUBE_TOOLS_VER=1.0.0
WIILOAD_VER=0.5.1
MMUTIL_VER=1.8.6
DFU_UTIL_VER=0.7.1
DFU_UTIL_VER=0.8.1
STLINK_VER=0.5.8
TOOLS3DS_VER=1.0.0
TOOLS3DS_VER=1.1.1
LINK3DS_VER=0.5.1
PICASSO_VER=2.1.0

#---------------------------------------------------------------------------------
function extract_and_patch {
Expand Down Expand Up @@ -92,7 +93,7 @@ unset LDFLAGS
#---------------------------------------------------------------------------------
# Look for automated configuration file to bypass prompts
#---------------------------------------------------------------------------------

echo -n "Looking for configuration file... "
if [ -f ./config.sh ]; then
echo "Found."
Expand Down Expand Up @@ -191,26 +192,37 @@ DEVKITPRO_URL="http://downloads.sourceforge.net/devkitpro"
patchdir=$(pwd)/$basedir/patches
scriptdir=$(pwd)/$basedir/scripts

archives="binutils-${BINUTILS_VER}.tar.bz2 gcc-${GCC_VER}.tar.bz2 newlib-${NEWLIB_VER}.tar.gz gdb-${GDB_VER}.tar.bz2"
archives="binutils-${BINUTILS_VER}.tar.bz2 gcc-${GCC_VER}.tar.bz2 newlib-${NEWLIB_VER}.tar.gz gdb-${GDB_VER}.tar.gz"

if [ $VERSION -eq 1 ]; then
targetarchives="
libnds-$LIBNDS_VER.tar.gz
libfat-$LIBFAT_VER.tar.gz
"
hostarchives="
grit-$GRIT_VER.tar.gz
"

# 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 libctru-src-${LIBCTRU_VER}.tar.bz2"

# hostarchives="gbatools-$GBATOOLS_VER.tar.bz2 gp32tools-$GP32_TOOLS_VER.tar.bz2
# dstools-$DSTOOLS_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 mmutil-$MMUTIL_VER.tar.bz2
# dfu-util-$DFU_UTIL_VER.tar.bz2 stlink-$STLINK_VER.tar.bz2 3dstools-$TOOLS3DS_VER.tar.bz2
# picasso-$PICASSO_VER.tar.bz2 3dslink-$LINK3DS_VER.tar.bz2"

targetarchives="libnds-src-$LIBNDS_VER.tar.gz libfat-src-$LIBFAT_VER.tar.gz"
#hostarchives="general-tools-$GENERAL_TOOLS_VER.tar.gz"
hostarchives=""
fi

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 general-tools-$GENERAL_TOOLS_VER.tar.bz2"

hostarchives="gamecube-tools-$GAMECUBE_TOOLS_VER.tar.bz2 wiiload-$WIILOAD_VER.tar.bz2 general-tools-$GENERAL_TOOLS_VER.tar.bz2"
fi

if [ $VERSION -eq 3 ]; then

targetarchives="pspsdk-src-${PSPSDK_VER}.tar.bz2"

fi

if [ ! -z "$BUILD_DKPRO_SRCDIR" ] ; then
Expand All @@ -221,9 +233,9 @@ fi

cd "$SRCDIR"
for archive in $archives $targetarchives $hostarchives
do
do
echo $archive
if [ ! -f $archive ]; then
if [ ! -f $archive ]; then
$FETCH http://downloads.sf.net/devkitpro/$archive || { echo "Error: Failed to download $archive"; exit 1; }
fi
done
Expand All @@ -236,16 +248,25 @@ extract_and_patch binutils $BINUTILS_VER bz2
extract_and_patch gcc $GCC_VER bz2
rm -fr gcc-$GCC_VER/zlib
extract_and_patch newlib $NEWLIB_VER gz
extract_and_patch gdb $GDB_VER bz2
extract_and_patch gdb $GDB_VER gz

for archive in $targetarchives $hostarchives
for archive in $targetarchives
do
destdir=$(echo $archive | sed -e 's/\(.*\)\-\(.*\)\.tar\.gz/\1-\2/' )
destdir=$(echo $archive | sed -e 's/\(.*\)-src-\(.*\)\.tar\.(.*)/\1-\2\.3/' )
echo $destdir
if [ ! -d $destdir ]; then
#mkdir -p $destdir
#tar -xf "$SRCDIR/$archive" -C $destdir || { echo "Error extracting "$archive; exit 1; }
tar -xf $SRCDIR/$archive
mkdir -p $destdir
# bzip2 -cd "$SRCDIR/$archive" | tar -xf - -C $destdir || { echo "Error extracting "$archive; exit 1; }
tar -xf $SRCDIR/$archive -C $destdir || { echo "Error extracting "$archive; exit 1; }
fi
done

for archive in $hostarchives
do
destdir=$(echo $archive | sed -e 's/\(.*\)-src-\(.*\)\.tar\.bz2/\1-\2/' )
if [ ! -d $destdir ]; then
# tar -xjf "$SRCDIR/$archive"
tar -xf "$SRCDIR/$archive"
fi
done

Expand All @@ -258,7 +279,7 @@ if [ -f $scriptdir/build-crtls.sh ]; then . $scriptdir/build-crtls.sh || { echo

if [ ! -z $CROSSBUILD ]; then
if [ $VERSION -ne 3 ]; then
cp -v $CROSSLIBPATH/FreeImage.dll $prefix/bin
cp -v $CROSSBINPATH/FreeImage.dll $prefix/bin
fi
if [ $VERSION -eq 1 ]; then
cp -v $CROSSBINPATH/libusb-1.0.dll $prefix/bin
Expand Down
22 changes: 22 additions & 0 deletions tool/buildscripts/build-tools.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
cd $BUILDDIR

for archive in $hostarchives
do
echo $archive
dir=$(echo $archive | sed -e 's/\(.*\)\.tar\..*/\1/' )
echo $dir
cd $BUILDDIR/$dir
if [ ! -f configured ]; then
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
$MAKE || { echo "error building $dir"; exit 1; }
touch built
fi
if [ ! -f installed ]; then
$MAKE install || { echo "error installing $dir"; exit 1; }
touch installed
fi
done
10 changes: 2 additions & 8 deletions tool/buildscripts/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,12 @@ BUILD_DKPRO_PACKAGE=1
#---------------------------------------------------------------------------------
# Toolchain installation directory, comment if not specified
#---------------------------------------------------------------------------------
BUILD_DKPRO_INSTALLDIR=/home/ray/Library/devkitpro/r43
BUILD_DKPRO_INSTALLDIR=$HOME/Library/devkitpro/r45

#---------------------------------------------------------------------------------
# Path to previously downloaded source packages, comment if not specified
#---------------------------------------------------------------------------------
BUILD_DKPRO_SRCDIR=/home/ray/Documents/r43/archive

#---------------------------------------------------------------------------------
# MAKEFLAGS for building - use number of processors for jobs
#---------------------------------------------------------------------------------
numcores=`getconf _NPROCESSORS_ONLN`
export MAKEFLAGS="$MAKEFLAGS -j${numcores}"
BUILD_DKPRO_SRCDIR=$(realpath $(dirname $0)/../archive)

#---------------------------------------------------------------------------------
# Automated script execution
Expand Down
Binary file removed tool/buildscripts/gcc-4.9.2.tar.bz2
Binary file not shown.
Binary file removed tool/buildscripts/gdb-7.7.1.tar.bz2
Binary file not shown.
Binary file removed tool/buildscripts/libfat-1.0.12.tar.gz
Binary file not shown.
Binary file removed tool/buildscripts/libnds-1.5.8.tar.gz
Binary file not shown.
Binary file removed tool/buildscripts/newlib-2.1.0.tar.gz
Binary file not shown.
65 changes: 65 additions & 0 deletions tool/buildscripts/select_toolchain.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/bin/bash
VERSION=0
case "$BUILD_DKPRO_PACKAGE" in
"1" )
VERSION=1
;;
"2" )
VERSION=2
;;
"3" )
VERSION=3
;;
"4" )
VERSION=4
;;
esac

while [ $VERSION -eq 0 ]
do
echo
echo "Please select the toolchain you require"
echo
echo "1: devkitARM (gba gp32 ds)"
echo "2: devkitPPC (gamecube wii)"
echo "3: devkitPSP (PSP)"
read VERSION

if [ "$VERSION" -ne 1 -a "$VERSION" -ne 2 -a "$VERSION" -ne 3 ]
then
VERSION=0
fi
done

case "$VERSION" in
"1" )
GCC_VER=5.3.0
BINUTILS_VER=2.25.1
NEWLIB_VER=2.2.0
GDB_VER=7.10
basedir='dkarm-eabi'
package=devkitARM
target=arm-none-eabi
toolchain=DEVKITARM
;;
"2" )
GCC_VER=4.8.2
BINUTILS_VER=2.24
NEWLIB_VER=2.0.0
GDB_VER=7.7
basedir='dkppc'
package=devkitPPC
target=powerpc-eabi
toolchain=DEVKITPPC
;;
"3" )
GCC_VER=4.6.3
BINUTILS_VER=2.22
NEWLIB_VER=1.20.0
GDB_VER=7.4
basedir='dkpsp'
package=devkitPSP
target=psp
toolchain=DEVKITPSP
;;
esac

0 comments on commit d55e142

Please sign in to comment.