Skip to content

Commit

Permalink
Merge pull request #37 from fjtrujy/fix_headers
Browse files Browse the repository at this point in the history
Use `sysroot` and `native-system-header-dir`
  • Loading branch information
davidgfnet authored Jun 4, 2024
2 parents a92f3d5 + 6be6c4c commit 5ad0c82
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 37 deletions.
15 changes: 8 additions & 7 deletions scripts/001-binutils.sh
Original file line number Diff line number Diff line change
@@ -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()
Expand Down Expand Up @@ -52,7 +52,7 @@ fi
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

## Build GDB without python support when built with a GitHub Action
## This makes the pre-build executable work on more systems
Expand All @@ -67,14 +67,15 @@ fi
--quiet \
--prefix="$PSPDEV" \
--target="$TARGET" \
--with-sysroot="$PSPDEV/$TARGET" \
--enable-plugins \
--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
24 changes: 15 additions & 9 deletions scripts/002-gcc-stage1.sh
Original file line number Diff line number Diff line change
@@ -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()
Expand Down Expand Up @@ -51,7 +51,9 @@ 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

## Configure the build.
../configure \
Expand All @@ -62,13 +64,17 @@ rm -rf mkdir build-$TARGET-stage1 && mkdir build-$TARGET-stage1 && cd build-$TAR
--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
15 changes: 8 additions & 7 deletions scripts/003-newlib.sh
Original file line number Diff line number Diff line change
@@ -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()
Expand Down Expand Up @@ -38,21 +38,22 @@ 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 \
--prefix="$PSPDEV" \
--target="$TARGET" \
--with-sysroot="$PSPDEV/$TARGET" \
--enable-newlib-retargetable-locking \
--enable-newlib-multithread \
--enable-newlib-io-c99-formats \
--enable-newlib-iconv \
--enable-newlib-iconv-encodings=us_ascii,utf8,utf16,ucs_2_internal,ucs_4_internal,iso_8859_1 \
$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
12 changes: 6 additions & 6 deletions scripts/004-pthread-embedded.sh
Original file line number Diff line number Diff line change
@@ -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()
Expand Down Expand Up @@ -37,10 +37,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
19 changes: 11 additions & 8 deletions scripts/005-gcc-stage2.sh
Original file line number Diff line number Diff line change
@@ -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()
Expand Down Expand Up @@ -51,24 +51,27 @@ if [ "$(uname -s)" = "Darwin" ]; then
fi

## Create and enter the toolchain/build directory
rm -rf build-$TARGET-stage2 && mkdir build-$TARGET-stage2 && cd build-$TARGET-stage2 || { exit 1; }
rm -rf build-$TARGET-stage2
mkdir build-$TARGET-stage2
cd build-$TARGET-stage2

## Configure the build.
../configure \
--quiet \
--prefix="$PSPDEV" \
--target="$TARGET" \
--with-sysroot="$PSPDEV/$TARGET" \
--with-native-system-header-dir="/include" \
--enable-languages="c,c++" \
--with-float=hard \
--with-newlib \
--disable-libssp \
--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

0 comments on commit 5ad0c82

Please sign in to comment.