Skip to content

Commit

Permalink
Add other build variants
Browse files Browse the repository at this point in the history
  • Loading branch information
Blackhex committed Nov 14, 2023
1 parent 12fe07d commit c35abad
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 15 deletions.
25 changes: 20 additions & 5 deletions .github/scripts/build-mingw-crt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,29 @@
MINGW_VERSION=${MINGW_VERSION:-mingw-w64-master}

TARGET=${TARGET:-aarch64-w64-mingw32}
CRT=${CRT:-msvcrt}
BUILD_PATH=${BUILD_PATH:-$PWD/build-$TARGET}
BUILD_MAKE_OPTIONS=-j$(nproc)
INSTALL_PATH=${INSTALL_PATH:-~/cross}

case "$TARGET" in
x86_64*)
MINGW_CONF="$MINGW_CONF --disable-lib32 --enable-lib64 --disable-libarm32 --disable-libarm64"
;;
aarch64*)
MINGW_CONF="$MINGW_CONF --disable-lib32 --disable-lib64 --disable-libarm32 --enable-libarm64"
;;
esac

case "$CRT" in
ucrt)
MINGW_CONF="$MINGW_CONF --with-default-msvcrt=ucrt"
;;
msvcrt)
MINGW_CONF="$MINGW_CONF --with-default-msvcrt=msvcrt"
;;
esac

export PATH=$INSTALL_PATH/bin:$PATH

set -e # exit on error
Expand All @@ -21,12 +40,8 @@ echo "::group::Configure MinGW CRT"
--build=x86_64-linux-gnu \
--host=$TARGET \
--with-sysroot=$INSTALL_PATH \
--enable-libarm64 \
--disable-lib32 \
--disable-lib64 \
--disable-libarm32 \
--disable-shared \
--with-default-msvcrt=msvcrt
$MINGW_CONF
echo "::endgroup::"

cd $BUILD_PATH/mingw
Expand Down
12 changes: 11 additions & 1 deletion .github/scripts/build-mingw-headers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,20 @@
MINGW_VERSION=${MINGW_VERSION:-mingw-w64-master}

TARGET=${TARGET:-aarch64-w64-mingw32}
CRT=${CRT:-msvcrt}
BUILD_PATH=${BUILD_PATH:-$PWD/build-$TARGET}
BUILD_MAKE_OPTIONS=-j$(nproc)
INSTALL_PATH=${INSTALL_PATH:-~/cross}

case "$CRT" in
ucrt)
MINGW_CONF="$MINGW_CONF --with-default-msvcrt=ucrt"
;;
msvcrt)
MINGW_CONF="$MINGW_CONF --with-default-msvcrt=msvcrt"
;;
esac

export PATH=$INSTALL_PATH/bin:$PATH

set -e # exit on error
Expand All @@ -19,7 +29,7 @@ echo "::group::Configure MinGW headers"
../../code/$MINGW_VERSION/mingw-w64-headers/configure \
--prefix=$INSTALL_PATH/$TARGET \
--host=$TARGET \
--with-default-msvcrt=msvcrt
$MINGW_CONF
echo "::endgroup::"

cd $BUILD_PATH/mingw-headers
Expand Down
26 changes: 20 additions & 6 deletions .github/scripts/build-mingw.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,29 @@
MINGW_VERSION=${MINGW_VERSION:-mingw-w64-master}

TARGET=${TARGET:-aarch64-w64-mingw32}
CRT=${CRT:-msvcrt}
BUILD_PATH=${BUILD_PATH:-$PWD/build-$TARGET}
BUILD_MAKE_OPTIONS=-j$(nproc)
INSTALL_PATH=${INSTALL_PATH:-~/cross}

case "$TARGET" in
x86_64*)
MINGW_CONF="$MINGW_CONF --disable-lib32 --enable-lib64 --disable-libarm32 --disable-libarm64"
;;
aarch64*)
MINGW_CONF="$MINGW_CONF --disable-lib32 --disable-lib64 --disable-libarm32 --enable-libarm64"
;;
esac

case "$CRT" in
ucrt)
MINGW_CONF="$MINGW_CONF --with-default-msvcrt=ucrt"
;;
msvcrt)
MINGW_CONF="$MINGW_CONF --with-default-msvcrt=msvcrt"
;;
esac

export PATH=$INSTALL_PATH/bin:$PATH

set -e # exit on error
Expand All @@ -18,14 +37,9 @@ echo "::group::Configure MinGW libraries"
../../code/$MINGW_VERSION/configure \
--prefix=$INSTALL_PATH/$TARGET \
--host=$TARGET \
--enable-libarm64 \
--disable-lib32 \
--disable-lib64 \
--disable-libarm32 \
--disable-shared \
--with-libraries=libmangle,pseh,winpthreads \
--with-default-msvcrt=msvcrt

$MINGW_CONF
echo "::endgroup::"

cd $BUILD_PATH/mingw
Expand Down
1 change: 1 addition & 0 deletions .github/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ set -e # exit on error
set -x # echo on

TARGET=${TARGET:-aarch64-w64-mingw32}
UCRT=${UCRT:-msvcrt}
INSTALL_PATH=${INSTALL_PATH:-~/cross}

.github/scripts/build-binutils.sh
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/advanced.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ jobs:
build-toolchain:
runs-on: ubuntu-latest

strategy:
matrix:
target: [aarch64-w64-mingw32, x86_64-w64-mingw32]
crt: [msvcrt, ucrt]

env:
BINUTILS_REPO: ZacWalk/binutils-woarm64
BINUTILS_BRANCH: ${{ github.event.inputs.binutils_branch }}
Expand All @@ -36,7 +41,8 @@ jobs:
MINGW_REPO: ZacWalk/mingw-woarm64
MINGW_BRANCH: ${{ github.event.inputs.mingw_branch }}
MINGW_VERSION: mingw-w64-master
TARGET: aarch64-w64-mingw32
TARGET: ${{ matrix.target }}
CRT: ${{ matrix.crt }}
INSTALL_PATH: ${{ github.workspace }}/cross

steps:
Expand Down Expand Up @@ -105,6 +111,6 @@ jobs:
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.TARGET }}-toolchain
name: ${{ env.TARGET }}-${{ env.CRT }}-toolchain
path: ${{ env.INSTALL_PATH }}
retention-days: 1
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.vscode/
build-aarch64-w64-mingw32/
build-*/
code/
downloads/
*.exe
Expand Down

0 comments on commit c35abad

Please sign in to comment.