config 24 KB

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