Ralf S. Engelschall | 58964a4 | 1998-12-21 10:56:39 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # |
Ulf Möller | 5d3bb22 | 1999-04-22 19:23:56 +0000 | [diff] [blame] | 3 | # OpenSSL config: determine the operating system and run ./Configure |
Ralf S. Engelschall | 58964a4 | 1998-12-21 10:56:39 +0000 | [diff] [blame] | 4 | # |
Ulf Möller | 5d3bb22 | 1999-04-22 19:23:56 +0000 | [diff] [blame] | 5 | # "config -h" for usage information. |
Ralf S. Engelschall | 58964a4 | 1998-12-21 10:56:39 +0000 | [diff] [blame] | 6 | # |
Ulf Möller | 5d3bb22 | 1999-04-22 19:23:56 +0000 | [diff] [blame] | 7 | # this is a merge of minarch and GuessOS from the Apache Group. |
| 8 | # Originally written by Tim Hudson <tjh@cryptsoft.com>. |
Ralf S. Engelschall | 58964a4 | 1998-12-21 10:56:39 +0000 | [diff] [blame] | 9 | |
| 10 | # Original Apache Group comments on GuessOS |
| 11 | |
| 12 | # Simple OS/Platform guesser. Similar to config.guess but |
| 13 | # much, much smaller. Since it was developed for use with |
| 14 | # Apache, it follows under Apache's regular licensing |
| 15 | # with one specific addition: Any changes or additions |
| 16 | # to this script should be Emailed to the Apache |
| 17 | # group (apache@apache.org) in general and to |
| 18 | # Jim Jagielski (jim@jaguNET.com) in specific. |
| 19 | # |
| 20 | # Be as similar to the output of config.guess/config.sub |
| 21 | # as possible. |
| 22 | |
| 23 | # First get uname entries that we use below |
| 24 | |
| 25 | MACHINE=`(uname -m) 2>/dev/null` || MACHINE="unknown" |
| 26 | RELEASE=`(uname -r) 2>/dev/null` || RELEASE="unknown" |
| 27 | SYSTEM=`(uname -s) 2>/dev/null` || SYSTEM="unknown" |
| 28 | VERSION=`(uname -v) 2>/dev/null` || VERSION="unknown" |
| 29 | |
Richard Levitte | 8f6dc9c | 2000-02-27 17:17:43 +0000 | [diff] [blame] | 30 | |
Ralf S. Engelschall | 58964a4 | 1998-12-21 10:56:39 +0000 | [diff] [blame] | 31 | # Now test for ISC and SCO, since it is has a braindamaged uname. |
| 32 | # |
| 33 | # We need to work around FreeBSD 1.1.5.1 |
| 34 | ( |
| 35 | XREL=`uname -X 2>/dev/null | grep "^Release" | awk '{print $3}'` |
| 36 | if [ "x$XREL" != "x" ]; then |
| 37 | if [ -f /etc/kconfig ]; then |
| 38 | case "$XREL" in |
| 39 | 4.0|4.1) |
| 40 | echo "${MACHINE}-whatever-isc4"; exit 0 |
| 41 | ;; |
| 42 | esac |
| 43 | else |
| 44 | case "$XREL" in |
| 45 | 3.2v4.2) |
| 46 | echo "whatever-whatever-sco3"; exit 0 |
| 47 | ;; |
| 48 | 3.2v5.0*) |
| 49 | echo "whatever-whatever-sco5"; exit 0 |
| 50 | ;; |
| 51 | 4.2MP) |
| 52 | if [ "x$VERSION" = "x2.1.1" ]; then |
| 53 | echo "${MACHINE}-whatever-unixware211"; exit 0 |
Richard Levitte | 8f6dc9c | 2000-02-27 17:17:43 +0000 | [diff] [blame] | 54 | elif [ "x$VERSION" = "x2.1.2" ]; then |
| 55 | echo "${MACHINE}-whatever-unixware212"; exit 0 |
Ralf S. Engelschall | 58964a4 | 1998-12-21 10:56:39 +0000 | [diff] [blame] | 56 | else |
| 57 | echo "${MACHINE}-whatever-unixware2"; exit 0 |
| 58 | fi |
| 59 | ;; |
| 60 | 4.2) |
| 61 | echo "whatever-whatever-unixware1"; exit 0 |
| 62 | ;; |
Richard Levitte | 8f6dc9c | 2000-02-27 17:17:43 +0000 | [diff] [blame] | 63 | 5) |
Richard Levitte | 2eb5bc5 | 2000-02-27 17:23:25 +0000 | [diff] [blame] | 64 | if [ "`echo x$VERSION | sed -e 's/\..*//'`" = "x7" ]; then |
Richard Levitte | 8f6dc9c | 2000-02-27 17:17:43 +0000 | [diff] [blame] | 65 | echo "${MACHINE}-sco-unixware7"; exit 0 |
| 66 | fi |
Richard Levitte | 9a5a740 | 2000-02-26 03:51:55 +0000 | [diff] [blame] | 67 | ;; |
Ralf S. Engelschall | 58964a4 | 1998-12-21 10:56:39 +0000 | [diff] [blame] | 68 | esac |
| 69 | fi |
| 70 | fi |
| 71 | # Now we simply scan though... In most cases, the SYSTEM info is enough |
| 72 | # |
| 73 | case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in |
| 74 | A/UX:*) |
| 75 | echo "m68k-apple-aux3"; exit 0 |
| 76 | ;; |
| 77 | |
| 78 | AIX:*) |
| 79 | echo "${MACHINE}-ibm-aix"; exit 0 |
| 80 | ;; |
| 81 | |
| 82 | dgux:*) |
| 83 | echo "${MACHINE}-dg-dgux"; exit 0 |
| 84 | ;; |
| 85 | |
| 86 | HI-UX:*) |
| 87 | echo "${MACHINE}-hi-hiux"; exit 0 |
| 88 | ;; |
| 89 | |
| 90 | HP-UX:*) |
| 91 | HPUXVER=`echo ${RELEASE}|sed -e 's/[^.]*.[0B]*//'` |
| 92 | case "$HPUXVER" in |
Ulf Möller | afd1f9e | 1999-05-04 11:52:26 +0000 | [diff] [blame] | 93 | 11.*) |
| 94 | echo "${MACHINE}-hp-hpux11"; exit 0 |
| 95 | ;; |
Ralf S. Engelschall | 58964a4 | 1998-12-21 10:56:39 +0000 | [diff] [blame] | 96 | 10.*) |
Ulf Möller | afd1f9e | 1999-05-04 11:52:26 +0000 | [diff] [blame] | 97 | echo "${MACHINE}-hp-hpux10"; exit 0 |
Ralf S. Engelschall | 58964a4 | 1998-12-21 10:56:39 +0000 | [diff] [blame] | 98 | ;; |
| 99 | *) |
| 100 | echo "${MACHINE}-hp-hpux"; exit 0 |
| 101 | ;; |
| 102 | esac |
| 103 | ;; |
| 104 | |
Andy Polyakov | da8fa72 | 1999-07-25 20:40:58 +0000 | [diff] [blame] | 105 | IRIX:5.*) |
| 106 | echo "mips2-sgi-irix"; exit 0 |
| 107 | ;; |
| 108 | |
Andy Polyakov | 1656ef2 | 1999-07-25 22:25:12 +0000 | [diff] [blame] | 109 | IRIX:6.*) |
Andy Polyakov | da8fa72 | 1999-07-25 20:40:58 +0000 | [diff] [blame] | 110 | echo "mips3-sgi-irix"; exit 0 |
Ralf S. Engelschall | 58964a4 | 1998-12-21 10:56:39 +0000 | [diff] [blame] | 111 | ;; |
| 112 | |
| 113 | IRIX64:*) |
Andy Polyakov | da8fa72 | 1999-07-25 20:40:58 +0000 | [diff] [blame] | 114 | echo "mips4-sgi-irix64"; exit 0 |
Ralf S. Engelschall | 58964a4 | 1998-12-21 10:56:39 +0000 | [diff] [blame] | 115 | ;; |
| 116 | |
| 117 | Linux:[2-9].*) |
| 118 | echo "${MACHINE}-whatever-linux2"; exit 0 |
| 119 | ;; |
| 120 | |
| 121 | Linux:1.*) |
| 122 | echo "${MACHINE}-whatever-linux1"; exit 0 |
| 123 | ;; |
| 124 | |
| 125 | LynxOS:*) |
| 126 | echo "${MACHINE}-lynx-lynxos"; exit 0 |
| 127 | ;; |
| 128 | |
Bodo Möller | a9ffce0 | 1999-06-11 11:45:22 +0000 | [diff] [blame] | 129 | BSD/OS:4.*) # BSD/OS always says 386 |
| 130 | echo "i486-whatever-bsdi4"; exit 0 |
Bodo Möller | 0cceb1c | 1999-05-30 23:54:52 +0000 | [diff] [blame] | 131 | ;; |
| 132 | |
Ralf S. Engelschall | 58964a4 | 1998-12-21 10:56:39 +0000 | [diff] [blame] | 133 | BSD/386:*:*:*486*|BSD/OS:*:*:*:*486*) |
Ulf Möller | 9c789ad | 1999-06-16 20:26:46 +0000 | [diff] [blame] | 134 | case `/sbin/sysctl -n hw.model` in |
| 135 | Pentium*) |
Ulf Möller | 8050bc7 | 1999-06-16 23:49:39 +0000 | [diff] [blame] | 136 | echo "i586-whatever-bsdi"; exit 0 |
Ulf Möller | 9c789ad | 1999-06-16 20:26:46 +0000 | [diff] [blame] | 137 | ;; |
| 138 | *) |
Ulf Möller | 8050bc7 | 1999-06-16 23:49:39 +0000 | [diff] [blame] | 139 | echo "i386-whatever-bsdi"; exit 0 |
Ulf Möller | 9c789ad | 1999-06-16 20:26:46 +0000 | [diff] [blame] | 140 | ;; |
| 141 | esac; |
Ralf S. Engelschall | 58964a4 | 1998-12-21 10:56:39 +0000 | [diff] [blame] | 142 | ;; |
| 143 | |
| 144 | BSD/386:*|BSD/OS:*) |
| 145 | echo "${MACHINE}-whatever-bsdi"; exit 0 |
| 146 | ;; |
| 147 | |
Ralf S. Engelschall | 58964a4 | 1998-12-21 10:56:39 +0000 | [diff] [blame] | 148 | FreeBSD:*) |
Ralf S. Engelschall | 4471747 | 1999-08-09 10:16:51 +0000 | [diff] [blame] | 149 | VERS=`echo ${RELEASE} | sed -e 's/[-(].*//'` |
| 150 | MACH=`sysctl -n hw.model` |
| 151 | ARCH='whatever' |
| 152 | case ${MACH} in |
| 153 | *386* ) MACH="i386" ;; |
| 154 | *486* ) MACH="i486" ;; |
| 155 | Pentium\ II*) MACH="i686" ;; |
| 156 | Pentium* ) MACH="i586" ;; |
| 157 | Alpha* ) MACH="alpha" ;; |
| 158 | * ) MACH="$MACHINE" ;; |
| 159 | esac |
| 160 | case ${MACH} in |
| 161 | i[0-9]86 ) ARCH="pc" ;; |
| 162 | esac |
| 163 | echo "${MACH}-${ARCH}-freebsd${VERS}"; exit 0 |
| 164 | ;; |
Ralf S. Engelschall | 58964a4 | 1998-12-21 10:56:39 +0000 | [diff] [blame] | 165 | |
Ulf Möller | c6fdd7d | 1999-04-23 16:32:04 +0000 | [diff] [blame] | 166 | NetBSD:*:*:*386*) |
| 167 | echo "`sysctl -n hw.model | sed 's,.*\(.\)86-class.*,i\186,'`-whateve\r-netbsd"; exit 0 |
Ralf S. Engelschall | 58964a4 | 1998-12-21 10:56:39 +0000 | [diff] [blame] | 168 | ;; |
| 169 | |
| 170 | NetBSD:*) |
| 171 | echo "${MACHINE}-whatever-netbsd"; exit 0 |
| 172 | ;; |
| 173 | |
| 174 | OpenBSD:*) |
| 175 | echo "${MACHINE}-whatever-openbsd"; exit 0 |
| 176 | ;; |
| 177 | |
| 178 | OSF1:*:*:*alpha*) |
| 179 | echo "${MACHINE}-dec-osf"; exit 0 |
| 180 | ;; |
| 181 | |
| 182 | QNX:*) |
| 183 | case "$VERSION" in |
| 184 | 423) |
| 185 | echo "${MACHINE}-qssl-qnx32" |
| 186 | ;; |
| 187 | *) |
| 188 | echo "${MACHINE}-qssl-qnx" |
| 189 | ;; |
| 190 | esac |
| 191 | exit 0 |
| 192 | ;; |
| 193 | |
| 194 | Paragon*:*:*:*) |
| 195 | echo "i860-intel-osf1"; exit 0 |
| 196 | ;; |
| 197 | |
Andy Polyakov | 0fad6cb | 2000-02-06 11:15:20 +0000 | [diff] [blame] | 198 | Rhapsody:*) |
| 199 | echo "ppc-apple-rhapsody"; exit 0 |
| 200 | ;; |
| 201 | |
Ralf S. Engelschall | 58964a4 | 1998-12-21 10:56:39 +0000 | [diff] [blame] | 202 | SunOS:5.*) |
| 203 | echo "${MACHINE}-sun-solaris2"; exit 0 |
| 204 | ;; |
| 205 | |
| 206 | SunOS:*) |
| 207 | echo "${MACHINE}-sun-sunos4"; exit 0 |
| 208 | ;; |
| 209 | |
| 210 | UNIX_System_V:4.*:*) |
| 211 | echo "${MACHINE}-whatever-sysv4"; exit 0 |
| 212 | ;; |
| 213 | |
| 214 | *:4*:R4*:m88k) |
| 215 | echo "${MACHINE}-whatever-sysv4"; exit 0 |
| 216 | ;; |
| 217 | |
| 218 | DYNIX/ptx:4*:*) |
| 219 | echo "${MACHINE}-whatever-sysv4"; exit 0 |
| 220 | ;; |
| 221 | |
| 222 | *:4.0:3.0:3[34]?? | *:4.0:3.0:3[34]??,*) |
| 223 | echo "i486-ncr-sysv4"; exit 0 |
| 224 | ;; |
| 225 | |
| 226 | ULTRIX:*) |
| 227 | echo "${MACHINE}-unknown-ultrix"; exit 0 |
| 228 | ;; |
| 229 | |
Ulf Möller | 1fac96e | 1999-05-20 17:28:19 +0000 | [diff] [blame] | 230 | SINIX*|ReliantUNIX*) |
| 231 | echo "${MACHINE}-siemens-sysv4"; exit 0 |
Ralf S. Engelschall | 58964a4 | 1998-12-21 10:56:39 +0000 | [diff] [blame] | 232 | ;; |
| 233 | |
Ulf Möller | 9231f47 | 1999-06-04 21:32:31 +0000 | [diff] [blame] | 234 | POSIX-BC*) |
| 235 | echo "${MACHINE}-siemens-sysv4"; exit 0 # Here, $MACHINE == "BS2000" |
| 236 | ;; |
| 237 | |
Ralf S. Engelschall | 58964a4 | 1998-12-21 10:56:39 +0000 | [diff] [blame] | 238 | machten:*) |
| 239 | echo "${MACHINE}-tenon-${SYSTEM}"; exit 0; |
| 240 | ;; |
| 241 | |
| 242 | library:*) |
| 243 | echo "${MACHINE}-ncr-sysv4"; exit 0 |
| 244 | ;; |
| 245 | |
| 246 | ConvexOS:*:11.0:*) |
| 247 | echo "${MACHINE}-v11-${SYSTEM}"; exit 0; |
| 248 | ;; |
| 249 | |
| 250 | esac |
| 251 | |
| 252 | # |
| 253 | # Ugg. These are all we can determine by what we know about |
| 254 | # the output of uname. Be more creative: |
| 255 | # |
| 256 | |
| 257 | # Do the Apollo stuff first. Here, we just simply assume |
| 258 | # that the existance of the /usr/apollo directory is proof |
| 259 | # enough |
| 260 | if [ -d /usr/apollo ]; then |
| 261 | echo "whatever-apollo-whatever" |
| 262 | exit 0 |
| 263 | fi |
| 264 | |
| 265 | # Now NeXT |
| 266 | ISNEXT=`hostinfo 2>/dev/null` |
| 267 | case "$ISNEXT" in |
Bodo Möller | 8e9eae0 | 1999-06-11 10:54:42 +0000 | [diff] [blame] | 268 | *'NeXT Mach 3.3'*) |
Bodo Möller | 74a6c7f | 1999-06-10 18:05:58 +0000 | [diff] [blame] | 269 | echo "whatever-next-nextstep3.3"; exit 0 |
| 270 | ;; |
Ralf S. Engelschall | 58964a4 | 1998-12-21 10:56:39 +0000 | [diff] [blame] | 271 | *NeXT*) |
| 272 | echo "whatever-next-nextstep"; exit 0 |
| 273 | ;; |
| 274 | esac |
| 275 | |
| 276 | # At this point we gone through all the one's |
| 277 | # we know of: Punt |
| 278 | |
Ulf Möller | b1fe6b4 | 1999-04-30 18:22:59 +0000 | [diff] [blame] | 279 | echo "${MACHINE}-whatever-${SYSTEM}" |
Ralf S. Engelschall | 58964a4 | 1998-12-21 10:56:39 +0000 | [diff] [blame] | 280 | exit 0 |
| 281 | ) 2>/dev/null | ( |
| 282 | |
| 283 | # --------------------------------------------------------------------------- |
| 284 | # this is where the translation occurs into SSLeay terms |
| 285 | # --------------------------------------------------------------------------- |
| 286 | |
| 287 | PREFIX="" |
| 288 | SUFFIX="" |
Ralf S. Engelschall | 58964a4 | 1998-12-21 10:56:39 +0000 | [diff] [blame] | 289 | TEST="false" |
| 290 | |
| 291 | # pick up any command line args to config |
| 292 | for i |
| 293 | do |
| 294 | case "$i" in |
Ulf Möller | 2da0c11 | 2000-02-28 19:16:41 +0000 | [diff] [blame] | 295 | # shared library support (behnke@trustcenter.de) |
| 296 | -shared) SHARED=true;; |
Ralf S. Engelschall | 58964a4 | 1998-12-21 10:56:39 +0000 | [diff] [blame] | 297 | -d*) PREFIX="debug-";; |
Ralf S. Engelschall | dfeab06 | 1998-12-21 11:00:56 +0000 | [diff] [blame] | 298 | -t*) TEST="true";; |
Ulf Möller | 5d3bb22 | 1999-04-22 19:23:56 +0000 | [diff] [blame] | 299 | -h*) TEST="true"; cat <<EOF |
| 300 | Usage: config [options] |
Ralf S. Engelschall | dfeab06 | 1998-12-21 11:00:56 +0000 | [diff] [blame] | 301 | -d Add a debug- prefix to machine choice. |
Ralf S. Engelschall | dfeab06 | 1998-12-21 11:00:56 +0000 | [diff] [blame] | 302 | -t Test mode, do not run the Configure perl script. |
| 303 | -h This help. |
| 304 | |
Ulf Möller | 7130806 | 1999-03-30 16:17:03 +0000 | [diff] [blame] | 305 | Any other text will be passed to the Configure perl script. |
Ulf Möller | 462ba4f | 1999-04-24 22:59:36 +0000 | [diff] [blame] | 306 | See INSTALL for instructions. |
Ralf S. Engelschall | dfeab06 | 1998-12-21 11:00:56 +0000 | [diff] [blame] | 307 | |
Ralf S. Engelschall | dfeab06 | 1998-12-21 11:00:56 +0000 | [diff] [blame] | 308 | EOF |
| 309 | ;; |
| 310 | *) options=$options" $i" ;; |
Ralf S. Engelschall | 58964a4 | 1998-12-21 10:56:39 +0000 | [diff] [blame] | 311 | esac |
| 312 | done |
| 313 | |
| 314 | # figure out if gcc is available and if so we use it otherwise |
| 315 | # we fallback to whatever cc does on the system |
Andy Polyakov | a0618e3 | 1999-07-25 15:13:49 +0000 | [diff] [blame] | 316 | GCCVER=`(gcc --version) 2>/dev/null` |
| 317 | if [ "$GCCVER" != "" ]; then |
Ralf S. Engelschall | 58964a4 | 1998-12-21 10:56:39 +0000 | [diff] [blame] | 318 | CC=gcc |
Andy Polyakov | a0618e3 | 1999-07-25 15:13:49 +0000 | [diff] [blame] | 319 | # then strip off whatever prefix Cygnus prepends the number with... |
| 320 | GCCVER=`echo $GCCVER | sed 's/^[a-z]*\-//'` |
Andy Polyakov | 1656ef2 | 1999-07-25 22:25:12 +0000 | [diff] [blame] | 321 | # peak single digit before and after first dot, e.g. 2.95.1 gives 29 |
Andy Polyakov | da8fa72 | 1999-07-25 20:40:58 +0000 | [diff] [blame] | 322 | GCCVER=`echo $GCCVER | sed 's/\([0-9]\)\.\([0-9]\).*/\1\2/'` |
Ralf S. Engelschall | 58964a4 | 1998-12-21 10:56:39 +0000 | [diff] [blame] | 323 | else |
| 324 | CC=cc |
Andy Polyakov | 1656ef2 | 1999-07-25 22:25:12 +0000 | [diff] [blame] | 325 | fi |
| 326 | |
| 327 | if [ "$SYSTEM" = "SunOS" ]; then |
Andy Polyakov | bdf5e18 | 2000-01-02 20:46:58 +0000 | [diff] [blame] | 328 | # check for WorkShop C, expected output is "cc: blah-blah C x.x" |
Andy Polyakov | 1656ef2 | 1999-07-25 22:25:12 +0000 | [diff] [blame] | 329 | CCVER=`(cc -V 2>&1) 2>/dev/null | \ |
| 330 | egrep -e '^cc: .* C [0-9]\.[0-9]' | \ |
| 331 | sed 's/.* C \([0-9]\)\.\([0-9]\).*/\1\2/'` |
| 332 | CCVER=${CCVER:-0} |
| 333 | if [ $CCVER -gt 40 ]; then |
| 334 | CC=cc # overrides gcc!!! |
| 335 | if [ $CCVER -eq 50 ]; then |
| 336 | echo "WARNING! Detected WorkShop C 5.0. Do make sure you have" |
| 337 | echo " patch #107357-01 or later applied." |
| 338 | sleep 5 |
| 339 | fi |
| 340 | elif [ "$CC" = "cc" -a $CCVER -gt 0 ]; then |
| 341 | CC=sc3 |
Ulf Möller | 744029c | 1999-05-04 23:18:24 +0000 | [diff] [blame] | 342 | fi |
Ralf S. Engelschall | 58964a4 | 1998-12-21 10:56:39 +0000 | [diff] [blame] | 343 | fi |
| 344 | |
Andy Polyakov | bdf5e18 | 2000-01-02 20:46:58 +0000 | [diff] [blame] | 345 | if [ "${SYSTEM}-${MACHINE}" = "Linux-alpha" ]; then |
| 346 | # check for Compaq C, expected output is "blah-blah C Vx.x" |
| 347 | CCCVER=`(ccc -V 2>&1) 2>/dev/null | \ |
| 348 | egrep -e '.* C V[0-9]\.[0-9]' | \ |
| 349 | sed 's/.* C V\([0-9]\)\.\([0-9]\).*/\1\2/'` |
| 350 | CCCVER=${CCCVER:-0} |
| 351 | if [ $CCCVER -gt 60 ]; then |
| 352 | CC=ccc # overrides gcc!!! well, ccc outperforms inoticeably |
| 353 | # only on hash routines and des, otherwise gcc (2.95) |
| 354 | # keeps along rather tight... |
| 355 | fi |
| 356 | fi |
| 357 | |
Andy Polyakov | da8fa72 | 1999-07-25 20:40:58 +0000 | [diff] [blame] | 358 | GCCVER=${GCCVER:-0} |
| 359 | CCVER=${CCVER:-0} |
| 360 | |
Ralf S. Engelschall | 58964a4 | 1998-12-21 10:56:39 +0000 | [diff] [blame] | 361 | # read the output of the embedded GuessOS |
| 362 | read GUESSOS |
| 363 | |
Ulf Möller | b1fe6b4 | 1999-04-30 18:22:59 +0000 | [diff] [blame] | 364 | echo Operating system: $GUESSOS |
Ralf S. Engelschall | 58964a4 | 1998-12-21 10:56:39 +0000 | [diff] [blame] | 365 | |
| 366 | # now map the output into SSLeay terms ... really should hack into the |
| 367 | # script above so we end up with values in vars but that would take |
| 368 | # more time that I want to waste at the moment |
| 369 | case "$GUESSOS" in |
Andy Polyakov | da8fa72 | 1999-07-25 20:40:58 +0000 | [diff] [blame] | 370 | mips2-sgi-irix) |
| 371 | CPU=`(hinv -t cpu) 2>/dev/null | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'` |
| 372 | CPU=${CPU:-0} |
| 373 | if [ $CPU -ge 4000 ]; then |
| 374 | options="$options -mips2" |
| 375 | fi |
| 376 | OUT="irix-$CC" |
| 377 | ;; |
| 378 | mips3-sgi-irix) |
| 379 | CPU=`(hinv -t cpu) 2>/dev/null | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'` |
| 380 | CPU=${CPU:-0} |
| 381 | if [ $CPU -ge 5000 ]; then |
| 382 | options="$options -mips4" |
| 383 | else |
| 384 | options="$options -mips3" |
| 385 | fi |
| 386 | OUT="irix-mips3-$CC" |
| 387 | ;; |
| 388 | mips4-sgi-irix64) |
| 389 | echo "WARNING! If you wish to build 64-bit library, then you have to" |
| 390 | echo " invoke './Configre irix64-mips4-$CC' *manually*." |
| 391 | echo " Type Ctrl-C if you don't want to continue." |
| 392 | read waste < /dev/tty |
| 393 | options="$options -mips4" |
| 394 | OUT="irix-mips3-$CC" |
| 395 | ;; |
Andy Polyakov | bdf5e18 | 2000-01-02 20:46:58 +0000 | [diff] [blame] | 396 | alpha-*-linux2) |
| 397 | ISA=`awk '/cpu model/{print$4}' /proc/cpuinfo` |
| 398 | case ${ISA:-generic} in |
| 399 | *[67]) OUT="linux-alpha+bwx-$CC" ;; |
| 400 | *) OUT="linux-alpha-$CC" ;; |
| 401 | esac |
| 402 | if [ "$CC" = "gcc" ]; then |
| 403 | case ${ISA:-generic} in |
| 404 | EV5|EV45) options="$options -mcpu=ev5";; |
| 405 | EV56|PCA56) options="$options -mcpu=ev56";; |
| 406 | EV6|EV67|PCA57) options="$options -mcpu=ev6";; |
| 407 | esac |
| 408 | fi |
| 409 | ;; |
| 410 | mips-*-linux?) OUT="linux-mips" ;; |
| 411 | ppc-*-linux2) OUT="linux-ppc" ;; |
Ralf S. Engelschall | 010712f | 2000-02-29 15:29:02 +0000 | [diff] [blame] | 412 | ia64-*-linux?) OUT="linux-ia64" ;; |
Andy Polyakov | 0fad6cb | 2000-02-06 11:15:20 +0000 | [diff] [blame] | 413 | ppc-apple-rhapsody) OUT="rhapsody-ppc-cc" ;; |
Andy Polyakov | a0618e3 | 1999-07-25 15:13:49 +0000 | [diff] [blame] | 414 | sparc64-*-linux2) |
Andy Polyakov | 1656ef2 | 1999-07-25 22:25:12 +0000 | [diff] [blame] | 415 | #Before we can uncomment following lines we have to wait at least |
| 416 | #till 64-bit glibc for SPARC is operational:-( |
| 417 | #echo "WARNING! If you wish to build 64-bit library, then you have to" |
Andy Polyakov | a0618e3 | 1999-07-25 15:13:49 +0000 | [diff] [blame] | 418 | #echo " invoke './Configure linux64-sparcv9' *manually*." |
| 419 | #echo " Type Ctrl-C if you don't want to continue." |
| 420 | #read waste < /dev/tty |
| 421 | OUT="linux-sparcv9" ;; |
Andy Polyakov | da8fa72 | 1999-07-25 20:40:58 +0000 | [diff] [blame] | 422 | sparc-*-linux2) |
Andy Polyakov | a0618e3 | 1999-07-25 15:13:49 +0000 | [diff] [blame] | 423 | KARCH=`awk '/type/{print$3}' /proc/cpuinfo` |
| 424 | case ${KARCH:-sun4} in |
| 425 | sun4u*) OUT="linux-sparcv9" ;; |
| 426 | sun4m) OUT="linux-sparcv8" ;; |
| 427 | sun4d) OUT="linux-sparcv8" ;; |
| 428 | *) OUT="linux-sparcv7" ;; |
| 429 | esac ;; |
Ralf S. Engelschall | 58964a4 | 1998-12-21 10:56:39 +0000 | [diff] [blame] | 430 | *-*-linux2) OUT="linux-elf" ;; |
Ben Laurie | dabba11 | 1999-01-17 14:20:20 +0000 | [diff] [blame] | 431 | *-*-linux1) OUT="linux-aout" ;; |
Andy Polyakov | 1656ef2 | 1999-07-25 22:25:12 +0000 | [diff] [blame] | 432 | sun4u*-sun-solaris2) |
| 433 | ISA64=`(isalist) 2>/dev/null | grep sparcv9` |
| 434 | if [ "$ISA64" != "" -a "$CC" = "cc" -a $CCVER -ge 50 ]; then |
| 435 | echo "WARNING! If you wish to build 64-bit library, then you have to" |
| 436 | echo " invoke './Configure solaris64-sparcv9-cc' *manually*." |
| 437 | echo " Type Ctrl-C if you don't want to continue." |
| 438 | read waste < /dev/tty |
| 439 | fi |
| 440 | OUT="solaris-sparcv9-$CC" ;; |
| 441 | sun4m-sun-solaris2) OUT="solaris-sparcv8-$CC" ;; |
| 442 | sun4d-sun-solaris2) OUT="solaris-sparcv8-$CC" ;; |
| 443 | sun4*-sun-solaris2) OUT="solaris-sparcv7-$CC" ;; |
Ralf S. Engelschall | 58964a4 | 1998-12-21 10:56:39 +0000 | [diff] [blame] | 444 | *86*-sun-solaris2) OUT="solaris-x86-$CC" ;; |
| 445 | *-*-sunos4) OUT="sunos-$CC" ;; |
Ralf S. Engelschall | 4471747 | 1999-08-09 10:16:51 +0000 | [diff] [blame] | 446 | alpha*-*-freebsd*) OUT="FreeBSD-alpha" ;; |
| 447 | *-freebsd[3-9]*) OUT="FreeBSD-elf" ;; |
| 448 | *-freebsd[1-2]*) OUT="FreeBSD" ;; |
Ralf S. Engelschall | 58964a4 | 1998-12-21 10:56:39 +0000 | [diff] [blame] | 449 | *86*-*-netbsd) OUT="NetBSD-x86" ;; |
| 450 | sun3*-*-netbsd) OUT="NetBSD-m68" ;; |
| 451 | *-*-netbsd) OUT="NetBSD-sparc" ;; |
Ralf S. Engelschall | dfeab06 | 1998-12-21 11:00:56 +0000 | [diff] [blame] | 452 | *86*-*-openbsd) OUT="OpenBSD-x86" ;; |
| 453 | alpha*-*-openbsd) OUT="OpenBSD-alpha" ;; |
| 454 | pmax*-*-openbsd) OUT="OpenBSD-mips" ;; |
| 455 | *-*-openbsd) OUT="OpenBSD" ;; |
Bodo Möller | 0cceb1c | 1999-05-30 23:54:52 +0000 | [diff] [blame] | 456 | *86*-*-bsdi4) OUT="bsdi-elf-gcc" ;; |
Ralf S. Engelschall | dfeab06 | 1998-12-21 11:00:56 +0000 | [diff] [blame] | 457 | *-*-osf) OUT="alpha-cc" ;; |
Richard Levitte | 9a5a740 | 2000-02-26 03:51:55 +0000 | [diff] [blame] | 458 | *-*-unixware7) OUT="unixware-7" ;; |
| 459 | *-*-UnixWare7) OUT="unixware-7" ;; |
| 460 | *-*-Unixware7) OUT="unixware-7" ;; |
| 461 | *-*-unixware[1-2]*) OUT="unixware-2.0" ;; |
| 462 | *-*-UnixWare[1-2]*) OUT="unixware-2.0" ;; |
| 463 | *-*-Unixware[1-2]*) OUT="unixware-2.0" ;; |
Ulf Möller | 9231f47 | 1999-06-04 21:32:31 +0000 | [diff] [blame] | 464 | BS2000-siemens-sysv4) OUT="BS2000-OSD" ;; |
Ulf Möller | 1fac96e | 1999-05-20 17:28:19 +0000 | [diff] [blame] | 465 | RM*-siemens-sysv4) OUT="ReliantUNIX" ;; |
| 466 | *-siemens-sysv4) OUT="SINIX" ;; |
Andy Polyakov | bcba6cc | 2000-02-12 23:33:01 +0000 | [diff] [blame] | 467 | *-hpux1*) OUT="hpux-parisc-$CC" |
| 468 | options="$options -D_REENTRANT" ;; |
| 469 | *-hpux) OUT="hpux-parisc-$CC" ;; |
Ralf S. Engelschall | 58964a4 | 1998-12-21 10:56:39 +0000 | [diff] [blame] | 470 | # these are all covered by the catchall below |
Ralf S. Engelschall | 58964a4 | 1998-12-21 10:56:39 +0000 | [diff] [blame] | 471 | # *-aix) OUT="aix-$CC" ;; |
| 472 | # *-dgux) OUT="dgux" ;; |
| 473 | *) OUT=`echo $GUESSOS | awk -F- '{print $3}'`;; |
| 474 | esac |
| 475 | |
Ben Laurie | bd03b99 | 2000-02-16 22:15:39 +0000 | [diff] [blame] | 476 | # See whether we can compile Atalla support |
| 477 | if [ -f /usr/include/atasi.h ] |
| 478 | then |
| 479 | options="$options -DATALLA" |
| 480 | fi |
| 481 | |
Ulf Möller | 2da0c11 | 2000-02-28 19:16:41 +0000 | [diff] [blame] | 482 | #get some basic shared lib support (behnke@trustcenter.de) |
| 483 | case "$OUT" in |
| 484 | solaris-*-gcc) |
| 485 | if [ "$SHARED" = "true" ] |
| 486 | then |
| 487 | options="$options -DPIC -fPIC" |
| 488 | fi |
| 489 | ;; |
| 490 | esac |
| 491 | |
Ulf Möller | b673583 | 1999-05-18 23:44:38 +0000 | [diff] [blame] | 492 | # gcc < 2.8 does not support -mcpu=ultrasparc |
Andy Polyakov | 1656ef2 | 1999-07-25 22:25:12 +0000 | [diff] [blame] | 493 | if [ "$OUT" = solaris-sparcv9-gcc -a $GCCVER -lt 28 ] |
Ulf Möller | b673583 | 1999-05-18 23:44:38 +0000 | [diff] [blame] | 494 | then |
Andy Polyakov | a0618e3 | 1999-07-25 15:13:49 +0000 | [diff] [blame] | 495 | echo "WARNING! Do consider upgrading to gcc-2.8 or later." |
Andy Polyakov | 1656ef2 | 1999-07-25 22:25:12 +0000 | [diff] [blame] | 496 | sleep 5 |
| 497 | OUT=solaris-sparcv9-gcc27 |
Andy Polyakov | a0618e3 | 1999-07-25 15:13:49 +0000 | [diff] [blame] | 498 | fi |
| 499 | if [ "$OUT" = "linux-sparcv9" -a $GCCVER -lt 28 ] |
| 500 | then |
| 501 | echo "WARNING! Falling down to 'linux-sparcv8'." |
| 502 | echo " Upgrade to gcc-2.8 or later." |
Andy Polyakov | 1656ef2 | 1999-07-25 22:25:12 +0000 | [diff] [blame] | 503 | sleep 5 |
Andy Polyakov | a0618e3 | 1999-07-25 15:13:49 +0000 | [diff] [blame] | 504 | OUT=linux-sparcv8 |
Ulf Möller | b673583 | 1999-05-18 23:44:38 +0000 | [diff] [blame] | 505 | fi |
Andy Polyakov | f8bbcf3 | 2000-02-15 17:31:12 +0000 | [diff] [blame] | 506 | # To start with $OUT is never i86pc-sun-solaris2. Secondly why |
| 507 | # ban *all* assembler implementation if it can't stand only one, |
| 508 | # SHA-0 implementation. |
| 509 | #if [ "$OUT" = "i86pc-sun-solaris2" ] |
| 510 | #then |
| 511 | # ASM=`as -V /dev/null 2>&1` |
| 512 | # case "$ASM" in |
| 513 | # GNU*) ;; |
| 514 | # *) options="$options no-asm" ; echo "WARNING: You need the GNU assembler to use OpenSSL assembler code." ; echo "Sun as is not supported on Solaris x86." ;; |
| 515 | # esac |
| 516 | #fi |
Ulf Möller | b673583 | 1999-05-18 23:44:38 +0000 | [diff] [blame] | 517 | |
Ulf Möller | 5d3bb22 | 1999-04-22 19:23:56 +0000 | [diff] [blame] | 518 | case "$GUESSOS" in |
| 519 | i386-*) options="$options 386" ;; |
| 520 | esac |
| 521 | |
Ulf Möller | 5676d8c | 1999-06-29 23:52:08 +0000 | [diff] [blame] | 522 | for i in bf cast des dh dsa hmac md2 md5 mdc2 rc2 rc4 rc5 ripemd rsa sha |
Ulf Möller | 9231f47 | 1999-06-04 21:32:31 +0000 | [diff] [blame] | 523 | do |
| 524 | if [ ! -d crypto/$i ] |
| 525 | then |
| 526 | options="$options no-$i" |
| 527 | fi |
| 528 | done |
| 529 | |
Ralf S. Engelschall | 58964a4 | 1998-12-21 10:56:39 +0000 | [diff] [blame] | 530 | if [ -z "$OUT" ]; then |
| 531 | OUT="$CC" |
| 532 | fi |
| 533 | |
Ulf Möller | 99aab16 | 1999-04-01 12:34:33 +0000 | [diff] [blame] | 534 | if [ ".$PERL" = . ] ; then |
| 535 | for i in . `echo $PATH | sed 's/:/ /g'`; do |
| 536 | if [ -f "$i/perl5" ] ; then |
| 537 | PERL="$i/perl5" |
| 538 | break; |
| 539 | fi; |
| 540 | done |
| 541 | fi |
| 542 | |
| 543 | if [ ".$PERL" = . ] ; then |
| 544 | for i in . `echo $PATH | sed 's/:/ /g'`; do |
| 545 | if [ -f "$i/perl" ] ; then |
Ulf Möller | a5a47e4 | 1999-04-09 16:25:25 +0000 | [diff] [blame] | 546 | if "$i/perl" -e 'exit($]<5.0)'; then |
| 547 | PERL="$i/perl" |
| 548 | break; |
| 549 | fi; |
Ulf Möller | 99aab16 | 1999-04-01 12:34:33 +0000 | [diff] [blame] | 550 | fi; |
| 551 | done |
| 552 | fi |
| 553 | |
Ulf Möller | a5a47e4 | 1999-04-09 16:25:25 +0000 | [diff] [blame] | 554 | if [ ".$PERL" = . ] ; then |
Ulf Möller | 99aab16 | 1999-04-01 12:34:33 +0000 | [diff] [blame] | 555 | echo "You need Perl 5." |
| 556 | exit 1 |
| 557 | fi |
| 558 | |
Ralf S. Engelschall | 58964a4 | 1998-12-21 10:56:39 +0000 | [diff] [blame] | 559 | # run Configure to check to see if we need to specify the |
| 560 | # compiler for the platform ... in which case we add it on |
| 561 | # the end ... otherwise we leave it off |
Ulf Möller | 99aab16 | 1999-04-01 12:34:33 +0000 | [diff] [blame] | 562 | |
Ulf Möller | 10a926c | 2000-02-21 00:55:45 +0000 | [diff] [blame] | 563 | $PERL ./Configure LIST | grep "$OUT-$CC" > /dev/null |
Ralf S. Engelschall | 58964a4 | 1998-12-21 10:56:39 +0000 | [diff] [blame] | 564 | if [ $? = "0" ]; then |
| 565 | OUT="$OUT-$CC" |
| 566 | fi |
| 567 | |
| 568 | OUT="$PREFIX$OUT" |
| 569 | |
Ulf Möller | 10a926c | 2000-02-21 00:55:45 +0000 | [diff] [blame] | 570 | $PERL ./Configure LIST | grep "$OUT" > /dev/null |
Ulf Möller | b1fe6b4 | 1999-04-30 18:22:59 +0000 | [diff] [blame] | 571 | if [ $? = "0" ]; then |
| 572 | echo Configuring for $OUT |
Ralf S. Engelschall | 58964a4 | 1998-12-21 10:56:39 +0000 | [diff] [blame] | 573 | |
Ulf Möller | b1fe6b4 | 1999-04-30 18:22:59 +0000 | [diff] [blame] | 574 | if [ "$TEST" = "true" ]; then |
| 575 | echo $PERL ./Configure $OUT $options |
| 576 | else |
| 577 | $PERL ./Configure $OUT $options |
| 578 | fi |
Ralf S. Engelschall | 58964a4 | 1998-12-21 10:56:39 +0000 | [diff] [blame] | 579 | else |
Ulf Möller | 744029c | 1999-05-04 23:18:24 +0000 | [diff] [blame] | 580 | echo "This system ($OUT) is not supported. See file INSTALL for details." |
Ralf S. Engelschall | 58964a4 | 1998-12-21 10:56:39 +0000 | [diff] [blame] | 581 | fi |
Ralf S. Engelschall | 58964a4 | 1998-12-21 10:56:39 +0000 | [diff] [blame] | 582 | ) |