Build 6.1.0 with w64devkit and make the prefix relocatable
Replace the MSYS2/UCRT64 toolchain with the portable w64devkit kit: bootstrap a pinned kit, build with its sh/make/gcc, and keep the compiler's temporary files inside work/. Update upstream to 6.1.0 and add a portable-prefix patch: when the configured prefix is gone, csc, csi, chicken, and the chicken-* tools derive include, library, and repository paths from the running executable. A released zip now works wherever it is unpacked, which it did not before. Signed-off-by: Pavel Kulyov <kulyov.pavel@gmail.com>
This commit is contained in:
33
build.sh
33
build.sh
@@ -1,13 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
# Configure, build, and install into work/prefix. Run from a UCRT64 shell.
|
||||
# Configure, build, and install into work/prefix.
|
||||
# Run from a w64devkit shell (or let ck.ps1 provide one).
|
||||
set -eu
|
||||
|
||||
root=$(CDPATH= cd -- "$(dirname "$0")" && pwd)
|
||||
src="$root/work/src"
|
||||
prefix=$(cygpath -m "$root/work/prefix")
|
||||
prefix="${CHICKEN_PREFIX:-$root/work/prefix}"
|
||||
prefix=${prefix//\\//}
|
||||
|
||||
if [ "${1:-}" = check ]; then
|
||||
export PATH="$(cygpath -u "$prefix")/bin:${PATH}"
|
||||
PATH="$prefix/bin;$PATH"
|
||||
export PATH
|
||||
make -C "$src" check
|
||||
exit 0
|
||||
fi
|
||||
@@ -17,19 +20,11 @@ if [ ! -f "$src/configure" ]; then
|
||||
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
|
||||
echo "gcc targets ${machine}. Run this from w64devkit (or .\\ck.ps1 build)." >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -41,13 +36,25 @@ if [ -f "$src/posixwin.c" ]; then
|
||||
fi
|
||||
|
||||
jobs=$(nproc 2>/dev/null || echo 1)
|
||||
# Bootstrap rebuilds run "chicken" from the source directory; sh does
|
||||
# not look in the current directory, so put it on PATH.
|
||||
PATH="$src;$PATH"
|
||||
export PATH
|
||||
(
|
||||
cd "$src"
|
||||
./configure --prefix "$prefix" --platform mingw
|
||||
# The tarball ships generated C that is newer than the Scheme sources
|
||||
# it came from, and the portable-prefix patch changes two of those
|
||||
# sources. Regenerating them needs the compiler those C files build,
|
||||
# so build it from the shipped C first, then let it regenerate.
|
||||
touch library.c csc.c chicken-install.c chicken-status.c chicken-uninstall.c
|
||||
make -j"$jobs" chicken.exe
|
||||
touch library.scm egg-environment.scm
|
||||
make -j"$jobs"
|
||||
make install
|
||||
)
|
||||
|
||||
export PATH="$(cygpath -u "$prefix")/bin:${PATH}"
|
||||
PATH="$prefix/bin;$PATH"
|
||||
export PATH
|
||||
echo "installed $prefix"
|
||||
csc -version
|
||||
|
||||
Reference in New Issue
Block a user