-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathSetup.sh
executable file
·100 lines (84 loc) · 3.11 KB
/
Setup.sh
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
#!/bin/sh
#
# Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
# 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Massachusetts
# Institute of Technology
#
# This file is part of MIT/GNU Scheme.
#
# MIT/GNU Scheme 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.
#
# MIT/GNU Scheme 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 MIT/GNU Scheme; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301, USA.
# Utility to set up the MIT/GNU Scheme build directories.
# The working directory must be the top-level source directory.
set -eu
: ${MIT_SCHEME_EXE:=mit-scheme}
configure=done
clean ()
{
if [ "x${configure}" != xdone ]; then
rm -f configure
fi
}
trap clean EXIT INT TERM
# Please keep the following messages synchronized with the messages in
# these files:
#
# src/Setup.sh
# src/configure.ac
# src/etc/make-native.sh
if ! "${MIT_SCHEME_EXE}" --batch-mode --eval '(%exit)' > /dev/null 2> /dev/null
then
cat <<EOF >&2
*** Error in ${0}
This script needs an existing MIT/GNU Scheme installation to function,
but the program \`${MIT_SCHEME_EXE}' does not appear to run it.
If you have installed MIT/GNU Scheme in an unusual location, set the
environment variable MIT_SCHEME_EXE to the name or pathname of the
MIT/GNU Scheme executable, which is usually \`mit-scheme' or
\`/usr/local/bin/mit-scheme', and set the environment variable
MITSCHEME_LIBRARY_PATH to the pathname of the MIT/GNU Scheme library
directory, which is usually \`/usr/local/lib/mit-scheme-ARCH', where
ARCH is the compiled code architecture, such as \`c', \`i386', etc.
EOF
exit 1
fi
if [ ! -x configure ]; then
configure=clean
echo "autoconf --include=microcode"
autoconf --include=microcode
configure=done
fi
. etc/functions.sh
INSTALLED_SUBDIRS="cref edwin ffi imail sf sos ssp star-parser xml"
OTHER_SUBDIRS="6001 compiler rcs runtime win32 xdoc microcode"
# lib
maybe_mkdir lib
maybe_link lib/edwin ../edwin
maybe_link lib/include ../microcode
maybe_link lib/optiondb.scm ../etc/optiondb.scm
maybe_link lib/runtime ../runtime
maybe_link lib/mit-scheme.h ../microcode/pruxffi.h
maybe_link lib/ffi ../ffi
maybe_link lib/ffi-test-shim.so ../ffi/ffi-test-shim.so
maybe_link lib/ffi-test-types.bin ../ffi/ffi-test-types.bin
maybe_link lib/ffi-test-const.bin ../ffi/ffi-test-const.bin
maybe_link config.sub microcode/config.sub
maybe_link config.guess microcode/config.guess
for SUBDIR in ${INSTALLED_SUBDIRS} ${OTHER_SUBDIRS}; do
echo "setting up ${SUBDIR}"
maybe_link ${SUBDIR}/Setup.sh ../etc/Setup.sh
(cd ${SUBDIR} && ./Setup.sh ${@:+"${@}"})
done