Skip to content
Newer
Older
100644 151 lines (141 sloc) 4.32 KB
901fd0e @akovalenko Modifications for unix-host and wine-target support.
authored
1 # For some build environments, file system hierarchy, style and
2 # filename constraints are different for host CL and target SBCL. In
3 # that case, targetpath and hostpath should be set to file name
4 # conversion commands or shell functions.
5 #
6
7 targetpath=${SBCL_ENV_TARGETPATH:-"echo -n"}
8 hostpath=${SBCL_ENV_HOSTPATH:-"echo -n"}
9 devnull=/dev/null
10
11 # Cygwin and MSYS set OSTYPE by themselves (hence a strange name that
12 # I wouldn't choose but have to accept). For "combined cross-native"
13 # builds with e.g. Linux host and wine environment, OSTYPE has to be
14 # set manually.
15
16 if [ "$OSTYPE" = "cygwin" -o "$OSTYPE" = "msys" -o "$OSTYPE" = "wine" \
17 -o -n "$windir" ] ;
18 then
19 definstallroot="${PROGRAMFILES:-C:/Program Files}/Steel Bank Common Lisp/"
20 installroot=${SBCL_ENV_INSTALL_ROOT:-$definstallroot}
21 runtime=sbcl.exe
22 sbcl_os=win32
ac5a3d8 @akovalenko * guess-environment.sh: win32: allow detected arch override with
authored
23 sbcl_arch=${SBCL_ARCH:-x86}
901fd0e @akovalenko Modifications for unix-host and wine-target support.
authored
24 case "$OSTYPE" in
25 cygwin)
cb01fe8 @akovalenko * guess-environment.sh: added temporary workaround for horrible
authored
26 targetpath=${SBCL_ENV_TARGETPATH:-"env TERM=dumb cygpath -w"}
901fd0e @akovalenko Modifications for unix-host and wine-target support.
authored
27 hostpath=${SBCL_ENV_HOSTPATH:-"cygpath -u"}
28 lncp="ln -s"
29 ;;
30 wine)
cb01fe8 @akovalenko * guess-environment.sh: added temporary workaround for horrible
authored
31 targetpath=${SBCL_ENV_TARGETPATH:-"env TERM=dumb winepath -w"}
32 hostpath=${SBCL_ENV_HOSTPATH:-"env TERM=dumb winepath -u"}
901fd0e @akovalenko Modifications for unix-host and wine-target support.
authored
33 lncp="ln -s"
cb01fe8 @akovalenko * guess-environment.sh: added temporary workaround for horrible
authored
34 # Temporary workaround for some "smart" change in
35 # wine-1.3.12: "console subsystem" programs started to
36 # output some terminal escape garbage before other output,
37 # even if redirected to a pipe, file or socket. It breaks
38 # "hello, world" -- surely there is an award for such
39 # things!
40 #
41 # What's fortunate and even convenient, though: wine
42 # doesn't show its new talents when
43 TERM=dumb
44 # so we
45 export TERM
901fd0e @akovalenko Modifications for unix-host and wine-target support.
authored
46 ;;
47 *)
48 lncp="cp -r"
49 ;;
50 esac
51 else
52 installroot=${SBCL_ENV_INSTALL_ROOT:-"/usr/local"}
53 runtime=sbcl
cd52d1c @akovalenko * guess-environment.sh: fixing non-windows builds: assign $lncp
authored
54 lncp="ln -s"
901fd0e @akovalenko Modifications for unix-host and wine-target support.
authored
55 fi
56
57 if [ -z "$sbcl_os" ] ; then
58 case `uname` in
59 Linux)
60 sbcl_os="linux"
61 ;;
62 OSF1)
63 # it's changed name twice since it was called OSF/1: clearly
64 # the marketers forgot to tell the engineers about Digital Unix
65 # _or_ OSF/1 ...
66 sbcl_os="osf1"
67 ;;
68 *BSD)
69 case `uname` in
70 FreeBSD)
71 sbcl_os="freebsd"
72 ;;
73 OpenBSD)
74 sbcl_os="openbsd"
75 ;;
76 NetBSD)
77 sbcl_os="netbsd"
78 ;;
79 *)
80 echo unsupported BSD variant: `uname`
81 exit 1
82 ;;
83 esac
84 ;;
85 Darwin)
86 sbcl_os="darwin"
87 ;;
88 SunOS)
89 sbcl_os="sunos"
90 ;;
91 CYGWIN* | WindowsNT | MINGW*)
92 sbcl_os="win32"
93 ;;
94 HP-UX)
95 sbcl_os="hpux"
96 ;;
97 *)
98 echo unsupported OS type: `uname`
99 exit 1
100 ;;
101 esac
102 case `uname -m` in
103 *86) guessed_sbcl_arch=x86 ;;
104 i86pc) guessed_sbcl_arch=x86 ;;
105 *x86_64) guessed_sbcl_arch=x86-64 ;;
106 amd64) guessed_sbcl_arch=x86-64 ;;
107 [Aa]lpha) guessed_sbcl_arch=alpha ;;
108 sparc*) guessed_sbcl_arch=sparc ;;
109 sun*) guessed_sbcl_arch=sparc ;;
110 *ppc) guessed_sbcl_arch=ppc ;;
111 ppc64) guessed_sbcl_arch=ppc ;;
112 Power*Macintosh) guessed_sbcl_arch=ppc ;;
113 parisc) guessed_sbcl_arch=hppa ;;
114 9000/800) guessed_sbcl_arch=hppa ;;
115 mips*) guessed_sbcl_arch=mips ;;
116 *)
117 # If we're not building on a supported target architecture, we
118 # we have no guess, but it's not an error yet, since maybe
119 # target architecture will be specified explicitly below.
120 guessed_sbcl_arch=''
121 ;;
122 esac
123 # Under Solaris, uname -m returns "i86pc" even if CPU is amd64.
124 if [ "$sbcl_os" = "sunos" ] && [ `isainfo -k` = "amd64" ]; then
125 guessed_sbcl_arch=x86-64
126 fi
127
128 # Under Darwin, uname -m returns "i386" even if CPU is x86_64.
129 if [ "$sbcl_os" = "darwin" ] &&
130 [ "`/usr/sbin/sysctl -n hw.optional.x86_64`" = "1" ] ; then
131 guessed_sbcl_arch=x86-64
132 fi
133
134 sbcl_arch=${SBCL_ARCH:-$guessed_sbcl_arch}
135 if [ "$sbcl_arch" = "" ] ; then
136 echo "can't guess target SBCL architecture, need SBCL_ARCH environment var"
137 exit 1
138 fi
139 fi
140
141 # Under Darwin x86-64, guess whether Darwin 9+ or below.
142 if [ "$sbcl_os" = "darwin" ] && [ "$sbcl_arch" = "x86-64" ]; then
143 darwin_version=`uname -r`
144 darwin_version_major=${DARWIN_VERSION_MAJOR:-${darwin_version%%.*}}
145 fi
146
147 link_or_copy() {
148 $lncp "$1" "$2"
149 }
150
Something went wrong with that request. Please try again.