diff --git a/.github/workflows/compilation.yml b/.github/workflows/compilation.yml index 0809db6..8908037 100755 --- a/.github/workflows/compilation.yml +++ b/.github/workflows/compilation.yml @@ -12,11 +12,16 @@ jobs: runs-on: ${{ matrix.os[0] }} strategy: matrix: - os: [[macos-latest, bash], [ubuntu-latest, bash], [windows-latest, msys2]] + os: [ + [macos-latest, arm64, bash], + [macos-13, x86_64, bash], + [ubuntu-latest, x86_64, bash], + [windows-latest, x86_64, msys2] + ] fail-fast: false defaults: run: - shell: ${{ matrix.os[1] }} {0} + shell: ${{ matrix.os[2] }} {0} steps: - uses: actions/checkout@v4 @@ -30,7 +35,7 @@ jobs: sudo apt-get -y install texinfo bison flex gettext libgmp3-dev libmpfr-dev libmpc-dev - name: Install macOS packages - if: matrix.os[0] == 'macos-latest' + if: startsWith(matrix.os[0], 'macos') run: | brew update brew install texinfo bison flex gnu-sed gsl gmp mpfr libmpc diff --git a/config/ps2toolchain-dvp-config.sh b/config/ps2toolchain-dvp-config.sh index 62658dd..73972b4 100644 --- a/config/ps2toolchain-dvp-config.sh +++ b/config/ps2toolchain-dvp-config.sh @@ -1,7 +1,7 @@ #!/bin/bash PS2TOOLCHAIN_DVP_BINUTILS_REPO_URL="https://github.com/ps2dev/binutils-gdb.git" -PS2TOOLCHAIN_DVP_BINUTILS_DEFAULT_REPO_REF="dvp-v2.14" +PS2TOOLCHAIN_DVP_BINUTILS_DEFAULT_REPO_REF="dvp-v2.31.1" if test -f "$PS2DEV_CONFIG_OVERRIDE"; then source "$PS2DEV_CONFIG_OVERRIDE" diff --git a/scripts/001-binutils.sh b/scripts/001-binutils.sh index ff215e1..82b3e66 100755 --- a/scripts/001-binutils.sh +++ b/scripts/001-binutils.sh @@ -36,20 +36,17 @@ TARGET_ALIAS="dvp" TARG_XTRA_OPTS="" OSVER=$(uname) -# setting lt_cv_sys_max_cmd_len works around ancient libtool bugs -if [ "${OSVER:0:10}" == MINGW64_NT ]; then - export lt_cv_sys_max_cmd_len=8000 - export CC=x86_64-w64-mingw32-gcc - TARG_XTRA_OPTS="--host=x86_64-w64-mingw32" - CFLAGS="$CFLAGS -DHAVE_DECL_ASPRINTF -DHAVE_DECL_VASPRINTF" -elif [ "${OSVER:0:10}" == MINGW32_NT ]; then - export lt_cv_sys_max_cmd_len=8000 - export CC=i686-w64-mingw32-gcc - TARG_XTRA_OPTS="--host=i686-w64-mingw32" - CFLAGS="$CFLAGS -DHAVE_DECL_ASPRINTF -DHAVE_DECL_VASPRINTF" -elif [ "${OSVER:0:9}" == "CYGWIN_NT" ]; then - export lt_cv_sys_max_cmd_len=8000 - TARG_XTRA_OPTS="--host=x86_64-pc-cygwin" +## If using MacOS Apple, set gmp and mpfr paths using TARG_XTRA_OPTS +## (this is needed for Apple Silicon but we will do it for all MacOS systems) +if [ "$(uname -s)" = "Darwin" ]; then + ## Check if using brew + if command -v brew &> /dev/null; then + TARG_XTRA_OPTS="--with-gmp=$(brew --prefix gmp) --with-mpfr=$(brew --prefix mpfr)" + fi + ## Check if using MacPorts + if command -v port &> /dev/null; then + TARG_XTRA_OPTS="--with-gmp=$(port -q prefix gmp) --with-mpfr=$(port -q prefix mpfr)" + fi fi ## Determine the maximum number of processes that Make can work with. @@ -72,7 +69,7 @@ for TARGET in "dvp"; do $TARG_XTRA_OPTS ## Compile and install. - make --quiet -j "$PROC_NR" CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=0 -O2 -Wno-implicit-function-declaration" LDFLAGS="$LDFLAGS -s" + make --quiet -j "$PROC_NR" CFLAGS="$CFLAGS -Wno-implicit-function-declaration" make --quiet -j "$PROC_NR" install make --quiet -j "$PROC_NR" clean