config 19 KB

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