forked from concurrency/kroc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build
executable file
·116 lines (90 loc) · 2.94 KB
/
build
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
#! /bin/sh
#
# build -- KRoC/Linux build script
# Copyright (C) 2001-2006 Fred Barnes <[email protected]>
# Copyright (C) 2007-2009 University of Kent
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# Remove ACLOCAL from the environment, because KRoC includes all the .m4
# files it might need anyway, and having ACLOCAL pointing at an older
# version of KRoC can cause build problems.
unset ACLOCAL
step="Initialising"
supportaddress="[email protected]"
if [ "$1" = "" -o "$1" = "--help" ]; then
cat <<EOF
Usage: $0 OPTIONS ...
This script will configure, compile and install KRoC. It is intended for
use by end-users who have downloaded a KRoC source tree using
Subversion. Options given to this script will be passed to KRoC's
configure script.
Common options:
--prefix=DIRECTORY Select directory to install into
(you must specify this; e.g. /usr/local)
--with-toolchain=tvm Build the Transterpreter toolchain
(default: build the KRoC toolchain)
--enable-pony Enable pony networking support
If you are working on KRoC itself, or building packages of it, you
should probably not use this script but instead use the regular
autotools commands.
Please report problems with KRoC to <$supportaddress>.
EOF
exit 0
fi
script="typescript"
if [ "$1" != "--kroc-build-typescript" ]; then
cat >$script <<EOF
KRoC typescript file, generated at `date`
Build arguments: $*
uname -a: `uname -a 2>&1`
EOF
$0 --kroc-build-typescript "$@" 2>&1 | tee -a $script
exit $?
fi
shift
status () {
printf '\n*** %s ***\n\n' "$1"
}
fail () {
status "${step} failed - KRoC was not installed."
cat <<EOF
The KRoC installation failed. If the messages above don't help you work
out why, please mail:
$supportaddress
attaching the "$script" file and a description of your system (e.g.
architecture, operating system version, etc.).
EOF
exit 1
}
status "Generating build system"
step="Generating build system"
autoreconf -v -f -i || fail
if [ "$1" = "--autoreconf-only" ]; then
exit 0
fi
status "Configuring with arguments: $*"
step="Configuration"
./configure "$@" || fail
status "Cleaning source tree"
make -k clean
status "Compiling"
step="Compilation"
make || fail
status "Installing"
step="Installation"
make install || fail
status "Installation successful"
exit 0