~ chicken-core (master) /scripts/bootstrap.sh


 1#!/bin/sh
 2
 3set -e
 4
 5# When cd is given as argument a directory that cannot be found in the
 6# paths yielded by CDPATH on OpenBSD's ksh (same binary as sh), it
 7# fails with
 8#     `sh: cd: <the dir>: bad directory'
 9# So, we unset CDPATH to avoid such problems.
10unset CDPATH
11
12BOOTVERSION=6.0.0rc3
13BOOTURL=2026/05/12/chicken-${BOOTVERSION}.tar.gz
14
15getcmd="wget -c"
16mkcmd=make
17case "$(uname)" in
18    FreeBSD)
19        mkcmd=gmake
20	# FreeBSD's ftp doesn't support HTTPS (only HTTP)
21        getcmd=fetch;;
22    *BSD)
23	# Counter-intuitively, the ftp(1) program on many
24	# BSDs supports both HTTP(S) and FTP
25        getcmd=ftp
26        mkcmd=gmake;;
27esac
28
29mkdir -p boot/snapshot
30cd boot
31$getcmd https://code.call-cc.org/dev-snapshots/$BOOTURL
32tar -xzf chicken-${BOOTVERSION}.tar.gz
33cd chicken-${BOOTVERSION}
34./configure --prefix "$(pwd)"/../snapshot
35$mkcmd "$@"
36$mkcmd "$@" install
37cd ../..
38
39# build a boot-chicken from git head using the snapshot
40# chicken and then use that to build the real thing
41
42./configure --chicken "$(pwd)"/boot/snapshot/bin/chicken
43$mkcmd boot-chicken
44
45# remove snapshot installation and tarball
46rm -fr boot/snapshot
47rm -fr boot/chicken-${BOOTVERSION}
48rm -f  boot/chicken-${BOOTVERSION}.tar.gz
49
50echo
51echo 'Now, build chicken by passing "--chicken ./chicken-boot" to "configure",'
52echo 'in addition to "--prefix ..." and additional parameters.'
53echo
Trap