config 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848
  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 "$RELEASE" in
  217. 4*)
  218. echo "${MACHINE}-whatever-qnx4"
  219. ;;
  220. 6*)
  221. echo "${MACHINE}-whatever-qnx6"
  222. ;;
  223. *)
  224. echo "${MACHINE}-whatever-qnx"
  225. ;;
  226. esac
  227. exit 0
  228. ;;
  229. Paragon*:*:*:*)
  230. echo "i860-intel-osf1"; exit 0
  231. ;;
  232. Rhapsody:*)
  233. echo "ppc-apple-rhapsody"; exit 0
  234. ;;
  235. Darwin:*)
  236. case "$MACHINE" in
  237. Power*)
  238. echo "ppc-apple-darwin${VERSION}"
  239. ;;
  240. *)
  241. echo "i386-apple-darwin${VERSION}"
  242. ;;
  243. esac
  244. exit 0
  245. ;;
  246. SunOS:5.*)
  247. echo "${MACHINE}-whatever-solaris2"; exit 0
  248. ;;
  249. SunOS:*)
  250. echo "${MACHINE}-sun-sunos4"; exit 0
  251. ;;
  252. UNIX_System_V:4.*:*)
  253. echo "${MACHINE}-whatever-sysv4"; exit 0
  254. ;;
  255. *:4*:R4*:m88k)
  256. echo "${MACHINE}-whatever-sysv4"; exit 0
  257. ;;
  258. DYNIX/ptx:4*:*)
  259. echo "${MACHINE}-whatever-sysv4"; exit 0
  260. ;;
  261. *:4.0:3.0:3[34]?? | *:4.0:3.0:3[34]??,*)
  262. echo "i486-ncr-sysv4"; exit 0
  263. ;;
  264. ULTRIX:*)
  265. echo "${MACHINE}-unknown-ultrix"; exit 0
  266. ;;
  267. SINIX*|ReliantUNIX*)
  268. echo "${MACHINE}-siemens-sysv4"; exit 0
  269. ;;
  270. POSIX-BC*)
  271. echo "${MACHINE}-siemens-sysv4"; exit 0 # Here, $MACHINE == "BS2000"
  272. ;;
  273. machten:*)
  274. echo "${MACHINE}-tenon-${SYSTEM}"; exit 0;
  275. ;;
  276. library:*)
  277. echo "${MACHINE}-ncr-sysv4"; exit 0
  278. ;;
  279. ConvexOS:*:11.0:*)
  280. echo "${MACHINE}-v11-${SYSTEM}"; exit 0;
  281. ;;
  282. NEWS-OS:4.*)
  283. echo "mips-sony-newsos4"; exit 0;
  284. ;;
  285. CYGWIN*)
  286. case "$RELEASE" in
  287. [bB]*|1.0|1.[12].*)
  288. echo "${MACHINE}-whatever-cygwin_pre1.3"
  289. ;;
  290. *)
  291. echo "${MACHINE}-whatever-cygwin"
  292. ;;
  293. esac
  294. exit 0
  295. ;;
  296. *"CRAY T3E")
  297. echo "t3e-cray-unicosmk"; exit 0;
  298. ;;
  299. *CRAY*)
  300. echo "j90-cray-unicos"; exit 0;
  301. ;;
  302. NONSTOP_KERNEL*)
  303. echo "nsr-tandem-nsk"; exit 0;
  304. ;;
  305. esac
  306. #
  307. # Ugg. These are all we can determine by what we know about
  308. # the output of uname. Be more creative:
  309. #
  310. # Do the Apollo stuff first. Here, we just simply assume
  311. # that the existance of the /usr/apollo directory is proof
  312. # enough
  313. if [ -d /usr/apollo ]; then
  314. echo "whatever-apollo-whatever"
  315. exit 0
  316. fi
  317. # Now NeXT
  318. ISNEXT=`hostinfo 2>/dev/null`
  319. case "$ISNEXT" in
  320. *'NeXT Mach 3.3'*)
  321. echo "whatever-next-nextstep3.3"; exit 0
  322. ;;
  323. *NeXT*)
  324. echo "whatever-next-nextstep"; exit 0
  325. ;;
  326. esac
  327. # At this point we gone through all the one's
  328. # we know of: Punt
  329. echo "${MACHINE}-whatever-${SYSTEM}"
  330. exit 0
  331. ) 2>/dev/null | (
  332. # ---------------------------------------------------------------------------
  333. # this is where the translation occurs into SSLeay terms
  334. # ---------------------------------------------------------------------------
  335. # figure out if gcc is available and if so we use it otherwise
  336. # we fallback to whatever cc does on the system
  337. GCCVER=`(gcc -dumpversion) 2>/dev/null`
  338. if [ "$GCCVER" != "" ]; then
  339. CC=gcc
  340. # then strip off whatever prefix egcs prepends the number with...
  341. # Hopefully, this will work for any future prefixes as well.
  342. GCCVER=`echo $GCCVER | sed 's/^[a-zA-Z]*\-//'`
  343. # Since gcc 3.1 gcc --version behaviour has changed. gcc -dumpversion
  344. # does give us what we want though, so we use that. We just just the
  345. # major and minor version numbers.
  346. # peak single digit before and after first dot, e.g. 2.95.1 gives 29
  347. GCCVER=`echo $GCCVER | sed 's/\([0-9]\)\.\([0-9]\).*/\1\2/'`
  348. else
  349. CC=cc
  350. fi
  351. GCCVER=${GCCVER:-0}
  352. if [ "$SYSTEM" = "HP-UX" ];then
  353. # By default gcc is a ILP32 compiler (with long long == 64).
  354. GCC_BITS="32"
  355. if [ $GCCVER -ge 30 ]; then
  356. # PA64 support only came in with gcc 3.0.x.
  357. # We look for the preprocessor symbol __LP64__ indicating
  358. # 64bit bit long and pointer. sizeof(int) == 32 on HPUX64.
  359. if gcc -v -E -x c /dev/null 2>&1 | grep __LP64__ > /dev/null; then
  360. GCC_BITS="64"
  361. fi
  362. fi
  363. fi
  364. if [ "$SYSTEM" = "SunOS" ]; then
  365. if [ $GCCVER -ge 30 ]; then
  366. # 64-bit ABI isn't officially supported in gcc 3.0, but it appears
  367. # to be working, at the very least 'make test' passes...
  368. if gcc -v -E -x c /dev/null 2>&1 | grep __arch64__ > /dev/null; then
  369. GCC_ARCH="-m64"
  370. else
  371. GCC_ARCH="-m32"
  372. fi
  373. fi
  374. # check for WorkShop C, expected output is "cc: blah-blah C x.x"
  375. CCVER=`(cc -V 2>&1) 2>/dev/null | \
  376. egrep -e '^cc: .* C [0-9]\.[0-9]' | \
  377. sed 's/.* C \([0-9]\)\.\([0-9]\).*/\1\2/'`
  378. CCVER=${CCVER:-0}
  379. if [ $CCVER -gt 40 ]; then
  380. CC=cc # overrides gcc!!!
  381. if [ $CCVER -eq 50 ]; then
  382. echo "WARNING! Detected WorkShop C 5.0. Do make sure you have"
  383. echo " patch #107357-01 or later applied."
  384. sleep 5
  385. fi
  386. elif [ "$CC" = "cc" -a $CCVER -gt 0 ]; then
  387. CC=sc3
  388. fi
  389. fi
  390. if [ "${SYSTEM}-${MACHINE}" = "Linux-alpha" ]; then
  391. # check for Compaq C, expected output is "blah-blah C Vx.x"
  392. CCCVER=`(ccc -V 2>&1) 2>/dev/null | \
  393. egrep -e '.* C V[0-9]\.[0-9]' | \
  394. sed 's/.* C V\([0-9]\)\.\([0-9]\).*/\1\2/'`
  395. CCCVER=${CCCVER:-0}
  396. if [ $CCCVER -gt 60 ]; then
  397. CC=ccc # overrides gcc!!! well, ccc outperforms inoticeably
  398. # only on hash routines and des, otherwise gcc (2.95)
  399. # keeps along rather tight...
  400. fi
  401. fi
  402. CCVER=${CCVER:-0}
  403. # read the output of the embedded GuessOS
  404. read GUESSOS
  405. echo Operating system: $GUESSOS
  406. # now map the output into SSLeay terms ... really should hack into the
  407. # script above so we end up with values in vars but that would take
  408. # more time that I want to waste at the moment
  409. case "$GUESSOS" in
  410. mips2-sgi-irix)
  411. CPU=`(hinv -t cpu) 2>/dev/null | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'`
  412. CPU=${CPU:-0}
  413. if [ $CPU -ge 4000 ]; then
  414. options="$options -mips2"
  415. fi
  416. OUT="irix-$CC"
  417. ;;
  418. mips3-sgi-irix)
  419. CPU=`(hinv -t cpu) 2>/dev/null | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'`
  420. CPU=${CPU:-0}
  421. if [ $CPU -ge 5000 ]; then
  422. options="$options -mips4"
  423. else
  424. options="$options -mips3"
  425. fi
  426. OUT="irix-mips3-$CC"
  427. ;;
  428. mips4-sgi-irix64)
  429. echo "WARNING! If you wish to build 64-bit library, then you have to"
  430. echo " invoke './Configure irix64-mips4-$CC' *manually*."
  431. if [ "$TEST" = "false" ]; then
  432. echo " You have about 5 seconds to press Ctrl-C to abort."
  433. (stty -icanon min 0 time 50; read waste) < /dev/tty
  434. fi
  435. CPU=`(hinv -t cpu) 2>/dev/null | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'`
  436. CPU=${CPU:-0}
  437. if [ $CPU -ge 5000 ]; then
  438. options="$options -mips4"
  439. else
  440. options="$options -mips3"
  441. fi
  442. OUT="irix-mips3-$CC"
  443. ;;
  444. alpha-*-linux2)
  445. ISA=`awk '/cpu model/{print$4}' /proc/cpuinfo`
  446. case ${ISA:-generic} in
  447. *[67]) OUT="linux-alpha+bwx-$CC" ;;
  448. *) OUT="linux-alpha-$CC" ;;
  449. esac
  450. if [ "$CC" = "gcc" ]; then
  451. case ${ISA:-generic} in
  452. EV5|EV45) options="$options -mcpu=ev5";;
  453. EV56|PCA56) options="$options -mcpu=ev56";;
  454. EV6|EV67|PCA57) options="$options -mcpu=ev6";;
  455. esac
  456. fi
  457. ;;
  458. mips-*-linux?)
  459. cat >dummy.c <<EOF
  460. #include <stdio.h> /* for printf() prototype */
  461. int main (argc, argv) int argc; char *argv[]; {
  462. #ifdef __MIPSEB__
  463. printf ("linux-%s\n", argv[1]);
  464. #endif
  465. #ifdef __MIPSEL__
  466. printf ("linux-%sel\n", argv[1]);
  467. #endif
  468. return 0;
  469. }
  470. EOF
  471. ${CC} -o dummy dummy.c && OUT=`./dummy ${MACHINE}`
  472. rm dummy dummy.c
  473. ;;
  474. ppc64-*-linux2)
  475. #Use the standard target for PPC architecture until we create a
  476. #special one for the 64bit architecture.
  477. OUT="linux-ppc" ;;
  478. ppc-*-linux2) OUT="linux-ppc" ;;
  479. m68k-*-linux*) OUT="linux-m68k" ;;
  480. ia64-*-linux?) OUT="linux-ia64" ;;
  481. ppc-apple-rhapsody) OUT="rhapsody-ppc-cc" ;;
  482. ppc-apple-darwin*) OUT="darwin-ppc-cc" ;;
  483. i386-apple-darwin*) OUT="darwin-i386-cc" ;;
  484. sparc64-*-linux2)
  485. #Before we can uncomment following lines we have to wait at least
  486. #till 64-bit glibc for SPARC is operational:-(
  487. #echo "WARNING! If you wish to build 64-bit library, then you have to"
  488. #echo " invoke './Configure linux64-sparcv9' *manually*."
  489. #echo " Type return if you want to continue, Ctrl-C to abort."
  490. #read waste < /dev/tty
  491. OUT="linux-sparcv9" ;;
  492. sparc-*-linux2)
  493. KARCH=`awk '/^type/{print$3}' /proc/cpuinfo`
  494. case ${KARCH:-sun4} in
  495. sun4u*) OUT="linux-sparcv9" ;;
  496. sun4m) OUT="linux-sparcv8" ;;
  497. sun4d) OUT="linux-sparcv8" ;;
  498. *) OUT="linux-sparcv7" ;;
  499. esac ;;
  500. parisc-*-linux2)
  501. CPUARCH=`awk '/cpu family/{print substr($5,1,3)}' /proc/cpuinfo`
  502. CPUSCHEDULE=`awk '/^cpu.[ ]: PA/{print substr($3,3)}' /proc/cpuinfo`
  503. # ??TODO ?? Model transformations
  504. # 0. CPU Architecture for the 1.1 processor has letter suffixes. We strip that off
  505. # assuming no further arch. identification will ever be used by GCC.
  506. # 1. I'm most concerned about whether is a 7300LC is closer to a 7100 versus a 7100LC.
  507. # 2. The variant 64-bit processors cause concern should GCC support explicit schedulers
  508. # for these chips in the future.
  509. # PA7300LC -> 7100LC (1.1)
  510. # PA8200 -> 8000 (2.0)
  511. # PA8500 -> 8000 (2.0)
  512. # PA8600 -> 8000 (2.0)
  513. CPUSCHEDULE=`echo $CPUSCHEDULE|sed -e 's/7300LC/7100LC/' -e 's/8?00/8000/'`
  514. # Finish Model transformations
  515. options="$options -mschedule=$CPUSCHEDULE -march=$CPUARCH"
  516. OUT="linux-parisc" ;;
  517. arm*-*-linux2) OUT="linux-elf-arm" ;;
  518. s390-*-linux2) OUT="linux-s390" ;;
  519. s390x-*-linux?) OUT="linux-s390x" ;;
  520. *-*-linux2) OUT="linux-elf"
  521. if [ "$GCCVER" -gt 28 ]; then
  522. if grep '^model.*Pentium' /proc/cpuinfo >/dev/null ; then
  523. OUT="linux-pentium"
  524. fi
  525. if grep '^model.*Pentium Pro' /proc/cpuinfo >/dev/null ; then
  526. OUT="linux-ppro"
  527. fi
  528. if grep '^model.*K6' /proc/cpuinfo >/dev/null ; then
  529. OUT="linux-k6"
  530. fi
  531. fi ;;
  532. *-*-linux1) OUT="linux-aout" ;;
  533. sun4u*-*-solaris2)
  534. OUT="solaris-sparcv9-$CC"
  535. ISA64=`(isalist) 2>/dev/null | grep sparcv9`
  536. if [ "$ISA64" != "" ]; then
  537. if [ "$CC" = "cc" -a $CCVER -ge 50 ]; then
  538. echo "WARNING! If you wish to build 64-bit library, then you have to"
  539. echo " invoke './Configure solaris64-sparcv9-cc' *manually*."
  540. if [ "$TEST" = "false" ]; then
  541. echo " You have about 5 seconds to press Ctrl-C to abort."
  542. (stty -icanon min 0 time 50; read waste) < /dev/tty
  543. fi
  544. elif [ "$CC" = "gcc" -a "$GCC_ARCH" = "-m64" ]; then
  545. # $GCC_ARCH denotes default ABI chosen by compiler driver
  546. # (first one found on the $PATH). I assume that user
  547. # expects certain consistency with the rest of his builds
  548. # and therefore switch over to 64-bit. <appro>
  549. OUT="solaris64-sparcv9-gcc"
  550. echo "WARNING! If you wish to build 32-bit library, then you have to"
  551. echo " invoke './Configure solaris-sparcv9-gcc' *manually*."
  552. if [ "$TEST" = "false" ]; then
  553. echo " You have about 5 seconds to press Ctrl-C to abort."
  554. (stty -icanon min 0 time 50; read waste) < /dev/tty
  555. fi
  556. elif [ "$GCC_ARCH" = "-m32" ]; then
  557. echo "NOTICE! If you *know* that your GNU C supports 64-bit/V9 ABI"
  558. echo " and wish to build 64-bit library, then you have to"
  559. echo " invoke './Configure solaris64-sparcv9-gcc' *manually*."
  560. if [ "$TEST" = "false" ]; then
  561. echo " You have about 5 seconds to press Ctrl-C to abort."
  562. (stty -icanon min 0 time 50; read waste) < /dev/tty
  563. fi
  564. fi
  565. fi
  566. ;;
  567. sun4m-*-solaris2) OUT="solaris-sparcv8-$CC" ;;
  568. sun4d-*-solaris2) OUT="solaris-sparcv8-$CC" ;;
  569. sun4*-*-solaris2) OUT="solaris-sparcv7-$CC" ;;
  570. *86*-*-solaris2) OUT="solaris-x86-$CC" ;;
  571. *-*-sunos4) OUT="sunos-$CC" ;;
  572. alpha*-*-freebsd*) OUT="FreeBSD-alpha" ;;
  573. *-freebsd[3-9]*) OUT="FreeBSD-elf" ;;
  574. *-freebsd[1-2]*) OUT="FreeBSD" ;;
  575. *86*-*-netbsd) OUT="NetBSD-x86" ;;
  576. sun3*-*-netbsd) OUT="NetBSD-m68" ;;
  577. *-*-netbsd) OUT="NetBSD-sparc" ;;
  578. alpha*-*-openbsd) OUT="OpenBSD-alpha" ;;
  579. *86*-*-openbsd) OUT="OpenBSD-i386" ;;
  580. m68k*-*-openbsd) OUT="OpenBSD-m68k" ;;
  581. m88k*-*-openbsd) OUT="OpenBSD-m88k" ;;
  582. mips*-*-openbsd) OUT="OpenBSD-mips" ;;
  583. pmax*-*-openbsd) OUT="OpenBSD-mips" ;;
  584. powerpc*-*-openbsd) OUT="OpenBSD-powerpc" ;;
  585. sparc64*-*-openbsd) OUT="OpenBSD-sparc64" ;;
  586. sparc*-*-openbsd) OUT="OpenBSD-sparc" ;;
  587. vax*-*-openbsd) OUT="OpenBSD-vax" ;;
  588. hppa*-*-openbsd) OUT="OpenBSD-hppa" ;;
  589. *-*-openbsd) OUT="OpenBSD" ;;
  590. *86*-*-bsdi4) OUT="bsdi-elf-gcc" ;;
  591. *-*-osf) OUT="alphaold-cc" ;;
  592. *-*-tru64) OUT="alpha-cc" ;;
  593. *-*-OpenUNIX*)
  594. if [ "$CC" = "gcc" ]; then
  595. OUT="OpenUNIX-8-gcc"
  596. else
  597. OUT="OpenUNIX-8"
  598. fi
  599. ;;
  600. *-*-unixware7) OUT="unixware-7" ;;
  601. *-*-UnixWare7) OUT="unixware-7" ;;
  602. *-*-Unixware7) OUT="unixware-7" ;;
  603. *-*-unixware20*) OUT="unixware-2.0" ;;
  604. *-*-unixware21*) OUT="unixware-2.1" ;;
  605. *-*-UnixWare20*) OUT="unixware-2.0" ;;
  606. *-*-UnixWare21*) OUT="unixware-2.1" ;;
  607. *-*-Unixware20*) OUT="unixware-2.0" ;;
  608. *-*-Unixware21*) OUT="unixware-2.1" ;;
  609. BS2000-siemens-sysv4) OUT="BS2000-OSD" ;;
  610. RM*-siemens-sysv4) OUT="ReliantUNIX" ;;
  611. *-siemens-sysv4) OUT="SINIX" ;;
  612. *-hpux1*)
  613. if [ $CC = "gcc" ];
  614. then
  615. if [ $GCC_BITS = "64" ]; then
  616. OUT="hpux64-parisc-gcc"
  617. else
  618. OUT="hpux-parisc-gcc"
  619. fi
  620. else
  621. OUT="hpux-parisc-$CC"
  622. fi
  623. KERNEL_BITS=`(getconf KERNEL_BITS) 2>/dev/null`
  624. KERNEL_BITS=${KERNEL_BITS:-32}
  625. CPU_VERSION=`(getconf CPU_VERSION) 2>/dev/null`
  626. CPU_VERSION=${CPU_VERSION:-0}
  627. # See <sys/unistd.h> for further info on CPU_VERSION.
  628. if [ $CPU_VERSION -ge 768 ]; then # IA-64 CPU
  629. echo "NOTICE! 64-bit is the only ABI currently operational on HP-UXi."
  630. echo " Post request to openssl-dev@openssl.org for 32-bit support."
  631. if [ "$TEST" = "false" ]; then
  632. (stty -icanon min 0 time 50; read waste) < /dev/tty
  633. fi
  634. OUT="hpux64-ia64-cc"
  635. elif [ $CPU_VERSION -ge 532 ]; then # PA-RISC 2.x CPU
  636. if [ "$CC" = "cc" ]; then
  637. OUT="hpux-parisc2-cc" # can't we have hpux-parisc2-gcc?
  638. fi
  639. if [ $KERNEL_BITS -eq 64 -a "$CC" = "cc" ]; then
  640. echo "WARNING! If you wish to build 64-bit library then you have to"
  641. echo " invoke './Configure hpux64-parisc2-cc' *manually*."
  642. if [ "$TEST" = "false" ]; then
  643. echo " You have about 5 seconds to press Ctrl-C to abort."
  644. (stty -icanon min 0 time 50; read waste) < /dev/tty
  645. fi
  646. fi
  647. elif [ $CPU_VERSION -ge 528 ]; then # PA-RISC 1.1+ CPU
  648. :
  649. elif [ $CPU_VERSION -ge 523 ]; then # PA-RISC 1.0 CPU
  650. :
  651. else # Motorola(?) CPU
  652. OUT="hpux-$CC"
  653. fi
  654. options="$options -D_REENTRANT" ;;
  655. *-hpux) OUT="hpux-parisc-$CC" ;;
  656. # these are all covered by the catchall below
  657. # *-aix) OUT="aix-$CC" ;;
  658. # *-dgux) OUT="dgux" ;;
  659. mips-sony-newsos4) OUT="newsos4-gcc" ;;
  660. *-*-cygwin_pre1.3) OUT="Cygwin-pre1.3" ;;
  661. *-*-cygwin) OUT="Cygwin" ;;
  662. t3e-cray-unicosmk) OUT="cray-t3e" ;;
  663. j90-cray-unicos) OUT="cray-j90" ;;
  664. nsr-tandem-nsk) OUT="tandem-c89" ;;
  665. *) OUT=`echo $GUESSOS | awk -F- '{print $3}'`;;
  666. esac
  667. # NB: This atalla support has been superceded by the ENGINE support
  668. # That contains its own header and definitions anyway. Support can
  669. # be enabled or disabled on any supported platform without external
  670. # headers, eg. by adding the "hw-atalla" switch to ./config or
  671. # perl Configure
  672. #
  673. # See whether we can compile Atalla support
  674. #if [ -f /usr/include/atasi.h ]
  675. #then
  676. # options="$options -DATALLA"
  677. #fi
  678. # gcc < 2.8 does not support -mcpu=ultrasparc
  679. if [ "$OUT" = solaris-sparcv9-gcc -a $GCCVER -lt 28 ]
  680. then
  681. echo "WARNING! Do consider upgrading to gcc-2.8 or later."
  682. sleep 5
  683. OUT=solaris-sparcv9-gcc27
  684. fi
  685. if [ "$OUT" = "linux-sparcv9" -a $GCCVER -lt 28 ]
  686. then
  687. echo "WARNING! Falling down to 'linux-sparcv8'."
  688. echo " Upgrade to gcc-2.8 or later."
  689. sleep 5
  690. OUT=linux-sparcv8
  691. fi
  692. case "$GUESSOS" in
  693. i386-*) options="$options 386" ;;
  694. esac
  695. for i in bf cast des dh dsa ec hmac idea md2 md5 mdc2 rc2 rc4 rc5 aes ripemd rsa sha
  696. do
  697. if [ ! -d crypto/$i ]
  698. then
  699. options="$options no-$i"
  700. fi
  701. done
  702. # Discover Kerberos 5 (since it's still a prototype, we don't
  703. # do any guesses yet, that's why this section is commented away.
  704. #if [ -d /usr/kerberos ]; then
  705. # krb5_dir=/usr/kerberos
  706. # if [ \( -f $krb5_dir/lib/libgssapi_krb5.a -o -f $krb5_dir/lib/libgssapi_krb5.so* \)\
  707. # -a \( -f $krb5_dir/lib/libkrb5.a -o -f $krb5_dir/lib/libkrb5.so* \)\
  708. # -a \( -f $krb5_dir/lib/libcom_err.a -o -f $krb5_dir/lib/libcom_err.so* \)\
  709. # -a \( -f $krb5_dir/lib/libk5crypto.a -o -f $krb5_dir/lib/libk5crypto.so* \)\
  710. # -a \( -f $krb5_dir/include/krb5.h \) ]; then
  711. # options="$options --with-krb5-flavor=MIT"
  712. # fi
  713. #elif [ -d /usr/heimdal ]; then
  714. # krb5_dir=/usr/heimdal
  715. # if [ \( -f $krb5_dir/lib/libgssapi.a -o -f $krb5_dir/lib/libgssapi.so* \)\
  716. # -a \( -f $krb5_dir/lib/libkrb5.a -o -f $krb5_dir/lib/libkrb5.so* \)\
  717. # -a \( -f $krb5_dir/lib/libcom_err.a -o -f $krb5_dir/lib/libcom_err.so* \)\
  718. # -a \( -f $krb5_dir/include/krb5.h \) ]; then
  719. # options="$options --with-krb5-flavor=Heimdal"
  720. # fi
  721. #fi
  722. if [ -z "$OUT" ]; then
  723. OUT="$CC"
  724. fi
  725. if [ ".$PERL" = . ] ; then
  726. for i in . `echo $PATH | sed 's/:/ /g'`; do
  727. if [ -f "$i/perl5" ] ; then
  728. PERL="$i/perl5"
  729. break;
  730. fi;
  731. done
  732. fi
  733. if [ ".$PERL" = . ] ; then
  734. for i in . `echo $PATH | sed 's/:/ /g'`; do
  735. if [ -f "$i/perl" ] ; then
  736. if "$i/perl" -e 'exit($]<5.0)'; then
  737. PERL="$i/perl"
  738. break;
  739. fi;
  740. fi;
  741. done
  742. fi
  743. if [ ".$PERL" = . ] ; then
  744. echo "You need Perl 5."
  745. exit 1
  746. fi
  747. # run Configure to check to see if we need to specify the
  748. # compiler for the platform ... in which case we add it on
  749. # the end ... otherwise we leave it off
  750. $PERL ./Configure LIST | grep "$OUT-$CC" > /dev/null
  751. if [ $? = "0" ]; then
  752. OUT="$OUT-$CC"
  753. fi
  754. OUT="$PREFIX$OUT"
  755. $PERL ./Configure LIST | grep "$OUT" > /dev/null
  756. if [ $? = "0" ]; then
  757. echo Configuring for $OUT
  758. if [ "$TEST" = "true" ]; then
  759. echo $PERL ./Configure $OUT $options
  760. else
  761. $PERL ./Configure $OUT $options
  762. fi
  763. else
  764. echo "This system ($OUT) is not supported. See file INSTALL for details."
  765. fi
  766. )