config 20 KB

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