📄 config
字号:
#!/bin/sh## OpenSSL config: determine the operating system and run ./Configure## "config -h" for usage information.## this is a merge of minarch and GuessOS from the Apache Group.# Originally written by Tim Hudson <tjh@cryptsoft.com>.# Original Apache Group comments on GuessOS# Simple OS/Platform guesser. Similar to config.guess but# much, much smaller. Since it was developed for use with# Apache, it follows under Apache's regular licensing# with one specific addition: Any changes or additions# to this script should be Emailed to the Apache# group (apache@apache.org) in general and to# Jim Jagielski (jim@jaguNET.com) in specific.## Be as similar to the output of config.guess/config.sub# as possible.PREFIX=""SUFFIX=""TEST="false"EXE=""# pick up any command line args to configfor idocase "$i" in -d*) PREFIX="debug-";;-t*) TEST="true";;-h*) TEST="true"; cat <<EOFUsage: config [options] -d Add a debug- prefix to machine choice. -t Test mode, do not run the Configure perl script. -h This help.Any other text will be passed to the Configure perl script.See INSTALL for instructions.EOF;;*) options=$options" $i" ;;esacdone# First get uname entries that we use belowMACHINE=`(uname -m) 2>/dev/null` || MACHINE="unknown"RELEASE=`(uname -r) 2>/dev/null` || RELEASE="unknown"SYSTEM=`(uname -s) 2>/dev/null` || SYSTEM="unknown"VERSION=`(uname -v) 2>/dev/null` || VERSION="unknown"# Now test for ISC and SCO, since it is has a braindamaged uname.## We need to work around FreeBSD 1.1.5.1 (XREL=`uname -X 2>/dev/null | grep "^Release" | awk '{print $3}'`if [ "x$XREL" != "x" ]; then if [ -f /etc/kconfig ]; then case "$XREL" in 4.0|4.1) echo "${MACHINE}-whatever-isc4"; exit 0 ;; esac else case "$XREL" in 3.2v4.2) echo "whatever-whatever-sco3"; exit 0 ;; 3.2v5.0*) echo "whatever-whatever-sco5"; exit 0 ;; 4.2MP) case "x${VERSION}" in x2.0*) echo "whatever-whatever-unixware20"; exit 0 ;; x2.1*) echo "whatever-whatever-unixware21"; exit 0 ;; x2*) echo "whatever-whatever-unixware2"; exit 0 ;; esac ;; 4.2) echo "whatever-whatever-unixware1"; exit 0 ;; 5*) case "x${VERSION}" in # We hardcode i586 in place of ${MACHINE} for the # following reason. The catch is that even though Pentium # is minimum requirement for platforms in question, # ${MACHINE} gets always assigned to i386. Now, problem # with i386 is that it makes ./config pass 386 to # ./Configure, which in turn makes make generate # inefficient SHA-1 (for this moment) code. x[678]*) echo "i586-sco-unixware7"; exit 0 ;; esac ;; esac fifi# Now we simply scan though... In most cases, the SYSTEM info is enough#case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in MPE/iX:*) MACHINE=`echo "$MACHINE" | sed -e 's/-/_/g'` echo "parisc-hp-MPE/iX"; exit 0 ;; A/UX:*) echo "m68k-apple-aux3"; exit 0 ;; AIX:[3-9]:4:*) echo "${MACHINE}-ibm-aix"; exit 0 ;; AIX:*:[5-9]:*) echo "${MACHINE}-ibm-aix"; exit 0 ;; AIX:*) echo "${MACHINE}-ibm-aix3"; exit 0 ;; dgux:*) echo "${MACHINE}-dg-dgux"; exit 0 ;; HI-UX:*) echo "${MACHINE}-hi-hiux"; exit 0 ;; HP-UX:*) HPUXVER=`echo ${RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "$HPUXVER" in 1[0-9].*) # HPUX 10 and 11 targets are unified echo "${MACHINE}-hp-hpux1x"; exit 0 ;; *) echo "${MACHINE}-hp-hpux"; exit 0 ;; esac ;; IRIX:5.*) echo "mips2-sgi-irix"; exit 0 ;; IRIX:6.*) echo "mips3-sgi-irix"; exit 0 ;; IRIX64:*) echo "mips4-sgi-irix64"; exit 0 ;; Linux:[2-9].*) echo "${MACHINE}-whatever-linux2"; exit 0 ;; Linux:1.*) echo "${MACHINE}-whatever-linux1"; exit 0 ;; GNU*) echo "hurd-x86"; exit 0; ;; LynxOS:*) echo "${MACHINE}-lynx-lynxos"; exit 0 ;; BSD/OS:4.*) # BSD/OS always says 386 echo "i486-whatever-bsdi4"; exit 0 ;; BSD/386:*:*:*486*|BSD/OS:*:*:*:*486*) case `/sbin/sysctl -n hw.model` in Pentium*) echo "i586-whatever-bsdi"; exit 0 ;; *) echo "i386-whatever-bsdi"; exit 0 ;; esac; ;; BSD/386:*|BSD/OS:*) echo "${MACHINE}-whatever-bsdi"; exit 0 ;; FreeBSD:*:*:*386*) VERS=`echo ${RELEASE} | sed -e 's/[-(].*//'` MACH=`sysctl -n hw.model` ARCH='whatever' case ${MACH} in *386* ) MACH="i386" ;; *486* ) MACH="i486" ;; Pentium\ II*) MACH="i686" ;; Pentium* ) MACH="i586" ;; * ) MACH="$MACHINE" ;; esac case ${MACH} in i[0-9]86 ) ARCH="pc" ;; esac echo "${MACH}-${ARCH}-freebsd${VERS}"; exit 0 ;; FreeBSD:*) echo "${MACHINE}-whatever-freebsd"; exit 0 ;; NetBSD:*:*:*386*) echo "`(/usr/sbin/sysctl -n hw.model || /sbin/sysctl -n hw.model) | sed 's,.*\(.\)86-class.*,i\186,'`-whatever-netbsd"; exit 0 ;; NetBSD:*) echo "${MACHINE}-whatever-netbsd"; exit 0 ;; OpenBSD:*) echo "${MACHINE}-whatever-openbsd"; exit 0 ;; OpenUNIX:*) echo "${MACHINE}-unknown-OpenUNIX${VERSION}"; exit 0 ;; OSF1:*:*:*alpha*) OSFMAJOR=`echo ${RELEASE}| sed -e 's/^V\([0-9]*\)\..*$/\1/'` case "$OSFMAJOR" in 4|5) echo "${MACHINE}-dec-tru64"; exit 0 ;; 1|2|3) echo "${MACHINE}-dec-osf"; exit 0 ;; *) echo "${MACHINE}-dec-osf"; exit 0 ;; esac ;; QNX:*) case "$RELEASE" in 4*) echo "${MACHINE}-whatever-qnx4" ;; 6*) echo "${MACHINE}-whatever-qnx6" ;; *) echo "${MACHINE}-whatever-qnx" ;; esac exit 0 ;; Paragon*:*:*:*) echo "i860-intel-osf1"; exit 0 ;; Rhapsody:*) echo "ppc-apple-rhapsody"; exit 0 ;; Darwin:*) case "$MACHINE" in Power*) echo "ppc-apple-darwin${VERSION}" ;; *) echo "i386-apple-darwin${VERSION}" ;; esac exit 0 ;; SunOS:5.*) echo "${MACHINE}-whatever-solaris2"; exit 0 ;; SunOS:*) echo "${MACHINE}-sun-sunos4"; exit 0 ;; UNIX_System_V:4.*:*) echo "${MACHINE}-whatever-sysv4"; exit 0 ;; VOS:*:*:i786) echo "i386-stratus-vos"; exit 0 ;; VOS:*:*:*) echo "hppa1.1-stratus-vos"; exit 0 ;; *:4*:R4*:m88k) echo "${MACHINE}-whatever-sysv4"; exit 0 ;; DYNIX/ptx:4*:*) echo "${MACHINE}-whatever-sysv4"; exit 0 ;; *:4.0:3.0:3[34]?? | *:4.0:3.0:3[34]??,*) echo "i486-ncr-sysv4"; exit 0 ;; ULTRIX:*) echo "${MACHINE}-unknown-ultrix"; exit 0 ;; SINIX*|ReliantUNIX*) echo "${MACHINE}-siemens-sysv4"; exit 0 ;; POSIX-BC*) echo "${MACHINE}-siemens-sysv4"; exit 0 # Here, $MACHINE == "BS2000" ;; machten:*) echo "${MACHINE}-tenon-${SYSTEM}"; exit 0; ;; library:*) echo "${MACHINE}-ncr-sysv4"; exit 0 ;; ConvexOS:*:11.0:*) echo "${MACHINE}-v11-${SYSTEM}"; exit 0; ;; NEWS-OS:4.*) echo "mips-sony-newsos4"; exit 0; ;; MINGW*) echo "${MACHINE}-whatever-mingw"; exit 0; ;; CYGWIN*) case "$RELEASE" in [bB]*|1.0|1.[12].*) echo "${MACHINE}-whatever-cygwin_pre1.3" ;; *) echo "${MACHINE}-whatever-cygwin" ;; esac exit 0 ;; *"CRAY T3E") echo "t3e-cray-unicosmk"; exit 0; ;; *CRAY*) echo "j90-cray-unicos"; exit 0; ;; NONSTOP_KERNEL*) echo "nsr-tandem-nsk"; exit 0; ;;esac## Ugg. These are all we can determine by what we know about# the output of uname. Be more creative:## Do the Apollo stuff first. Here, we just simply assume# that the existance of the /usr/apollo directory is proof# enoughif [ -d /usr/apollo ]; then echo "whatever-apollo-whatever" exit 0fi# Now NeXTISNEXT=`hostinfo 2>/dev/null`case "$ISNEXT" in *'NeXT Mach 3.3'*) echo "whatever-next-nextstep3.3"; exit 0 ;; *NeXT*) echo "whatever-next-nextstep"; exit 0 ;;esac# At this point we gone through all the one's# we know of: Puntecho "${MACHINE}-whatever-${SYSTEM}" exit 0) 2>/dev/null | (# ---------------------------------------------------------------------------# this is where the translation occurs into SSLeay terms# ---------------------------------------------------------------------------# figure out if gcc is available and if so we use it otherwise# we fallback to whatever cc does on the systemGCCVER=`(gcc -dumpversion) 2>/dev/null`if [ "$GCCVER" != "" ]; then CC=gcc # then strip off whatever prefix egcs prepends the number with... # Hopefully, this will work for any future prefixes as well. GCCVER=`echo $GCCVER | sed 's/^[a-zA-Z]*\-//'` # Since gcc 3.1 gcc --version behaviour has changed. gcc -dumpversion # does give us what we want though, so we use that. We just just the # major and minor version numbers. # peak single digit before and after first dot, e.g. 2.95.1 gives 29 GCCVER=`echo $GCCVER | sed 's/\([0-9]\)\.\([0-9]\).*/\1\2/'`else CC=ccfiGCCVER=${GCCVER:-0}if [ "$SYSTEM" = "HP-UX" ];then # By default gcc is a ILP32 compiler (with long long == 64). GCC_BITS="32" if [ $GCCVER -ge 30 ]; then # PA64 support only came in with gcc 3.0.x. # We check if the preprocessor symbol __LP64__ is defined... if echo "__LP64__" | gcc -v -E -x c - 2>/dev/null | grep "^__LP64__" 2>&1 > /dev/null; then : # __LP64__ has slipped through, it therefore is not defined else GCC_BITS="64" fi fifiif [ "$SYSTEM" = "SunOS" ]; then if [ $GCCVER -ge 30 ]; then # 64-bit ABI isn't officially supported in gcc 3.0, but it appears # to be working, at the very least 'make test' passes... if gcc -v -E -x c /dev/null 2>&1 | grep __arch64__ > /dev/null; then GCC_ARCH="-m64" else GCC_ARCH="-m32" fi
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -