Skip to content
Newer
Older
100644 164 lines (151 sloc) 5.26 KB
a530bbe Initial revision
William Harold Newman authored Sep 18, 2000
1 #!/bin/sh
2
3 # The make-config.sh script uses information about the target machine
4 # to set things up for compilation. It's vaguely like a stripped-down
5 # version of autoconf. It's intended to be run as part of make.sh. The
6 # only time you'd want to run it by itself is if you're trying to
7 # cross-compile the system or if you're doing some kind of
8 # troubleshooting.
9
10 # This software is part of the SBCL system. See the README file for
11 # more information.
12 #
13 # This software is derived from the CMU CL system, which was
14 # written at Carnegie Mellon University and released into the
15 # public domain. The software is in the public domain and is
16 # provided with absolutely no warranty. See the COPYING and CREDITS
17 # files for more information.
18
19 echo //entering make-config.sh
20
f2aa2d0 0.6.12.7:
William Harold Newman authored May 10, 2001
21 echo //ensuring the existence of output/ directory
22 if [ ! -d output ] ; then mkdir output; fi
23
a530bbe Initial revision
William Harold Newman authored Sep 18, 2000
24 ltf=`pwd`/local-target-features.lisp-expr
25 echo //initializing $ltf
672ac58 0.6.12.6:
William Harold Newman authored May 9, 2001
26 echo ';;;; This is a machine-generated file.' > $ltf
d7f6139 0.6.12.7.flaky1:
William Harold Newman authored May 15, 2001
27 echo ';;;; Please do not edit it by hand.' >> $ltf
28 echo ';;;; See make-config.sh.' >> $ltf
0d669e6 @csrhodes 0.7.1.1:
csrhodes authored Mar 25, 2002
29 printf '(' >> $ltf
a530bbe Initial revision
William Harold Newman authored Sep 18, 2000
30
f2aa2d0 0.6.12.7:
William Harold Newman authored May 10, 2001
31 echo //guessing default target CPU architecture from host architecture
32 case `uname -m` in
33 *86) guessed_sbcl_arch=x86 ;;
34 [Aa]lpha) guessed_sbcl_arch=alpha ;;
68fd2d2 0.7.1.20:
William Harold Newman authored Feb 15, 2002
35 sparc*) guessed_sbcl_arch=sparc ;;
0d669e6 @csrhodes 0.7.1.1:
csrhodes authored Mar 25, 2002
36 sun*) guessed_sbcl_arch=sparc ;;
68fd2d2 0.7.1.20:
William Harold Newman authored Feb 15, 2002
37 ppc) guessed_sbcl_arch=ppc ;;
8a19c68 @csrhodes 0.7.6.27:
csrhodes authored Aug 19, 2002
38 parisc) guessed_sbcl_arch=hppa ;;
4ae1b79 @csrhodes 0.7.7.9:
csrhodes authored Sep 1, 2002
39 mips) guessed_sbcl_arch=mips ;;
40 mipsel) guessed_sbcl_arch=mips; little_endian=yes ;;
f2aa2d0 0.6.12.7:
William Harold Newman authored May 10, 2001
41 *)
42 # If we're not building on a supported target architecture, we
43 # we have no guess, but it's not an error yet, since maybe
44 # target architecture will be specified explicitly below.
45 guessed_sbcl_arch=''
46 ;;
47 esac
48
672ac58 0.6.12.6:
William Harold Newman authored May 9, 2001
49 echo //setting up CPU-architecture-dependent information
f2aa2d0 0.6.12.7:
William Harold Newman authored May 10, 2001
50 sbcl_arch=${SBCL_ARCH:-$guessed_sbcl_arch}
d7f6139 0.6.12.7.flaky1:
William Harold Newman authored May 15, 2001
51 echo sbcl_arch=\"$sbcl_arch\"
f2aa2d0 0.6.12.7:
William Harold Newman authored May 10, 2001
52 if [ "$sbcl_arch" = "" ] ; then
53 echo "can't guess target SBCL architecture, need SBCL_ARCH environment var"
54 exit 1
55 fi
0d669e6 @csrhodes 0.7.1.1:
csrhodes authored Mar 25, 2002
56 printf ":%s" "$sbcl_arch" >> $ltf
b767eae 0.7.1.24:
William Harold Newman authored Feb 22, 2002
57 # KLUDGE: currently the x86 only works with the generational garbage
aca45f3 0.7.1.41:
William Harold Newman authored Mar 16, 2002
58 # collector (indicated by the presence of :GENCGC in *FEATURES*) and
b767eae 0.7.1.24:
William Harold Newman authored Feb 22, 2002
59 # alpha, sparc and ppc with the stop'n'copy collector (indicated by
aca45f3 0.7.1.41:
William Harold Newman authored Mar 16, 2002
60 # the absence of :GENCGC in *FEATURES*). This isn't a great
61 # separation, but for now, rather than have :GENCGC in
b767eae 0.7.1.24:
William Harold Newman authored Feb 22, 2002
62 # base-target-features.lisp-expr, we add it into local-target-features
8286d1f 0.7.1.29:
William Harold Newman authored Mar 5, 2002
63 # if we're building for x86. -- CSR, 2002-02-21 Then we do something
64 # similar with :STACK-GROWS-FOOWARD, too. -- WHN 2002-03-03
b767eae 0.7.1.24:
William Harold Newman authored Feb 22, 2002
65 if [ "$sbcl_arch" = "x86" ] ; then
dc5e316 @telent 0.7.6.1:
telent authored Jul 23, 2002
66 printf ' :gencgc :stack-grows-downward-not-upward :c-stack-is-control-stack' >> $ltf
4ae1b79 @csrhodes 0.7.7.9:
csrhodes authored Sep 1, 2002
67 elif [ "$sbcl_arch" = "mips" -a "$little_endian" = "yes" ] ; then
68 printf ' :little-endian' >> $ltf
8286d1f 0.7.1.29:
William Harold Newman authored Mar 5, 2002
69 else
aca45f3 0.7.1.41:
William Harold Newman authored Mar 16, 2002
70 # Nothing need be done in this case, but sh syntax wants a placeholder.
71 echo > /dev/null
b767eae 0.7.1.24:
William Harold Newman authored Feb 22, 2002
72 fi
a530bbe Initial revision
William Harold Newman authored Sep 18, 2000
73 for d in src/compiler src/assembly; do
74 echo //setting up symlink $d/target
75 original_dir=`pwd`
76 cd $d
0d669e6 @csrhodes 0.7.1.1:
csrhodes authored Mar 25, 2002
77 if [ -h target ] ; then
a530bbe Initial revision
William Harold Newman authored Sep 18, 2000
78 rm target
0d669e6 @csrhodes 0.7.1.1:
csrhodes authored Mar 25, 2002
79 elif [ -w target ] ; then
a530bbe Initial revision
William Harold Newman authored Sep 18, 2000
80 echo "I'm afraid to replace non-symlink $d/target with a symlink."
81 exit 1
82 fi
83 if [ -d $sbcl_arch ] ; then
84 ln -s $sbcl_arch target
85 else
86 echo "missing sbcl_arch directory $PWD/$sbcl_arch"
87 exit 1
88 fi
89 cd $original_dir
90 done
91
92 echo //setting up OS-dependent information
eaf8fba tidied up OpenBSD-vs.-FreeBSD stuff, and src/runtime/Config.x86-*
William Harold Newman authored Oct 2, 2000
93 original_dir=`pwd`
a530bbe Initial revision
William Harold Newman authored Sep 18, 2000
94 cd src/runtime/
68fd2d2 0.7.1.20:
William Harold Newman authored Feb 15, 2002
95 rm -f Config target-arch-os.h target-arch.h target-os.h target-lispregs.h
96 # KLUDGE: these two logically belong in the previous section
97 # ("architecture-dependent"); it seems silly to enforce this in terms
98 # of the shell script, though. -- CSR, 2002-02-03
99 ln -s $sbcl_arch-arch.h target-arch.h
100 ln -s $sbcl_arch-lispregs.h target-lispregs.h
f2aa2d0 0.6.12.7:
William Harold Newman authored May 10, 2001
101 case `uname` in
102 Linux)
0d669e6 @csrhodes 0.7.1.1:
csrhodes authored Mar 25, 2002
103 printf ' :linux' >> $ltf
f2aa2d0 0.6.12.7:
William Harold Newman authored May 10, 2001
104 ln -s Config.$sbcl_arch-linux Config
68fd2d2 0.7.1.20:
William Harold Newman authored Feb 15, 2002
105 ln -s $sbcl_arch-linux-os.h target-arch-os.h
106 ln -s linux-os.h target-os.h
f2aa2d0 0.6.12.7:
William Harold Newman authored May 10, 2001
107 ;;
1e46297 @telent 0.7.4.17: Mostly Alpha fixes
telent authored Jun 7, 2002
108 OSF1)
109 # it's changed name twice since it was called OSF/1: clearly
110 # the marketers forgot to tell the engineers about Digital Unix
111 # _or_ OSF/1 ...
112 printf ' :osf1' >> $ltf
113 ln -s Config.$sbcl_arch-osf1 Config
114 ln -s $sbcl_arch-osf1-os.h target-arch-os.h
115 ln -s osf1-os.h target-os.h
116 ;;
f2aa2d0 0.6.12.7:
William Harold Newman authored May 10, 2001
117 *BSD)
0d669e6 @csrhodes 0.7.1.1:
csrhodes authored Mar 25, 2002
118 printf ' :bsd' >> $ltf
68fd2d2 0.7.1.20:
William Harold Newman authored Feb 15, 2002
119 ln -s $sbcl_arch-bsd-os.h target-arch-os.h
120 ln -s bsd-os.h target-os.h
f2aa2d0 0.6.12.7:
William Harold Newman authored May 10, 2001
121 case `uname` in
122 FreeBSD)
0d669e6 @csrhodes 0.7.1.1:
csrhodes authored Mar 25, 2002
123 printf ' :freebsd' >> $ltf
f2aa2d0 0.6.12.7:
William Harold Newman authored May 10, 2001
124 ln -s Config.$sbcl_arch-freebsd Config
125 ;;
126 OpenBSD)
0d669e6 @csrhodes 0.7.1.1:
csrhodes authored Mar 25, 2002
127 printf ' :openbsd' >> $ltf
f2aa2d0 0.6.12.7:
William Harold Newman authored May 10, 2001
128 ln -s Config.$sbcl_arch-openbsd Config
129 ;;
130 *)
131 echo unsupported BSD variant: `uname`
132 exit 1
133 ;;
134 esac
135 ;;
0d669e6 @csrhodes 0.7.1.1:
csrhodes authored Mar 25, 2002
136 SunOS)
137 printf ' :sunos' >> $ltf
138 ln -s Config.$sbcl_arch-sunos Config
139 ln -s $sbcl_arch-sunos-os.h target-arch-os.h
140 ln -s sunos-os.h target-os.h
141 ;;
f2aa2d0 0.6.12.7:
William Harold Newman authored May 10, 2001
142 *)
143 echo unsupported OS type: `uname`
a530bbe Initial revision
William Harold Newman authored Sep 18, 2000
144 exit 1
f2aa2d0 0.6.12.7:
William Harold Newman authored May 10, 2001
145 ;;
146 esac
eaf8fba tidied up OpenBSD-vs.-FreeBSD stuff, and src/runtime/Config.x86-*
William Harold Newman authored Oct 2, 2000
147 cd $original_dir
a530bbe Initial revision
William Harold Newman authored Sep 18, 2000
148
149 echo //finishing $ltf
150 echo ')' >> $ltf
151
152 # FIXME: The version system should probably be redone along these lines:
153 #
154 # echo //setting up version information.
155 # versionfile=version.txt
156 # cp base-version.txt $versionfile
157 # echo " (built `date -u` by `whoami`@`hostname`)" >> $versionfile
158 # echo 'This is a machine-generated file and should not be edited by hand.' >> $versionfile
9139275 @csrhodes 0.7.9.7:
csrhodes authored Oct 27, 2002
159
160 # Make a unique ID for this build (to discourage people from
161 # mismatching sbcl and *.core files).
162 echo '"'`hostname -s`-`whoami`-`date +%F-%H-%M-%S`'"' > output/build-id.tmp
163
Something went wrong with that request. Please try again.