From 517ca52f428ab37f0db7a0cc6cb3511fd96110fb Mon Sep 17 00:00:00 2001 From: Francisco Javier Trujillo Mata Date: Mon, 27 May 2024 18:11:18 +0200 Subject: [PATCH] Adding temporal folder for phase1 --- scripts/001-binutils.sh | 12 ++++++------ scripts/002-gcc-stage1.sh | 34 +++++++++++++++++++++++---------- scripts/003-newlib.sh | 20 +++++++++++++------ scripts/004-pthread-embedded.sh | 17 +++++++++++------ scripts/005-gcc-stage2.sh | 12 ++++++------ 5 files changed, 61 insertions(+), 34 deletions(-) diff --git a/scripts/001-binutils.sh b/scripts/001-binutils.sh index ace1f73..3a763eb 100755 --- a/scripts/001-binutils.sh +++ b/scripts/001-binutils.sh @@ -1,5 +1,5 @@ #!/bin/bash -# 001-binutils.sh by pspdev developers +# binutils by pspdev developers ## Exit with code 1 when any command executed returns a non-zero exit code. onerr() @@ -71,10 +71,10 @@ fi --disable-initfini-array \ --with-python="$WITH_PYTHON" \ --disable-werror \ - $TARG_XTRA_OPTS || { exit 1; } + $TARG_XTRA_OPTS ## Compile and install. -make --quiet -j $PROC_NR clean || { exit 1; } -make --quiet -j $PROC_NR || { exit 1; } -make --quiet -j $PROC_NR install-strip || { exit 1; } -make --quiet -j $PROC_NR clean || { exit 1; } +make --quiet -j $PROC_NR clean +make --quiet -j $PROC_NR all +make --quiet -j $PROC_NR install-strip +make --quiet -j $PROC_NR clean diff --git a/scripts/002-gcc-stage1.sh b/scripts/002-gcc-stage1.sh index 012c651..22c0adc 100755 --- a/scripts/002-gcc-stage1.sh +++ b/scripts/002-gcc-stage1.sh @@ -1,5 +1,5 @@ #!/bin/bash -# 002-gcc-stage1.sh by pspdev developers +# gcc-stage1 by pspdev developers ## Exit with code 1 when any command executed returns a non-zero exit code. onerr() @@ -8,6 +8,16 @@ onerr() } trap onerr ERR +## Create a temporal folder where to build the phase 1 of the toolchain. +TMP_TOOLCHAIN_BUILD_DIR=$(pwd)/tmp_toolchain_build +rm -rf $TMP_TOOLCHAIN_BUILD_DIR && mkdir $TMP_TOOLCHAIN_BUILD_DIR || { exit 1; } +## Copy toolchain content ($PSPDEV) to the temporal folder. +cp -r $PSPDEV/* $TMP_TOOLCHAIN_BUILD_DIR || { exit 1; } + +## Add the toolchain to the PATH. +export PATH="$TMP_TOOLCHAIN_BUILD_DIR/bin:$PATH" + + ## Read information from the configuration file. source "$(dirname "$0")/../config/psptoolchain-allegrex-config.sh" @@ -51,24 +61,28 @@ if [ "$(uname -s)" = "Darwin" ]; then fi ## Create and enter the toolchain/build directory -rm -rf mkdir build-$TARGET-stage1 && mkdir build-$TARGET-stage1 && cd build-$TARGET-stage1 || { exit 1; } +rm -rf build-$TARGET-stage1 && mkdir build-$TARGET-stage1 && cd build-$TARGET-stage1 || { exit 1; } ## Configure the build. ../configure \ --quiet \ - --prefix="$PSPDEV" \ + --prefix="$TMP_TOOLCHAIN_BUILD_DIR" \ --target="$TARGET" \ --enable-languages="c" \ --with-float=hard \ --with-headers=no \ --without-newlib \ - --disable-libatomic \ + --disable-libgcc \ + --disable-shared \ + --disable-threads \ --disable-libssp \ - --disable-multilib \ - $TARG_XTRA_OPTS || { exit 1; } + --disable-libgomp \ + --disable-libmudflap \ + --disable-libquadmath \ + $TARG_XTRA_OPTS ## Compile and install. -make --quiet -j $PROC_NR clean || { exit 1; } -make --quiet -j $PROC_NR all || { exit 1; } -make --quiet -j $PROC_NR install-strip || { exit 1; } -make --quiet -j $PROC_NR clean || { exit 1; } +make --quiet -j $PROC_NR clean +make --quiet -j $PROC_NR all-gcc +make --quiet -j $PROC_NR install-gcc +make --quiet -j $PROC_NR clean diff --git a/scripts/003-newlib.sh b/scripts/003-newlib.sh index 498f67a..7dae747 100755 --- a/scripts/003-newlib.sh +++ b/scripts/003-newlib.sh @@ -1,5 +1,5 @@ #!/bin/bash -# 003-newlib.sh by pspdev developers +# newlib by pspdev developers ## Exit with code 1 when any command executed returns a non-zero exit code. onerr() @@ -8,6 +8,11 @@ onerr() } trap onerr ERR +## Create a temporal folder where to build the phase 1 of the toolchain. +TMP_TOOLCHAIN_BUILD_DIR=$(pwd)/tmp_toolchain_build +## Add the toolchain to the PATH. +export PATH="$TMP_TOOLCHAIN_BUILD_DIR/bin:$PATH" + ## Read information from the configuration file. source "$(dirname "$0")/../config/psptoolchain-allegrex-config.sh" @@ -38,7 +43,7 @@ TARGET="psp" PROC_NR=$(getconf _NPROCESSORS_ONLN) # Create and enter the toolchain/build directory -rm -rf build-$TARGET && mkdir build-$TARGET && cd build-$TARGET || { exit 1; } +rm -rf build-$TARGET && mkdir build-$TARGET && cd build-$TARGET # Configure the build. ../configure \ @@ -52,7 +57,10 @@ rm -rf build-$TARGET && mkdir build-$TARGET && cd build-$TARGET || { exit 1; } $TARG_XTRA_OPTS || { exit 1; } ## Compile and install. -make --quiet -j $PROC_NR clean || { exit 1; } -make --quiet -j $PROC_NR all || { exit 1; } -make --quiet -j $PROC_NR install-strip || { exit 1; } -make --quiet -j $PROC_NR clean || { exit 1; } +make --quiet -j $PROC_NR clean +make --quiet -j $PROC_NR all +make --quiet -j $PROC_NR install-strip +make --quiet -j $PROC_NR clean + +## Copy contents of the toolchain to the temporal folder. +cp -r $PSPDEV/* $TMP_TOOLCHAIN_BUILD_DIR \ No newline at end of file diff --git a/scripts/004-pthread-embedded.sh b/scripts/004-pthread-embedded.sh index 04a70fa..9d6958d 100755 --- a/scripts/004-pthread-embedded.sh +++ b/scripts/004-pthread-embedded.sh @@ -1,5 +1,5 @@ #!/bin/bash -# 004-pthread-embeedded.sh by pspdev developers +# pthread-embeedded by pspdev developers ## Exit with code 1 when any command executed returns a non-zero exit code. onerr() @@ -8,6 +8,11 @@ onerr() } trap onerr ERR +## Temporal folder where to build the phase 1 of the toolchain. +TMP_TOOLCHAIN_BUILD_DIR=$(pwd)/tmp_toolchain_build +## Add the toolchain to the PATH. +export PATH="$TMP_TOOLCHAIN_BUILD_DIR/bin:$PATH" + ## Read information from the configuration file. source "$(dirname "$0")/../config/psptoolchain-allegrex-config.sh" @@ -37,10 +42,10 @@ TARGET="psp" ## Determine the maximum number of processes that Make can work with. PROC_NR=$(getconf _NPROCESSORS_ONLN) -cd platform/psp || { exit 1; } +cd platform/psp ## Compile and install. -make --quiet -j $PROC_NR clean || { exit 1; } -make --quiet -j $PROC_NR all || { exit 1; } -make --quiet -j $PROC_NR install || { exit 1; } -make --quiet -j $PROC_NR clean || { exit 1; } +make --quiet -j $PROC_NR clean +make --quiet -j $PROC_NR all +make --quiet -j $PROC_NR install +make --quiet -j $PROC_NR clean diff --git a/scripts/005-gcc-stage2.sh b/scripts/005-gcc-stage2.sh index b3ebd1b..ec84881 100755 --- a/scripts/005-gcc-stage2.sh +++ b/scripts/005-gcc-stage2.sh @@ -1,5 +1,5 @@ #!/bin/bash -# 005-gcc-stage2.sh by pspdev developers +# gcc-stage2 by pspdev developers ## Exit with code 1 when any command executed returns a non-zero exit code. onerr() @@ -65,10 +65,10 @@ rm -rf build-$TARGET-stage2 && mkdir build-$TARGET-stage2 && cd build-$TARGET-st --disable-multilib \ --enable-threads=posix \ MAKEINFO=missing \ - $TARG_XTRA_OPTS || { exit 1; } + $TARG_XTRA_OPTS ## Compile and install. -make --quiet -j $PROC_NR clean || { exit 1; } -make --quiet -j $PROC_NR all || { exit 1; } -make --quiet -j $PROC_NR install-strip || { exit 1; } -make --quiet -j $PROC_NR clean || { exit 1; } +make --quiet -j $PROC_NR clean +make --quiet -j $PROC_NR all +make --quiet -j $PROC_NR install-strip +make --quiet -j $PROC_NR clean