forked from shirok/Gauche
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDIST
executable file
·133 lines (119 loc) · 3.85 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
#!/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
if [ "$LIBTOOLIZE" = "" -a "`uname`" = "Darwin" ]; then
if command -v "glibtoolize" > /dev/null; then
LIBTOOLIZE=glibtoolize
elif command -v "libtoolize" > /dev/null; then
LIBTOOLIZE=libtoolize
else
echo "DIST: line $LINENO: command libtoolize or glibtoolize not found"
exit 1
fi
fi
${LIBTOOLIZE:-libtoolize} -q --copy # ensures ltmain.sh in the top_srcdir
autoconf
(cd gc; ./autogen.sh)
}
# Creates a release tarabll as ../Gauche-$VERSION.tgz
do_tgz () {
tools/make-tgz.sh
}
do_pdf () {
./DIST gen
./configure --enable-threads=pthreads --enable-multibyte=utf8
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
makeopt_1="$makeopt BUILD_GOSH_FLAGS=$BUILD_GOSH_FLAGS"
if [ -d $destdir/stage1 ]; then rm -rf $destdir; fi
XPATH=$destdir/bin:$PATH
mkdir -p $destdir/stage1
(cd $destdir/stage1; $srcdir/configure --prefix=$destdir; make $makeopt_1; make install && make -s install-check)
mkdir -p $destdir/stage2
(cd $destdir/stage2; PATH=$XPATH $srcdir/configure; PATH=$XPATH make $makeopt; PATH=$XPATH make -s check)
}
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