Files
chicken6-4-win/build.sh
Pavel Kulyov 2c27d42d7e Run the CHICKEN test suite from build.sh.
The previous test command broke on nested quotes before make check started.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-09 01:38:57 +03:00

54 lines
1.1 KiB
Bash

#!/usr/bin/env bash
# Configure, build, and install into work/prefix. Run from a UCRT64 shell.
set -eu
root=$(CDPATH= cd -- "$(dirname "$0")" && pwd)
src="$root/work/src"
prefix=$(cygpath -m "$root/work/prefix")
if [ "${1:-}" = check ]; then
export PATH="$(cygpath -u "$prefix")/bin:${PATH}"
make -C "$src" check
exit 0
fi
if [ ! -f "$src/configure" ]; then
echo "no sources in work/src; run: .\\ck.ps1 fetch-sources" >&2
exit 1
fi
case "${MSYSTEM:-}" in
UCRT64|MINGW64|CLANG64) ;;
*)
echo "build.sh needs an MSYS2 MinGW shell (UCRT64)." >&2
exit 1
;;
esac
machine=$(gcc -dumpmachine)
case "$machine" in
*mingw*) ;;
*)
echo "gcc targets ${machine}. Install the UCRT64 toolchain." >&2
exit 1
;;
esac
# The generated posixwin.c is what this tarball compiles. Keep it newer
# than posixwin.scm so make does not try to regenerate it.
if [ -f "$src/posixwin.c" ]; then
touch "$src/posixwin.c"
fi
jobs=$(nproc 2>/dev/null || echo 1)
(
cd "$src"
./configure --prefix "$prefix" --platform mingw
make -j"$jobs"
make install
)
export PATH="$(cygpath -u "$prefix")/bin:${PATH}"
echo "installed $prefix"
csc -version