]>
Commit | Line | Data |
---|---|---|
58964a49 RE |
1 | #!/bin/sh |
2 | # | |
5d3bb220 | 3 | # OpenSSL config: determine the operating system and run ./Configure |
58964a49 | 4 | # |
5d3bb220 | 5 | # "config -h" for usage information. |
58964a49 | 6 | # |
5d3bb220 UM |
7 | # this is a merge of minarch and GuessOS from the Apache Group. |
8 | # Originally written by Tim Hudson <tjh@cryptsoft.com>. | |
58964a49 RE |
9 | |
10 | # Original Apache Group comments on GuessOS | |
11 | ||
12 | # Simple OS/Platform guesser. Similar to config.guess but | |
13 | # much, much smaller. Since it was developed for use with | |
14 | # Apache, it follows under Apache's regular licensing | |
15 | # with one specific addition: Any changes or additions | |
16 | # to this script should be Emailed to the Apache | |
17 | # group (apache@apache.org) in general and to | |
18 | # Jim Jagielski (jim@jaguNET.com) in specific. | |
19 | # | |
20 | # Be as similar to the output of config.guess/config.sub | |
21 | # as possible. | |
22 | ||
06a2b07b UM |
23 | PREFIX="" |
24 | SUFFIX="" | |
25 | TEST="false" | |
26 | ||
27 | # pick up any command line args to config | |
28 | for i | |
29 | do | |
30 | case "$i" in | |
31 | -d*) PREFIX="debug-";; | |
32 | -t*) TEST="true";; | |
33 | -h*) TEST="true"; cat <<EOF | |
34 | Usage: config [options] | |
35 | -d Add a debug- prefix to machine choice. | |
36 | -t Test mode, do not run the Configure perl script. | |
37 | -h This help. | |
38 | ||
39 | Any other text will be passed to the Configure perl script. | |
40 | See INSTALL for instructions. | |
41 | ||
42 | EOF | |
43 | ;; | |
44 | *) options=$options" $i" ;; | |
45 | esac | |
46 | done | |
47 | ||
58964a49 RE |
48 | # First get uname entries that we use below |
49 | ||
50 | MACHINE=`(uname -m) 2>/dev/null` || MACHINE="unknown" | |
51 | RELEASE=`(uname -r) 2>/dev/null` || RELEASE="unknown" | |
52 | SYSTEM=`(uname -s) 2>/dev/null` || SYSTEM="unknown" | |
53 | VERSION=`(uname -v) 2>/dev/null` || VERSION="unknown" | |
54 | ||
8f6dc9c5 | 55 | |
58964a49 RE |
56 | # Now test for ISC and SCO, since it is has a braindamaged uname. |
57 | # | |
58 | # We need to work around FreeBSD 1.1.5.1 | |
59 | ( | |
60 | XREL=`uname -X 2>/dev/null | grep "^Release" | awk '{print $3}'` | |
61 | if [ "x$XREL" != "x" ]; then | |
62 | if [ -f /etc/kconfig ]; then | |
63 | case "$XREL" in | |
64 | 4.0|4.1) | |
65 | echo "${MACHINE}-whatever-isc4"; exit 0 | |
66 | ;; | |
67 | esac | |
68 | else | |
69 | case "$XREL" in | |
70 | 3.2v4.2) | |
71 | echo "whatever-whatever-sco3"; exit 0 | |
72 | ;; | |
73 | 3.2v5.0*) | |
74 | echo "whatever-whatever-sco5"; exit 0 | |
75 | ;; | |
76 | 4.2MP) | |
77 | if [ "x$VERSION" = "x2.1.1" ]; then | |
78 | echo "${MACHINE}-whatever-unixware211"; exit 0 | |
8f6dc9c5 RL |
79 | elif [ "x$VERSION" = "x2.1.2" ]; then |
80 | echo "${MACHINE}-whatever-unixware212"; exit 0 | |
58964a49 RE |
81 | else |
82 | echo "${MACHINE}-whatever-unixware2"; exit 0 | |
83 | fi | |
84 | ;; | |
85 | 4.2) | |
86 | echo "whatever-whatever-unixware1"; exit 0 | |
87 | ;; | |
8f6dc9c5 | 88 | 5) |
2eb5bc5c | 89 | if [ "`echo x$VERSION | sed -e 's/\..*//'`" = "x7" ]; then |
8f6dc9c5 RL |
90 | echo "${MACHINE}-sco-unixware7"; exit 0 |
91 | fi | |
9a5a7401 | 92 | ;; |
58964a49 RE |
93 | esac |
94 | fi | |
95 | fi | |
96 | # Now we simply scan though... In most cases, the SYSTEM info is enough | |
97 | # | |
98 | case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in | |
c5f8bbbc RL |
99 | MPE/iX:*) |
100 | MACHINE=`echo "$MACHINE" | sed -e 's/-/_/g'` | |
101 | echo "parisc-hp-MPE/iX"; exit 0 | |
102 | ;; | |
58964a49 RE |
103 | A/UX:*) |
104 | echo "m68k-apple-aux3"; exit 0 | |
105 | ;; | |
106 | ||
36810177 RL |
107 | AIX:[3456789]:4:*) |
108 | echo "${MACHINE}-ibm-aix43"; exit 0 | |
109 | ;; | |
110 | ||
111 | AIX:*:[56789]:*) | |
112 | echo "${MACHINE}-ibm-aix43"; exit 0 | |
113 | ;; | |
114 | ||
58964a49 RE |
115 | AIX:*) |
116 | echo "${MACHINE}-ibm-aix"; exit 0 | |
117 | ;; | |
118 | ||
119 | dgux:*) | |
120 | echo "${MACHINE}-dg-dgux"; exit 0 | |
121 | ;; | |
122 | ||
123 | HI-UX:*) | |
124 | echo "${MACHINE}-hi-hiux"; exit 0 | |
125 | ;; | |
126 | ||
127 | HP-UX:*) | |
128 | HPUXVER=`echo ${RELEASE}|sed -e 's/[^.]*.[0B]*//'` | |
129 | case "$HPUXVER" in | |
afd1f9e8 UM |
130 | 11.*) |
131 | echo "${MACHINE}-hp-hpux11"; exit 0 | |
132 | ;; | |
58964a49 | 133 | 10.*) |
afd1f9e8 | 134 | echo "${MACHINE}-hp-hpux10"; exit 0 |
58964a49 RE |
135 | ;; |
136 | *) | |
137 | echo "${MACHINE}-hp-hpux"; exit 0 | |
138 | ;; | |
139 | esac | |
140 | ;; | |
141 | ||
da8fa72f AP |
142 | IRIX:5.*) |
143 | echo "mips2-sgi-irix"; exit 0 | |
144 | ;; | |
145 | ||
1656ef29 | 146 | IRIX:6.*) |
da8fa72f | 147 | echo "mips3-sgi-irix"; exit 0 |
58964a49 RE |
148 | ;; |
149 | ||
150 | IRIX64:*) | |
da8fa72f | 151 | echo "mips4-sgi-irix64"; exit 0 |
58964a49 RE |
152 | ;; |
153 | ||
154 | Linux:[2-9].*) | |
155 | echo "${MACHINE}-whatever-linux2"; exit 0 | |
156 | ;; | |
157 | ||
158 | Linux:1.*) | |
159 | echo "${MACHINE}-whatever-linux1"; exit 0 | |
160 | ;; | |
161 | ||
10a2975a RL |
162 | GNU*) |
163 | echo "hurd-x86"; exit 0; | |
164 | ;; | |
165 | ||
58964a49 RE |
166 | LynxOS:*) |
167 | echo "${MACHINE}-lynx-lynxos"; exit 0 | |
168 | ;; | |
169 | ||
a9ffce0a BM |
170 | BSD/OS:4.*) # BSD/OS always says 386 |
171 | echo "i486-whatever-bsdi4"; exit 0 | |
0cceb1c7 BM |
172 | ;; |
173 | ||
58964a49 | 174 | BSD/386:*:*:*486*|BSD/OS:*:*:*:*486*) |
9c789ad1 UM |
175 | case `/sbin/sysctl -n hw.model` in |
176 | Pentium*) | |
8050bc79 | 177 | echo "i586-whatever-bsdi"; exit 0 |
9c789ad1 UM |
178 | ;; |
179 | *) | |
8050bc79 | 180 | echo "i386-whatever-bsdi"; exit 0 |
9c789ad1 UM |
181 | ;; |
182 | esac; | |
58964a49 RE |
183 | ;; |
184 | ||
185 | BSD/386:*|BSD/OS:*) | |
186 | echo "${MACHINE}-whatever-bsdi"; exit 0 | |
187 | ;; | |
188 | ||
58964a49 | 189 | FreeBSD:*) |
44717474 RE |
190 | VERS=`echo ${RELEASE} | sed -e 's/[-(].*//'` |
191 | MACH=`sysctl -n hw.model` | |
192 | ARCH='whatever' | |
193 | case ${MACH} in | |
194 | *386* ) MACH="i386" ;; | |
195 | *486* ) MACH="i486" ;; | |
196 | Pentium\ II*) MACH="i686" ;; | |
197 | Pentium* ) MACH="i586" ;; | |
198 | Alpha* ) MACH="alpha" ;; | |
199 | * ) MACH="$MACHINE" ;; | |
200 | esac | |
201 | case ${MACH} in | |
202 | i[0-9]86 ) ARCH="pc" ;; | |
203 | esac | |
204 | echo "${MACH}-${ARCH}-freebsd${VERS}"; exit 0 | |
205 | ;; | |
58964a49 | 206 | |
c6fdd7dc | 207 | NetBSD:*:*:*386*) |
48d89b56 | 208 | echo "`(/usr/sbin/sysctl -n hw.model || /sbin/sysctl -n hw.model) | sed 's,.*\(.\)86-class.*,i\186,'`-whatever-netbsd"; exit 0 |
58964a49 RE |
209 | ;; |
210 | ||
211 | NetBSD:*) | |
212 | echo "${MACHINE}-whatever-netbsd"; exit 0 | |
213 | ;; | |
214 | ||
215 | OpenBSD:*) | |
216 | echo "${MACHINE}-whatever-openbsd"; exit 0 | |
217 | ;; | |
218 | ||
219 | OSF1:*:*:*alpha*) | |
220 | echo "${MACHINE}-dec-osf"; exit 0 | |
221 | ;; | |
222 | ||
223 | QNX:*) | |
224 | case "$VERSION" in | |
36124b10 BM |
225 | 4*) |
226 | echo "${MACHINE}-whatever-qnx4" | |
58964a49 RE |
227 | ;; |
228 | *) | |
36124b10 | 229 | echo "${MACHINE}-whatever-qnx" |
58964a49 RE |
230 | ;; |
231 | esac | |
232 | exit 0 | |
233 | ;; | |
234 | ||
235 | Paragon*:*:*:*) | |
236 | echo "i860-intel-osf1"; exit 0 | |
237 | ;; | |
238 | ||
0fad6cb7 AP |
239 | Rhapsody:*) |
240 | echo "ppc-apple-rhapsody"; exit 0 | |
241 | ;; | |
242 | ||
9b7a552f | 243 | Darwin:*) |
70d70a3c RL |
244 | case "$MACHINE" in |
245 | Power*) | |
246 | echo "ppc-apple-darwin${VERSION}" | |
247 | ;; | |
248 | *) | |
249 | echo "i386-apple-darwin${VERSION}" | |
250 | ;; | |
251 | esac | |
252 | exit 0 | |
9b7a552f RL |
253 | ;; |
254 | ||
58964a49 | 255 | SunOS:5.*) |
7228920c | 256 | echo "${MACHINE}-whatever-solaris2"; exit 0 |
58964a49 RE |
257 | ;; |
258 | ||
259 | SunOS:*) | |
260 | echo "${MACHINE}-sun-sunos4"; exit 0 | |
261 | ;; | |
262 | ||
263 | UNIX_System_V:4.*:*) | |
264 | echo "${MACHINE}-whatever-sysv4"; exit 0 | |
265 | ;; | |
266 | ||
267 | *:4*:R4*:m88k) | |
268 | echo "${MACHINE}-whatever-sysv4"; exit 0 | |
269 | ;; | |
270 | ||
271 | DYNIX/ptx:4*:*) | |
272 | echo "${MACHINE}-whatever-sysv4"; exit 0 | |
273 | ;; | |
274 | ||
275 | *:4.0:3.0:3[34]?? | *:4.0:3.0:3[34]??,*) | |
276 | echo "i486-ncr-sysv4"; exit 0 | |
277 | ;; | |
278 | ||
279 | ULTRIX:*) | |
280 | echo "${MACHINE}-unknown-ultrix"; exit 0 | |
281 | ;; | |
282 | ||
1fac96e4 UM |
283 | SINIX*|ReliantUNIX*) |
284 | echo "${MACHINE}-siemens-sysv4"; exit 0 | |
58964a49 RE |
285 | ;; |
286 | ||
9231f477 UM |
287 | POSIX-BC*) |
288 | echo "${MACHINE}-siemens-sysv4"; exit 0 # Here, $MACHINE == "BS2000" | |
289 | ;; | |
290 | ||
58964a49 RE |
291 | machten:*) |
292 | echo "${MACHINE}-tenon-${SYSTEM}"; exit 0; | |
293 | ;; | |
294 | ||
295 | library:*) | |
296 | echo "${MACHINE}-ncr-sysv4"; exit 0 | |
297 | ;; | |
298 | ||
299 | ConvexOS:*:11.0:*) | |
300 | echo "${MACHINE}-v11-${SYSTEM}"; exit 0; | |
301 | ;; | |
302 | ||
72660f5f RL |
303 | NEWS-OS:4.*) |
304 | echo "mips-sony-newsos4"; exit 0; | |
305 | ;; | |
306 | ||
58964a49 RE |
307 | esac |
308 | ||
309 | # | |
310 | # Ugg. These are all we can determine by what we know about | |
311 | # the output of uname. Be more creative: | |
312 | # | |
313 | ||
314 | # Do the Apollo stuff first. Here, we just simply assume | |
315 | # that the existance of the /usr/apollo directory is proof | |
316 | # enough | |
317 | if [ -d /usr/apollo ]; then | |
318 | echo "whatever-apollo-whatever" | |
319 | exit 0 | |
320 | fi | |
321 | ||
322 | # Now NeXT | |
323 | ISNEXT=`hostinfo 2>/dev/null` | |
324 | case "$ISNEXT" in | |
8e9eae0f | 325 | *'NeXT Mach 3.3'*) |
74a6c7f3 BM |
326 | echo "whatever-next-nextstep3.3"; exit 0 |
327 | ;; | |
58964a49 RE |
328 | *NeXT*) |
329 | echo "whatever-next-nextstep"; exit 0 | |
330 | ;; | |
331 | esac | |
332 | ||
333 | # At this point we gone through all the one's | |
334 | # we know of: Punt | |
335 | ||
b1fe6b43 | 336 | echo "${MACHINE}-whatever-${SYSTEM}" |
58964a49 RE |
337 | exit 0 |
338 | ) 2>/dev/null | ( | |
339 | ||
340 | # --------------------------------------------------------------------------- | |
341 | # this is where the translation occurs into SSLeay terms | |
342 | # --------------------------------------------------------------------------- | |
343 | ||
58964a49 RE |
344 | # figure out if gcc is available and if so we use it otherwise |
345 | # we fallback to whatever cc does on the system | |
a0618e3e AP |
346 | GCCVER=`(gcc --version) 2>/dev/null` |
347 | if [ "$GCCVER" != "" ]; then | |
58964a49 | 348 | CC=gcc |
a0618e3e AP |
349 | # then strip off whatever prefix Cygnus prepends the number with... |
350 | GCCVER=`echo $GCCVER | sed 's/^[a-z]*\-//'` | |
1656ef29 | 351 | # peak single digit before and after first dot, e.g. 2.95.1 gives 29 |
da8fa72f | 352 | GCCVER=`echo $GCCVER | sed 's/\([0-9]\)\.\([0-9]\).*/\1\2/'` |
58964a49 RE |
353 | else |
354 | CC=cc | |
1656ef29 AP |
355 | fi |
356 | ||
357 | if [ "$SYSTEM" = "SunOS" ]; then | |
bdf5e183 | 358 | # check for WorkShop C, expected output is "cc: blah-blah C x.x" |
1656ef29 AP |
359 | CCVER=`(cc -V 2>&1) 2>/dev/null | \ |
360 | egrep -e '^cc: .* C [0-9]\.[0-9]' | \ | |
361 | sed 's/.* C \([0-9]\)\.\([0-9]\).*/\1\2/'` | |
362 | CCVER=${CCVER:-0} | |
363 | if [ $CCVER -gt 40 ]; then | |
364 | CC=cc # overrides gcc!!! | |
365 | if [ $CCVER -eq 50 ]; then | |
366 | echo "WARNING! Detected WorkShop C 5.0. Do make sure you have" | |
367 | echo " patch #107357-01 or later applied." | |
368 | sleep 5 | |
369 | fi | |
370 | elif [ "$CC" = "cc" -a $CCVER -gt 0 ]; then | |
371 | CC=sc3 | |
744029c1 | 372 | fi |
58964a49 RE |
373 | fi |
374 | ||
bdf5e183 AP |
375 | if [ "${SYSTEM}-${MACHINE}" = "Linux-alpha" ]; then |
376 | # check for Compaq C, expected output is "blah-blah C Vx.x" | |
377 | CCCVER=`(ccc -V 2>&1) 2>/dev/null | \ | |
378 | egrep -e '.* C V[0-9]\.[0-9]' | \ | |
379 | sed 's/.* C V\([0-9]\)\.\([0-9]\).*/\1\2/'` | |
380 | CCCVER=${CCCVER:-0} | |
381 | if [ $CCCVER -gt 60 ]; then | |
382 | CC=ccc # overrides gcc!!! well, ccc outperforms inoticeably | |
383 | # only on hash routines and des, otherwise gcc (2.95) | |
384 | # keeps along rather tight... | |
385 | fi | |
386 | fi | |
387 | ||
da8fa72f AP |
388 | GCCVER=${GCCVER:-0} |
389 | CCVER=${CCVER:-0} | |
390 | ||
58964a49 RE |
391 | # read the output of the embedded GuessOS |
392 | read GUESSOS | |
393 | ||
b1fe6b43 | 394 | echo Operating system: $GUESSOS |
58964a49 RE |
395 | |
396 | # now map the output into SSLeay terms ... really should hack into the | |
397 | # script above so we end up with values in vars but that would take | |
398 | # more time that I want to waste at the moment | |
399 | case "$GUESSOS" in | |
da8fa72f AP |
400 | mips2-sgi-irix) |
401 | CPU=`(hinv -t cpu) 2>/dev/null | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'` | |
402 | CPU=${CPU:-0} | |
403 | if [ $CPU -ge 4000 ]; then | |
404 | options="$options -mips2" | |
405 | fi | |
406 | OUT="irix-$CC" | |
407 | ;; | |
408 | mips3-sgi-irix) | |
409 | CPU=`(hinv -t cpu) 2>/dev/null | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'` | |
410 | CPU=${CPU:-0} | |
411 | if [ $CPU -ge 5000 ]; then | |
412 | options="$options -mips4" | |
413 | else | |
414 | options="$options -mips3" | |
415 | fi | |
416 | OUT="irix-mips3-$CC" | |
417 | ;; | |
418 | mips4-sgi-irix64) | |
419 | echo "WARNING! If you wish to build 64-bit library, then you have to" | |
720235ee | 420 | echo " invoke './Configure irix64-mips4-$CC' *manually*." |
69e42952 | 421 | echo " Type return if you want to continue, Ctrl-C to abort." |
06a2b07b UM |
422 | if [ "$TEST" = "false" ]; then |
423 | read waste < /dev/tty | |
424 | fi | |
720235ee UM |
425 | CPU=`(hinv -t cpu) 2>/dev/null | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'` |
426 | CPU=${CPU:-0} | |
427 | if [ $CPU -ge 5000 ]; then | |
428 | options="$options -mips4" | |
429 | else | |
430 | options="$options -mips3" | |
431 | fi | |
da8fa72f AP |
432 | OUT="irix-mips3-$CC" |
433 | ;; | |
93cd57a5 | 434 | alpha-*-linux2) |
bdf5e183 AP |
435 | ISA=`awk '/cpu model/{print$4}' /proc/cpuinfo` |
436 | case ${ISA:-generic} in | |
437 | *[67]) OUT="linux-alpha+bwx-$CC" ;; | |
438 | *) OUT="linux-alpha-$CC" ;; | |
439 | esac | |
440 | if [ "$CC" = "gcc" ]; then | |
441 | case ${ISA:-generic} in | |
442 | EV5|EV45) options="$options -mcpu=ev5";; | |
443 | EV56|PCA56) options="$options -mcpu=ev56";; | |
444 | EV6|EV67|PCA57) options="$options -mcpu=ev6";; | |
445 | esac | |
446 | fi | |
447 | ;; | |
815c83f7 RL |
448 | mips-*-linux?) |
449 | cat >dummy.c <<EOF | |
450 | #include <stdio.h> /* for printf() prototype */ | |
451 | int main (argc, argv) int argc; char *argv[]; { | |
452 | #ifdef __MIPSEB__ | |
453 | printf ("linux-%s\n", argv[1]); | |
454 | #endif | |
455 | #ifdef __MIPSEL__ | |
456 | printf ("linux-%sel\n", argv[1]); | |
457 | #endif | |
458 | return 0; | |
459 | } | |
460 | EOF | |
461 | ${CC} -o dummy dummy.c && OUT=`./dummy ${MACHINE}` | |
462 | rm dummy dummy.c | |
463 | ;; | |
bdf5e183 | 464 | ppc-*-linux2) OUT="linux-ppc" ;; |
2933ed4d | 465 | m68k-*-linux*) OUT="linux-m68k" ;; |
010712ff | 466 | ia64-*-linux?) OUT="linux-ia64" ;; |
0fad6cb7 | 467 | ppc-apple-rhapsody) OUT="rhapsody-ppc-cc" ;; |
70d70a3c RL |
468 | ppc-apple-darwin*) OUT="darwin-ppc-cc" ;; |
469 | i386-apple-darwin*) OUT="darwin-i386-cc" ;; | |
a0618e3e | 470 | sparc64-*-linux2) |
1656ef29 AP |
471 | #Before we can uncomment following lines we have to wait at least |
472 | #till 64-bit glibc for SPARC is operational:-( | |
473 | #echo "WARNING! If you wish to build 64-bit library, then you have to" | |
a0618e3e | 474 | #echo " invoke './Configure linux64-sparcv9' *manually*." |
69e42952 | 475 | #echo " Type return if you want to continue, Ctrl-C to abort." |
a0618e3e AP |
476 | #read waste < /dev/tty |
477 | OUT="linux-sparcv9" ;; | |
da8fa72f | 478 | sparc-*-linux2) |
d5695a26 | 479 | KARCH=`awk '/^type/{print$3}' /proc/cpuinfo` |
a0618e3e AP |
480 | case ${KARCH:-sun4} in |
481 | sun4u*) OUT="linux-sparcv9" ;; | |
482 | sun4m) OUT="linux-sparcv8" ;; | |
483 | sun4d) OUT="linux-sparcv8" ;; | |
484 | *) OUT="linux-sparcv7" ;; | |
485 | esac ;; | |
b1086116 | 486 | arm*-*-linux2) OUT="linux-elf-arm" ;; |
49ce63cd | 487 | s390-*-linux2) OUT="linux-s390" ;; |
58964a49 | 488 | *-*-linux2) OUT="linux-elf" ;; |
dabba110 | 489 | *-*-linux1) OUT="linux-aout" ;; |
7228920c | 490 | sun4u*-*-solaris2) |
1656ef29 AP |
491 | ISA64=`(isalist) 2>/dev/null | grep sparcv9` |
492 | if [ "$ISA64" != "" -a "$CC" = "cc" -a $CCVER -ge 50 ]; then | |
493 | echo "WARNING! If you wish to build 64-bit library, then you have to" | |
494 | echo " invoke './Configure solaris64-sparcv9-cc' *manually*." | |
69e42952 | 495 | echo " Type return if you want to continue, Ctrl-C to abort." |
06a2b07b UM |
496 | if [ "$TEST" = "false" ]; then |
497 | read waste < /dev/tty | |
498 | fi | |
1656ef29 AP |
499 | fi |
500 | OUT="solaris-sparcv9-$CC" ;; | |
7228920c BM |
501 | sun4m-*-solaris2) OUT="solaris-sparcv8-$CC" ;; |
502 | sun4d-*-solaris2) OUT="solaris-sparcv8-$CC" ;; | |
503 | sun4*-*-solaris2) OUT="solaris-sparcv7-$CC" ;; | |
504 | *86*-*-solaris2) OUT="solaris-x86-$CC" ;; | |
58964a49 | 505 | *-*-sunos4) OUT="sunos-$CC" ;; |
44717474 RE |
506 | alpha*-*-freebsd*) OUT="FreeBSD-alpha" ;; |
507 | *-freebsd[3-9]*) OUT="FreeBSD-elf" ;; | |
508 | *-freebsd[1-2]*) OUT="FreeBSD" ;; | |
58964a49 RE |
509 | *86*-*-netbsd) OUT="NetBSD-x86" ;; |
510 | sun3*-*-netbsd) OUT="NetBSD-m68" ;; | |
511 | *-*-netbsd) OUT="NetBSD-sparc" ;; | |
dfeab068 RE |
512 | *86*-*-openbsd) OUT="OpenBSD-x86" ;; |
513 | alpha*-*-openbsd) OUT="OpenBSD-alpha" ;; | |
514 | pmax*-*-openbsd) OUT="OpenBSD-mips" ;; | |
515 | *-*-openbsd) OUT="OpenBSD" ;; | |
0cceb1c7 | 516 | *86*-*-bsdi4) OUT="bsdi-elf-gcc" ;; |
dfeab068 | 517 | *-*-osf) OUT="alpha-cc" ;; |
9a5a7401 RL |
518 | *-*-unixware7) OUT="unixware-7" ;; |
519 | *-*-UnixWare7) OUT="unixware-7" ;; | |
520 | *-*-Unixware7) OUT="unixware-7" ;; | |
521 | *-*-unixware[1-2]*) OUT="unixware-2.0" ;; | |
522 | *-*-UnixWare[1-2]*) OUT="unixware-2.0" ;; | |
523 | *-*-Unixware[1-2]*) OUT="unixware-2.0" ;; | |
9231f477 | 524 | BS2000-siemens-sysv4) OUT="BS2000-OSD" ;; |
1fac96e4 UM |
525 | RM*-siemens-sysv4) OUT="ReliantUNIX" ;; |
526 | *-siemens-sysv4) OUT="SINIX" ;; | |
bcba6cc6 AP |
527 | *-hpux1*) OUT="hpux-parisc-$CC" |
528 | options="$options -D_REENTRANT" ;; | |
529 | *-hpux) OUT="hpux-parisc-$CC" ;; | |
58964a49 | 530 | # these are all covered by the catchall below |
58964a49 RE |
531 | # *-aix) OUT="aix-$CC" ;; |
532 | # *-dgux) OUT="dgux" ;; | |
72660f5f | 533 | mips-sony-newsos4) OUT="newsos4-gcc" ;; |
58964a49 | 534 | *) OUT=`echo $GUESSOS | awk -F- '{print $3}'`;; |
5d3bb220 UM |
535 | esac |
536 | ||
5270e702 RL |
537 | # NB: This atalla support has been superceded by the ENGINE support |
538 | # That contains its own header and definitions anyway. Support can | |
539 | # be enabled or disabled on any supported platform without external | |
540 | # headers, eg. by adding the "hw-atalla" switch to ./config or | |
541 | # perl Configure | |
542 | # | |
bd03b99b | 543 | # See whether we can compile Atalla support |
5270e702 RL |
544 | #if [ -f /usr/include/atasi.h ] |
545 | #then | |
546 | # options="$options -DATALLA" | |
547 | #fi | |
bd03b99b | 548 | |
b6735832 | 549 | # gcc < 2.8 does not support -mcpu=ultrasparc |
1656ef29 | 550 | if [ "$OUT" = solaris-sparcv9-gcc -a $GCCVER -lt 28 ] |
b6735832 | 551 | then |
a0618e3e | 552 | echo "WARNING! Do consider upgrading to gcc-2.8 or later." |
1656ef29 AP |
553 | sleep 5 |
554 | OUT=solaris-sparcv9-gcc27 | |
a0618e3e AP |
555 | fi |
556 | if [ "$OUT" = "linux-sparcv9" -a $GCCVER -lt 28 ] | |
557 | then | |
558 | echo "WARNING! Falling down to 'linux-sparcv8'." | |
559 | echo " Upgrade to gcc-2.8 or later." | |
1656ef29 | 560 | sleep 5 |
a0618e3e | 561 | OUT=linux-sparcv8 |
b6735832 UM |
562 | fi |
563 | ||
5d3bb220 UM |
564 | case "$GUESSOS" in |
565 | i386-*) options="$options 386" ;; | |
58964a49 RE |
566 | esac |
567 | ||
bb62a8b0 | 568 | for i in bf cast des dh dsa ec hmac md2 md5 mdc2 rc2 rc4 rc5 ripemd rsa sha |
9231f477 UM |
569 | do |
570 | if [ ! -d crypto/$i ] | |
571 | then | |
572 | options="$options no-$i" | |
573 | fi | |
574 | done | |
575 | ||
f9b3bff6 RL |
576 | # Discover Kerberos 5 (since it's still a prototype, we don't |
577 | # do any guesses yet, that's why this section is commented away. | |
578 | #if [ -d /usr/kerberos ]; then | |
579 | # krb5_dir=/usr/kerberos | |
580 | # if [ \( -f $krb5_dir/lib/libgssapi_krb5.a -o -f $krb5_dir/lib/libgssapi_krb5.so* \)\ | |
581 | # -a \( -f $krb5_dir/lib/libkrb5.a -o -f $krb5_dir/lib/libkrb5.so* \)\ | |
582 | # -a \( -f $krb5_dir/lib/libcom_err.a -o -f $krb5_dir/lib/libcom_err.so* \)\ | |
583 | # -a \( -f $krb5_dir/lib/libk5crypto.a -o -f $krb5_dir/lib/libk5crypto.so* \)\ | |
584 | # -a \( -f $krb5_dir/include/krb5.h \) ]; then | |
585 | # options="$options --with-krb5-flavor=MIT" | |
586 | # fi | |
587 | #elif [ -d /usr/heimdal ]; then | |
588 | # krb5_dir=/usr/heimdal | |
589 | # if [ \( -f $krb5_dir/lib/libgssapi.a -o -f $krb5_dir/lib/libgssapi.so* \)\ | |
590 | # -a \( -f $krb5_dir/lib/libkrb5.a -o -f $krb5_dir/lib/libkrb5.so* \)\ | |
591 | # -a \( -f $krb5_dir/lib/libcom_err.a -o -f $krb5_dir/lib/libcom_err.so* \)\ | |
592 | # -a \( -f $krb5_dir/include/krb5.h \) ]; then | |
593 | # options="$options --with-krb5-flavor=Heimdal" | |
594 | # fi | |
595 | #fi | |
596 | ||
58964a49 RE |
597 | if [ -z "$OUT" ]; then |
598 | OUT="$CC" | |
599 | fi | |
600 | ||
99aab161 UM |
601 | if [ ".$PERL" = . ] ; then |
602 | for i in . `echo $PATH | sed 's/:/ /g'`; do | |
603 | if [ -f "$i/perl5" ] ; then | |
604 | PERL="$i/perl5" | |
605 | break; | |
606 | fi; | |
607 | done | |
608 | fi | |
609 | ||
610 | if [ ".$PERL" = . ] ; then | |
611 | for i in . `echo $PATH | sed 's/:/ /g'`; do | |
612 | if [ -f "$i/perl" ] ; then | |
a5a47e4a UM |
613 | if "$i/perl" -e 'exit($]<5.0)'; then |
614 | PERL="$i/perl" | |
615 | break; | |
616 | fi; | |
99aab161 UM |
617 | fi; |
618 | done | |
619 | fi | |
620 | ||
a5a47e4a | 621 | if [ ".$PERL" = . ] ; then |
99aab161 UM |
622 | echo "You need Perl 5." |
623 | exit 1 | |
624 | fi | |
625 | ||
58964a49 RE |
626 | # run Configure to check to see if we need to specify the |
627 | # compiler for the platform ... in which case we add it on | |
628 | # the end ... otherwise we leave it off | |
99aab161 | 629 | |
10a926c1 | 630 | $PERL ./Configure LIST | grep "$OUT-$CC" > /dev/null |
58964a49 RE |
631 | if [ $? = "0" ]; then |
632 | OUT="$OUT-$CC" | |
633 | fi | |
634 | ||
635 | OUT="$PREFIX$OUT" | |
636 | ||
10a926c1 | 637 | $PERL ./Configure LIST | grep "$OUT" > /dev/null |
b1fe6b43 | 638 | if [ $? = "0" ]; then |
9e2c0f41 | 639 | echo Configuring for $OUT |
58964a49 | 640 | |
b1fe6b43 UM |
641 | if [ "$TEST" = "true" ]; then |
642 | echo $PERL ./Configure $OUT $options | |
643 | else | |
644 | $PERL ./Configure $OUT $options | |
645 | fi | |
58964a49 | 646 | else |
744029c1 | 647 | echo "This system ($OUT) is not supported. See file INSTALL for details." |
58964a49 | 648 | fi |
58964a49 | 649 | ) |