]>
Commit | Line | Data |
---|---|---|
58964a49 | 1 | #!/bin/sh |
b0edda11 | 2 | # Copyright 1998-2018 The OpenSSL Project Authors. All Rights Reserved. |
58964a49 | 3 | # |
44c8a5e2 RS |
4 | # Licensed under the OpenSSL license (the "License"). You may not use |
5 | # this file except in compliance with the License. You can obtain a copy | |
6 | # in the file LICENSE in the source distribution or at | |
7 | # https://www.openssl.org/source/license.html | |
8 | ||
5d3bb220 | 9 | # OpenSSL config: determine the operating system and run ./Configure |
44c8a5e2 | 10 | # Derived from minarch and GuessOS from Apache. |
58964a49 | 11 | # |
44c8a5e2 | 12 | # Do "config -h" for usage information. |
06a2b07b | 13 | SUFFIX="" |
ffb261ff RL |
14 | DRYRUN="false" |
15 | VERBOSE="false" | |
28a80034 | 16 | EXE="" |
9fe2bb77 | 17 | THERE=`dirname $0` |
06a2b07b UM |
18 | |
19 | # pick up any command line args to config | |
20 | for i | |
21 | do | |
22 | case "$i" in | |
9e43c6b5 | 23 | -d*) options=$options" --debug";; |
ffb261ff RL |
24 | -t*) DRYRUN="true" VERBOSE="true";; |
25 | -v*) VERBOSE="true";; | |
26 | -h*) DRYRUN="true"; cat <<EOF | |
06a2b07b | 27 | Usage: config [options] |
b33c5ffe | 28 | -d Build with debugging when possible. |
06a2b07b | 29 | -t Test mode, do not run the Configure perl script. |
ffb261ff | 30 | -v Verbose mode, show the exact Configure call that is being made. |
06a2b07b UM |
31 | -h This help. |
32 | ||
33 | Any other text will be passed to the Configure perl script. | |
34 | See INSTALL for instructions. | |
35 | ||
36 | EOF | |
37 | ;; | |
a064c615 RL |
38 | *) i=`echo "$i" | sed -e "s|'|'\\\\\\''|g"` |
39 | options="$options '$i'" ;; | |
06a2b07b UM |
40 | esac |
41 | done | |
42 | ||
2ab92ae9 RL |
43 | # Environment that's being passed to Configure |
44 | __CNF_CPPDEFINES= | |
45 | __CNF_CPPINCLUDES= | |
46 | __CNF_CPPFLAGS= | |
47 | __CNF_CFLAGS= | |
48 | __CNF_CXXFLAGS= | |
49 | __CNF_LDFLAGS= | |
50 | __CNF_LDLIBS= | |
51 | ||
58964a49 RE |
52 | # First get uname entries that we use below |
53 | ||
19a0192b DSH |
54 | [ "$MACHINE" ] || MACHINE=`(uname -m) 2>/dev/null` || MACHINE="unknown" |
55 | [ "$RELEASE" ] || RELEASE=`(uname -r) 2>/dev/null` || RELEASE="unknown" | |
56 | [ "$SYSTEM" ] || SYSTEM=`(uname -s) 2>/dev/null` || SYSTEM="unknown" | |
57 | [ "$BUILD" ] || VERSION=`(uname -v) 2>/dev/null` || VERSION="unknown" | |
58964a49 | 58 | |
8f6dc9c5 | 59 | |
58964a49 RE |
60 | # Now test for ISC and SCO, since it is has a braindamaged uname. |
61 | # | |
62 | # We need to work around FreeBSD 1.1.5.1 | |
63 | ( | |
64 | XREL=`uname -X 2>/dev/null | grep "^Release" | awk '{print $3}'` | |
65 | if [ "x$XREL" != "x" ]; then | |
66 | if [ -f /etc/kconfig ]; then | |
67 | case "$XREL" in | |
68 | 4.0|4.1) | |
69 | echo "${MACHINE}-whatever-isc4"; exit 0 | |
70 | ;; | |
71 | esac | |
72 | else | |
73 | case "$XREL" in | |
74 | 3.2v4.2) | |
75 | echo "whatever-whatever-sco3"; exit 0 | |
76 | ;; | |
77 | 3.2v5.0*) | |
78 | echo "whatever-whatever-sco5"; exit 0 | |
79 | ;; | |
80 | 4.2MP) | |
7c4e24af | 81 | case "x${VERSION}" in |
9abff96b AP |
82 | x2.0*) echo "whatever-whatever-unixware20"; exit 0 ;; |
83 | x2.1*) echo "whatever-whatever-unixware21"; exit 0 ;; | |
84 | x2*) echo "whatever-whatever-unixware2"; exit 0 ;; | |
7c4e24af | 85 | esac |
58964a49 RE |
86 | ;; |
87 | 4.2) | |
88 | echo "whatever-whatever-unixware1"; exit 0 | |
89 | ;; | |
14cc0aaf | 90 | 5*) |
7c4e24af AP |
91 | case "x${VERSION}" in |
92 | # We hardcode i586 in place of ${MACHINE} for the | |
93 | # following reason. The catch is that even though Pentium | |
94 | # is minimum requirement for platforms in question, | |
95 | # ${MACHINE} gets always assigned to i386. Now, problem | |
96 | # with i386 is that it makes ./config pass 386 to | |
97 | # ./Configure, which in turn makes make generate | |
98 | # inefficient SHA-1 (for this moment) code. | |
14cc0aaf | 99 | x[678]*) echo "i586-sco-unixware7"; exit 0 ;; |
7c4e24af | 100 | esac |
9a5a7401 | 101 | ;; |
58964a49 RE |
102 | esac |
103 | fi | |
104 | fi | |
105 | # Now we simply scan though... In most cases, the SYSTEM info is enough | |
106 | # | |
107 | case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in | |
108 | A/UX:*) | |
109 | echo "m68k-apple-aux3"; exit 0 | |
110 | ;; | |
111 | ||
76ef6ac9 AP |
112 | AIX:[3-9]:4:*) |
113 | echo "${MACHINE}-ibm-aix"; exit 0 | |
114 | ;; | |
115 | ||
dd558806 | 116 | AIX:*:[5-9]:*) |
76ef6ac9 | 117 | echo "${MACHINE}-ibm-aix"; exit 0 |
36810177 RL |
118 | ;; |
119 | ||
58964a49 | 120 | AIX:*) |
76ef6ac9 | 121 | echo "${MACHINE}-ibm-aix3"; exit 0 |
58964a49 RE |
122 | ;; |
123 | ||
58964a49 RE |
124 | HI-UX:*) |
125 | echo "${MACHINE}-hi-hiux"; exit 0 | |
126 | ;; | |
127 | ||
128 | HP-UX:*) | |
129 | HPUXVER=`echo ${RELEASE}|sed -e 's/[^.]*.[0B]*//'` | |
130 | case "$HPUXVER" in | |
6d03b73e | 131 | 1[0-9].*) # HPUX 10 and 11 targets are unified |
0a4c8baf | 132 | echo "${MACHINE}-hp-hpux1x"; exit 0 |
58964a49 RE |
133 | ;; |
134 | *) | |
135 | echo "${MACHINE}-hp-hpux"; exit 0 | |
136 | ;; | |
137 | esac | |
138 | ;; | |
139 | ||
1656ef29 | 140 | IRIX:6.*) |
da8fa72f | 141 | echo "mips3-sgi-irix"; exit 0 |
58964a49 RE |
142 | ;; |
143 | ||
144 | IRIX64:*) | |
da8fa72f | 145 | echo "mips4-sgi-irix64"; exit 0 |
58964a49 RE |
146 | ;; |
147 | ||
148 | Linux:[2-9].*) | |
149 | echo "${MACHINE}-whatever-linux2"; exit 0 | |
150 | ;; | |
151 | ||
152 | Linux:1.*) | |
153 | echo "${MACHINE}-whatever-linux1"; exit 0 | |
154 | ;; | |
155 | ||
10a2975a RL |
156 | GNU*) |
157 | echo "hurd-x86"; exit 0; | |
158 | ;; | |
159 | ||
58964a49 RE |
160 | LynxOS:*) |
161 | echo "${MACHINE}-lynx-lynxos"; exit 0 | |
162 | ;; | |
163 | ||
a9ffce0a BM |
164 | BSD/OS:4.*) # BSD/OS always says 386 |
165 | echo "i486-whatever-bsdi4"; exit 0 | |
0cceb1c7 BM |
166 | ;; |
167 | ||
58964a49 | 168 | BSD/386:*:*:*486*|BSD/OS:*:*:*:*486*) |
9c789ad1 UM |
169 | case `/sbin/sysctl -n hw.model` in |
170 | Pentium*) | |
8050bc79 | 171 | echo "i586-whatever-bsdi"; exit 0 |
9c789ad1 UM |
172 | ;; |
173 | *) | |
8050bc79 | 174 | echo "i386-whatever-bsdi"; exit 0 |
9c789ad1 UM |
175 | ;; |
176 | esac; | |
58964a49 RE |
177 | ;; |
178 | ||
179 | BSD/386:*|BSD/OS:*) | |
180 | echo "${MACHINE}-whatever-bsdi"; exit 0 | |
181 | ;; | |
182 | ||
afd41c9f | 183 | FreeBSD:*:*:*386*) |
44717474 RE |
184 | VERS=`echo ${RELEASE} | sed -e 's/[-(].*//'` |
185 | MACH=`sysctl -n hw.model` | |
186 | ARCH='whatever' | |
187 | case ${MACH} in | |
188 | *386* ) MACH="i386" ;; | |
189 | *486* ) MACH="i486" ;; | |
190 | Pentium\ II*) MACH="i686" ;; | |
191 | Pentium* ) MACH="i586" ;; | |
44717474 RE |
192 | * ) MACH="$MACHINE" ;; |
193 | esac | |
194 | case ${MACH} in | |
195 | i[0-9]86 ) ARCH="pc" ;; | |
196 | esac | |
197 | echo "${MACH}-${ARCH}-freebsd${VERS}"; exit 0 | |
198 | ;; | |
58964a49 | 199 | |
2df7f11f | 200 | DragonFly:*) |
201 | echo "${MACHINE}-whatever-dragonfly"; exit 0 | |
202 | ;; | |
203 | ||
afd41c9f RL |
204 | FreeBSD:*) |
205 | echo "${MACHINE}-whatever-freebsd"; exit 0 | |
206 | ;; | |
207 | ||
6e08e9e7 JD |
208 | Haiku:*) |
209 | echo "${MACHINE}-whatever-haiku"; exit 0 | |
210 | ;; | |
211 | ||
c6fdd7dc | 212 | NetBSD:*:*:*386*) |
48d89b56 | 213 | echo "`(/usr/sbin/sysctl -n hw.model || /sbin/sysctl -n hw.model) | sed 's,.*\(.\)86-class.*,i\186,'`-whatever-netbsd"; exit 0 |
58964a49 RE |
214 | ;; |
215 | ||
216 | NetBSD:*) | |
217 | echo "${MACHINE}-whatever-netbsd"; exit 0 | |
218 | ;; | |
219 | ||
220 | OpenBSD:*) | |
221 | echo "${MACHINE}-whatever-openbsd"; exit 0 | |
222 | ;; | |
223 | ||
6c36f7a9 LJ |
224 | OpenUNIX:*) |
225 | echo "${MACHINE}-unknown-OpenUNIX${VERSION}"; exit 0 | |
226 | ;; | |
227 | ||
58964a49 | 228 | OSF1:*:*:*alpha*) |
6bc847e4 RL |
229 | OSFMAJOR=`echo ${RELEASE}| sed -e 's/^V\([0-9]*\)\..*$/\1/'` |
230 | case "$OSFMAJOR" in | |
231 | 4|5) | |
232 | echo "${MACHINE}-dec-tru64"; exit 0 | |
233 | ;; | |
234 | 1|2|3) | |
235 | echo "${MACHINE}-dec-osf"; exit 0 | |
236 | ;; | |
237 | *) | |
238 | echo "${MACHINE}-dec-osf"; exit 0 | |
239 | ;; | |
240 | esac | |
58964a49 RE |
241 | ;; |
242 | ||
58964a49 RE |
243 | Paragon*:*:*:*) |
244 | echo "i860-intel-osf1"; exit 0 | |
245 | ;; | |
246 | ||
0fad6cb7 AP |
247 | Rhapsody:*) |
248 | echo "ppc-apple-rhapsody"; exit 0 | |
249 | ;; | |
250 | ||
9b7a552f | 251 | Darwin:*) |
70d70a3c RL |
252 | case "$MACHINE" in |
253 | Power*) | |
254 | echo "ppc-apple-darwin${VERSION}" | |
255 | ;; | |
3dfcb6a0 RL |
256 | x86_64) |
257 | echo "x86_64-apple-darwin${VERSION}" | |
258 | ;; | |
70d70a3c | 259 | *) |
ca640568 | 260 | echo "i686-apple-darwin${VERSION}" |
70d70a3c RL |
261 | ;; |
262 | esac | |
263 | exit 0 | |
9b7a552f RL |
264 | ;; |
265 | ||
58964a49 | 266 | SunOS:5.*) |
7228920c | 267 | echo "${MACHINE}-whatever-solaris2"; exit 0 |
58964a49 RE |
268 | ;; |
269 | ||
270 | SunOS:*) | |
271 | echo "${MACHINE}-sun-sunos4"; exit 0 | |
272 | ;; | |
273 | ||
274 | UNIX_System_V:4.*:*) | |
275 | echo "${MACHINE}-whatever-sysv4"; exit 0 | |
276 | ;; | |
277 | ||
28a80034 RL |
278 | VOS:*:*:i786) |
279 | echo "i386-stratus-vos"; exit 0 | |
280 | ;; | |
281 | ||
282 | VOS:*:*:*) | |
283 | echo "hppa1.1-stratus-vos"; exit 0 | |
284 | ;; | |
285 | ||
58964a49 RE |
286 | *:4*:R4*:m88k) |
287 | echo "${MACHINE}-whatever-sysv4"; exit 0 | |
288 | ;; | |
289 | ||
290 | DYNIX/ptx:4*:*) | |
291 | echo "${MACHINE}-whatever-sysv4"; exit 0 | |
292 | ;; | |
293 | ||
294 | *:4.0:3.0:3[34]?? | *:4.0:3.0:3[34]??,*) | |
295 | echo "i486-ncr-sysv4"; exit 0 | |
296 | ;; | |
297 | ||
298 | ULTRIX:*) | |
299 | echo "${MACHINE}-unknown-ultrix"; exit 0 | |
300 | ;; | |
301 | ||
9231f477 UM |
302 | POSIX-BC*) |
303 | echo "${MACHINE}-siemens-sysv4"; exit 0 # Here, $MACHINE == "BS2000" | |
304 | ;; | |
305 | ||
58964a49 RE |
306 | machten:*) |
307 | echo "${MACHINE}-tenon-${SYSTEM}"; exit 0; | |
308 | ;; | |
309 | ||
310 | library:*) | |
311 | echo "${MACHINE}-ncr-sysv4"; exit 0 | |
312 | ;; | |
313 | ||
314 | ConvexOS:*:11.0:*) | |
315 | echo "${MACHINE}-v11-${SYSTEM}"; exit 0; | |
316 | ;; | |
317 | ||
41bee3e8 RL |
318 | # The following combinations are supported |
319 | # MINGW64* on x86_64 => mingw64 | |
320 | # MINGW32* on x86_64 => mingw | |
321 | # MINGW32* on i?86 => mingw | |
322 | # | |
323 | # MINGW64* on i?86 isn't expected to work... | |
324 | MINGW64*:*:*:x86_64) | |
325 | echo "${MACHINE}-whatever-mingw64"; exit 0; | |
326 | ;; | |
4848cbf1 AP |
327 | MINGW*) |
328 | echo "${MACHINE}-whatever-mingw"; exit 0; | |
329 | ;; | |
d78e5298 | 330 | CYGWIN*) |
a717c110 | 331 | echo "${MACHINE}-pc-cygwin"; exit 0 |
d78e5298 UM |
332 | ;; |
333 | ||
2f6efd6a DSH |
334 | vxworks*) |
335 | echo "${MACHINE}-whatever-vxworks"; exit 0; | |
336 | ;; | |
58964a49 RE |
337 | esac |
338 | ||
339 | # | |
340 | # Ugg. These are all we can determine by what we know about | |
341 | # the output of uname. Be more creative: | |
342 | # | |
343 | ||
344 | # Do the Apollo stuff first. Here, we just simply assume | |
478b50cf | 345 | # that the existence of the /usr/apollo directory is proof |
58964a49 RE |
346 | # enough |
347 | if [ -d /usr/apollo ]; then | |
348 | echo "whatever-apollo-whatever" | |
349 | exit 0 | |
350 | fi | |
351 | ||
352 | # Now NeXT | |
353 | ISNEXT=`hostinfo 2>/dev/null` | |
354 | case "$ISNEXT" in | |
8e9eae0f | 355 | *'NeXT Mach 3.3'*) |
74a6c7f3 BM |
356 | echo "whatever-next-nextstep3.3"; exit 0 |
357 | ;; | |
58964a49 RE |
358 | *NeXT*) |
359 | echo "whatever-next-nextstep"; exit 0 | |
360 | ;; | |
361 | esac | |
362 | ||
363 | # At this point we gone through all the one's | |
364 | # we know of: Punt | |
365 | ||
b1fe6b43 | 366 | echo "${MACHINE}-whatever-${SYSTEM}" |
58964a49 RE |
367 | exit 0 |
368 | ) 2>/dev/null | ( | |
369 | ||
370 | # --------------------------------------------------------------------------- | |
371 | # this is where the translation occurs into SSLeay terms | |
372 | # --------------------------------------------------------------------------- | |
373 | ||
7f625320 | 374 | # Only set CC if not supplied already |
8b8d2dcc AP |
375 | if [ -z "$CROSS_COMPILE$CC" ]; then |
376 | GCCVER=`sh -c "gcc -dumpversion" 2>/dev/null` | |
7f625320 | 377 | if [ "$GCCVER" != "" ]; then |
8b8d2dcc AP |
378 | # then strip off whatever prefix egcs prepends the number with... |
379 | # Hopefully, this will work for any future prefixes as well. | |
380 | GCCVER=`echo $GCCVER | LC_ALL=C sed 's/^[a-zA-Z]*\-//'` | |
381 | # Since gcc 3.1 gcc --version behaviour has changed. gcc -dumpversion | |
382 | # does give us what we want though, so we use that. We just just the | |
383 | # major and minor version numbers. | |
384 | # peak single digit before and after first dot, e.g. 2.95.1 gives 29 | |
385 | GCCVER=`echo $GCCVER | sed 's/\([0-9]\)\.\([0-9]\).*/\1\2/'` | |
7f625320 BL |
386 | CC=gcc |
387 | else | |
388 | CC=cc | |
389 | fi | |
1656ef29 | 390 | fi |
ac7b4261 | 391 | GCCVER=${GCCVER:-0} |
1d4547a4 LJ |
392 | if [ "$SYSTEM" = "HP-UX" ];then |
393 | # By default gcc is a ILP32 compiler (with long long == 64). | |
394 | GCC_BITS="32" | |
395 | if [ $GCCVER -ge 30 ]; then | |
396 | # PA64 support only came in with gcc 3.0.x. | |
0a4c8baf AP |
397 | # We check if the preprocessor symbol __LP64__ is defined... |
398 | if echo "__LP64__" | gcc -v -E -x c - 2>/dev/null | grep "^__LP64__" 2>&1 > /dev/null; then | |
399 | : # __LP64__ has slipped through, it therefore is not defined | |
400 | else | |
1d4547a4 LJ |
401 | GCC_BITS="64" |
402 | fi | |
403 | fi | |
404 | fi | |
1656ef29 | 405 | if [ "$SYSTEM" = "SunOS" ]; then |
ac7b4261 AP |
406 | if [ $GCCVER -ge 30 ]; then |
407 | # 64-bit ABI isn't officially supported in gcc 3.0, but it appears | |
408 | # to be working, at the very least 'make test' passes... | |
409 | if gcc -v -E -x c /dev/null 2>&1 | grep __arch64__ > /dev/null; then | |
410 | GCC_ARCH="-m64" | |
411 | else | |
412 | GCC_ARCH="-m32" | |
413 | fi | |
414 | fi | |
bdf5e183 | 415 | # check for WorkShop C, expected output is "cc: blah-blah C x.x" |
1656ef29 AP |
416 | CCVER=`(cc -V 2>&1) 2>/dev/null | \ |
417 | egrep -e '^cc: .* C [0-9]\.[0-9]' | \ | |
418 | sed 's/.* C \([0-9]\)\.\([0-9]\).*/\1\2/'` | |
419 | CCVER=${CCVER:-0} | |
0abfd606 | 420 | if [ $MACHINE != i86pc -a $CCVER -gt 40 ]; then |
1656ef29 AP |
421 | CC=cc # overrides gcc!!! |
422 | if [ $CCVER -eq 50 ]; then | |
423 | echo "WARNING! Detected WorkShop C 5.0. Do make sure you have" | |
424 | echo " patch #107357-01 or later applied." | |
425 | sleep 5 | |
426 | fi | |
744029c1 | 427 | fi |
58964a49 RE |
428 | fi |
429 | ||
726c2231 | 430 | if [ "${SYSTEM}" = "AIX" ]; then # favor vendor cc over gcc |
439909a0 | 431 | (cc) 2>&1 | grep -iv "not found" > /dev/null && CC=cc |
726c2231 AP |
432 | fi |
433 | ||
da8fa72f AP |
434 | CCVER=${CCVER:-0} |
435 | ||
58964a49 RE |
436 | # read the output of the embedded GuessOS |
437 | read GUESSOS | |
438 | ||
b1fe6b43 | 439 | echo Operating system: $GUESSOS |
58964a49 RE |
440 | |
441 | # now map the output into SSLeay terms ... really should hack into the | |
442 | # script above so we end up with values in vars but that would take | |
443 | # more time that I want to waste at the moment | |
444 | case "$GUESSOS" in | |
15c7adb0 DSH |
445 | uClinux*64*) |
446 | OUT=uClinux-dist64 | |
447 | ;; | |
448 | uClinux*) | |
449 | OUT=uClinux-dist | |
450 | ;; | |
da8fa72f | 451 | mips3-sgi-irix) |
da8fa72f AP |
452 | OUT="irix-mips3-$CC" |
453 | ;; | |
454 | mips4-sgi-irix64) | |
455 | echo "WARNING! If you wish to build 64-bit library, then you have to" | |
9fe2bb77 | 456 | echo " invoke '$THERE/Configure irix64-mips4-$CC' *manually*." |
ffb261ff | 457 | if [ "$DRYRUN" = "false" -a -t 1 ]; then |
ac7b4261 | 458 | echo " You have about 5 seconds to press Ctrl-C to abort." |
a87c159f | 459 | (trap "stty `stty -g`; exit 0" 2 0; stty -icanon min 0 time 50; read waste) <&1 |
06a2b07b | 460 | fi |
da8fa72f AP |
461 | OUT="irix-mips3-$CC" |
462 | ;; | |
b7efa56a | 463 | ppc-apple-rhapsody) OUT="rhapsody-ppc-cc" ;; |
d6c76457 AP |
464 | ppc-apple-darwin*) |
465 | ISA64=`(sysctl -n hw.optional.64bitops) 2>/dev/null` | |
af036845 | 466 | if [ "$ISA64" = "1" -a -z "$KERNEL_BITS" ]; then |
d6c76457 | 467 | echo "WARNING! If you wish to build 64-bit library, then you have to" |
9fe2bb77 | 468 | echo " invoke '$THERE/Configure darwin64-ppc-cc' *manually*." |
ffb261ff | 469 | if [ "$DRYRUN" = "false" -a -t 1 ]; then |
d6c76457 | 470 | echo " You have about 5 seconds to press Ctrl-C to abort." |
a87c159f | 471 | (trap "stty `stty -g`; exit 0" 2 0; stty -icanon min 0 time 50; read waste) <&1 |
d6c76457 AP |
472 | fi |
473 | fi | |
af036845 AP |
474 | if [ "$ISA64" = "1" -a "$KERNEL_BITS" = "64" ]; then |
475 | OUT="darwin64-ppc-cc" | |
476 | else | |
477 | OUT="darwin-ppc-cc" | |
478 | fi ;; | |
ca640568 | 479 | i?86-apple-darwin*) |
0bb01b7d | 480 | ISA64=`(sysctl -n hw.optional.x86_64) 2>/dev/null` |
af036845 | 481 | if [ "$ISA64" = "1" -a -z "$KERNEL_BITS" ]; then |
0bb01b7d | 482 | echo "WARNING! If you wish to build 64-bit library, then you have to" |
3dfcb6a0 | 483 | echo " invoke 'KERNEL_BITS=64 $THERE/config $options'." |
ffb261ff | 484 | if [ "$DRYRUN" = "false" -a -t 1 ]; then |
0bb01b7d | 485 | echo " You have about 5 seconds to press Ctrl-C to abort." |
8a4460c2 | 486 | (trap "stty `stty -g`; exit 1" 2; stty -icanon min 0 time 50; read waste; exit 0) <&1 || exit |
0bb01b7d AP |
487 | fi |
488 | fi | |
af036845 AP |
489 | if [ "$ISA64" = "1" -a "$KERNEL_BITS" = "64" ]; then |
490 | OUT="darwin64-x86_64-cc" | |
491 | else | |
492 | OUT="darwin-i386-cc" | |
493 | fi ;; | |
3dfcb6a0 | 494 | x86_64-apple-darwin*) |
3dfcb6a0 RL |
495 | if [ "$KERNEL_BITS" = "32" ]; then |
496 | OUT="darwin-i386-cc" | |
497 | else | |
498 | OUT="darwin64-x86_64-cc" | |
499 | fi ;; | |
a2570242 | 500 | armv6+7-*-iphoneos) |
2ab92ae9 RL |
501 | __CNF_CFLAGS="$__CNF_CFLAGS -arch%20armv6 -arch%20armv7" |
502 | __CNF_CXXFLAGS="$__CNF_CXXFLAGS -arch%20armv6 -arch%20armv7" | |
a2570242 AP |
503 | OUT="iphoneos-cross" ;; |
504 | *-*-iphoneos) | |
2ab92ae9 RL |
505 | __CNF_CFLAGS="$__CNF_CFLAGS -arch%20${MACHINE}" |
506 | __CNF_CXXFLAGS="$__CNF_CXXFLAGS -arch%20${MACHINE}" | |
a2570242 | 507 | OUT="iphoneos-cross" ;; |
b06f7d9a AP |
508 | arm64-*-iphoneos|*-*-ios64) |
509 | OUT="ios64-cross" ;; | |
93cd57a5 | 510 | alpha-*-linux2) |
b7efa56a | 511 | ISA=`awk '/cpu model/{print$4;exit(0);}' /proc/cpuinfo` |
bdf5e183 | 512 | case ${ISA:-generic} in |
b7efa56a | 513 | *[678]) OUT="linux-alpha+bwx-$CC" ;; |
bdf5e183 AP |
514 | *) OUT="linux-alpha-$CC" ;; |
515 | esac | |
516 | if [ "$CC" = "gcc" ]; then | |
517 | case ${ISA:-generic} in | |
2ab92ae9 RL |
518 | EV5|EV45) __CNF_CFLAGS="$__CNF_CFLAGS -mcpu=ev5" |
519 | __CNF_CXXFLAGS="$__CNF_CFLAGS -mcpu=ev5";; | |
520 | EV56|PCA56) __CNF_CFLAGS="$__CNF_CFLAGS -mcpu=ev56" | |
521 | __CNF_CXXFLAGS="$__CNF_CXXFLAGS -mcpu=ev56";; | |
522 | *) __CNF_CFLAGS="$__CNF_CFLAGS -mcpu=ev6" | |
523 | __CNF_CXXFLAGS="$__CNF_CXXFLAGS -mcpu=ev6";; | |
bdf5e183 AP |
524 | esac |
525 | fi | |
526 | ;; | |
76ef6ac9 | 527 | ppc64-*-linux2) |
78c3e205 AP |
528 | if [ -z "$KERNEL_BITS" ]; then |
529 | echo "WARNING! If you wish to build 64-bit library, then you have to" | |
9fe2bb77 | 530 | echo " invoke '$THERE/Configure linux-ppc64' *manually*." |
ffb261ff | 531 | if [ "$DRYRUN" = "false" -a -t 1 ]; then |
78c3e205 | 532 | echo " You have about 5 seconds to press Ctrl-C to abort." |
a87c159f | 533 | (trap "stty `stty -g`; exit 0" 2 0; stty -icanon min 0 time 50; read waste) <&1 |
78c3e205 AP |
534 | fi |
535 | fi | |
536 | if [ "$KERNEL_BITS" = "64" ]; then | |
537 | OUT="linux-ppc64" | |
538 | else | |
539 | OUT="linux-ppc" | |
2ab92ae9 RL |
540 | if (echo "__LP64__" | gcc -E -x c - 2>/dev/null | grep "^__LP64__" 2>&1 > /dev/null); then |
541 | :; | |
542 | else | |
543 | __CNF_CFLAGS="$__CNF_CFLAGS -m32" | |
544 | __CNF_CXXFLAGS="$__CNF_CXXFLAGS -m32" | |
545 | fi | |
76ef6ac9 | 546 | fi |
76ef6ac9 | 547 | ;; |
f1982acc | 548 | ppc64le-*-linux2) OUT="linux-ppc64le" ;; |
bdf5e183 | 549 | ppc-*-linux2) OUT="linux-ppc" ;; |
b8c59291 AP |
550 | mips64*-*-linux2) |
551 | echo "WARNING! If you wish to build 64-bit library, then you have to" | |
9fe2bb77 | 552 | echo " invoke '$THERE/Configure linux64-mips64' *manually*." |
ffb261ff | 553 | if [ "$DRYRUN" = "false" -a -t 1 ]; then |
b8c59291 | 554 | echo " You have about 5 seconds to press Ctrl-C to abort." |
a87c159f | 555 | (trap "stty `stty -g`; exit 0" 2 0; stty -icanon min 0 time 50; read waste) <&1 |
b8c59291 AP |
556 | fi |
557 | OUT="linux-mips64" | |
558 | ;; | |
559 | mips*-*-linux2) OUT="linux-mips32" ;; | |
2f6efd6a DSH |
560 | ppc60x-*-vxworks*) OUT="vxworks-ppc60x" ;; |
561 | ppcgen-*-vxworks*) OUT="vxworks-ppcgen" ;; | |
1fb2e0f9 DSH |
562 | pentium-*-vxworks*) OUT="vxworks-pentium" ;; |
563 | simlinux-*-vxworks*) OUT="vxworks-simlinux" ;; | |
564 | mips-*-vxworks*) OUT="vxworks-mips";; | |
010712ff | 565 | ia64-*-linux?) OUT="linux-ia64" ;; |
a0618e3e | 566 | sparc64-*-linux2) |
c14b4d6b | 567 | echo "WARNING! If you *know* that your GNU C supports 64-bit/V9 ABI" |
6d4ac67a | 568 | echo " and wish to build 64-bit library, then you have to" |
9fe2bb77 | 569 | echo " invoke '$THERE/Configure linux64-sparcv9' *manually*." |
ffb261ff | 570 | if [ "$DRYRUN" = "false" -a -t 1 ]; then |
6d4ac67a | 571 | echo " You have about 5 seconds to press Ctrl-C to abort." |
a87c159f | 572 | (trap "stty `stty -g`; exit 0" 2 0; stty -icanon min 0 time 50; read waste) <&1 |
6d4ac67a | 573 | fi |
a0618e3e | 574 | OUT="linux-sparcv9" ;; |
da8fa72f | 575 | sparc-*-linux2) |
b7efa56a | 576 | KARCH=`awk '/^type/{print$3;exit(0);}' /proc/cpuinfo` |
a0618e3e AP |
577 | case ${KARCH:-sun4} in |
578 | sun4u*) OUT="linux-sparcv9" ;; | |
579 | sun4m) OUT="linux-sparcv8" ;; | |
580 | sun4d) OUT="linux-sparcv8" ;; | |
2ab92ae9 RL |
581 | *) OUT="linux-generic32"; |
582 | __CNF_CPPFLAGS="$__CNF_CPPFLAGS -DB_ENDIAN" ;; | |
a0618e3e | 583 | esac ;; |
57a68b21 AP |
584 | parisc*-*-linux2) |
585 | # 64-bit builds under parisc64 linux are not supported and | |
586 | # compiler is expected to generate 32-bit objects... | |
587 | CPUARCH=`awk '/cpu family/{print substr($5,1,3); exit(0);}' /proc/cpuinfo` | |
588 | CPUSCHEDULE=`awk '/^cpu.[ ]*: PA/{print substr($3,3); exit(0);}' /proc/cpuinfo` | |
95f8c719 RL |
589 | |
590 | # ??TODO ?? Model transformations | |
591 | # 0. CPU Architecture for the 1.1 processor has letter suffixes. We strip that off | |
592 | # assuming no further arch. identification will ever be used by GCC. | |
593 | # 1. I'm most concerned about whether is a 7300LC is closer to a 7100 versus a 7100LC. | |
594 | # 2. The variant 64-bit processors cause concern should GCC support explicit schedulers | |
595 | # for these chips in the future. | |
596 | # PA7300LC -> 7100LC (1.1) | |
597 | # PA8200 -> 8000 (2.0) | |
598 | # PA8500 -> 8000 (2.0) | |
599 | # PA8600 -> 8000 (2.0) | |
600 | ||
57a68b21 | 601 | CPUSCHEDULE=`echo $CPUSCHEDULE|sed -e 's/7300LC/7100LC/' -e 's/8.00/8000/'` |
95f8c719 RL |
602 | # Finish Model transformations |
603 | ||
2ab92ae9 RL |
604 | __CNF_CPPFLAGS="$__CNF_CPPFLAGS -DB_ENDIAN" |
605 | __CNF_CFLAGS="$__CNF_CFLAGS -mschedule=$CPUSCHEDULE -march=$CPUARCH" | |
606 | __CNF_CXXFLAGS="$__CNF_CXXFLAGS -mschedule=$CPUSCHEDULE -march=$CPUARCH" | |
b7efa56a | 607 | OUT="linux-generic32" ;; |
2c3ee162 | 608 | armv[1-3]*-*-linux2) OUT="linux-generic32" ;; |
2ab92ae9 RL |
609 | armv[7-9]*-*-linux2) OUT="linux-armv4" |
610 | __CNF_CFLAGS="$__CNF_CFLAGS -march=armv7-a" | |
611 | __CNF_CXXFLAGS="$__CNF_CXXFLAGS -march=armv7-a" | |
612 | ;; | |
7722e53f | 613 | arm*-*-linux2) OUT="linux-armv4" ;; |
e8d93e34 | 614 | aarch64-*-linux2) OUT="linux-aarch64" ;; |
2ab92ae9 RL |
615 | sh*b-*-linux2) OUT="linux-generic32"; |
616 | __CNF_CPPFLAGS="$__CNF_CPPFLAGS -DB_ENDIAN" ;; | |
617 | sh*-*-linux2) OUT="linux-generic32"; | |
618 | __CNF_CPPFLAGS="$__CNF_CPPFLAGS -DL_ENDIAN" ;; | |
619 | m68k*-*-linux2) OUT="linux-generic32"; | |
620 | __CNF_CPPFLAGS="$__CNF_CPPFLAGS -DB_ENDIAN" ;; | |
621 | s390-*-linux2) OUT="linux-generic32"; | |
622 | __CNF_CPPFLAGS="$__CNF_CPPFLAGS -DB_ENDIAN" ;; | |
e822c756 AP |
623 | s390x-*-linux2) |
624 | # To be uncommented when glibc bug is fixed, see Configure... | |
625 | #if egrep -e '^features.* highgprs' /proc/cpuinfo >/dev/null ; then | |
626 | # echo "WARNING! If you wish to build \"highgprs\" 32-bit library, then you" | |
627 | # echo " have to invoke './Configure linux32-s390x' *manually*." | |
ffb261ff | 628 | # if [ "$DRYRUN" = "false" -a -t -1 ]; then |
e822c756 | 629 | # echo " You have about 5 seconds to press Ctrl-C to abort." |
a87c159f | 630 | # (trap "stty `stty -g`; exit 0" 2 0; stty -icanon min 0 time 50; read waste) <&1 |
e822c756 AP |
631 | # fi |
632 | #fi | |
633 | OUT="linux64-s390x" | |
634 | ;; | |
c5c0cac5 AP |
635 | x86_64-*-linux?) |
636 | if $CC -dM -E -x c /dev/null 2>&1 | grep -q ILP32 > /dev/null; then | |
637 | OUT="linux-x32" | |
638 | else | |
639 | OUT="linux-x86_64" | |
640 | fi ;; | |
27a451e3 RL |
641 | *86-*-linux2) |
642 | # On machines where the compiler understands -m32, prefer a | |
643 | # config target that uses it | |
644 | if $CC -m32 -E -x c /dev/null > /dev/null 2>&1; then | |
645 | OUT="linux-x86" | |
646 | else | |
647 | OUT="linux-elf" | |
648 | fi ;; | |
8f3bc096 AP |
649 | *86-*-linux1) OUT="linux-aout" ;; |
650 | *-*-linux?) OUT="linux-generic32" ;; | |
160065c5 | 651 | sun4[uv]*-*-solaris2) |
cc8aa08b | 652 | OUT="solaris-sparcv9-$CC" |
74c2db31 | 653 | ISA64=`(isainfo) 2>/dev/null | grep sparcv9` |
bba391a9 | 654 | if [ "$ISA64" != "" -a "$KERNEL_BITS" = "" ]; then |
ac7b4261 | 655 | if [ "$CC" = "cc" -a $CCVER -ge 50 ]; then |
1656ef29 | 656 | echo "WARNING! If you wish to build 64-bit library, then you have to" |
9fe2bb77 | 657 | echo " invoke '$THERE/Configure solaris64-sparcv9-cc' *manually*." |
ffb261ff | 658 | if [ "$DRYRUN" = "false" -a -t 1 ]; then |
ac7b4261 | 659 | echo " You have about 5 seconds to press Ctrl-C to abort." |
a87c159f | 660 | (trap "stty `stty -g`; exit 0" 2 0; stty -icanon min 0 time 50; read waste) <&1 |
06a2b07b | 661 | fi |
ac7b4261 AP |
662 | elif [ "$CC" = "gcc" -a "$GCC_ARCH" = "-m64" ]; then |
663 | # $GCC_ARCH denotes default ABI chosen by compiler driver | |
664 | # (first one found on the $PATH). I assume that user | |
665 | # expects certain consistency with the rest of his builds | |
666 | # and therefore switch over to 64-bit. <appro> | |
667 | OUT="solaris64-sparcv9-gcc" | |
668 | echo "WARNING! If you wish to build 32-bit library, then you have to" | |
9fe2bb77 | 669 | echo " invoke '$THERE/Configure solaris-sparcv9-gcc' *manually*." |
ffb261ff | 670 | if [ "$DRYRUN" = "false" -a -t 1 ]; then |
ac7b4261 | 671 | echo " You have about 5 seconds to press Ctrl-C to abort." |
a87c159f | 672 | (trap "stty `stty -g`; exit 0" 2 0; stty -icanon min 0 time 50; read waste) <&1 |
ac7b4261 AP |
673 | fi |
674 | elif [ "$GCC_ARCH" = "-m32" ]; then | |
675 | echo "NOTICE! If you *know* that your GNU C supports 64-bit/V9 ABI" | |
676 | echo " and wish to build 64-bit library, then you have to" | |
9fe2bb77 | 677 | echo " invoke '$THERE/Configure solaris64-sparcv9-gcc' *manually*." |
ffb261ff | 678 | if [ "$DRYRUN" = "false" -a -t 1 ]; then |
ac7b4261 | 679 | echo " You have about 5 seconds to press Ctrl-C to abort." |
a87c159f | 680 | (trap "stty `stty -g`; exit 0" 2 0; stty -icanon min 0 time 50; read waste) <&1 |
ac7b4261 AP |
681 | fi |
682 | fi | |
1656ef29 | 683 | fi |
bba391a9 AP |
684 | if [ "$ISA64" != "" -a "$KERNEL_BITS" = "64" ]; then |
685 | OUT="solaris64-sparcv9-$CC" | |
686 | fi | |
ac7b4261 | 687 | ;; |
7228920c BM |
688 | sun4m-*-solaris2) OUT="solaris-sparcv8-$CC" ;; |
689 | sun4d-*-solaris2) OUT="solaris-sparcv8-$CC" ;; | |
690 | sun4*-*-solaris2) OUT="solaris-sparcv7-$CC" ;; | |
0abfd606 | 691 | *86*-*-solaris2) |
74c2db31 | 692 | ISA64=`(isainfo) 2>/dev/null | grep amd64` |
bba391a9 | 693 | if [ "$ISA64" != "" -a ${KERNEL_BITS:-64} -eq 64 ]; then |
0abfd606 AP |
694 | OUT="solaris64-x86_64-$CC" |
695 | else | |
696 | OUT="solaris-x86-$CC" | |
e4c9b85e AP |
697 | if [ `uname -r | sed -e 's/5\.//'` -lt 10 ]; then |
698 | options="$options no-sse2" | |
699 | fi | |
0abfd606 AP |
700 | fi |
701 | ;; | |
b7efa56a AP |
702 | *-*-sunos4) OUT="sunos-$CC" ;; |
703 | ||
2ab92ae9 RL |
704 | *86*-*-bsdi4) OUT="BSD-x86-elf"; options="$options no-sse2"; |
705 | __CNF_LDFLAGS="$__CNF_LDFLAGS -ldl" ;; | |
706 | alpha*-*-*bsd*) OUT="BSD-generic64"; | |
707 | __CNF_CPPFLAGS="$__CNF_CPPFLAGS -DL_ENDIAN" ;; | |
708 | powerpc64-*-*bsd*) OUT="BSD-generic64"; | |
709 | __CNF_CPPFLAGS="$__CNF_CPPFLAGS -DB_ENDIAN" ;; | |
b7efa56a AP |
710 | sparc64-*-*bsd*) OUT="BSD-sparc64" ;; |
711 | ia64-*-*bsd*) OUT="BSD-ia64" ;; | |
2df7f11f | 712 | x86_64-*-dragonfly*) OUT="BSD-x86_64" ;; |
b7efa56a | 713 | amd64-*-*bsd*) OUT="BSD-x86_64" ;; |
8b452002 AP |
714 | *86*-*-*bsd*) # mimic ld behaviour when it's looking for libc... |
715 | if [ -L /usr/lib/libc.so ]; then # [Free|Net]BSD | |
716 | libc=/usr/lib/libc.so | |
717 | else # OpenBSD | |
718 | # ld searches for highest libc.so.* and so do we | |
c256e69d | 719 | libc=`(ls /usr/lib/libc.so.* /lib/libc.so.* | tail -1) 2>/dev/null` |
8b452002 AP |
720 | fi |
721 | case "`(file -L $libc) 2>/dev/null`" in | |
e1892f23 | 722 | *ELF*) OUT="BSD-x86-elf" ;; |
e4c9b85e | 723 | *) OUT="BSD-x86"; options="$options no-sse2" ;; |
e1892f23 | 724 | esac ;; |
8f3bc096 AP |
725 | *-*-*bsd*) OUT="BSD-generic32" ;; |
726 | ||
6e08e9e7 JD |
727 | x86_64-*-haiku) OUT="haiku-x86_64" ;; |
728 | *-*-haiku) OUT="haiku-x86" ;; | |
b7efa56a AP |
729 | |
730 | *-*-osf) OUT="osf1-alpha-cc" ;; | |
731 | *-*-tru64) OUT="tru64-alpha-cc" ;; | |
14cc0aaf | 732 | *-*-[Uu]nix[Ww]are7) |
cb42ce0b | 733 | if [ "$CC" = "gcc" ]; then |
14cc0aaf | 734 | OUT="unixware-7-gcc" ; options="$options no-sse2" |
cb42ce0b | 735 | else |
2ab92ae9 RL |
736 | OUT="unixware-7" ; options="$options no-sse2" |
737 | __CNF_CPPFLAGS="$__CNF_CPPFLAGS -D__i386__" | |
cb42ce0b LJ |
738 | fi |
739 | ;; | |
5b737a07 AP |
740 | *-*-[Uu]nix[Ww]are20*) OUT="unixware-2.0"; options="$options no-sse2 no-sha512" ;; |
741 | *-*-[Uu]nix[Ww]are21*) OUT="unixware-2.1"; options="$options no-sse2 no-sha512" ;; | |
28a80034 RL |
742 | *-*-vos) |
743 | options="$options no-threads no-shared no-asm no-dso" | |
744 | EXE=".pm" | |
745 | OUT="vos-$CC" ;; | |
9231f477 | 746 | BS2000-siemens-sysv4) OUT="BS2000-OSD" ;; |
6d03b73e | 747 | *-hpux1*) |
12470927 AP |
748 | if [ $CC = "gcc" -a $GCC_BITS = "64" ]; then |
749 | OUT="hpux64-parisc2-gcc" | |
1d4547a4 | 750 | fi |
9fa8f3a6 | 751 | [ "$KERNEL_BITS" ] || KERNEL_BITS=`(getconf KERNEL_BITS) 2>/dev/null` |
6d03b73e AP |
752 | KERNEL_BITS=${KERNEL_BITS:-32} |
753 | CPU_VERSION=`(getconf CPU_VERSION) 2>/dev/null` | |
754 | CPU_VERSION=${CPU_VERSION:-0} | |
755 | # See <sys/unistd.h> for further info on CPU_VERSION. | |
756 | if [ $CPU_VERSION -ge 768 ]; then # IA-64 CPU | |
bdd45497 DSH |
757 | if [ $KERNEL_BITS -eq 64 -a "$CC" = "cc" ]; then |
758 | OUT="hpux64-ia64-cc" | |
759 | else | |
760 | OUT="hpux-ia64-cc" | |
761 | fi | |
6d03b73e | 762 | elif [ $CPU_VERSION -ge 532 ]; then # PA-RISC 2.x CPU |
e14795f8 AP |
763 | # PA-RISC 2.0 is no longer supported as separate 32-bit |
764 | # target. This is compensated for by run-time detection | |
765 | # in most critical assembly modules and taking advantage | |
766 | # of 2.0 architecture in PA-RISC 1.1 build. | |
767 | OUT=${OUT:-"hpux-parisc1_1-${CC}"} | |
6d03b73e AP |
768 | if [ $KERNEL_BITS -eq 64 -a "$CC" = "cc" ]; then |
769 | echo "WARNING! If you wish to build 64-bit library then you have to" | |
9fe2bb77 | 770 | echo " invoke '$THERE/Configure hpux64-parisc2-cc' *manually*." |
ffb261ff | 771 | if [ "$DRYRUN" = "false" -a -t 1 ]; then |
6d03b73e | 772 | echo " You have about 5 seconds to press Ctrl-C to abort." |
a87c159f | 773 | (trap "stty `stty -g`; exit 0" 2 0; stty -icanon min 0 time 50; read waste) <&1 |
6d03b73e AP |
774 | fi |
775 | fi | |
776 | elif [ $CPU_VERSION -ge 528 ]; then # PA-RISC 1.1+ CPU | |
74acf1c4 | 777 | OUT="hpux-parisc1_1-${CC}" |
6d03b73e | 778 | elif [ $CPU_VERSION -ge 523 ]; then # PA-RISC 1.0 CPU |
83ed4914 | 779 | OUT="hpux-parisc-${CC}" |
6d03b73e AP |
780 | else # Motorola(?) CPU |
781 | OUT="hpux-$CC" | |
782 | fi | |
2ab92ae9 | 783 | __CNF_CPPFLAGS="$__CNF_CPPFLAGS -D_REENTRANT" ;; |
bcba6cc6 | 784 | *-hpux) OUT="hpux-parisc-$CC" ;; |
76ef6ac9 | 785 | *-aix) |
9fa8f3a6 | 786 | [ "$KERNEL_BITS" ] || KERNEL_BITS=`(getconf KERNEL_BITMODE) 2>/dev/null` |
dd558806 | 787 | KERNEL_BITS=${KERNEL_BITS:-32} |
76ef6ac9 | 788 | OBJECT_MODE=${OBJECT_MODE:-32} |
dd558806 AP |
789 | if [ "$CC" = "gcc" ]; then |
790 | OUT="aix-gcc" | |
a0e4a8e1 DSH |
791 | if [ $OBJECT_MODE -eq 64 ]; then |
792 | echo 'Your $OBJECT_MODE was found to be set to 64' | |
793 | OUT="aix64-gcc" | |
794 | fi | |
76ef6ac9 AP |
795 | elif [ $OBJECT_MODE -eq 64 ]; then |
796 | echo 'Your $OBJECT_MODE was found to be set to 64' | |
797 | OUT="aix64-cc" | |
dd558806 | 798 | else |
76ef6ac9 AP |
799 | OUT="aix-cc" |
800 | if [ $KERNEL_BITS -eq 64 ]; then | |
801 | echo "WARNING! If you wish to build 64-bit kit, then you have to" | |
9fe2bb77 | 802 | echo " invoke '$THERE/Configure aix64-cc' *manually*." |
ffb261ff | 803 | if [ "$DRYRUN" = "false" -a -t 1 ]; then |
76ef6ac9 | 804 | echo " You have ~5 seconds to press Ctrl-C to abort." |
a87c159f | 805 | (trap "stty `stty -g`; exit 0" 2 0; stty -icanon min 0 time 50; read waste) <&1 |
76ef6ac9 AP |
806 | fi |
807 | fi | |
dd558806 | 808 | fi |
0a29f511 | 809 | if (lsattr -E -O -l `lsdev -c processor|awk '{print$1;exit}'` | grep -i powerpc) >/dev/null 2>&1; then |
60dd0857 AP |
810 | : # this applies even to Power3 and later, as they return PowerPC_POWER[345] |
811 | else | |
812 | options="$options no-asm" | |
813 | fi | |
dd558806 | 814 | ;; |
58964a49 | 815 | # these are all covered by the catchall below |
3f542969 | 816 | i[3456]86-*-cygwin) OUT="Cygwin-x86" ;; |
a717c110 | 817 | *-*-cygwin) OUT="Cygwin-${MACHINE}" ;; |
8fcdb1e6 | 818 | x86-*-android|i?86-*-android) OUT="android-x86" ;; |
893fe73a | 819 | armv[7-9]*-*-android) |
2ab92ae9 RL |
820 | OUT="android-armeabi" |
821 | __CNF_CFLAGS="$__CNF_CFLAGS -march=armv7-a" | |
822 | __CNF_CXXFLAGS="$__CNF_CXXFLAGS -march=armv7-a";; | |
893fe73a | 823 | arm*-*-android) OUT="android-armeabi" ;; |
58964a49 | 824 | *) OUT=`echo $GUESSOS | awk -F- '{print $3}'`;; |
5d3bb220 UM |
825 | esac |
826 | ||
478b50cf | 827 | # NB: This atalla support has been superseded by the ENGINE support |
5270e702 RL |
828 | # That contains its own header and definitions anyway. Support can |
829 | # be enabled or disabled on any supported platform without external | |
830 | # headers, eg. by adding the "hw-atalla" switch to ./config or | |
831 | # perl Configure | |
832 | # | |
bd03b99b | 833 | # See whether we can compile Atalla support |
5270e702 RL |
834 | #if [ -f /usr/include/atasi.h ] |
835 | #then | |
2ab92ae9 | 836 | # __CNF_CPPFLAGS="$__CNF_CPPFLAGS -DATALLA" |
5270e702 | 837 | #fi |
bd03b99b | 838 | |
1fb2e0f9 DSH |
839 | if [ -n "$CONFIG_OPTIONS" ]; then |
840 | options="$options $CONFIG_OPTIONS" | |
841 | fi | |
842 | ||
8b8d2dcc | 843 | if expr "$options" : '.*no\-asm' > /dev/null; then :; else |
2ab92ae9 RL |
844 | if sh -c "$CROSS_COMPILE${CC:-gcc} -Wa,--help -c -o /tmp/null.$$.o -x assembler /dev/null && rm /tmp/null.$$.o" 2>&1 | \ |
845 | grep \\--noexecstack >/dev/null; then | |
846 | __CNF_CFLAGS="$__CNF_CFLAGS -Wa,--noexecstack" | |
847 | __CNF_CXXFLAGS="$__CNF_CXXFLAGS -Wa,--noexecstack" | |
848 | fi | |
1fb2e0f9 | 849 | fi |
2966c2ec | 850 | |
9540ccdf | 851 | # gcc < 2.8 does not support -march=ultrasparc |
1656ef29 | 852 | if [ "$OUT" = solaris-sparcv9-gcc -a $GCCVER -lt 28 ] |
b6735832 | 853 | then |
d0590fe6 AP |
854 | echo "WARNING! Falling down to 'solaris-sparcv8-gcc'." |
855 | echo " Upgrade to gcc-2.8 or later." | |
1656ef29 | 856 | sleep 5 |
d0590fe6 | 857 | OUT=solaris-sparcv8-gcc |
a0618e3e AP |
858 | fi |
859 | if [ "$OUT" = "linux-sparcv9" -a $GCCVER -lt 28 ] | |
860 | then | |
861 | echo "WARNING! Falling down to 'linux-sparcv8'." | |
862 | echo " Upgrade to gcc-2.8 or later." | |
1656ef29 | 863 | sleep 5 |
a0618e3e | 864 | OUT=linux-sparcv8 |
b6735832 UM |
865 | fi |
866 | ||
5d3bb220 UM |
867 | case "$GUESSOS" in |
868 | i386-*) options="$options 386" ;; | |
58964a49 RE |
869 | esac |
870 | ||
3d328a44 | 871 | for i in aes aria bf camellia cast des dh dsa ec hmac idea md2 md5 mdc2 rc2 rc4 rc5 ripemd rsa seed sha sm2 sm3 sm4 |
9231f477 | 872 | do |
9fe2bb77 | 873 | if [ ! -d $THERE/crypto/$i ] |
9231f477 UM |
874 | then |
875 | options="$options no-$i" | |
876 | fi | |
877 | done | |
878 | ||
58964a49 RE |
879 | if [ -z "$OUT" ]; then |
880 | OUT="$CC" | |
881 | fi | |
882 | ||
99aab161 UM |
883 | if [ ".$PERL" = . ] ; then |
884 | for i in . `echo $PATH | sed 's/:/ /g'`; do | |
28a80034 RL |
885 | if [ -f "$i/perl5$EXE" ] ; then |
886 | PERL="$i/perl5$EXE" | |
99aab161 UM |
887 | break; |
888 | fi; | |
889 | done | |
890 | fi | |
891 | ||
892 | if [ ".$PERL" = . ] ; then | |
893 | for i in . `echo $PATH | sed 's/:/ /g'`; do | |
28a80034 RL |
894 | if [ -f "$i/perl$EXE" ] ; then |
895 | if "$i/perl$EXE" -e 'exit($]<5.0)'; then | |
896 | PERL="$i/perl$EXE" | |
a5a47e4a UM |
897 | break; |
898 | fi; | |
99aab161 UM |
899 | fi; |
900 | done | |
901 | fi | |
902 | ||
a5a47e4a | 903 | if [ ".$PERL" = . ] ; then |
99aab161 UM |
904 | echo "You need Perl 5." |
905 | exit 1 | |
906 | fi | |
907 | ||
58964a49 RE |
908 | # run Configure to check to see if we need to specify the |
909 | # compiler for the platform ... in which case we add it on | |
910 | # the end ... otherwise we leave it off | |
99aab161 | 911 | |
9fe2bb77 | 912 | $PERL $THERE/Configure LIST | grep "$OUT-$CC" > /dev/null |
58964a49 RE |
913 | if [ $? = "0" ]; then |
914 | OUT="$OUT-$CC" | |
915 | fi | |
916 | ||
d2a5c40d | 917 | OUT="$OUT" |
58964a49 | 918 | |
9fe2bb77 | 919 | $PERL $THERE/Configure LIST | grep "$OUT" > /dev/null |
b1fe6b43 | 920 | if [ $? = "0" ]; then |
ffb261ff | 921 | if [ "$VERBOSE" = "true" ]; then |
2ab92ae9 RL |
922 | echo /usr/bin/env \ |
923 | __CNF_CPPDEFINES="'$__CNF_CPPDEFINES'" \ | |
924 | __CNF_CPPINCLUDES="'$__CNF_CPPINCLUDES'" \ | |
925 | __CNF_CPPFLAGS="'$__CNF_CPPFLAGS'" \ | |
926 | __CNF_CFLAGS="'$__CNF_CFLAGS'" \ | |
927 | __CNF_CXXFLAGS="'$__CNF_CXXFLAGS'" \ | |
928 | __CNF_LDFLAGS="'$__CNF_LDFLAGS'" \ | |
929 | __CNF_LDLIBS="'$__CNF_LDLIBS'" \ | |
930 | $PERL $THERE/Configure $OUT $options | |
ffb261ff RL |
931 | fi |
932 | if [ "$DRYRUN" = "false" ]; then | |
a064c615 RL |
933 | # eval to make sure quoted options, possibly with spaces inside, |
934 | # are treated right | |
2ab92ae9 RL |
935 | eval /usr/bin/env \ |
936 | __CNF_CPPDEFINES="'$__CNF_CPPDEFINES'" \ | |
937 | __CNF_CPPINCLUDES="'$__CNF_CPPINCLUDES'" \ | |
938 | __CNF_CPPFLAGS="'$__CNF_CPPFLAGS'" \ | |
939 | __CNF_CFLAGS="'$__CNF_CFLAGS'" \ | |
940 | __CNF_CXXFLAGS="'$__CNF_CXXFLAGS'" \ | |
941 | __CNF_LDFLAGS="'$__CNF_LDFLAGS'" \ | |
942 | __CNF_LDLIBS="'$__CNF_LDLIBS'" \ | |
943 | $PERL $THERE/Configure $OUT $options | |
b1fe6b43 | 944 | fi |
58964a49 | 945 | else |
744029c1 | 946 | echo "This system ($OUT) is not supported. See file INSTALL for details." |
141d7325 | 947 | exit 1 |
58964a49 | 948 | fi |
26967dc3 BL |
949 | |
950 | if [ "$OUT" = "darwin64-x86_64-cc" ]; then | |
951 | echo "WARNING! If you wish to build 32-bit libraries, then you have to" | |
952 | echo " invoke 'KERNEL_BITS=32 $THERE/config $options'." | |
953 | fi | |
58964a49 | 954 | ) |