-
-
Notifications
You must be signed in to change notification settings - Fork 82
/
DIST
executable file
·155 lines (141 loc) · 4.86 KB
/
DIST
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
#!/bin/sh
#
# Maintenance script
#
set -e
usage () {
echo "Maintenance script for Gauche."
echo "Usage: DIST command"
echo "Commands:"
echo " gen Generate configure scripts"
echo " tgz Generate distribution tarball"
echo " clean-build-test Run make maintainer-clean, then fully build and"
echo " run tests. Requires newest release of gosh in"
echo " PATH."
echo " self-host-test In a separate directly, first build the current"
echo " source tree with installed gosh, then build the"
echo " source tree again using the freshly compiled"
echo " gosh, and run tests."
exit 0
}
maintainer_clean () {
if [ -f Makefile ]; then make maintainer-clean; fi
for xdir in spigot mqueue-cpp; do
if [ -f examples/$xdir/Makefile ]; then
(cd examples/$xdir; make maintainer-clean)
fi
done
find . -path '*/.git' -prune -o -type f -name '*~' -exec rm -- {} +
rm -f DIST_EXCLUDE_X
cat DIST_EXCLUDE > DIST_EXCLUDE_X
}
check_version () {
if [ ! -f VERSION ]; then echo "No VERSION; something wrong?"; exit 1; fi
VERSION=`cat VERSION`
}
do_gen () {
maintainer_clean
rm -f configure gc/configure gc/configure.gnu
cp tools/gc-configure.gnu gc/configure.gnu
autoconf
(cd src; gosh ./gen-genconfig.scm genconfig.in.in)
(cd gc; ./autogen.sh)
}
# Creates a release tarabll as ../Gauche-$VERSION.tgz
do_tgz () {
tools/make-tgz.sh
}
do_pdf () {
./DIST gen
./configure
make
(cd doc; make gauche-refe.pdf; mv gauche-refe.pdf ../../Gauche-$VERSION-refe.pdf)
}
# hidden command - only meaningful on the release engineer's machine
do_release () {
check_version
do_tgz
do_pdf
gpg --detach-sign --armor -o ../Gauche-$VERSION.tgz.asc ../Gauche-$VERSION.tgz
}
do_mingw_installer () {
do_gen
MSYSTEM=MINGW64 src/mingw-dist.sh --with-gl --with-installer --with-mbedtls
MSYSTEM=MINGW32 src/mingw-dist.sh --with-gl --with-installer --with-mbedtls
}
do_mingw_sign () {
check_version
vault_dir=$HOME/sites/practical-scheme.net/vault
gpg --detach-sign --armor \
-o $vault_dir/Gauche-mingw-$VERSION-32bit.msi.asc \
$vault_dir/Gauche-mingw-$VERSION-32bit.msi
gpg --detach-sign --armor \
-o $vault_dir/Gauche-mingw-$VERSION-64bit.msi.asc \
$vault_dir/Gauche-mingw-$VERSION-64bit.msi
}
do_clean_build_test () {
do_gen
gauche-config --reconfigure | sh
make -j
make -s check
}
do_self_host_test () {
do_gen
srcdir=`pwd`
destdir=`pwd`/../Gauche-tmp-self-host-test
# mingw doesn't seem to like parallel make
if [ x$MSYSTEM = x ]; then
makeopt=-j
else
makeopt=
fi
if [ -d $destdir/stage1 ]; then rm -rf $destdir; fi
XPATH=$destdir/bin:$PATH
mkdir -p $destdir/stage1
echo "************************** STAGE1 BUILD ****************************"
(cd $destdir/stage1; \
$srcdir/configure --prefix=$destdir; \
make $makeopt || exit 1)
echo "************************* STAGE1 INSTALL ***************************"
(cd $destdir/stage1; \
make install && make -s install-check || exit 1)
mkdir -p $destdir/stage2
makeopt_1="$makeopt BUILD_GOSH_FLAGS="
echo "************************** STAGE2 BUILD ****************************"
(cd $destdir/stage2; \
PATH=$XPATH $srcdir/configure --prefix=$destdir; \
PATH=$XPATH make $makeopt_1; \
PATH=$XPATH make -s check || exit 1)
echo "************************* STAGE2 INSTALL ***************************"
(cd $destdir/stage2; \
PATH=$XPATH make install && PATH=$XPATH make -s install-check)
echo "************************ EXTENTION EXAMPLES ************************"
mkdir -p $destdir/spigot
(cd $destdir/spigot; \
PATH=$XPATH $srcdir/examples/spigot/configure --prefix=$destdir && \
PATH=$XPATH make $makeopt_1 && \
PATH=$XPATH make -s check && PATH=$XPATH make install || exit 1)
mkdir -p $destdir/spigot-subdir
(cd $destdir/spigot-subdir; \
PATH=$XPATH $srcdir/examples/spigot-subdir/configure --prefix=$destdir && \
PATH=$XPATH make $makeopt_1 && \
PATH=$XPATH make -s check && PATH=$XPATH make install || exit 1)
mkdir -p $destdir/mqueue-cpp
(cd $destdir/mqueue-cpp; \
PATH=$XPATH $srcdir/examples/mqueue-cpp/configure --prefix=$destdir && \
PATH=$XPATH make $makeopt_1 && \
PATH=$XPATH make -s check && PATH=$XPATH make install || exit 1)
mkdir -p $destdir/standalone
(cd $destdir/standalone; \
PATH=$XPATH gosh $srcdir/test/standalone.scm || exit 1)
}
case $1 in
gen) do_gen ;;
tgz) do_tgz ;;
release) do_release ;;
mingw-installer) do_mingw_installer ;;
mingw-sign) do_mingw_sign ;;
clean-build-test) do_clean_build_test ;;
self-host-test) do_self_host_test ;;
*) usage ;;
esac