head	1.6;
access;
symbols
	RELENG_8_4:1.6.0.2
	RELENG_9_1_0_RELEASE:1.4.2.1
	RELENG_9_1:1.4.2.1.0.2
	RELENG_9_1_BP:1.4.2.1
	RELENG_8_3_0_RELEASE:1.2.2.1
	RELENG_8_3:1.2.2.1.0.6
	RELENG_8_3_BP:1.2.2.1
	RELENG_9_0_0_RELEASE:1.4
	RELENG_9_0:1.4.0.4
	RELENG_9_0_BP:1.4
	RELENG_9:1.4.0.2
	RELENG_9_BP:1.4
	RELENG_7_4_0_RELEASE:1.1.1.18.2.1
	RELENG_8_2_0_RELEASE:1.2.2.1
	RELENG_7_4:1.1.1.18.2.1.0.2
	RELENG_7_4_BP:1.1.1.18.2.1
	RELENG_8_2:1.2.2.1.0.4
	RELENG_8_2_BP:1.2.2.1
	RELENG_8_1_0_RELEASE:1.2.2.1
	RELENG_8_1:1.2.2.1.0.2
	RELENG_8_1_BP:1.2.2.1
	RELENG_7_3_0_RELEASE:1.1.1.18
	RELENG_7_3:1.1.1.18.0.10
	RELENG_7_3_BP:1.1.1.18
	RELENG_8_0_0_RELEASE:1.2
	RELENG_8_0:1.2.0.4
	RELENG_8_0_BP:1.2
	RELENG_8:1.2.0.2
	RELENG_8_BP:1.2
	RELENG_7_2_0_RELEASE:1.1.1.18
	RELENG_7_2:1.1.1.18.0.8
	RELENG_7_2_BP:1.1.1.18
	RELENG_7_1_0_RELEASE:1.1.1.18
	RELENG_6_4_0_RELEASE:1.1.1.15
	RELENG_7_1:1.1.1.18.0.6
	RELENG_7_1_BP:1.1.1.18
	RELENG_6_4:1.1.1.15.0.12
	RELENG_6_4_BP:1.1.1.15
	RELENG_7_0_0_RELEASE:1.1.1.18
	RELENG_6_3_0_RELEASE:1.1.1.15
	RELENG_7_0:1.1.1.18.0.4
	RELENG_7_0_BP:1.1.1.18
	RELENG_6_3:1.1.1.15.0.10
	RELENG_6_3_BP:1.1.1.15
	RELENG_7:1.1.1.18.0.2
	RELENG_7_BP:1.1.1.18
	v0_9_8e:1.1.1.18
	RELENG_6_2_0_RELEASE:1.1.1.15
	RELENG_6_2:1.1.1.15.0.8
	RELENG_6_2_BP:1.1.1.15
	v0_9_8d:1.1.1.17
	v0_9_8b:1.1.1.16
	RELENG_5_5_0_RELEASE:1.1.1.14.2.1
	RELENG_5_5:1.1.1.14.2.1.0.4
	RELENG_5_5_BP:1.1.1.14.2.1
	RELENG_6_1_0_RELEASE:1.1.1.15
	RELENG_6_1:1.1.1.15.0.6
	RELENG_6_1_BP:1.1.1.15
	RELENG_6_0_0_RELEASE:1.1.1.15
	RELENG_6_0:1.1.1.15.0.4
	RELENG_6_0_BP:1.1.1.15
	RELENG_6:1.1.1.15.0.2
	RELENG_6_BP:1.1.1.15
	RELENG_5_4_0_RELEASE:1.1.1.14.2.1
	RELENG_5_4:1.1.1.14.2.1.0.2
	RELENG_5_4_BP:1.1.1.14.2.1
	v0_9_7e:1.1.1.15
	RELENG_4_11_0_RELEASE:1.1.1.1.2.9
	RELENG_4_11:1.1.1.1.2.9.0.4
	RELENG_4_11_BP:1.1.1.1.2.9
	RELENG_5_3_0_RELEASE:1.1.1.14
	RELENG_5_3:1.1.1.14.0.4
	RELENG_5_3_BP:1.1.1.14
	RELENG_5:1.1.1.14.0.2
	RELENG_5_BP:1.1.1.14
	RELENG_4_10_0_RELEASE:1.1.1.1.2.9
	RELENG_4_10:1.1.1.1.2.9.0.2
	RELENG_4_10_BP:1.1.1.1.2.9
	v0_9_7d:1.1.1.14
	RELENG_5_2_1_RELEASE:1.1.1.13
	RELENG_5_2_0_RELEASE:1.1.1.13
	RELENG_5_2:1.1.1.13.0.2
	RELENG_5_2_BP:1.1.1.13
	RELENG_4_9_0_RELEASE:1.1.1.1.2.8
	RELENG_4_9:1.1.1.1.2.8.0.2
	RELENG_4_9_BP:1.1.1.1.2.8
	v0_9_7c:1.1.1.13
	RELENG_5_1_0_RELEASE:1.1.1.12
	RELENG_5_1:1.1.1.12.0.2
	RELENG_5_1_BP:1.1.1.12
	RELENG_4_8_0_RELEASE:1.1.1.1.2.7
	RELENG_4_8:1.1.1.1.2.7.0.2
	RELENG_4_8_BP:1.1.1.1.2.7
	v0_9_7a:1.1.1.12
	v0_9_7:1.1.1.11
	RELENG_5_0_0_RELEASE:1.1.1.10
	RELENG_5_0:1.1.1.10.0.2
	RELENG_5_0_BP:1.1.1.10
	RELENG_4_7_0_RELEASE:1.1.1.1.2.5
	RELENG_4_7:1.1.1.1.2.5.0.2
	RELENG_4_7_BP:1.1.1.1.2.5
	RELENG_4_6_2_RELEASE:1.1.1.1.2.3.6.1
	v0_9_6g:1.1.1.10
	v0_9_6f:1.1.1.9
	v0_9_6e:1.1.1.8
	v0_9_6d:1.1.1.7
	RELENG_4_6_1_RELEASE:1.1.1.1.2.3
	RELENG_4_6_0_RELEASE:1.1.1.1.2.3
	RELENG_4_6:1.1.1.1.2.3.0.6
	RELENG_4_6_BP:1.1.1.1.2.3
	RELENG_4_5_0_RELEASE:1.1.1.1.2.3
	v0_9_6c:1.1.1.6
	RELENG_4_5:1.1.1.1.2.3.0.4
	RELENG_4_5_BP:1.1.1.1.2.3
	RELENG_4_4_0_RELEASE:1.1.1.1.2.3
	RELENG_4_4:1.1.1.1.2.3.0.2
	RELENG_4_4_BP:1.1.1.1.2.3
	v0_9_6b:1.1.1.5
	v0_9_6a:1.1.1.5
	RELENG_4_3_0_RELEASE:1.1.1.1.2.2
	RELENG_4_3:1.1.1.1.2.2.0.2
	RELENG_4_3_BP:1.1.1.1.2.2
	v0_9_6_2001_02_10:1.1.1.4
	RELENG_4_2_0_RELEASE:1.1.1.1.2.1
	v0_9_6:1.1.1.3
	RELENG_4_1_1_RELEASE:1.1.1.1.2.1
	PRE_SMPNG:1.1.1.2
	RELENG_4_1_0_RELEASE:1.1.1.1
	v0_9_5a:1.1.1.2
	RELENG_4_0_0_RELEASE:1.1.1.1
	RELENG_4:1.1.1.1.0.2
	RELENG_4_BP:1.1.1.1
	v0_9_4:1.1.1.1
	OPENSSL:1.1.1;
locks; strict;
comment	@# @;


1.6
date	2012.07.12.19.30.53;	author jkim;	state Exp;
branches
	1.6.2.1;
next	1.5;

1.5
date	2012.06.27.18.44.36;	author jkim;	state Exp;
branches;
next	1.4;

1.4
date	2010.04.01.15.19.51;	author simon;	state Exp;
branches
	1.4.2.1
	1.4.4.1;
next	1.3;

1.3
date	2010.03.13.19.22.41;	author simon;	state Exp;
branches;
next	1.2;

1.2
date	2009.06.14.19.45.16;	author simon;	state Exp;
branches
	1.2.2.1;
next	1.1;

1.1
date	2000.01.10.06.21.17;	author kris;	state Exp;
branches
	1.1.1.1;
next	;

1.6.2.1
date	2012.07.12.19.30.53;	author svnexp;	state dead;
branches;
next	1.6.2.2;

1.6.2.2
date	2013.03.28.13.02.27;	author svnexp;	state Exp;
branches;
next	;

1.4.2.1
date	2012.07.02.16.00.38;	author jkim;	state Exp;
branches;
next	;

1.4.4.1
date	2013.04.02.18.17.57;	author svnexp;	state Exp;
branches;
next	;

1.2.2.1
date	2010.05.22.18.40.54;	author simon;	state Exp;
branches
	1.2.2.1.6.1;
next	1.2.2.2;

1.2.2.2
date	2012.07.02.16.14.35;	author jkim;	state Exp;
branches;
next	;

1.2.2.1.6.1
date	2013.04.02.17.48.59;	author svnexp;	state Exp;
branches;
next	;

1.1.1.1
date	2000.01.10.06.21.17;	author kris;	state Exp;
branches
	1.1.1.1.2.1;
next	1.1.1.2;

1.1.1.2
date	2000.04.13.06.24.54;	author kris;	state Exp;
branches;
next	1.1.1.3;

1.1.1.3
date	2000.11.13.00.54.41;	author kris;	state Exp;
branches;
next	1.1.1.4;

1.1.1.4
date	2001.02.18.03.14.55;	author kris;	state Exp;
branches;
next	1.1.1.5;

1.1.1.5
date	2001.05.20.03.04.52;	author kris;	state Exp;
branches;
next	1.1.1.6;

1.1.1.6
date	2002.01.27.03.10.40;	author kris;	state Exp;
branches;
next	1.1.1.7;

1.1.1.7
date	2002.07.30.12.43.17;	author nectar;	state Exp;
branches;
next	1.1.1.8;

1.1.1.8
date	2002.07.30.13.37.25;	author nectar;	state Exp;
branches;
next	1.1.1.9;

1.1.1.9
date	2002.08.10.01.37.20;	author nectar;	state Exp;
branches;
next	1.1.1.10;

1.1.1.10
date	2002.08.10.01.47.54;	author nectar;	state Exp;
branches
	1.1.1.10.2.1;
next	1.1.1.11;

1.1.1.11
date	2003.01.28.21.09.38;	author markm;	state Exp;
branches;
next	1.1.1.12;

1.1.1.12
date	2003.02.19.23.10.56;	author nectar;	state Exp;
branches;
next	1.1.1.13;

1.1.1.13
date	2003.10.01.12.32.37;	author nectar;	state Exp;
branches;
next	1.1.1.14;

1.1.1.14
date	2004.03.17.15.41.33;	author nectar;	state Exp;
branches
	1.1.1.14.2.1;
next	1.1.1.15;

1.1.1.15
date	2005.02.25.05.32.12;	author nectar;	state Exp;
branches;
next	1.1.1.16;

1.1.1.16
date	2006.07.29.19.10.15;	author simon;	state Exp;
branches;
next	1.1.1.17;

1.1.1.17
date	2006.10.01.07.33.32;	author simon;	state Exp;
branches;
next	1.1.1.18;

1.1.1.18
date	2007.03.15.20.02.17;	author simon;	state Exp;
branches
	1.1.1.18.2.1;
next	;

1.1.1.1.2.1
date	2000.08.20.08.45.57;	author kris;	state Exp;
branches;
next	1.1.1.1.2.2;

1.1.1.1.2.2
date	2000.11.26.11.32.45;	author kris;	state Exp;
branches;
next	1.1.1.1.2.3;

1.1.1.1.2.3
date	2001.07.04.23.19.08;	author kris;	state Exp;
branches
	1.1.1.1.2.3.2.1
	1.1.1.1.2.3.4.1
	1.1.1.1.2.3.6.1;
next	1.1.1.1.2.4;

1.1.1.1.2.4
date	2002.07.30.22.04.59;	author nectar;	state Exp;
branches;
next	1.1.1.1.2.5;

1.1.1.1.2.5
date	2002.08.11.14.13.53;	author nectar;	state Exp;
branches
	1.1.1.1.2.5.2.1;
next	1.1.1.1.2.6;

1.1.1.1.2.6
date	2003.02.14.22.37.38;	author nectar;	state Exp;
branches;
next	1.1.1.1.2.7;

1.1.1.1.2.7
date	2003.02.20.15.07.20;	author nectar;	state Exp;
branches;
next	1.1.1.1.2.8;

1.1.1.1.2.8
date	2003.10.03.01.32.04;	author nectar;	state Exp;
branches;
next	1.1.1.1.2.9;

1.1.1.1.2.9
date	2004.04.02.01.10.59;	author nectar;	state Exp;
branches;
next	;

1.1.1.1.2.3.2.1
date	2002.07.31.16.40.31;	author nectar;	state Exp;
branches;
next	;

1.1.1.1.2.3.4.1
date	2002.07.31.14.04.47;	author nectar;	state Exp;
branches;
next	;

1.1.1.1.2.3.6.1
date	2002.07.31.02.54.37;	author nectar;	state Exp;
branches;
next	1.1.1.1.2.3.6.2;

1.1.1.1.2.3.6.2
date	2003.02.21.16.32.47;	author nectar;	state Exp;
branches;
next	;

1.1.1.1.2.5.2.1
date	2003.02.20.20.42.05;	author nectar;	state Exp;
branches;
next	;

1.1.1.10.2.1
date	2003.02.20.17.14.09;	author nectar;	state Exp;
branches;
next	;

1.1.1.14.2.1
date	2005.03.01.16.47.24;	author nectar;	state Exp;
branches;
next	;

1.1.1.18.2.1
date	2010.11.28.13.45.51;	author simon;	state Exp;
branches;
next	1.1.1.18.2.2;

1.1.1.18.2.2
date	2012.07.02.16.24.43;	author jkim;	state Exp;
branches;
next	;


desc
@@


1.6
log
@SVN rev 238405 on 2012-07-12 19:30:53Z by jkim

Merge OpenSSL 1.0.1c.

Approved by:	benl (maintainer)
@
text
@#!/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 config
for i
do
case "$i" in 
-d*) PREFIX="debug-";;
-t*) TEST="true";;
-h*) TEST="true"; cat <<EOF
Usage: 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" ;;
esac
done

# First get uname entries that we use below

[ "$MACHINE" ] || MACHINE=`(uname -m) 2>/dev/null` || MACHINE="unknown"
[ "$RELEASE" ] || RELEASE=`(uname -r) 2>/dev/null` || RELEASE="unknown"
[ "$SYSTEM" ] || SYSTEM=`(uname -s) 2>/dev/null`  || SYSTEM="unknown"
[ "$BUILD" ] || 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
    fi
fi
# 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
	;;

    BeOS:*:BePC)
    if [ -e /boot/develop/headers/be/bone ]; then
		echo "beos-x86-bone"; exit 0
	else
		echo "beos-x86-r5"; exit 0
	fi
	;;

    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 "i686-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;
       ;;

    vxworks*)
       echo "${MACHINE}-whatever-vxworks"; 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
# enough
if [ -d /usr/apollo ]; then
    echo "whatever-apollo-whatever"
    exit 0
fi

# Now NeXT
ISNEXT=`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: Punt

echo "${MACHINE}-whatever-${SYSTEM}" 
exit 0
) 2>/dev/null | (

# ---------------------------------------------------------------------------
# this is where the translation occurs into SSLeay terms
# ---------------------------------------------------------------------------

# Only set CC if not supplied already
if [ -z "$CROSS_COMPILE$CC" ]; then
  GCCVER=`sh -c "gcc -dumpversion" 2>/dev/null`
  if [ "$GCCVER" != "" ]; then
    # then strip off whatever prefix egcs prepends the number with...
    # Hopefully, this will work for any future prefixes as well.
    GCCVER=`echo $GCCVER | LC_ALL=C 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/'`
    CC=gcc
  else
    CC=cc
  fi
fi
GCCVER=${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
  fi
fi
if [ "$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
  fi
  # check for WorkShop C, expected output is "cc: blah-blah C x.x"
  CCVER=`(cc -V 2>&1) 2>/dev/null | \
  	egrep -e '^cc: .* C [0-9]\.[0-9]' | \
	sed 's/.* C \([0-9]\)\.\([0-9]\).*/\1\2/'`
  CCVER=${CCVER:-0}
  if [ $MACHINE != i86pc -a $CCVER -gt 40 ]; then
    CC=cc	# overrides gcc!!!
    if [ $CCVER -eq 50 ]; then
      echo "WARNING! Detected WorkShop C 5.0. Do make sure you have"
      echo "         patch #107357-01 or later applied."
      sleep 5
    fi
  fi
fi

if [ "${SYSTEM}-${MACHINE}" = "Linux-alpha" ]; then
  # check for Compaq C, expected output is "blah-blah C Vx.x"
  CCCVER=`(ccc -V 2>&1) 2>/dev/null | \
	egrep -e '.* C V[0-9]\.[0-9]' | \
	sed 's/.* C V\([0-9]\)\.\([0-9]\).*/\1\2/'`
  CCCVER=${CCCVER:-0}
  if [ $CCCVER -gt 60 ]; then
    CC=ccc	# overrides gcc!!! well, ccc outperforms inoticeably
		# only on hash routines and des, otherwise gcc (2.95)
		# keeps along rather tight...
  fi
fi

if [ "${SYSTEM}" = "AIX" ]; then	# favor vendor cc over gcc
    (cc) 2>&1 | grep -iv "not found" > /dev/null && CC=cc
fi

CCVER=${CCVER:-0}

# read the output of the embedded GuessOS 
read GUESSOS

echo Operating system: $GUESSOS

# now map the output into SSLeay terms ... really should hack into the
# script above so we end up with values in vars but that would take
# more time that I want to waste at the moment
case "$GUESSOS" in
  uClinux*64*)
    OUT=uClinux-dist64
	;;
  uClinux*)
    OUT=uClinux-dist
	;;
  mips2-sgi-irix)
	CPU=`(hinv -t cpu) 2>/dev/null | head -1 | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'`
	CPU=${CPU:-0}
	if [ $CPU -ge 4000 ]; then
		options="$options -mips2"
	fi
	OUT="irix-$CC"
	;;
  mips3-sgi-irix)
	#CPU=`(hinv -t cpu) 2>/dev/null | head -1 | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'`
	#CPU=${CPU:-0}
	#if [ $CPU -ge 5000 ]; then
	#	options="$options -mips4"
	#else
	#	options="$options -mips3"
	#fi
	OUT="irix-mips3-$CC"
	;;
  mips4-sgi-irix64)
	echo "WARNING! If you wish to build 64-bit library, then you have to"
	echo "         invoke './Configure irix64-mips4-$CC' *manually*."
	if [ "$TEST" = "false" -a -t 1 ]; then
	  echo "         You have about 5 seconds to press Ctrl-C to abort."
	  (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
	fi
        #CPU=`(hinv -t cpu) 2>/dev/null | head -1 | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'`
        #CPU=${CPU:-0}
        #if [ $CPU -ge 5000 ]; then
        #        options="$options -mips4"
        #else
        #        options="$options -mips3"
        #fi
	OUT="irix-mips3-$CC"
	;;
  ppc-apple-rhapsody) OUT="rhapsody-ppc-cc" ;;
  ppc-apple-darwin*)
	ISA64=`(sysctl -n hw.optional.64bitops) 2>/dev/null`
	if [ "$ISA64" = "1" -a -z "$KERNEL_BITS" ]; then
	    echo "WARNING! If you wish to build 64-bit library, then you have to"
	    echo "         invoke './Configure darwin64-ppc-cc' *manually*."
	    if [ "$TEST" = "false" -a -t 1 ]; then
	      echo "         You have about 5 seconds to press Ctrl-C to abort."
	      (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
	    fi
	fi
	if [ "$ISA64" = "1" -a "$KERNEL_BITS" = "64" ]; then
	    OUT="darwin64-ppc-cc"
	else
	    OUT="darwin-ppc-cc"
	fi ;;
  i?86-apple-darwin*)
	ISA64=`(sysctl -n hw.optional.x86_64) 2>/dev/null`
	if [ "$ISA64" = "1" -a -z "$KERNEL_BITS" ]; then
	    echo "WARNING! If you wish to build 64-bit library, then you have to"
	    echo "         invoke './Configure darwin64-x86_64-cc' *manually*."
	    if [ "$TEST" = "false" -a -t 1 ]; then
	      echo "         You have about 5 seconds to press Ctrl-C to abort."
	      (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
	    fi
	fi
	if [ "$ISA64" = "1" -a "$KERNEL_BITS" = "64" ]; then
	    OUT="darwin64-x86_64-cc"
	else
	    OUT="darwin-i386-cc"
	fi ;;
  armv6+7-*-iphoneos)
	options="$options -arch%20armv6 -arch%20armv7"
	OUT="iphoneos-cross" ;;
  *-*-iphoneos)
	options="$options -arch%20${MACHINE}"
	OUT="iphoneos-cross" ;;
  alpha-*-linux2)
        ISA=`awk '/cpu model/{print$4;exit(0);}' /proc/cpuinfo`
	case ${ISA:-generic} in
	*[678])	OUT="linux-alpha+bwx-$CC" ;;
	*)	OUT="linux-alpha-$CC" ;;
	esac
	if [ "$CC" = "gcc" ]; then
	    case ${ISA:-generic} in
	    EV5|EV45)		options="$options -mcpu=ev5";;
	    EV56|PCA56)		options="$options -mcpu=ev56";;
	    *)			options="$options -mcpu=ev6";;
	    esac
	fi
	;;
  ppc64-*-linux2)
	echo "WARNING! If you wish to build 64-bit library, then you have to"
	echo "         invoke './Configure linux-ppc64' *manually*."
	if [ "$TEST" = "false" -a -t 1 ]; then
	    echo "         You have about 5 seconds to press Ctrl-C to abort."
	    (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
	fi
	OUT="linux-ppc"
	;;
  ppc-*-linux2) OUT="linux-ppc" ;;
  ppc60x-*-vxworks*) OUT="vxworks-ppc60x" ;;
  ppcgen-*-vxworks*) OUT="vxworks-ppcgen" ;;
  pentium-*-vxworks*) OUT="vxworks-pentium" ;;
  simlinux-*-vxworks*) OUT="vxworks-simlinux" ;;
  mips-*-vxworks*) OUT="vxworks-mips";;
  ia64-*-linux?) OUT="linux-ia64" ;;
  sparc64-*-linux2)
	echo "WARNING! If you *know* that your GNU C supports 64-bit/V9 ABI"
	echo "         and wish to build 64-bit library, then you have to"
	echo "         invoke './Configure linux64-sparcv9' *manually*."
	if [ "$TEST" = "false" -a -t 1 ]; then
	  echo "          You have about 5 seconds to press Ctrl-C to abort."
	  (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
	fi
	OUT="linux-sparcv9" ;;
  sparc-*-linux2)
	KARCH=`awk '/^type/{print$3;exit(0);}' /proc/cpuinfo`
	case ${KARCH:-sun4} in
	sun4u*)	OUT="linux-sparcv9" ;;
	sun4m)	OUT="linux-sparcv8" ;;
	sun4d)	OUT="linux-sparcv8" ;;
	*)	OUT="linux-generic32"; options="$options -DB_ENDIAN" ;;
	esac ;;
  parisc*-*-linux2)
	# 64-bit builds under parisc64 linux are not supported and
	# compiler is expected to generate 32-bit objects...
	CPUARCH=`awk '/cpu family/{print substr($5,1,3); exit(0);}' /proc/cpuinfo`
	CPUSCHEDULE=`awk '/^cpu.[ 	]*: PA/{print substr($3,3); exit(0);}' /proc/cpuinfo`

	# ??TODO ??  Model transformations
	# 0. CPU Architecture for the 1.1 processor has letter suffixes. We strip that off
	#    assuming no further arch. identification will ever be used by GCC.
	# 1. I'm most concerned about whether is a 7300LC is closer to a 7100 versus a 7100LC.
	# 2. The variant 64-bit processors cause concern should GCC support explicit schedulers
	#    for these chips in the future.
	#         PA7300LC -> 7100LC (1.1)
	#         PA8200   -> 8000   (2.0)
	#         PA8500   -> 8000   (2.0)
	#         PA8600   -> 8000   (2.0)

	CPUSCHEDULE=`echo $CPUSCHEDULE|sed -e 's/7300LC/7100LC/' -e 's/8.00/8000/'`
	# Finish Model transformations

	options="$options -DB_ENDIAN -mschedule=$CPUSCHEDULE -march=$CPUARCH"
	OUT="linux-generic32" ;;
  armv[1-3]*-*-linux2) OUT="linux-generic32" ;;
  armv[7-9]*-*-linux2) OUT="linux-armv4"; options="$options -march=armv7-a" ;;
  arm*-*-linux2) OUT="linux-armv4" ;;
  sh*b-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN" ;;
  sh*-*-linux2)  OUT="linux-generic32"; options="$options -DL_ENDIAN" ;;
  m68k*-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN" ;;
  s390-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN" ;;
  s390x-*-linux2)
	# To be uncommented when glibc bug is fixed, see Configure...
	#if egrep -e '^features.* highgprs' /proc/cpuinfo >/dev/null ; then
	#  echo "WARNING! If you wish to build \"highgprs\" 32-bit library, then you"
	#  echo "         have to invoke './Configure linux32-s390x' *manually*."
	#  if [ "$TEST" = "false" -a -t -1 ]; then
	#    echo "         You have about 5 seconds to press Ctrl-C to abort."
	#    (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
	#  fi
	#fi
	OUT="linux64-s390x"
	;;
  x86_64-*-linux?) OUT="linux-x86_64" ;;
  *86-*-linux2) OUT="linux-elf"
	if [ "$GCCVER" -gt 28 ]; then
          if grep '^model.*Pentium' /proc/cpuinfo >/dev/null ; then
	    options="$options -march=pentium"
          fi
          if grep '^model.*Pentium Pro' /proc/cpuinfo >/dev/null ; then
	    options="$options -march=pentiumpro"
          fi
          if grep '^model.*K6' /proc/cpuinfo >/dev/null ; then
	    options="$options -march=k6"
          fi
        fi ;;
  *-*-linux1) OUT="linux-aout" ;;
  *-*-linux2) OUT="linux-generic32" ;;
  sun4[uv]*-*-solaris2)
	OUT="solaris-sparcv9-$CC"
	ISA64=`(isalist) 2>/dev/null | grep sparcv9`
	if [ "$ISA64" != "" -a "$KERNEL_BITS" = "" ]; then
	    if [ "$CC" = "cc" -a $CCVER -ge 50 ]; then
		echo "WARNING! If you wish to build 64-bit library, then you have to"
		echo "         invoke './Configure solaris64-sparcv9-cc' *manually*."
		if [ "$TEST" = "false" -a -t 1 ]; then
		  echo "         You have about 5 seconds to press Ctrl-C to abort."
		  (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
		fi
	    elif [ "$CC" = "gcc" -a "$GCC_ARCH" = "-m64" ]; then
		# $GCC_ARCH denotes default ABI chosen by compiler driver
		# (first one found on the $PATH). I assume that user
		# expects certain consistency with the rest of his builds
		# and therefore switch over to 64-bit. <appro>
		OUT="solaris64-sparcv9-gcc"
		echo "WARNING! If you wish to build 32-bit library, then you have to"
		echo "         invoke './Configure solaris-sparcv9-gcc' *manually*."
		if [ "$TEST" = "false" -a -t 1 ]; then
		  echo "         You have about 5 seconds to press Ctrl-C to abort."
		  (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
		fi
	    elif [ "$GCC_ARCH" = "-m32" ]; then
		echo "NOTICE! If you *know* that your GNU C supports 64-bit/V9 ABI"
		echo "        and wish to build 64-bit library, then you have to"
		echo "        invoke './Configure solaris64-sparcv9-gcc' *manually*."
		if [ "$TEST" = "false" -a -t 1 ]; then
		  echo "         You have about 5 seconds to press Ctrl-C to abort."
		  (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
		fi
	    fi
	fi
	if [ "$ISA64" != "" -a "$KERNEL_BITS" = "64" ]; then
	    OUT="solaris64-sparcv9-$CC"
	fi
	;;
  sun4m-*-solaris2)	OUT="solaris-sparcv8-$CC" ;;
  sun4d-*-solaris2)	OUT="solaris-sparcv8-$CC" ;;
  sun4*-*-solaris2)	OUT="solaris-sparcv7-$CC" ;;
  *86*-*-solaris2)
	ISA64=`(isalist) 2>/dev/null | grep amd64`
	if [ "$ISA64" != "" -a ${KERNEL_BITS:-64} -eq 64 ]; then
	    OUT="solaris64-x86_64-$CC"
	else
	    OUT="solaris-x86-$CC"
	    if [ `uname -r | sed -e 's/5\.//'` -lt 10 ]; then
		options="$options no-sse2"
	    fi
	fi
	;;
  *-*-sunos4)		OUT="sunos-$CC" ;;

  *86*-*-bsdi4)		OUT="BSD-x86-elf"; options="$options no-sse2 -ldl" ;;
  alpha*-*-*bsd*)	OUT="BSD-generic64"; options="$options -DL_ENDIAN" ;;
  powerpc64-*-*bsd*)	OUT="BSD-generic64"; options="$options -DB_ENDIAN" ;;
  sparc64-*-*bsd*)	OUT="BSD-sparc64" ;;
  ia64-*-*bsd*)		OUT="BSD-ia64" ;;
  amd64-*-*bsd*)	OUT="BSD-x86_64" ;;
  *86*-*-*bsd*)		# mimic ld behaviour when it's looking for libc...
			if [ -L /usr/lib/libc.so ]; then	# [Free|Net]BSD
			    libc=/usr/lib/libc.so
			else					# OpenBSD
			    # ld searches for highest libc.so.* and so do we
			    libc=`(ls /usr/lib/libc.so.* | tail -1) 2>/dev/null`
			fi
			case "`(file -L $libc) 2>/dev/null`" in
			*ELF*)	OUT="BSD-x86-elf" ;;
			*)	OUT="BSD-x86"; options="$options no-sse2" ;;
			esac ;;
  *-*-*bsd*)		OUT="BSD-generic32" ;;

  *-*-osf)		OUT="osf1-alpha-cc" ;;
  *-*-tru64)		OUT="tru64-alpha-cc" ;;
  *-*-[Uu]nix[Ww]are7)
	if [ "$CC" = "gcc" ]; then
	  OUT="unixware-7-gcc" ; options="$options no-sse2"
	else    
	  OUT="unixware-7" ; options="$options no-sse2 -D__i386__"
	fi
	;;
  *-*-[Uu]nix[Ww]are20*) OUT="unixware-2.0"; options="$options no-sse2 no-sha512" ;;
  *-*-[Uu]nix[Ww]are21*) OUT="unixware-2.1"; options="$options no-sse2 no-sha512" ;;
  *-*-vos)
	options="$options no-threads no-shared no-asm no-dso"
	EXE=".pm"
	OUT="vos-$CC" ;;
  BS2000-siemens-sysv4) OUT="BS2000-OSD" ;;
  RM*-siemens-sysv4) OUT="ReliantUNIX" ;;
  *-siemens-sysv4) OUT="SINIX" ;;
  *-hpux1*)
	if [ $CC = "gcc" -a $GCC_BITS = "64" ]; then
	    OUT="hpux64-parisc2-gcc"
	fi
	[ "$KERNEL_BITS" ] || KERNEL_BITS=`(getconf KERNEL_BITS) 2>/dev/null`
	KERNEL_BITS=${KERNEL_BITS:-32}
	CPU_VERSION=`(getconf CPU_VERSION) 2>/dev/null`
	CPU_VERSION=${CPU_VERSION:-0}
	# See <sys/unistd.h> for further info on CPU_VERSION.
	if   [ $CPU_VERSION -ge 768 ]; then	# IA-64 CPU
	     if [ $KERNEL_BITS -eq 64 -a "$CC" = "cc" ]; then
	        OUT="hpux64-ia64-cc"
             else
	        OUT="hpux-ia64-cc"
             fi
	elif [ $CPU_VERSION -ge 532 ]; then	# PA-RISC 2.x CPU
	     OUT=${OUT:-"hpux-parisc2-${CC}"}
	     if [ $KERNEL_BITS -eq 64 -a "$CC" = "cc" ]; then
		echo "WARNING! If you wish to build 64-bit library then you have to"
		echo "         invoke './Configure hpux64-parisc2-cc' *manually*."
		if [ "$TEST" = "false" -a -t 1 ]; then
		  echo "         You have about 5 seconds to press Ctrl-C to abort."
		  (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
		fi
	     fi
	elif [ $CPU_VERSION -ge 528 ]; then	# PA-RISC 1.1+ CPU
	     OUT="hpux-parisc-${CC}"
	elif [ $CPU_VERSION -ge 523 ]; then	# PA-RISC 1.0 CPU
	     OUT="hpux-parisc-${CC}"
	else					# Motorola(?) CPU
	     OUT="hpux-$CC"
	fi
	options="$options -D_REENTRANT" ;;
  *-hpux)	OUT="hpux-parisc-$CC" ;;
  *-aix)
	[ "$KERNEL_BITS" ] || KERNEL_BITS=`(getconf KERNEL_BITMODE) 2>/dev/null`
	KERNEL_BITS=${KERNEL_BITS:-32}
	OBJECT_MODE=${OBJECT_MODE:-32}
	if [ "$CC" = "gcc" ]; then
	    OUT="aix-gcc"
          if [ $OBJECT_MODE -eq 64 ]; then
            echo 'Your $OBJECT_MODE was found to be set to 64'
            OUT="aix64-gcc"
          fi
	elif [ $OBJECT_MODE -eq 64 ]; then
	    echo 'Your $OBJECT_MODE was found to be set to 64' 
	    OUT="aix64-cc"
	else
	    OUT="aix-cc"
	    if [ $KERNEL_BITS -eq 64 ]; then
		echo "WARNING! If you wish to build 64-bit kit, then you have to"
		echo "         invoke './Configure aix64-cc' *manually*."
		if [ "$TEST" = "false" -a -t 1 ]; then
		    echo "         You have ~5 seconds to press Ctrl-C to abort."
		    (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
		fi
	    fi
	fi
	if (lsattr -E -O -l `lsdev -c processor|awk '{print$1;exit}'` | grep -i powerpc) >/dev/null 2>&1; then
	    :	# this applies even to Power3 and later, as they return PowerPC_POWER[345]
	else
	    options="$options no-asm"
	fi
	;;
  # these are all covered by the catchall below
  # *-dgux) OUT="dgux" ;;
  mips-sony-newsos4) OUT="newsos4-gcc" ;;
  *-*-cygwin_pre1.3) OUT="Cygwin-pre1.3" ;;
  *-*-cygwin) OUT="Cygwin" ;;
  t3e-cray-unicosmk) OUT="cray-t3e" ;;
  j90-cray-unicos) OUT="cray-j90" ;;
  nsr-tandem-nsk) OUT="tandem-c89" ;;
  beos-*) OUT="$GUESSOS" ;;
  x86pc-*-qnx6) OUT="QNX6-i386" ;;
  *-*-qnx6) OUT="QNX6" ;;
  x86-*-android|i?86-*-android) OUT="android-x86" ;;
  armv[7-9]*-*-android) OUT="android-armv7" ;;
  *) OUT=`echo $GUESSOS | awk -F- '{print $3}'`;;
esac

# NB: This atalla support has been superceded by the ENGINE support
# That contains its own header and definitions anyway. Support can
# be enabled or disabled on any supported platform without external
# headers, eg. by adding the "hw-atalla" switch to ./config or
# perl Configure
#
# See whether we can compile Atalla support
#if [ -f /usr/include/atasi.h ]
#then
#  options="$options -DATALLA"
#fi

if expr "$options" : '.*no\-asm' > /dev/null; then :; else
  sh -c "$CROSS_COMPILE${CC:-gcc} -Wa,--help -c -o /tmp/null.$$.o -x assembler /dev/null && rm /tmp/null.$$.o" 2>&1 | \
  grep \\--noexecstack >/dev/null && \
  options="$options -Wa,--noexecstack"
fi

# gcc < 2.8 does not support -march=ultrasparc
if [ "$OUT" = solaris-sparcv9-gcc -a $GCCVER -lt 28 ]
then
  echo "WARNING! Falling down to 'solaris-sparcv8-gcc'."
  echo "         Upgrade to gcc-2.8 or later."
  sleep 5
  OUT=solaris-sparcv8-gcc
fi
if [ "$OUT" = "linux-sparcv9" -a $GCCVER -lt 28 ]
then
  echo "WARNING! Falling down to 'linux-sparcv8'."
  echo "         Upgrade to gcc-2.8 or later."
  sleep 5
  OUT=linux-sparcv8
fi

case "$GUESSOS" in
  i386-*) options="$options 386" ;;
esac

for i in aes bf camellia cast des dh dsa ec hmac idea md2 md5 mdc2 rc2 rc4 rc5 ripemd rsa seed sha
do
  if [ ! -d crypto/$i ]
  then
    options="$options no-$i"
  fi
done

# Discover Kerberos 5 (since it's still a prototype, we don't
# do any guesses yet, that's why this section is commented away.
#if [ -d /usr/kerberos ]; then
#    krb5_dir=/usr/kerberos
#    if [ \( -f $krb5_dir/lib/libgssapi_krb5.a -o -f $krb5_dir/lib/libgssapi_krb5.so* \)\
#	-a \( -f $krb5_dir/lib/libkrb5.a -o -f $krb5_dir/lib/libkrb5.so* \)\
#	-a \( -f $krb5_dir/lib/libcom_err.a -o -f $krb5_dir/lib/libcom_err.so* \)\
#	-a \( -f $krb5_dir/lib/libk5crypto.a -o -f $krb5_dir/lib/libk5crypto.so* \)\
#	-a \( -f $krb5_dir/include/krb5.h \) ]; then
#	options="$options --with-krb5-flavor=MIT"
#    fi
#elif [ -d /usr/heimdal ]; then
#    krb5_dir=/usr/heimdal
#    if [ \( -f $krb5_dir/lib/libgssapi.a -o -f $krb5_dir/lib/libgssapi.so* \)\
#	-a \( -f $krb5_dir/lib/libkrb5.a -o -f $krb5_dir/lib/libkrb5.so* \)\
#	-a \( -f $krb5_dir/lib/libcom_err.a -o -f $krb5_dir/lib/libcom_err.so* \)\
#	-a \( -f $krb5_dir/include/krb5.h \) ]; then
#	options="$options --with-krb5-flavor=Heimdal"
#    fi
#fi

if [ -z "$OUT" ]; then
  OUT="$CC"
fi

if [ ".$PERL" = . ] ; then
	for i in . `echo $PATH | sed 's/:/ /g'`; do
		if [ -f "$i/perl5$EXE" ] ; then
			PERL="$i/perl5$EXE"
			break;
		fi;
	done
fi

if [ ".$PERL" = . ] ; then
	for i in . `echo $PATH | sed 's/:/ /g'`; do
		if [ -f "$i/perl$EXE" ] ; then
			if "$i/perl$EXE" -e 'exit($]<5.0)'; then
				PERL="$i/perl$EXE"
				break;
			fi;
		fi;
	done
fi

if [ ".$PERL" = . ] ; then
	echo "You need Perl 5."
	exit 1
fi

# run Configure to check to see if we need to specify the 
# compiler for the platform ... in which case we add it on
# the end ... otherwise we leave it off

$PERL ./Configure LIST | grep "$OUT-$CC" > /dev/null
if [ $? = "0" ]; then
  OUT="$OUT-$CC"
fi

OUT="$PREFIX$OUT"

$PERL ./Configure LIST | grep "$OUT" > /dev/null
if [ $? = "0" ]; then
  echo Configuring for $OUT

  if [ "$TEST" = "true" ]; then
    echo $PERL ./Configure $OUT $options
  else
    $PERL ./Configure $OUT $options
  fi
else
  echo "This system ($OUT) is not supported. See file INSTALL for details."
fi
)
@


1.6.2.1
log
@file config was added on branch RELENG_8_4 on 2013-03-28 13:02:27 +0000
@
text
@d1 967
@


1.6.2.2
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/248810
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@a0 898
#!/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 config
for i
do
case "$i" in 
-d) PREFIX="debug-";;
-t*) TEST="true";;
-h*) TEST="true"; cat <<EOF
Usage: 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" ;;
esac
done

# First get uname entries that we use below

[ "$MACHINE" ] || MACHINE=`(uname -m) 2>/dev/null` || MACHINE="unknown"
[ "$RELEASE" ] || RELEASE=`(uname -r) 2>/dev/null` || RELEASE="unknown"
[ "$SYSTEM" ] || SYSTEM=`(uname -s) 2>/dev/null`  || SYSTEM="unknown"
[ "$BUILD" ] || 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
    fi
fi
# 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
# enough
if [ -d /usr/apollo ]; then
    echo "whatever-apollo-whatever"
    exit 0
fi

# Now NeXT
ISNEXT=`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: Punt

echo "${MACHINE}-whatever-${SYSTEM}" 
exit 0
) 2>/dev/null | (

# ---------------------------------------------------------------------------
# this is where the translation occurs into SSLeay terms
# ---------------------------------------------------------------------------

GCCVER=`(gcc -dumpversion) 2>/dev/null`
if [ "$GCCVER" != "" ]; then
  # then strip off whatever prefix egcs prepends the number with...
  # Hopefully, this will work for any future prefixes as well.
  GCCVER=`echo $GCCVER | LC_ALL=C 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/'`
fi

# Only set CC if not supplied already
if [ -z "$CC" ]; then
# figure out if gcc is available and if so we use it otherwise
# we fallback to whatever cc does on the system
  if [ "$GCCVER" != "" ]; then
    CC=gcc
  else
    CC=cc
  fi
fi
GCCVER=${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
  fi
fi
if [ "$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
  fi
  # check for WorkShop C, expected output is "cc: blah-blah C x.x"
  CCVER=`(cc -V 2>&1) 2>/dev/null | \
  	egrep -e '^cc: .* C [0-9]\.[0-9]' | \
	sed 's/.* C \([0-9]\)\.\([0-9]\).*/\1\2/'`
  CCVER=${CCVER:-0}
  if [ $MACHINE != i86pc -a $CCVER -gt 40 ]; then
    CC=cc	# overrides gcc!!!
    if [ $CCVER -eq 50 ]; then
      echo "WARNING! Detected WorkShop C 5.0. Do make sure you have"
      echo "         patch #107357-01 or later applied."
      sleep 5
    fi
  fi
fi

if [ "${SYSTEM}-${MACHINE}" = "Linux-alpha" ]; then
  # check for Compaq C, expected output is "blah-blah C Vx.x"
  CCCVER=`(ccc -V 2>&1) 2>/dev/null | \
	egrep -e '.* C V[0-9]\.[0-9]' | \
	sed 's/.* C V\([0-9]\)\.\([0-9]\).*/\1\2/'`
  CCCVER=${CCCVER:-0}
  if [ $CCCVER -gt 60 ]; then
    CC=ccc	# overrides gcc!!! well, ccc outperforms inoticeably
		# only on hash routines and des, otherwise gcc (2.95)
		# keeps along rather tight...
  fi
fi

if [ "${SYSTEM}" = "AIX" ]; then	# favor vendor cc over gcc
    (cc) 2>&1 | grep -iv "not found" > /dev/null && CC=cc
fi

CCVER=${CCVER:-0}

# read the output of the embedded GuessOS 
read GUESSOS

echo Operating system: $GUESSOS

# now map the output into SSLeay terms ... really should hack into the
# script above so we end up with values in vars but that would take
# more time that I want to waste at the moment
case "$GUESSOS" in
  mips2-sgi-irix)
	CPU=`(hinv -t cpu) 2>/dev/null | head -1 | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'`
	CPU=${CPU:-0}
	if [ $CPU -ge 4000 ]; then
		options="$options -mips2"
	fi
	OUT="irix-$CC"
	;;
  mips3-sgi-irix)
	#CPU=`(hinv -t cpu) 2>/dev/null | head -1 | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'`
	#CPU=${CPU:-0}
	#if [ $CPU -ge 5000 ]; then
	#	options="$options -mips4"
	#else
	#	options="$options -mips3"
	#fi
	OUT="irix-mips3-$CC"
	;;
  mips4-sgi-irix64)
	echo "WARNING! If you wish to build 64-bit library, then you have to"
	echo "         invoke './Configure irix64-mips4-$CC' *manually*."
	if [ "$TEST" = "false" -a -t 1 ]; then
	  echo "         You have about 5 seconds to press Ctrl-C to abort."
	  (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
	fi
        #CPU=`(hinv -t cpu) 2>/dev/null | head -1 | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'`
        #CPU=${CPU:-0}
        #if [ $CPU -ge 5000 ]; then
        #        options="$options -mips4"
        #else
        #        options="$options -mips3"
        #fi
	OUT="irix-mips3-$CC"
	;;
  ppc-apple-rhapsody) OUT="rhapsody-ppc-cc" ;;
  ppc-apple-darwin*) OUT="darwin-ppc-cc" ;;
  i386-apple-darwin*) OUT="darwin-i386-cc" ;;
  alpha-*-linux2)
        ISA=`awk '/cpu model/{print$4;exit(0);}' /proc/cpuinfo`
	case ${ISA:-generic} in
	*[678])	OUT="linux-alpha+bwx-$CC" ;;
	*)	OUT="linux-alpha-$CC" ;;
	esac
	if [ "$CC" = "gcc" ]; then
	    case ${ISA:-generic} in
	    EV5|EV45)		options="$options -mcpu=ev5";;
	    EV56|PCA56)		options="$options -mcpu=ev56";;
	    *)			options="$options -mcpu=ev6";;
	    esac
	fi
	;;
  ppc64-*-linux2)
	echo "WARNING! If you wish to build 64-bit library, then you have to"
	echo "         invoke './Configure linux-ppc64' *manually*."
	if [ "$TEST" = "false" -a -t 1 ]; then
	    echo "         You have about 5 seconds to press Ctrl-C to abort."
	    (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
	fi
	OUT="linux-ppc"
	;;
  ppc-*-linux2) OUT="linux-ppc" ;;
  ia64-*-linux?) OUT="linux-ia64" ;;
  sparc64-*-linux2)
	echo "WARNING! If you *know* that your GNU C supports 64-bit/V9 ABI"
	echo "         and wish to build 64-bit library, then you have to"
	echo "         invoke './Configure linux64-sparcv9' *manually*."
	if [ "$TEST" = "false" -a -t 1 ]; then
	  echo "          You have about 5 seconds to press Ctrl-C to abort."
	  (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
	fi
	OUT="linux-sparcv9" ;;
  sparc-*-linux2)
	KARCH=`awk '/^type/{print$3;exit(0);}' /proc/cpuinfo`
	case ${KARCH:-sun4} in
	sun4u*)	OUT="linux-sparcv9" ;;
	sun4m)	OUT="linux-sparcv8" ;;
	sun4d)	OUT="linux-sparcv8" ;;
	*)	OUT="linux-generic32"; options="$options -DB_ENDIAN" ;;
	esac ;;
  parisc*-*-linux2)
	# 64-bit builds under parisc64 linux are not supported and
	# compiler is expected to generate 32-bit objects...
	CPUARCH=`awk '/cpu family/{print substr($5,1,3); exit(0);}' /proc/cpuinfo`
	CPUSCHEDULE=`awk '/^cpu.[ 	]*: PA/{print substr($3,3); exit(0);}' /proc/cpuinfo`

	# ??TODO ??  Model transformations
	# 0. CPU Architecture for the 1.1 processor has letter suffixes. We strip that off
	#    assuming no further arch. identification will ever be used by GCC.
	# 1. I'm most concerned about whether is a 7300LC is closer to a 7100 versus a 7100LC.
	# 2. The variant 64-bit processors cause concern should GCC support explicit schedulers
	#    for these chips in the future.
	#         PA7300LC -> 7100LC (1.1)
	#         PA8200   -> 8000   (2.0)
	#         PA8500   -> 8000   (2.0)
	#         PA8600   -> 8000   (2.0)

	CPUSCHEDULE=`echo $CPUSCHEDULE|sed -e 's/7300LC/7100LC/' -e 's/8.00/8000/'`
	# Finish Model transformations

	options="$options -DB_ENDIAN -mschedule=$CPUSCHEDULE -march=$CPUARCH"
	OUT="linux-generic32" ;;
  arm*b-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN" ;;
  arm*l-*-linux2) OUT="linux-generic32"; options="$options -DL_ENDIAN" ;;
  sh*b-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN" ;;
  sh*-*-linux2)  OUT="linux-generic32"; options="$options -DL_ENDIAN" ;;
  m68k*-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN" ;;
  s390-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN -DNO_ASM" ;;
  s390x-*-linux2) OUT="linux-generic64"; options="$options -DB_ENDIAN" ;;
  x86_64-*-linux?) OUT="linux-x86_64" ;;
  *86-*-linux2) OUT="linux-elf"
	if [ "$GCCVER" -gt 28 ]; then
          if grep '^model.*Pentium' /proc/cpuinfo >/dev/null ; then
	    options="$options -march=pentium"
          fi
          if grep '^model.*Pentium Pro' /proc/cpuinfo >/dev/null ; then
	    options="$options -march=pentiumpro"
          fi
          if grep '^model.*K6' /proc/cpuinfo >/dev/null ; then
	    options="$options -march=k6"
          fi
        fi ;;
  *-*-linux1) OUT="linux-aout" ;;
  *-*-linux2) OUT="linux-generic32" ;;
  sun4[uv]*-*-solaris2)
	OUT="solaris-sparcv9-$CC"
	ISA64=`(isalist) 2>/dev/null | grep sparcv9`
	if [ "$ISA64" != "" ]; then
	    if [ "$CC" = "cc" -a $CCVER -ge 50 ]; then
		echo "WARNING! If you wish to build 64-bit library, then you have to"
		echo "         invoke './Configure solaris64-sparcv9-cc' *manually*."
		if [ "$TEST" = "false" -a -t 1 ]; then
		  echo "         You have about 5 seconds to press Ctrl-C to abort."
		  (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
		fi
	    elif [ "$CC" = "gcc" -a "$GCC_ARCH" = "-m64" ]; then
		# $GCC_ARCH denotes default ABI chosen by compiler driver
		# (first one found on the $PATH). I assume that user
		# expects certain consistency with the rest of his builds
		# and therefore switch over to 64-bit. <appro>
		OUT="solaris64-sparcv9-gcc"
		echo "WARNING! If you wish to build 32-bit library, then you have to"
		echo "         invoke './Configure solaris-sparcv9-gcc' *manually*."
		if [ "$TEST" = "false" -a -t 1 ]; then
		  echo "         You have about 5 seconds to press Ctrl-C to abort."
		  (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
		fi
	    elif [ "$GCC_ARCH" = "-m32" ]; then
		echo "NOTICE! If you *know* that your GNU C supports 64-bit/V9 ABI"
		echo "        and wish to build 64-bit library, then you have to"
		echo "        invoke './Configure solaris64-sparcv9-gcc' *manually*."
		if [ "$TEST" = "false" -a -t 1 ]; then
		  echo "         You have about 5 seconds to press Ctrl-C to abort."
		  (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
		fi
	    fi
	fi
	;;
  sun4m-*-solaris2)	OUT="solaris-sparcv8-$CC" ;;
  sun4d-*-solaris2)	OUT="solaris-sparcv8-$CC" ;;
  sun4*-*-solaris2)	OUT="solaris-sparcv7-$CC" ;;
  *86*-*-solaris2)
	ISA64=`(isalist) 2>/dev/null | grep amd64`
	if [ "$ISA64" != "" ]; then
	    OUT="solaris64-x86_64-$CC"
	else
	    OUT="solaris-x86-$CC"
	    if [ `uname -r | sed -e 's/5\.//'` -lt 10 ]; then
		options="$options no-sse2"
	    fi
	fi
	;;
  *-*-sunos4)		OUT="sunos-$CC" ;;

  *86*-*-bsdi4)		OUT="BSD-x86-elf"; options="$options no-sse2 -ldl" ;;
  alpha*-*-*bsd*)	OUT="BSD-generic64"; options="$options -DL_ENDIAN" ;;
  powerpc64-*-*bsd*)	OUT="BSD-generic64"; options="$options -DB_ENDIAN" ;;
  sparc64-*-*bsd*)	OUT="BSD-sparc64" ;;
  ia64-*-*bsd*)		OUT="BSD-ia64" ;;
  amd64-*-*bsd*)	OUT="BSD-x86_64" ;;
  *86*-*-*bsd*)		# mimic ld behaviour when it's looking for libc...
			if [ -L /usr/lib/libc.so ]; then	# [Free|Net]BSD
			    libc=/usr/lib/libc.so
			else					# OpenBSD
			    # ld searches for highest libc.so.* and so do we
			    libc=`(ls /usr/lib/libc.so.* | tail -1) 2>/dev/null`
			fi
			case "`(file -L $libc) 2>/dev/null`" in
			*ELF*)	OUT="BSD-x86-elf" ;;
			*)	OUT="BSD-x86"; options="$options no-sse2" ;;
			esac ;;
  *-*-*bsd*)		OUT="BSD-generic32" ;;

  *-*-osf)		OUT="osf1-alpha-cc" ;;
  *-*-tru64)		OUT="tru64-alpha-cc" ;;
  *-*-[Uu]nix[Ww]are7)
	if [ "$CC" = "gcc" ]; then
	  OUT="unixware-7-gcc" ; options="$options no-sse2"
	else    
	  OUT="unixware-7" ; options="$options no-sse2 -D__i386__"
	fi
	;;
  *-*-[Uu]nix[Ww]are20*) OUT="unixware-2.0"; options="$options no-sse2 no-sha512" ;;
  *-*-[Uu]nix[Ww]are21*) OUT="unixware-2.1"; options="$options no-sse2 no-sha512" ;;
  *-*-vos)
	options="$options no-threads no-shared no-asm no-dso"
	EXE=".pm"
	OUT="vos-$CC" ;;
  BS2000-siemens-sysv4) OUT="BS2000-OSD" ;;
  RM*-siemens-sysv4) OUT="ReliantUNIX" ;;
  *-siemens-sysv4) OUT="SINIX" ;;
  *-hpux1*)
	if [ $CC = "gcc" -a $GCC_BITS = "64" ]; then
	    OUT="hpux64-parisc2-gcc"
	fi
	KERNEL_BITS=`(getconf KERNEL_BITS) 2>/dev/null`
	KERNEL_BITS=${KERNEL_BITS:-32}
	CPU_VERSION=`(getconf CPU_VERSION) 2>/dev/null`
	CPU_VERSION=${CPU_VERSION:-0}
	# See <sys/unistd.h> for further info on CPU_VERSION.
	if   [ $CPU_VERSION -ge 768 ]; then	# IA-64 CPU
	     echo "WARNING! 64-bit ABI is the default configured ABI on HP-UXi."
	     echo "         If you wish to build 32-bit library, the you have to"
	     echo "         invoke './Configure hpux-ia64-cc' *manually*."
	     if [ "$TEST" = "false" -a -t 1 ]; then
		echo "         You have about 5 seconds to press Ctrl-C to abort."
		(trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
	     fi
	     OUT="hpux64-ia64-cc"
	elif [ $CPU_VERSION -ge 532 ]; then	# PA-RISC 2.x CPU
	     OUT=${OUT:-"hpux-parisc2-${CC}"}
	     if [ $KERNEL_BITS -eq 64 -a "$CC" = "cc" ]; then
		echo "WARNING! If you wish to build 64-bit library then you have to"
		echo "         invoke './Configure hpux64-parisc2-cc' *manually*."
		if [ "$TEST" = "false" -a -t 1 ]; then
		  echo "         You have about 5 seconds to press Ctrl-C to abort."
		  (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
		fi
	     fi
	elif [ $CPU_VERSION -ge 528 ]; then	# PA-RISC 1.1+ CPU
	     OUT="hpux-parisc-${CC}"
	elif [ $CPU_VERSION -ge 523 ]; then	# PA-RISC 1.0 CPU
	     OUT="hpux-parisc-${CC}"
	else					# Motorola(?) CPU
	     OUT="hpux-$CC"
	fi
	options="$options -D_REENTRANT" ;;
  *-hpux)	OUT="hpux-parisc-$CC" ;;
  *-aix)
	KERNEL_BITS=`(getconf KERNEL_BITMODE) 2>/dev/null`
	KERNEL_BITS=${KERNEL_BITS:-32}
	OBJECT_MODE=${OBJECT_MODE:-32}
	if [ "$CC" = "gcc" ]; then
	    OUT="aix-gcc"
          if [ $OBJECT_MODE -eq 64 ]; then
            echo 'Your $OBJECT_MODE was found to be set to 64'
            OUT="aix64-gcc"
          fi
	elif [ $OBJECT_MODE -eq 64 ]; then
	    echo 'Your $OBJECT_MODE was found to be set to 64' 
	    OUT="aix64-cc"
	else
	    OUT="aix-cc"
	    if [ $KERNEL_BITS -eq 64 ]; then
		echo "WARNING! If you wish to build 64-bit kit, then you have to"
		echo "         invoke './Configure aix64-cc' *manually*."
		if [ "$TEST" = "false" -a -t 1 ]; then
		    echo "         You have ~5 seconds to press Ctrl-C to abort."
		    (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
		fi
	    fi
	fi
	if (lsattr -E -O -l `lsdev -c processor|awk '{print$1;exit}'` | grep -i powerpc) >/dev/null 2>&1; then
	    :	# this applies even to Power3 and later, as they return PowerPC_POWER[345]
	else
	    options="$options no-asm"
	fi
	;;
  # these are all covered by the catchall below
  # *-dgux) OUT="dgux" ;;
  mips-sony-newsos4) OUT="newsos4-gcc" ;;
  *-*-cygwin_pre1.3) OUT="Cygwin-pre1.3" ;;
  *-*-cygwin) OUT="Cygwin" ;;
  t3e-cray-unicosmk) OUT="cray-t3e" ;;
  j90-cray-unicos) OUT="cray-j90" ;;
  nsr-tandem-nsk) OUT="tandem-c89" ;;
  x86pc-*-qnx6) OUT="QNX6-i386" ;;
  *-*-qnx6) OUT="QNX6" ;;
  *) OUT=`echo $GUESSOS | awk -F- '{print $3}'`;;
esac

# NB: This atalla support has been superceded by the ENGINE support
# That contains its own header and definitions anyway. Support can
# be enabled or disabled on any supported platform without external
# headers, eg. by adding the "hw-atalla" switch to ./config or
# perl Configure
#
# See whether we can compile Atalla support
#if [ -f /usr/include/atasi.h ]
#then
#  options="$options -DATALLA"
#fi

($CC -Wa,--help -c -o /dev/null -x assembler /dev/null 2>&1 | \
 grep \\--noexecstack) 2>&1 > /dev/null && \
  options="$options -Wa,--noexecstack"

# gcc < 2.8 does not support -march=ultrasparc
if [ "$OUT" = solaris-sparcv9-gcc -a $GCCVER -lt 28 ]
then
  echo "WARNING! Falling down to 'solaris-sparcv8-gcc'."
  echo "         Upgrade to gcc-2.8 or later."
  sleep 5
  OUT=solaris-sparcv8-gcc
fi
if [ "$OUT" = "linux-sparcv9" -a $GCCVER -lt 28 ]
then
  echo "WARNING! Falling down to 'linux-sparcv8'."
  echo "         Upgrade to gcc-2.8 or later."
  sleep 5
  OUT=linux-sparcv8
fi

case "$GUESSOS" in
  i386-*) options="$options 386" ;;
esac

for i in aes bf camellia cast des dh dsa ec hmac idea md2 md5 mdc2 rc2 rc4 rc5 ripemd rsa seed sha
do
  if [ ! -d crypto/$i ]
  then
    options="$options no-$i"
  fi
done

# Discover Kerberos 5 (since it's still a prototype, we don't
# do any guesses yet, that's why this section is commented away.
#if [ -d /usr/kerberos ]; then
#    krb5_dir=/usr/kerberos
#    if [ \( -f $krb5_dir/lib/libgssapi_krb5.a -o -f $krb5_dir/lib/libgssapi_krb5.so* \)\
#	-a \( -f $krb5_dir/lib/libkrb5.a -o -f $krb5_dir/lib/libkrb5.so* \)\
#	-a \( -f $krb5_dir/lib/libcom_err.a -o -f $krb5_dir/lib/libcom_err.so* \)\
#	-a \( -f $krb5_dir/lib/libk5crypto.a -o -f $krb5_dir/lib/libk5crypto.so* \)\
#	-a \( -f $krb5_dir/include/krb5.h \) ]; then
#	options="$options --with-krb5-flavor=MIT"
#    fi
#elif [ -d /usr/heimdal ]; then
#    krb5_dir=/usr/heimdal
#    if [ \( -f $krb5_dir/lib/libgssapi.a -o -f $krb5_dir/lib/libgssapi.so* \)\
#	-a \( -f $krb5_dir/lib/libkrb5.a -o -f $krb5_dir/lib/libkrb5.so* \)\
#	-a \( -f $krb5_dir/lib/libcom_err.a -o -f $krb5_dir/lib/libcom_err.so* \)\
#	-a \( -f $krb5_dir/include/krb5.h \) ]; then
#	options="$options --with-krb5-flavor=Heimdal"
#    fi
#fi

if [ -z "$OUT" ]; then
  OUT="$CC"
fi

if [ ".$PERL" = . ] ; then
	for i in . `echo $PATH | sed 's/:/ /g'`; do
		if [ -f "$i/perl5$EXE" ] ; then
			PERL="$i/perl5$EXE"
			break;
		fi;
	done
fi

if [ ".$PERL" = . ] ; then
	for i in . `echo $PATH | sed 's/:/ /g'`; do
		if [ -f "$i/perl$EXE" ] ; then
			if "$i/perl$EXE" -e 'exit($]<5.0)'; then
				PERL="$i/perl$EXE"
				break;
			fi;
		fi;
	done
fi

if [ ".$PERL" = . ] ; then
	echo "You need Perl 5."
	exit 1
fi

# run Configure to check to see if we need to specify the 
# compiler for the platform ... in which case we add it on
# the end ... otherwise we leave it off

$PERL ./Configure LIST | grep "$OUT-$CC" > /dev/null
if [ $? = "0" ]; then
  OUT="$OUT-$CC"
fi

OUT="$PREFIX$OUT"

$PERL ./Configure LIST | grep "$OUT" > /dev/null
if [ $? = "0" ]; then
  echo Configuring for $OUT

  if [ "$TEST" = "true" ]; then
    echo $PERL ./Configure $OUT $options
  else
    $PERL ./Configure $OUT $options
  fi
else
  echo "This system ($OUT) is not supported. See file INSTALL for details."
fi
)
@


1.5
log
@SVN rev 237657 on 2012-06-27 18:44:36Z by jkim

Merge OpenSSL 0.9.8x.

Reviewed by:	stas
Approved by:	benl (maintainer)
MFC after:	3 days
@
text
@d32 1
a32 1
-d) PREFIX="debug-";;
d125 8
d281 1
a281 1
		echo "i386-apple-darwin${VERSION}"
d373 4
a413 12
GCCVER=`(gcc -dumpversion) 2>/dev/null`
if [ "$GCCVER" != "" ]; then
  # then strip off whatever prefix egcs prepends the number with...
  # Hopefully, this will work for any future prefixes as well.
  GCCVER=`echo $GCCVER | LC_ALL=C 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/'`
fi

d415 2
a416 3
if [ -z "$CC" ]; then
# figure out if gcc is available and if so we use it otherwise
# we fallback to whatever cc does on the system
d418 8
d498 6
d539 36
a574 2
  ppc-apple-darwin*) OUT="darwin-ppc-cc" ;;
  i386-apple-darwin*) OUT="darwin-i386-cc" ;;
d599 5
d644 3
a646 2
  arm*b-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN" ;;
  arm*l-*-linux2) OUT="linux-generic32"; options="$options -DL_ENDIAN" ;;
d650 13
a662 2
  s390-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN -DNO_ASM" ;;
  s390x-*-linux2) OUT="linux-generic64"; options="$options -DB_ENDIAN" ;;
d681 1
a681 1
	if [ "$ISA64" != "" ]; then
d711 3
d720 1
a720 1
	if [ "$ISA64" != "" ]; then
d772 1
a772 1
	KERNEL_BITS=`(getconf KERNEL_BITS) 2>/dev/null`
d778 5
a782 8
	     echo "WARNING! 64-bit ABI is the default configured ABI on HP-UXi."
	     echo "         If you wish to build 32-bit library, the you have to"
	     echo "         invoke './Configure hpux-ia64-cc' *manually*."
	     if [ "$TEST" = "false" -a -t 1 ]; then
		echo "         You have about 5 seconds to press Ctrl-C to abort."
		(trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
	     fi
	     OUT="hpux64-ia64-cc"
d803 1
a803 1
	KERNEL_BITS=`(getconf KERNEL_BITMODE) 2>/dev/null`
d840 1
d843 2
d860 3
a862 2
($CC -Wa,--help -c -o /dev/null -x assembler /dev/null 2>&1 | \
 grep \\--noexecstack) 2>&1 > /dev/null && \
d864 1
@


1.4
log
@SVN rev 206046 on 2010-04-01 15:19:51Z by simon

Merge OpenSSL 0.9.8n into head.

This fixes CVE-2010-0740 which only affected -CURRENT (OpenSSL 0.9.8m)
but not -STABLE branches.

I have not yet been able to find out if CVE-2010-0433 impacts FreeBSD.
This will be investigated further.

Security:	CVE-2010-0433, CVE-2010-0740
Security:	http://www.openssl.org/news/secadv_20100324.txt
@
text
@d793 4
@


1.4.4.1
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/249029
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@a792 4
($CC -Wa,--help -c -o /dev/null -x assembler /dev/null 2>&1 | \
 grep \\--noexecstack) 2>&1 > /dev/null && \
  options="$options -Wa,--noexecstack"

@


1.4.2.1
log
@SVN rev 237998 on 2012-07-02 16:00:38Z by jkim

MFC:	r237657, r237658, r237666

Merge OpenSSL 0.9.8x and regen manual pages.
@
text
@a792 4
($CC -Wa,--help -c -o /dev/null -x assembler /dev/null 2>&1 | \
 grep \\--noexecstack) 2>&1 > /dev/null && \
  options="$options -Wa,--noexecstack"

@


1.3
log
@SVN rev 205128 on 2010-03-13 19:22:41Z by simon

Merge OpenSSL 0.9.8m into head.

This also "reverts" some FreeBSD local changes so we should now
be back to using entirely stock OpenSSL.  The local changes were
simple $FreeBSD$ lines additions, which were required in the CVS
days, and the patch for FreeBSD-SA-09:15.ssl which has been
superseded with OpenSSL 0.9.8m's RFC5746 'TLS renegotiation
extension' support.

MFC after:	3 weeks
@
text
@d744 4
@


1.2
log
@SVN rev 194206 on 2009-06-14 19:45:16Z by simon

Merge OpenSSL 0.9.8k into head.

Approved by:	re
@
text
@d51 4
a54 4
MACHINE=`(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"
d772 2
@


1.2.2.1
log
@SVN rev 208419 on 2010-05-22 18:40:54Z by simon

Merge OpenSSL 0.9.8n from head into stable/8.

Approved by:	re (kib)
@
text
@d51 4
a54 4
[ "$MACHINE" ] || MACHINE=`(uname -m) 2>/dev/null` || MACHINE="unknown"
[ "$RELEASE" ] || RELEASE=`(uname -r) 2>/dev/null` || RELEASE="unknown"
[ "$SYSTEM" ] || SYSTEM=`(uname -s) 2>/dev/null`  || SYSTEM="unknown"
[ "$BUILD" ] || VERSION=`(uname -v) 2>/dev/null` || VERSION="unknown"
a743 4
          if [ $OBJECT_MODE -eq 64 ]; then
            echo 'Your $OBJECT_MODE was found to be set to 64'
            OUT="aix64-gcc"
          fi
a771 2
  x86pc-*-qnx6) OUT="QNX6-i386" ;;
  *-*-qnx6) OUT="QNX6" ;;
@


1.2.2.1.6.1
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/249029
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@a792 4
($CC -Wa,--help -c -o /dev/null -x assembler /dev/null 2>&1 | \
 grep \\--noexecstack) 2>&1 > /dev/null && \
  options="$options -Wa,--noexecstack"

@


1.2.2.2
log
@SVN rev 237999 on 2012-07-02 16:14:35Z by jkim

MFC:	r237657, r237658, r237666

Merge OpenSSL 0.9.8x and regen manual pages.
@
text
@a792 4
($CC -Wa,--help -c -o /dev/null -x assembler /dev/null 2>&1 | \
 grep \\--noexecstack) 2>&1 > /dev/null && \
  options="$options -Wa,--noexecstack"

@


1.1
log
@Initial revision
@
text
@d23 26
d56 1
d78 5
a82 5
		if [ "x$VERSION" = "x2.1.1" ]; then
		    echo "${MACHINE}-whatever-unixware211"; exit 0
		else
		    echo "${MACHINE}-whatever-unixware2"; exit 0
		fi
d87 12
d105 4
d113 8
d122 1
a122 1
	echo "${MACHINE}-ibm-aix"; exit 0
d136 2
a137 5
	    11.*)
		echo "${MACHINE}-hp-hpux11"; exit 0
		;;
	    10.*)
		echo "${MACHINE}-hp-hpux10"; exit 0
d165 4
d192 1
a192 1
    FreeBSD:*)
a200 1
           Alpha*      ) MACH="alpha"    ;;
d209 4
d214 1
a214 1
        echo "`sysctl -n hw.model | sed 's,.*\(.\)86-class.*,i\186,'`-whateve\r-netbsd"; exit 0
d225 4
d230 12
a241 1
	echo "${MACHINE}-dec-osf"; exit 0
d245 6
a250 3
	case "$VERSION" in
	    423)
		echo "${MACHINE}-qssl-qnx32"
d253 1
a253 1
		echo "${MACHINE}-qssl-qnx"
d263 16
d280 1
a280 1
	echo "${MACHINE}-sun-solaris2"; exit 0
d291 8
d335 30
d402 1
a402 28
PREFIX=""
SUFFIX=""
TEST="false"

# pick up any command line args to config
for i
do
case "$i" in 
-d*) PREFIX="debug-";;
-t*) TEST="true";;
-h*) TEST="true"; cat <<EOF
Usage: 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" ;;
esac
done

# figure out if gcc is available and if so we use it otherwise
# we fallback to whatever cc does on the system
GCCVER=`(gcc --version) 2>/dev/null`
d404 6
a409 3
  CC=gcc
  # then strip off whatever prefix Cygnus prepends the number with...
  GCCVER=`echo $GCCVER | sed 's/^[a-z]*\-//'`
a411 2
else
  CC=cc
d414 24
d439 10
a448 1
  # assume output is "blah-blah C x.x"
d453 1
a453 1
  if [ $CCVER -gt 40 ]; then
a459 2
  elif [ "$CC" = "cc" -a $CCVER -gt 0 ]; then
    CC=sc3
d463 17
a479 1
GCCVER=${GCCVER:-0}
a490 3
  alpha-*-linux2) OUT="alpha-gcc" ;;
  ppc-*-linux2) OUT="linux-ppc" ;;
  mips-*-linux?) OUT="linux-mips" ;;
d492 1
a492 1
	CPU=`(hinv -t cpu) 2>/dev/null | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'`
d500 7
a506 7
	CPU=`(hinv -t cpu) 2>/dev/null | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'`
	CPU=${CPU:-0}
	if [ $CPU -ge 5000 ]; then
		options="$options -mips4"
	else
		options="$options -mips3"
	fi
d511 12
a522 4
	echo "         invoke './Configre irix64-mips4-$CC' *manually*."
	echo "         Type Ctrl-C if you don't want to continue."
	read waste < /dev/tty
	options="$options -mips4"
d525 28
d554 7
a560 6
	#Before we can uncomment following lines we have to wait at least
	#till 64-bit glibc for SPARC is operational:-(
	#echo "WARNING! If you wish to build 64-bit library, then you have to"
	#echo "         invoke './Configure linux64-sparcv9' *manually*."
	#echo "         Type Ctrl-C if you don't want to continue."
	#read waste < /dev/tty
d563 1
a563 1
	KARCH=`awk '/type/{print$3}' /proc/cpuinfo`
d568 1
a568 1
	*)	OUT="linux-sparcv7" ;;
d570 42
a611 1
  *-*-linux2) OUT="linux-elf" ;;
d613 3
a615 1
  sun4u*-sun-solaris2)
d617 2
a618 1
	if [ "$ISA64" != "" -a "$CC" = "cc" -a $CCVER -ge 50 ]; then
d621 25
a645 2
		echo "         Type Ctrl-C if you don't want to continue."
		read waste < /dev/tty
d647 51
a697 19
	OUT="solaris-sparcv9-$CC" ;;
  sun4m-sun-solaris2)	OUT="solaris-sparcv8-$CC" ;;
  sun4d-sun-solaris2)	OUT="solaris-sparcv8-$CC" ;;
  sun4*-sun-solaris2)	OUT="solaris-sparcv7-$CC" ;;
  *86*-sun-solaris2) OUT="solaris-x86-$CC" ;;
  *-*-sunos4) OUT="sunos-$CC" ;;
  alpha*-*-freebsd*) OUT="FreeBSD-alpha" ;;
  *-freebsd[3-9]*) OUT="FreeBSD-elf" ;;
  *-freebsd[1-2]*) OUT="FreeBSD" ;;
  *86*-*-netbsd) OUT="NetBSD-x86" ;;
  sun3*-*-netbsd) OUT="NetBSD-m68" ;;
  *-*-netbsd) OUT="NetBSD-sparc" ;;
  *86*-*-openbsd) OUT="OpenBSD-x86" ;;
  alpha*-*-openbsd) OUT="OpenBSD-alpha" ;;
  pmax*-*-openbsd) OUT="OpenBSD-mips" ;;
  *-*-openbsd) OUT="OpenBSD" ;;
  *86*-*-bsdi4) OUT="bsdi-elf-gcc" ;;
  *-*-osf) OUT="alpha-cc" ;;
  *-*-unixware*) OUT="unixware-2.0" ;;
d701 63
a764 2
  # *-hpux*) OUT="hpux-$CC" ;;
  # *-aix) OUT="aix-$CC" ;;
d766 6
d775 13
a787 1
# gcc < 2.8 does not support -mcpu=ultrasparc
d790 2
a791 1
  echo "WARNING! Do consider upgrading to gcc-2.8 or later."
d793 1
a793 1
  OUT=solaris-sparcv9-gcc27
d807 1
a807 1
for i in bf cast des dh dsa hmac md2 md5 mdc2 rc2 rc4 rc5 ripemd rsa sha
d815 21
d842 2
a843 2
		if [ -f "$i/perl5" ] ; then
			PERL="$i/perl5"
d851 3
a853 3
		if [ -f "$i/perl" ] ; then
			if "$i/perl" -e 'exit($]<5.0)'; then
				PERL="$i/perl"
d869 1
a869 1
$PERL ./Configure 2>&1 | grep "$OUT-$CC" > /dev/null
d876 1
a876 1
$PERL ./Configure 2>&1 | grep "$OUT" > /dev/null
@


1.1.1.1
log
@Initial import of OpenSSL 0.9.4, sans IDEA and RSA code for patent
infringement reasons.
@
text
@@


1.1.1.1.2.1
log
@MFC: OpenSSL 0.9.5a
@
text
@a29 1

a52 2
		elif [ "x$VERSION" = "x2.1.2" ]; then
		    echo "${MACHINE}-whatever-unixware212"; exit 0
a59 5
	    5)
		if [ "`echo x$VERSION | sed -e 's/\..*//'`" = "x7" ]; then
		    echo "${MACHINE}-sco-unixware7"; exit 0
		fi
		;;
a189 4
    Rhapsody:*)
	echo "ppc-apple-rhapsody"; exit 0
	;;

a282 2
# shared library support (behnke@@trustcenter.de)
-shared) SHARED=true;;
d314 1
a314 1
  # check for WorkShop C, expected output is "cc: blah-blah C x.x"
a330 13
if [ "${SYSTEM}-${MACHINE}" = "Linux-alpha" ]; then
  # check for Compaq C, expected output is "blah-blah C Vx.x"
  CCCVER=`(ccc -V 2>&1) 2>/dev/null | \
	egrep -e '.* C V[0-9]\.[0-9]' | \
	sed 's/.* C V\([0-9]\)\.\([0-9]\).*/\1\2/'`
  CCCVER=${CCCVER:-0}
  if [ $CCCVER -gt 60 ]; then
    CC=ccc	# overrides gcc!!! well, ccc outperforms inoticeably
		# only on hash routines and des, otherwise gcc (2.95)
		# keeps along rather tight...
  fi
fi

d343 3
a371 18
  alpha-*-linux2)
        ISA=`awk '/cpu model/{print$4}' /proc/cpuinfo`
	case ${ISA:-generic} in
	*[67])	OUT="linux-alpha+bwx-$CC" ;;
	*)	OUT="linux-alpha-$CC" ;;
	esac
	if [ "$CC" = "gcc" ]; then
	    case ${ISA:-generic} in
	    EV5|EV45)		options="$options -mcpu=ev5";;
	    EV56|PCA56)		options="$options -mcpu=ev56";;
	    EV6|EV67|PCA57)	options="$options -mcpu=ev6";;
	    esac
	fi
	;;
  mips-*-linux?) OUT="linux-mips" ;;
  ppc-*-linux2) OUT="linux-ppc" ;;
  ia64-*-linux?) OUT="linux-ia64" ;;
  ppc-apple-rhapsody) OUT="rhapsody-ppc-cc" ;;
d416 1
a416 6
  *-*-unixware7) OUT="unixware-7" ;;
  *-*-UnixWare7) OUT="unixware-7" ;;
  *-*-Unixware7) OUT="unixware-7" ;;
  *-*-unixware[1-2]*) OUT="unixware-2.0" ;;
  *-*-UnixWare[1-2]*) OUT="unixware-2.0" ;;
  *-*-Unixware[1-2]*) OUT="unixware-2.0" ;;
a419 3
  *-hpux1*)	OUT="hpux-parisc-$CC"
		options="$options -D_REENTRANT" ;;
  *-hpux)	OUT="hpux-parisc-$CC" ;;
d421 1
a426 16
# See whether we can compile Atalla support
if [ -f /usr/include/atasi.h ]
then
  options="$options -DATALLA"
fi

#get some basic shared lib support (behnke@@trustcenter.de)
case "$OUT" in
   solaris-*-gcc)
	if  [ "$SHARED" = "true" ] 
	 then
	  options="$options -DPIC -fPIC"
        fi
     ;;
esac

a440 11
# To start with $OUT is never i86pc-sun-solaris2. Secondly why
# ban *all* assembler implementation if it can't stand only one,
# SHA-0 implementation.
#if [ "$OUT" = "i86pc-sun-solaris2" ]
#then
#  ASM=`as -V /dev/null 2>&1`
#  case "$ASM" in
#    GNU*) ;;
#    *) 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." ;;
#  esac
#fi
d487 1
a487 1
$PERL ./Configure LIST | grep "$OUT-$CC" > /dev/null
d494 1
a494 1
$PERL ./Configure LIST | grep "$OUT" > /dev/null
@


1.1.1.1.2.2
log
@MFC: OpenSSL 0.9.6
@
text
@a73 4
    MPE/iX:*)
	MACHINE=`echo "$MACHINE" | sed -e 's/-/_/g'`
	echo "parisc-hp-MPE/iX"; exit 0
	;;
d167 1
a167 1
        echo "`/usr/sbin/sysctl -n hw.model | sed 's,.*\(.\)86-class.*,i\186,'`-whatever-netbsd"; exit 0
d184 2
a185 2
	    4*)
		echo "${MACHINE}-whatever-qnx4"
d188 1
a188 1
		echo "${MACHINE}-whatever-qnx"
d203 1
a203 1
	echo "${MACHINE}-whatever-solaris2"; exit 0
a249 4
    NEWS-OS:4.*)
	echo "mips-sony-newsos4"; exit 0;
	;;

d295 2
a411 1
  m68k-*-linux*) OUT="linux-m68k" ;;
a429 1
  arm*-*-linux2) OUT="linux-elf-arm" ;;
d432 1
a432 1
  sun4u*-*-solaris2)
d441 4
a444 4
  sun4m-*-solaris2)	OUT="solaris-sparcv8-$CC" ;;
  sun4d-*-solaris2)	OUT="solaris-sparcv8-$CC" ;;
  sun4*-*-solaris2)	OUT="solaris-sparcv7-$CC" ;;
  *86*-*-solaris2) OUT="solaris-x86-$CC" ;;
a472 1
  mips-sony-newsos4) OUT="newsos4-gcc" ;;
d482 10
d506 11
d572 1
a572 1
  #echo Configuring for $OUT
@


1.1.1.1.2.3
log
@MFC: Update to OpenSSL 0.9.6a
@
text
@d52 1
a52 7
		if [ "x$VERSION" = "x2.01" ]; then
		    echo "${MACHINE}-whatever-unixware201"; exit 0
		elif [ "x$VERSION" = "x2.02" ]; then
		    echo "${MACHINE}-whatever-unixware202"; exit 0
		elif [ "x$VERSION" = "x2.03" ]; then
		    echo "${MACHINE}-whatever-unixware203"; exit 0
		elif [ "x$VERSION" = "x2.1.1" ]; then
a55 2
		elif [ "x$VERSION" = "x2.1.3" ]; then
		    echo "${MACHINE}-whatever-unixware213"; exit 0
a81 8
    AIX:[3456789]:4:*)
	echo "${MACHINE}-ibm-aix43"; exit 0
	;;

    AIX:*:[56789]:*)
	echo "${MACHINE}-ibm-aix43"; exit 0
	;;

d171 1
a171 1
        echo "`(/usr/sbin/sysctl -n hw.model || /sbin/sysctl -n hw.model) | sed 's,.*\(.\)86-class.*,i\186,'`-whatever-netbsd"; exit 0
d396 2
a397 2
	echo "         invoke './Configure irix64-mips4-$CC' *manually*."
	echo "         Type return if you want to continue, Ctrl-C to abort."
d399 1
a399 7
        CPU=`(hinv -t cpu) 2>/dev/null | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'`
        CPU=${CPU:-0}
        if [ $CPU -ge 5000 ]; then
                options="$options -mips4"
        else
                options="$options -mips3"
        fi
d426 1
a426 1
	#echo "         Type return if you want to continue, Ctrl-C to abort."
d430 1
a430 1
	KARCH=`awk '/^type/{print$3}' /proc/cpuinfo`
a437 1
  s390-*-linux2) OUT="linux-s390" ;;
d445 1
a445 1
		echo "         Type return if you want to continue, Ctrl-C to abort."
d469 3
a471 6
  *-*-unixware20*) OUT="unixware-2.0" ;;
  *-*-unixware21*) OUT="unixware-2.1" ;;
  *-*-UnixWare20*) OUT="unixware-2.0" ;;
  *-*-UnixWare21*) OUT="unixware-2.1" ;;
  *-*-Unixware20*) OUT="unixware-2.0" ;;
  *-*-Unixware21*) OUT="unixware-2.1" ;;
d560 1
a560 1
  echo Configuring for $OUT
@


1.1.1.1.2.3.2.1
log
@MFC: OpenSSL 0.9.6e
@
text
@a70 5
     OpenUNIX)
		if [ "`echo x$VERSION | sed -e 's/\..*//'`" = "x8" ]; then
		    echo "${MACHINE}-unknown-OpenUNIX${VERSION}"; exit 0
		fi
		;;
a197 4
    OpenUNIX:*)
	echo "${MACHINE}-unknown-OpenUNIX${VERSION}"; exit 0
	;;

d199 1
a199 12
	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
d203 1
a203 1
	case "$RELEASE" in
a206 3
	    6*)
		echo "${MACHINE}-whatever-qnx6"
		;;
a221 4
    Darwin:*)
	echo "ppc-apple-darwin"; exit 0
	;;

a273 19
    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;
       ;;
d338 1
a338 1
GCCVER=`(gcc -dumpversion) 2>/dev/null`
d341 2
a342 3
  # 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.
d348 1
a348 12
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 look for the preprocessor symbol __LP64__ indicating
    # 64bit bit long and pointer.  sizeof(int) == 32 on HPUX64.
    if gcc -v -E -x c /dev/null 2>&1 | grep __LP64__ > /dev/null; then
      GCC_BITS="64"
    fi
  fi
fi
d438 1
a438 20
  mips-*-linux?)
          cat >dummy.c <<EOF
#include <stdio.h>  /* for printf() prototype */
        int main (argc, argv) int argc; char *argv[]; {
#ifdef __MIPSEB__
  printf ("linux-%s\n", argv[1]);
#endif
#ifdef __MIPSEL__
  printf ("linux-%sel\n", argv[1]);
#endif
  return 0;
}
EOF
	${CC} -o dummy dummy.c && OUT=`./dummy ${MACHINE}`
	rm dummy dummy.c
	;;
  ppc64-*-linux2)
	#Use the standard target for PPC architecture until we create a
	#special one for the 64bit architecture.
	OUT="linux-ppc" ;;
a442 1
  ppc-apple-darwin) OUT="darwin-ppc-cc" ;;
a458 20
  parisc-*-linux2)
        CPUARCH=`awk '/cpu family/{print substr($5,1,3)}' /proc/cpuinfo`
	CPUSCHEDULE=`awk '/^cpu.[ 	]: PA/{print substr($3,3)}' /proc/cpuinfo`

	# ??TODO ??  Model transformations
	# 0. CPU Architecture for the 1.1 processor has letter suffixes. We strip that off
	#    assuming no further arch. identification will ever be used by GCC.
	# 1. I'm most concerned about whether is a 7300LC is closer to a 7100 versus a 7100LC.
	# 2. The variant 64-bit processors cause concern should GCC support explicit schedulers
	#    for these chips in the future.
	#         PA7300LC -> 7100LC (1.1)
	#         PA8200   -> 8000   (2.0)
	#         PA8500   -> 8000   (2.0)
	#         PA8600   -> 8000   (2.0)

	CPUSCHEDULE=`echo $CPUSCHEDULE|sed -e 's/7300LC/7100LC/' -e 's/8?00/8000/'`
	# Finish Model transformations

	options="$options -mschedule=$CPUSCHEDULE -march=$CPUARCH"
	OUT="linux-parisc" ;;
a460 1
  s390x-*-linux?) OUT="linux-s390x" ;;
d488 1
a488 9
  *-*-osf) OUT="alphaold-cc" ;;
  *-*-tru64) OUT="alpha-cc" ;;
  *-*-OpenUNIX*)
	if [ "$CC" = "gcc" ]; then
	  OUT="OpenUNIX-8-gcc" 
	else    
	  OUT="OpenUNIX-8" 
	fi
	;;
d501 2
a502 12
  *-hpux1*)
	if [ $CC = "gcc" ];
	then
	  if [ $GCC_BITS = "64" ]; then
	    OUT="hpux64-parisc-gcc"
	  else
	    OUT="hpux-parisc-gcc"
	  fi
	else
	  OUT="hpux-parisc-$CC"
	fi
	options="$options -D_REENTRANT" ;;
a507 4
  *-*-cygwin_pre1.3) OUT="Cygwin-pre1.3" ;;
  *-*-cygwin) OUT="Cygwin" ;;
  t3e-cray-unicosmk) OUT="cray-t3e" ;;
  j90-cray-unicos) OUT="cray-j90" ;;
d536 1
a536 1
for i in bf cast des dh dsa hmac idea md2 md5 mdc2 rc2 rc4 rc5 ripemd rsa sha
@


1.1.1.1.2.3.4.1
log
@MFC: OpenSSL 0.9.6e
@
text
@a70 5
     OpenUNIX)
		if [ "`echo x$VERSION | sed -e 's/\..*//'`" = "x8" ]; then
		    echo "${MACHINE}-unknown-OpenUNIX${VERSION}"; exit 0
		fi
		;;
a197 4
    OpenUNIX:*)
	echo "${MACHINE}-unknown-OpenUNIX${VERSION}"; exit 0
	;;

d199 1
a199 12
	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
d203 1
a203 1
	case "$RELEASE" in
a206 3
	    6*)
		echo "${MACHINE}-whatever-qnx6"
		;;
a221 4
    Darwin:*)
	echo "ppc-apple-darwin"; exit 0
	;;

a273 19
    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;
       ;;
d338 1
a338 1
GCCVER=`(gcc -dumpversion) 2>/dev/null`
d341 2
a342 3
  # 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.
d348 1
a348 12
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 look for the preprocessor symbol __LP64__ indicating
    # 64bit bit long and pointer.  sizeof(int) == 32 on HPUX64.
    if gcc -v -E -x c /dev/null 2>&1 | grep __LP64__ > /dev/null; then
      GCC_BITS="64"
    fi
  fi
fi
d438 1
a438 20
  mips-*-linux?)
          cat >dummy.c <<EOF
#include <stdio.h>  /* for printf() prototype */
        int main (argc, argv) int argc; char *argv[]; {
#ifdef __MIPSEB__
  printf ("linux-%s\n", argv[1]);
#endif
#ifdef __MIPSEL__
  printf ("linux-%sel\n", argv[1]);
#endif
  return 0;
}
EOF
	${CC} -o dummy dummy.c && OUT=`./dummy ${MACHINE}`
	rm dummy dummy.c
	;;
  ppc64-*-linux2)
	#Use the standard target for PPC architecture until we create a
	#special one for the 64bit architecture.
	OUT="linux-ppc" ;;
a442 1
  ppc-apple-darwin) OUT="darwin-ppc-cc" ;;
a458 20
  parisc-*-linux2)
        CPUARCH=`awk '/cpu family/{print substr($5,1,3)}' /proc/cpuinfo`
	CPUSCHEDULE=`awk '/^cpu.[ 	]: PA/{print substr($3,3)}' /proc/cpuinfo`

	# ??TODO ??  Model transformations
	# 0. CPU Architecture for the 1.1 processor has letter suffixes. We strip that off
	#    assuming no further arch. identification will ever be used by GCC.
	# 1. I'm most concerned about whether is a 7300LC is closer to a 7100 versus a 7100LC.
	# 2. The variant 64-bit processors cause concern should GCC support explicit schedulers
	#    for these chips in the future.
	#         PA7300LC -> 7100LC (1.1)
	#         PA8200   -> 8000   (2.0)
	#         PA8500   -> 8000   (2.0)
	#         PA8600   -> 8000   (2.0)

	CPUSCHEDULE=`echo $CPUSCHEDULE|sed -e 's/7300LC/7100LC/' -e 's/8?00/8000/'`
	# Finish Model transformations

	options="$options -mschedule=$CPUSCHEDULE -march=$CPUARCH"
	OUT="linux-parisc" ;;
a460 1
  s390x-*-linux?) OUT="linux-s390x" ;;
d488 1
a488 9
  *-*-osf) OUT="alphaold-cc" ;;
  *-*-tru64) OUT="alpha-cc" ;;
  *-*-OpenUNIX*)
	if [ "$CC" = "gcc" ]; then
	  OUT="OpenUNIX-8-gcc" 
	else    
	  OUT="OpenUNIX-8" 
	fi
	;;
d501 2
a502 12
  *-hpux1*)
	if [ $CC = "gcc" ];
	then
	  if [ $GCC_BITS = "64" ]; then
	    OUT="hpux64-parisc-gcc"
	  else
	    OUT="hpux-parisc-gcc"
	  fi
	else
	  OUT="hpux-parisc-$CC"
	fi
	options="$options -D_REENTRANT" ;;
a507 4
  *-*-cygwin_pre1.3) OUT="Cygwin-pre1.3" ;;
  *-*-cygwin) OUT="Cygwin" ;;
  t3e-cray-unicosmk) OUT="cray-t3e" ;;
  j90-cray-unicos) OUT="cray-j90" ;;
d536 1
a536 1
for i in bf cast des dh dsa hmac idea md2 md5 mdc2 rc2 rc4 rc5 ripemd rsa sha
@


1.1.1.1.2.3.6.1
log
@MFC: OpenSSL 0.9.6e
@
text
@a70 5
     OpenUNIX)
		if [ "`echo x$VERSION | sed -e 's/\..*//'`" = "x8" ]; then
		    echo "${MACHINE}-unknown-OpenUNIX${VERSION}"; exit 0
		fi
		;;
a197 4
    OpenUNIX:*)
	echo "${MACHINE}-unknown-OpenUNIX${VERSION}"; exit 0
	;;

d199 1
a199 12
	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
d203 1
a203 1
	case "$RELEASE" in
a206 3
	    6*)
		echo "${MACHINE}-whatever-qnx6"
		;;
a221 4
    Darwin:*)
	echo "ppc-apple-darwin"; exit 0
	;;

a273 19
    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;
       ;;
d338 1
a338 1
GCCVER=`(gcc -dumpversion) 2>/dev/null`
d341 2
a342 3
  # 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.
d348 1
a348 12
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 look for the preprocessor symbol __LP64__ indicating
    # 64bit bit long and pointer.  sizeof(int) == 32 on HPUX64.
    if gcc -v -E -x c /dev/null 2>&1 | grep __LP64__ > /dev/null; then
      GCC_BITS="64"
    fi
  fi
fi
d438 1
a438 20
  mips-*-linux?)
          cat >dummy.c <<EOF
#include <stdio.h>  /* for printf() prototype */
        int main (argc, argv) int argc; char *argv[]; {
#ifdef __MIPSEB__
  printf ("linux-%s\n", argv[1]);
#endif
#ifdef __MIPSEL__
  printf ("linux-%sel\n", argv[1]);
#endif
  return 0;
}
EOF
	${CC} -o dummy dummy.c && OUT=`./dummy ${MACHINE}`
	rm dummy dummy.c
	;;
  ppc64-*-linux2)
	#Use the standard target for PPC architecture until we create a
	#special one for the 64bit architecture.
	OUT="linux-ppc" ;;
a442 1
  ppc-apple-darwin) OUT="darwin-ppc-cc" ;;
a458 20
  parisc-*-linux2)
        CPUARCH=`awk '/cpu family/{print substr($5,1,3)}' /proc/cpuinfo`
	CPUSCHEDULE=`awk '/^cpu.[ 	]: PA/{print substr($3,3)}' /proc/cpuinfo`

	# ??TODO ??  Model transformations
	# 0. CPU Architecture for the 1.1 processor has letter suffixes. We strip that off
	#    assuming no further arch. identification will ever be used by GCC.
	# 1. I'm most concerned about whether is a 7300LC is closer to a 7100 versus a 7100LC.
	# 2. The variant 64-bit processors cause concern should GCC support explicit schedulers
	#    for these chips in the future.
	#         PA7300LC -> 7100LC (1.1)
	#         PA8200   -> 8000   (2.0)
	#         PA8500   -> 8000   (2.0)
	#         PA8600   -> 8000   (2.0)

	CPUSCHEDULE=`echo $CPUSCHEDULE|sed -e 's/7300LC/7100LC/' -e 's/8?00/8000/'`
	# Finish Model transformations

	options="$options -mschedule=$CPUSCHEDULE -march=$CPUARCH"
	OUT="linux-parisc" ;;
a460 1
  s390x-*-linux?) OUT="linux-s390x" ;;
d488 1
a488 9
  *-*-osf) OUT="alphaold-cc" ;;
  *-*-tru64) OUT="alpha-cc" ;;
  *-*-OpenUNIX*)
	if [ "$CC" = "gcc" ]; then
	  OUT="OpenUNIX-8-gcc" 
	else    
	  OUT="OpenUNIX-8" 
	fi
	;;
d501 2
a502 12
  *-hpux1*)
	if [ $CC = "gcc" ];
	then
	  if [ $GCC_BITS = "64" ]; then
	    OUT="hpux64-parisc-gcc"
	  else
	    OUT="hpux-parisc-gcc"
	  fi
	else
	  OUT="hpux-parisc-$CC"
	fi
	options="$options -D_REENTRANT" ;;
a507 4
  *-*-cygwin_pre1.3) OUT="Cygwin-pre1.3" ;;
  *-*-cygwin) OUT="Cygwin" ;;
  t3e-cray-unicosmk) OUT="cray-t3e" ;;
  j90-cray-unicos) OUT="cray-j90" ;;
d536 1
a536 1
for i in bf cast des dh dsa hmac idea md2 md5 mdc2 rc2 rc4 rc5 ripemd rsa sha
@


1.1.1.1.2.3.6.2
log
@Merge from RELENG_4_7: Update to OpenSSL 0.9.6i.
@
text
@a319 4

    NONSTOP_KERNEL*)
       echo "nsr-tandem-nsk"; exit 0;
       ;;
a386 3
  # 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]*\-//'`
a394 1
GCCVER=${GCCVER:-0}
d472 1
a472 2
	# Do not stop if /dev/tty is unavailable
	(read waste < /dev/tty) || true
d527 1
a527 2
	# Do not stop if /dev/tty is unavailable
	#(read waste < /dev/tty) || true
d568 1
a568 2
		# Do not stop if /dev/tty is unavailable
		(read waste < /dev/tty) || true
a628 1
  nsr-tandem-nsk) OUT="tandem-c89" ;;
@


1.1.1.1.2.4
log
@MFC: OpenSSL 0.9.6e
@
text
@a70 5
     OpenUNIX)
		if [ "`echo x$VERSION | sed -e 's/\..*//'`" = "x8" ]; then
		    echo "${MACHINE}-unknown-OpenUNIX${VERSION}"; exit 0
		fi
		;;
a197 4
    OpenUNIX:*)
	echo "${MACHINE}-unknown-OpenUNIX${VERSION}"; exit 0
	;;

d199 1
a199 12
	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
d203 1
a203 1
	case "$RELEASE" in
a206 3
	    6*)
		echo "${MACHINE}-whatever-qnx6"
		;;
a221 4
    Darwin:*)
	echo "ppc-apple-darwin"; exit 0
	;;

a273 19
    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;
       ;;
d338 1
a338 1
GCCVER=`(gcc -dumpversion) 2>/dev/null`
d341 2
a342 3
  # 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.
d348 1
a348 12
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 look for the preprocessor symbol __LP64__ indicating
    # 64bit bit long and pointer.  sizeof(int) == 32 on HPUX64.
    if gcc -v -E -x c /dev/null 2>&1 | grep __LP64__ > /dev/null; then
      GCC_BITS="64"
    fi
  fi
fi
d438 1
a438 20
  mips-*-linux?)
          cat >dummy.c <<EOF
#include <stdio.h>  /* for printf() prototype */
        int main (argc, argv) int argc; char *argv[]; {
#ifdef __MIPSEB__
  printf ("linux-%s\n", argv[1]);
#endif
#ifdef __MIPSEL__
  printf ("linux-%sel\n", argv[1]);
#endif
  return 0;
}
EOF
	${CC} -o dummy dummy.c && OUT=`./dummy ${MACHINE}`
	rm dummy dummy.c
	;;
  ppc64-*-linux2)
	#Use the standard target for PPC architecture until we create a
	#special one for the 64bit architecture.
	OUT="linux-ppc" ;;
a442 1
  ppc-apple-darwin) OUT="darwin-ppc-cc" ;;
a458 20
  parisc-*-linux2)
        CPUARCH=`awk '/cpu family/{print substr($5,1,3)}' /proc/cpuinfo`
	CPUSCHEDULE=`awk '/^cpu.[ 	]: PA/{print substr($3,3)}' /proc/cpuinfo`

	# ??TODO ??  Model transformations
	# 0. CPU Architecture for the 1.1 processor has letter suffixes. We strip that off
	#    assuming no further arch. identification will ever be used by GCC.
	# 1. I'm most concerned about whether is a 7300LC is closer to a 7100 versus a 7100LC.
	# 2. The variant 64-bit processors cause concern should GCC support explicit schedulers
	#    for these chips in the future.
	#         PA7300LC -> 7100LC (1.1)
	#         PA8200   -> 8000   (2.0)
	#         PA8500   -> 8000   (2.0)
	#         PA8600   -> 8000   (2.0)

	CPUSCHEDULE=`echo $CPUSCHEDULE|sed -e 's/7300LC/7100LC/' -e 's/8?00/8000/'`
	# Finish Model transformations

	options="$options -mschedule=$CPUSCHEDULE -march=$CPUARCH"
	OUT="linux-parisc" ;;
a460 1
  s390x-*-linux?) OUT="linux-s390x" ;;
d488 1
a488 9
  *-*-osf) OUT="alphaold-cc" ;;
  *-*-tru64) OUT="alpha-cc" ;;
  *-*-OpenUNIX*)
	if [ "$CC" = "gcc" ]; then
	  OUT="OpenUNIX-8-gcc" 
	else    
	  OUT="OpenUNIX-8" 
	fi
	;;
d501 2
a502 12
  *-hpux1*)
	if [ $CC = "gcc" ];
	then
	  if [ $GCC_BITS = "64" ]; then
	    OUT="hpux64-parisc-gcc"
	  else
	    OUT="hpux-parisc-gcc"
	  fi
	else
	  OUT="hpux-parisc-$CC"
	fi
	options="$options -D_REENTRANT" ;;
a507 4
  *-*-cygwin_pre1.3) OUT="Cygwin-pre1.3" ;;
  *-*-cygwin) OUT="Cygwin" ;;
  t3e-cray-unicosmk) OUT="cray-t3e" ;;
  j90-cray-unicos) OUT="cray-j90" ;;
d536 1
a536 1
for i in bf cast des dh dsa hmac idea md2 md5 mdc2 rc2 rc4 rc5 ripemd rsa sha
@


1.1.1.1.2.5
log
@MFC: OpenSSL 0.9.6g.
@
text
@a386 3
  # 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]*\-//'`
a394 1
GCCVER=${GCCVER:-0}
@


1.1.1.1.2.5.2.1
log
@Merge from RELENG_5_0: Update to OpenSSL 0.9.6i.
@
text
@a319 4

    NONSTOP_KERNEL*)
       echo "nsr-tandem-nsk"; exit 0;
       ;;
d476 1
a476 2
	# Do not stop if /dev/tty is unavailable
	(read waste < /dev/tty) || true
d531 1
a531 2
	# Do not stop if /dev/tty is unavailable
	#(read waste < /dev/tty) || true
d572 1
a572 2
		# Do not stop if /dev/tty is unavailable
		(read waste < /dev/tty) || true
a632 1
  nsr-tandem-nsk) OUT="tandem-c89" ;;
@


1.1.1.1.2.6
log
@MFC OpenSSL 0.9.7
@
text
@a22 25
PREFIX=""
SUFFIX=""
TEST="false"

# pick up any command line args to config
for i
do
case "$i" in 
-d*) PREFIX="debug-";;
-t*) TEST="true";;
-h*) TEST="true"; cat <<EOF
Usage: 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" ;;
esac
done

d71 1
a71 1
	    OpenUNIX)
d118 4
a121 1
	    1[0-9].*)	# HPUX 10 and 11 targets are unified
a149 4
    GNU*)
	echo "hurd-x86"; exit 0;
	;;

d246 1
a246 9
	case "$MACHINE" in
	    Power*)
		echo "ppc-apple-darwin${VERSION}"
		;;
	    *)
		echo "i386-apple-darwin${VERSION}"
		;;
	esac
	exit 0
a319 4

    NONSTOP_KERNEL*)
       echo "nsr-tandem-nsk"; exit 0;
       ;;
d357 25
a411 9
  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
  fi
d442 1
d475 2
a476 4
	if [ "$TEST" = "false" ]; then
	  echo "         You have about 5 seconds to press Ctrl-C to abort."
	  (stty -icanon min 0 time 50; read waste) < /dev/tty
	fi
d524 1
a524 2
  ppc-apple-darwin*) OUT="darwin-ppc-cc" ;;
  i386-apple-darwin*) OUT="darwin-i386-cc" ;;
d526 6
a531 7
	echo "WARNING! If *know* that your GNU C supports 64-bit/V9 ABI"
	echo "         and wish to build 64-bit library, then you have to"
	echo "         invoke './Configure linux64-sparcv9' *manually*."
	if [ "$TEST" = "false" ]; then
	  echo "          You have about 5 seconds to press Ctrl-C to abort."
	  (stty -icanon min 0 time 50; read waste) < /dev/tty
	fi
d564 1
a564 13
  x86_64-*-linux?) OUT="linux-x86_64" ;;
  *-*-linux2) OUT="linux-elf"
	if [ "$GCCVER" -gt 28 ]; then
          if grep '^model.*Pentium' /proc/cpuinfo >/dev/null ; then
            OUT="linux-pentium"
          fi
          if grep '^model.*Pentium Pro' /proc/cpuinfo >/dev/null ; then
            OUT="linux-ppro"
          fi
          if grep '^model.*K6' /proc/cpuinfo >/dev/null ; then
            OUT="linux-k6"
          fi
        fi ;;
a566 1
	OUT="solaris-sparcv9-$CC"
d568 1
a568 2
	if [ "$ISA64" != "" ]; then
	    if [ "$CC" = "cc" -a $CCVER -ge 50 ]; then
d571 2
a572 25
		if [ "$TEST" = "false" ]; then
		  echo "         You have about 5 seconds to press Ctrl-C to abort."
		  (stty -icanon min 0 time 50; read waste) < /dev/tty
		fi
	    elif [ "$CC" = "gcc" -a "$GCC_ARCH" = "-m64" ]; then
		# $GCC_ARCH denotes default ABI chosen by compiler driver
		# (first one found on the $PATH). I assume that user
		# expects certain consistency with the rest of his builds
		# and therefore switch over to 64-bit. <appro>
		OUT="solaris64-sparcv9-gcc"
		echo "WARNING! If you wish to build 32-bit library, then you have to"
		echo "         invoke './Configure solaris-sparcv9-gcc' *manually*."
		if [ "$TEST" = "false" ]; then
		  echo "         You have about 5 seconds to press Ctrl-C to abort."
		  (stty -icanon min 0 time 50; read waste) < /dev/tty
		fi
	    elif [ "$GCC_ARCH" = "-m32" ]; then
		echo "NOTICE! If you *know* that your GNU C supports 64-bit/V9 ABI"
		echo "        and wish to build 64-bit library, then you have to"
		echo "        invoke './Configure solaris64-sparcv9-gcc' *manually*."
		if [ "$TEST" = "false" ]; then
		  echo "         You have about 5 seconds to press Ctrl-C to abort."
		  (stty -icanon min 0 time 50; read waste) < /dev/tty
		fi
	    fi
d574 1
a574 1
	;;
d586 1
a587 4
  *86*-*-openbsd) OUT="OpenBSD-i386" ;;
  m68k*-*-openbsd) OUT="OpenBSD-m68k" ;;
  m88k*-*-openbsd) OUT="OpenBSD-m88k" ;;
  mips*-*-openbsd) OUT="OpenBSD-mips" ;;
a588 5
  powerpc*-*-openbsd) OUT="OpenBSD-powerpc" ;;
  sparc64*-*-openbsd) OUT="OpenBSD-sparc64" ;;
  sparc*-*-openbsd) OUT="OpenBSD-sparc" ;;
  vax*-*-openbsd) OUT="OpenBSD-vax" ;;
  hppa*-*-openbsd) OUT="OpenBSD-hppa" ;;
a622 31
	KERNEL_BITS=`(getconf KERNEL_BITS) 2>/dev/null`
	KERNEL_BITS=${KERNEL_BITS:-32}
	CPU_VERSION=`(getconf CPU_VERSION) 2>/dev/null`
	CPU_VERSION=${CPU_VERSION:-0}
	# See <sys/unistd.h> for further info on CPU_VERSION.
	if   [ $CPU_VERSION -ge 768 ]; then	# IA-64 CPU
	     echo "NOTICE! 64-bit is the only ABI currently operational on HP-UXi."
	     echo "        Post request to openssl-dev@@openssl.org for 32-bit support."
	     if [ "$TEST" = "false" ]; then
		(stty -icanon min 0 time 50; read waste) < /dev/tty
	     fi
	     OUT="hpux64-ia64-cc"
	elif [ $CPU_VERSION -ge 532 ]; then	# PA-RISC 2.x CPU
	     if [ "$CC" = "cc" ]; then
		OUT="hpux-parisc2-cc" # can't we have hpux-parisc2-gcc?
	     fi
	     if [ $KERNEL_BITS -eq 64 -a "$CC" = "cc" ]; then
		echo "WARNING! If you wish to build 64-bit library then you have to"
		echo "         invoke './Configure hpux64-parisc2-cc' *manually*."
		if [ "$TEST" = "false" ]; then
		  echo "         You have about 5 seconds to press Ctrl-C to abort."
		  (stty -icanon min 0 time 50; read waste) < /dev/tty
		fi
	     fi
	elif [ $CPU_VERSION -ge 528 ]; then	# PA-RISC 1.1+ CPU
	     :
	elif [ $CPU_VERSION -ge 523 ]; then	# PA-RISC 1.0 CPU
	     :
	else					# Motorola(?) CPU
	     OUT="hpux-$CC"
	fi
a632 1
  nsr-tandem-nsk) OUT="tandem-c89" ;;
a635 6
# NB: This atalla support has been superceded by the ENGINE support
# That contains its own header and definitions anyway. Support can
# be enabled or disabled on any supported platform without external
# headers, eg. by adding the "hw-atalla" switch to ./config or
# perl Configure
#
d637 4
a640 4
#if [ -f /usr/include/atasi.h ]
#then
#  options="$options -DATALLA"
#fi
d661 1
a661 1
for i in bf cast des dh dsa ec hmac idea md2 md5 mdc2 rc2 rc4 rc5 aes ripemd rsa sha
a667 21

# Discover Kerberos 5 (since it's still a prototype, we don't
# do any guesses yet, that's why this section is commented away.
#if [ -d /usr/kerberos ]; then
#    krb5_dir=/usr/kerberos
#    if [ \( -f $krb5_dir/lib/libgssapi_krb5.a -o -f $krb5_dir/lib/libgssapi_krb5.so* \)\
#	-a \( -f $krb5_dir/lib/libkrb5.a -o -f $krb5_dir/lib/libkrb5.so* \)\
#	-a \( -f $krb5_dir/lib/libcom_err.a -o -f $krb5_dir/lib/libcom_err.so* \)\
#	-a \( -f $krb5_dir/lib/libk5crypto.a -o -f $krb5_dir/lib/libk5crypto.so* \)\
#	-a \( -f $krb5_dir/include/krb5.h \) ]; then
#	options="$options --with-krb5-flavor=MIT"
#    fi
#elif [ -d /usr/heimdal ]; then
#    krb5_dir=/usr/heimdal
#    if [ \( -f $krb5_dir/lib/libgssapi.a -o -f $krb5_dir/lib/libgssapi.so* \)\
#	-a \( -f $krb5_dir/lib/libkrb5.a -o -f $krb5_dir/lib/libkrb5.so* \)\
#	-a \( -f $krb5_dir/lib/libcom_err.a -o -f $krb5_dir/lib/libcom_err.so* \)\
#	-a \( -f $krb5_dir/include/krb5.h \) ]; then
#	options="$options --with-krb5-flavor=Heimdal"
#    fi
#fi
@


1.1.1.1.2.7
log
@MFC OpenSSL 0.9.7a.

Approved by:	re (murray)
@
text
@d77 15
a91 5
		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
d94 6
a99 1
		echo "i386-whatever-unixware1"; exit 0
d102 3
a104 11
		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.
		    x7*)  echo "i586-sco-unixware7";           exit 0 ;;
		    x8*)  echo "i586-unkn-OpenUNIX${VERSION}"; exit 0 ;;
		esac
d199 1
a199 1
    FreeBSD:*:*:*386*)
d208 1
a216 4
    FreeBSD:*)
	echo "${MACHINE}-whatever-freebsd"; exit 0
	;;

a463 4
if [ "${SYSTEM}" = "AIX" ]; then	# favor vendor cc over gcc
    (cc) 2>&1 | grep -iv "command not found" > /dev/null && CC=cc
fi

d550 1
a550 1
	echo "WARNING! If you *know* that your GNU C supports 64-bit/V9 ABI"
a642 2
  sparc64-*-freebsd*) OUT="FreeBSD-sparc64" ;;
  ia64-*-freebsd*) OUT="FreeBSD-ia64" ;;
d699 2
a700 3
	     echo "WARNING! 64-bit ABI is the default configured ABI on HP-UXi."
	     echo "         If you wish to build 32-bit library, the you have to"
	     echo "         invoke './Configure hpux-ia32-cc' *manually*."
a701 1
		echo "         You have about 5 seconds to press Ctrl-C to abort."
@


1.1.1.1.2.8
log
@MFC OpenSSL 0.9.7c.

Approved by:	re
@
text
@d461 1
a461 1
    (cc) 2>&1 | grep -iv "not found" > /dev/null && CC=cc
d476 1
a476 1
	CPU=`(hinv -t cpu) 2>/dev/null | head -1 | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'`
d484 1
a484 1
	CPU=`(hinv -t cpu) 2>/dev/null | head -1 | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'`
d500 1
a500 1
        CPU=`(hinv -t cpu) 2>/dev/null | head -1 | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'`
@


1.1.1.1.2.9
log
@MFC OpenSSL 0.9.7d.
@
text
@d137 1
a137 1
		echo "${MACHINE}-hp-hpux1x"; exit 0
d413 3
a415 4
    # 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
d688 1
a688 1
	    OUT="hpux64-parisc2-gcc"
d703 1
a703 1
	     echo "         invoke './Configure hpux-ia64-cc' *manually*."
@


1.1.1.2
log
@Initial import of OpenSSL 0.9.5a
@
text
@a29 1

a52 2
		elif [ "x$VERSION" = "x2.1.2" ]; then
		    echo "${MACHINE}-whatever-unixware212"; exit 0
a59 5
	    5)
		if [ "`echo x$VERSION | sed -e 's/\..*//'`" = "x7" ]; then
		    echo "${MACHINE}-sco-unixware7"; exit 0
		fi
		;;
a189 4
    Rhapsody:*)
	echo "ppc-apple-rhapsody"; exit 0
	;;

a282 2
# shared library support (behnke@@trustcenter.de)
-shared) SHARED=true;;
d314 1
a314 1
  # check for WorkShop C, expected output is "cc: blah-blah C x.x"
a330 13
if [ "${SYSTEM}-${MACHINE}" = "Linux-alpha" ]; then
  # check for Compaq C, expected output is "blah-blah C Vx.x"
  CCCVER=`(ccc -V 2>&1) 2>/dev/null | \
	egrep -e '.* C V[0-9]\.[0-9]' | \
	sed 's/.* C V\([0-9]\)\.\([0-9]\).*/\1\2/'`
  CCCVER=${CCCVER:-0}
  if [ $CCCVER -gt 60 ]; then
    CC=ccc	# overrides gcc!!! well, ccc outperforms inoticeably
		# only on hash routines and des, otherwise gcc (2.95)
		# keeps along rather tight...
  fi
fi

d343 3
a371 18
  alpha-*-linux2)
        ISA=`awk '/cpu model/{print$4}' /proc/cpuinfo`
	case ${ISA:-generic} in
	*[67])	OUT="linux-alpha+bwx-$CC" ;;
	*)	OUT="linux-alpha-$CC" ;;
	esac
	if [ "$CC" = "gcc" ]; then
	    case ${ISA:-generic} in
	    EV5|EV45)		options="$options -mcpu=ev5";;
	    EV56|PCA56)		options="$options -mcpu=ev56";;
	    EV6|EV67|PCA57)	options="$options -mcpu=ev6";;
	    esac
	fi
	;;
  mips-*-linux?) OUT="linux-mips" ;;
  ppc-*-linux2) OUT="linux-ppc" ;;
  ia64-*-linux?) OUT="linux-ia64" ;;
  ppc-apple-rhapsody) OUT="rhapsody-ppc-cc" ;;
d416 1
a416 6
  *-*-unixware7) OUT="unixware-7" ;;
  *-*-UnixWare7) OUT="unixware-7" ;;
  *-*-Unixware7) OUT="unixware-7" ;;
  *-*-unixware[1-2]*) OUT="unixware-2.0" ;;
  *-*-UnixWare[1-2]*) OUT="unixware-2.0" ;;
  *-*-Unixware[1-2]*) OUT="unixware-2.0" ;;
a419 3
  *-hpux1*)	OUT="hpux-parisc-$CC"
		options="$options -D_REENTRANT" ;;
  *-hpux)	OUT="hpux-parisc-$CC" ;;
d421 1
a426 16
# See whether we can compile Atalla support
if [ -f /usr/include/atasi.h ]
then
  options="$options -DATALLA"
fi

#get some basic shared lib support (behnke@@trustcenter.de)
case "$OUT" in
   solaris-*-gcc)
	if  [ "$SHARED" = "true" ] 
	 then
	  options="$options -DPIC -fPIC"
        fi
     ;;
esac

a440 11
# To start with $OUT is never i86pc-sun-solaris2. Secondly why
# ban *all* assembler implementation if it can't stand only one,
# SHA-0 implementation.
#if [ "$OUT" = "i86pc-sun-solaris2" ]
#then
#  ASM=`as -V /dev/null 2>&1`
#  case "$ASM" in
#    GNU*) ;;
#    *) 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." ;;
#  esac
#fi
d487 1
a487 1
$PERL ./Configure LIST | grep "$OUT-$CC" > /dev/null
d494 1
a494 1
$PERL ./Configure LIST | grep "$OUT" > /dev/null
@


1.1.1.3
log
@Initial import of OpenSSL 0.9.6
@
text
@a73 4
    MPE/iX:*)
	MACHINE=`echo "$MACHINE" | sed -e 's/-/_/g'`
	echo "parisc-hp-MPE/iX"; exit 0
	;;
d167 1
a167 1
        echo "`/usr/sbin/sysctl -n hw.model | sed 's,.*\(.\)86-class.*,i\186,'`-whatever-netbsd"; exit 0
d184 2
a185 2
	    4*)
		echo "${MACHINE}-whatever-qnx4"
d188 1
a188 1
		echo "${MACHINE}-whatever-qnx"
d203 1
a203 1
	echo "${MACHINE}-whatever-solaris2"; exit 0
a249 4
    NEWS-OS:4.*)
	echo "mips-sony-newsos4"; exit 0;
	;;

d295 2
a411 1
  m68k-*-linux*) OUT="linux-m68k" ;;
a429 1
  arm*-*-linux2) OUT="linux-elf-arm" ;;
d432 1
a432 1
  sun4u*-*-solaris2)
d441 4
a444 4
  sun4m-*-solaris2)	OUT="solaris-sparcv8-$CC" ;;
  sun4d-*-solaris2)	OUT="solaris-sparcv8-$CC" ;;
  sun4*-*-solaris2)	OUT="solaris-sparcv7-$CC" ;;
  *86*-*-solaris2) OUT="solaris-x86-$CC" ;;
a472 1
  mips-sony-newsos4) OUT="newsos4-gcc" ;;
d482 10
d506 11
d572 1
a572 1
  #echo Configuring for $OUT
@


1.1.1.4
log
@Import of OpenSSL 0.9.6-STABLE snapshot dated 2001-02-10
@
text
@d171 1
a171 1
        echo "`(/usr/sbin/sysctl -n hw.model || /sbin/sysctl -n hw.model) | sed 's,.*\(.\)86-class.*,i\186,'`-whatever-netbsd"; exit 0
d397 1
a397 1
	echo "         Type return if you want to continue, Ctrl-C to abort."
d426 1
a426 1
	#echo "         Type return if you want to continue, Ctrl-C to abort."
d430 1
a430 1
	KARCH=`awk '/^type/{print$3}' /proc/cpuinfo`
a437 1
  s390-*-linux2) OUT="linux-s390" ;;
d445 1
a445 1
		echo "         Type return if you want to continue, Ctrl-C to abort."
d560 1
a560 1
  echo Configuring for $OUT
@


1.1.1.5
log
@Initial import of OpenSSL 0.9.6a
@
text
@d52 1
a52 7
		if [ "x$VERSION" = "x2.01" ]; then
		    echo "${MACHINE}-whatever-unixware201"; exit 0
		elif [ "x$VERSION" = "x2.02" ]; then
		    echo "${MACHINE}-whatever-unixware202"; exit 0
		elif [ "x$VERSION" = "x2.03" ]; then
		    echo "${MACHINE}-whatever-unixware203"; exit 0
		elif [ "x$VERSION" = "x2.1.1" ]; then
a55 2
		elif [ "x$VERSION" = "x2.1.3" ]; then
		    echo "${MACHINE}-whatever-unixware213"; exit 0
a81 8
    AIX:[3456789]:4:*)
	echo "${MACHINE}-ibm-aix43"; exit 0
	;;

    AIX:*:[56789]:*)
	echo "${MACHINE}-ibm-aix43"; exit 0
	;;

d396 1
a396 1
	echo "         invoke './Configure irix64-mips4-$CC' *manually*."
d399 1
a399 7
        CPU=`(hinv -t cpu) 2>/dev/null | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'`
        CPU=${CPU:-0}
        if [ $CPU -ge 5000 ]; then
                options="$options -mips4"
        else
                options="$options -mips3"
        fi
d470 3
a472 6
  *-*-unixware20*) OUT="unixware-2.0" ;;
  *-*-unixware21*) OUT="unixware-2.1" ;;
  *-*-UnixWare20*) OUT="unixware-2.0" ;;
  *-*-UnixWare21*) OUT="unixware-2.1" ;;
  *-*-Unixware20*) OUT="unixware-2.0" ;;
  *-*-Unixware21*) OUT="unixware-2.1" ;;
@


1.1.1.6
log
@Initial import of OpenSSL 0.9.6c
@
text
@a70 5
     OpenUNIX)
		if [ "`echo x$VERSION | sed -e 's/\..*//'`" = "x8" ]; then
		    echo "${MACHINE}-unknown-OpenUNIX${VERSION}"; exit 0
		fi
		;;
a197 4
    OpenUNIX:*)
	echo "${MACHINE}-unknown-OpenUNIX${VERSION}"; exit 0
	;;

d199 1
a199 12
	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
d203 1
a203 1
	case "$RELEASE" in
a206 3
	    6*)
		echo "${MACHINE}-whatever-qnx6"
		;;
a221 4
    Darwin:*)
	echo "ppc-apple-darwin"; exit 0
	;;

a273 4
    CYGWIN*)
	echo "${MACHINE}-whatever-cygwin32"; exit 0
	;;

d438 1
a438 16
  mips-*-linux?)
          cat >dummy.c <<EOF
#include <stdio.h>  /* for printf() prototype */
        int main (argc, argv) int argc; char *argv[]; {
#ifdef __MIPSEB__
  printf ("linux-%s\n", argv[1]);
#endif
#ifdef __MIPSEL__
  printf ("linux-%sel\n", argv[1]);
#endif
  return 0;
}
EOF
	${CC} -o dummy dummy.c && OUT=`./dummy ${MACHINE}`
	rm dummy dummy.c
	;;
a442 1
  ppc-apple-darwin) OUT="darwin-ppc-cc" ;;
d488 1
a488 9
  *-*-osf) OUT="alphaold-cc" ;;
  *-*-tru64) OUT="alpha-cc" ;;
  *-*-OpenUNIX*)
	if [ "$CC" = "gcc" ]; then
	  OUT="OpenUNIX-8-gcc" 
	else    
	  OUT="OpenUNIX-8" 
	fi
	;;
a507 2
  *-*-cygwin32) OUT="CygWin32"
		options="$options no-threads no-asm" ;;
d536 1
a536 1
for i in bf cast des dh dsa hmac idea md2 md5 mdc2 rc2 rc4 rc5 ripemd rsa sha
@


1.1.1.7
log
@Import of OpenSSL 0.9.6d.
@
text
@d302 1
a302 9
	case "$RELEASE" in
	    [bB]*|1.0|1.[12].*)
		echo "${MACHINE}-whatever-cygwin_pre1.3"
		;;
	    *)
		echo "${MACHINE}-whatever-cygwin"
		;;
	esac
	exit 0
a304 7
    *"CRAY T3E")
       echo "t3e-cray-unicosmk"; exit 0;
       ;;

    *CRAY*)
       echo "j90-cray-unicos"; exit 0;
       ;;
a505 20
  parisc-*-linux2)
        CPUARCH=`awk '/cpu family/{print substr($5,1,3)}' /proc/cpuinfo`
	CPUSCHEDULE=`awk '/^cpu.[ 	]: PA/{print substr($3,3)}' /proc/cpuinfo`

	# ??TODO ??  Model transformations
	# 0. CPU Architecture for the 1.1 processor has letter suffixes. We strip that off
	#    assuming no further arch. identification will ever be used by GCC.
	# 1. I'm most concerned about whether is a 7300LC is closer to a 7100 versus a 7100LC.
	# 2. The variant 64-bit processors cause concern should GCC support explicit schedulers
	#    for these chips in the future.
	#         PA7300LC -> 7100LC (1.1)
	#         PA8200   -> 8000   (2.0)
	#         PA8500   -> 8000   (2.0)
	#         PA8600   -> 8000   (2.0)

	CPUSCHEDULE=`echo $CPUSCHEDULE|sed -e 's/7300LC/7100LC/' -e 's/8?00/8000/'`
	# Finish Model transformations

	options="$options -mschedule=$CPUSCHEDULE -march=$CPUARCH"
	OUT="linux-parisc" ;;
a507 1
  s390x-*-linux?) OUT="linux-s390x" ;;
d563 2
a564 4
  *-*-cygwin_pre1.3) OUT="Cygwin-pre1.3" ;;
  *-*-cygwin) OUT="Cygwin" ;;
  t3e-cray-unicosmk) OUT="cray-t3e" ;;
  j90-cray-unicos) OUT="cray-j90" ;;
@


1.1.1.8
log
@Import of OpenSSL 0.9.6e.
@
text
@d384 1
a384 1
GCCVER=`(gcc -dumpversion) 2>/dev/null`
d387 2
a388 3
  # 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.
d394 1
a394 12
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 look for the preprocessor symbol __LP64__ indicating
    # 64bit bit long and pointer.  sizeof(int) == 32 on HPUX64.
    if gcc -v -E -x c /dev/null 2>&1 | grep __LP64__ > /dev/null; then
      GCC_BITS="64"
    fi
  fi
fi
a499 4
  ppc64-*-linux2)
	#Use the standard target for PPC architecture until we create a
	#special one for the 64bit architecture.
	OUT="linux-ppc" ;;
d592 2
a593 12
  *-hpux1*)
	if [ $CC = "gcc" ];
	then
	  if [ $GCC_BITS = "64" ]; then
	    OUT="hpux64-parisc-gcc"
	  else
	    OUT="hpux-parisc-gcc"
	  fi
	else
	  OUT="hpux-parisc-$CC"
	fi
	options="$options -D_REENTRANT" ;;
@


1.1.1.9
log
@Import of OpenSSL 0.9.6f.
@
text
@a394 1
GCCVER=${GCCVER:-0}
@


1.1.1.10
log
@Import of OpenSSL 0.9.6g.
@
text
@a386 3
  # 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]*\-//'`
@


1.1.1.10.2.1
log
@Update to OpenSSL 0.9.6i.
@
text
@a319 4

    NONSTOP_KERNEL*)
       echo "nsr-tandem-nsk"; exit 0;
       ;;
d476 1
a476 2
	# Do not stop if /dev/tty is unavailable
	(read waste < /dev/tty) || true
d531 1
a531 2
	# Do not stop if /dev/tty is unavailable
	#(read waste < /dev/tty) || true
d572 1
a572 2
		# Do not stop if /dev/tty is unavailable
		(read waste < /dev/tty) || true
a632 1
  nsr-tandem-nsk) OUT="tandem-c89" ;;
@


1.1.1.11
log
@Vendor import of OpenSSL release 0.9.7. This release includes
support for AES and OpenBSD's hardware crypto.
@
text
@a22 25
PREFIX=""
SUFFIX=""
TEST="false"

# pick up any command line args to config
for i
do
case "$i" in 
-d*) PREFIX="debug-";;
-t*) TEST="true";;
-h*) TEST="true"; cat <<EOF
Usage: 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" ;;
esac
done

d71 1
a71 1
	    OpenUNIX)
d118 4
a121 1
	    1[0-9].*)	# HPUX 10 and 11 targets are unified
a149 4
    GNU*)
	echo "hurd-x86"; exit 0;
	;;

d246 1
a246 9
	case "$MACHINE" in
	    Power*)
		echo "ppc-apple-darwin${VERSION}"
		;;
	    *)
		echo "i386-apple-darwin${VERSION}"
		;;
	esac
	exit 0
a319 4

    NONSTOP_KERNEL*)
       echo "nsr-tandem-nsk"; exit 0;
       ;;
d357 25
a411 9
  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
  fi
d442 1
d475 2
a476 4
	if [ "$TEST" = "false" ]; then
	  echo "         You have about 5 seconds to press Ctrl-C to abort."
	  (stty -icanon min 0 time 50; read waste) < /dev/tty
	fi
d524 1
a524 2
  ppc-apple-darwin*) OUT="darwin-ppc-cc" ;;
  i386-apple-darwin*) OUT="darwin-i386-cc" ;;
d526 6
a531 7
	echo "WARNING! If *know* that your GNU C supports 64-bit/V9 ABI"
	echo "         and wish to build 64-bit library, then you have to"
	echo "         invoke './Configure linux64-sparcv9' *manually*."
	if [ "$TEST" = "false" ]; then
	  echo "          You have about 5 seconds to press Ctrl-C to abort."
	  (stty -icanon min 0 time 50; read waste) < /dev/tty
	fi
d564 1
a564 13
  x86_64-*-linux?) OUT="linux-x86_64" ;;
  *-*-linux2) OUT="linux-elf"
	if [ "$GCCVER" -gt 28 ]; then
          if grep '^model.*Pentium' /proc/cpuinfo >/dev/null ; then
            OUT="linux-pentium"
          fi
          if grep '^model.*Pentium Pro' /proc/cpuinfo >/dev/null ; then
            OUT="linux-ppro"
          fi
          if grep '^model.*K6' /proc/cpuinfo >/dev/null ; then
            OUT="linux-k6"
          fi
        fi ;;
a566 1
	OUT="solaris-sparcv9-$CC"
d568 1
a568 2
	if [ "$ISA64" != "" ]; then
	    if [ "$CC" = "cc" -a $CCVER -ge 50 ]; then
d571 2
a572 25
		if [ "$TEST" = "false" ]; then
		  echo "         You have about 5 seconds to press Ctrl-C to abort."
		  (stty -icanon min 0 time 50; read waste) < /dev/tty
		fi
	    elif [ "$CC" = "gcc" -a "$GCC_ARCH" = "-m64" ]; then
		# $GCC_ARCH denotes default ABI chosen by compiler driver
		# (first one found on the $PATH). I assume that user
		# expects certain consistency with the rest of his builds
		# and therefore switch over to 64-bit. <appro>
		OUT="solaris64-sparcv9-gcc"
		echo "WARNING! If you wish to build 32-bit library, then you have to"
		echo "         invoke './Configure solaris-sparcv9-gcc' *manually*."
		if [ "$TEST" = "false" ]; then
		  echo "         You have about 5 seconds to press Ctrl-C to abort."
		  (stty -icanon min 0 time 50; read waste) < /dev/tty
		fi
	    elif [ "$GCC_ARCH" = "-m32" ]; then
		echo "NOTICE! If you *know* that your GNU C supports 64-bit/V9 ABI"
		echo "        and wish to build 64-bit library, then you have to"
		echo "        invoke './Configure solaris64-sparcv9-gcc' *manually*."
		if [ "$TEST" = "false" ]; then
		  echo "         You have about 5 seconds to press Ctrl-C to abort."
		  (stty -icanon min 0 time 50; read waste) < /dev/tty
		fi
	    fi
d574 1
a574 1
	;;
d586 1
a587 4
  *86*-*-openbsd) OUT="OpenBSD-i386" ;;
  m68k*-*-openbsd) OUT="OpenBSD-m68k" ;;
  m88k*-*-openbsd) OUT="OpenBSD-m88k" ;;
  mips*-*-openbsd) OUT="OpenBSD-mips" ;;
a588 5
  powerpc*-*-openbsd) OUT="OpenBSD-powerpc" ;;
  sparc64*-*-openbsd) OUT="OpenBSD-sparc64" ;;
  sparc*-*-openbsd) OUT="OpenBSD-sparc" ;;
  vax*-*-openbsd) OUT="OpenBSD-vax" ;;
  hppa*-*-openbsd) OUT="OpenBSD-hppa" ;;
a622 31
	KERNEL_BITS=`(getconf KERNEL_BITS) 2>/dev/null`
	KERNEL_BITS=${KERNEL_BITS:-32}
	CPU_VERSION=`(getconf CPU_VERSION) 2>/dev/null`
	CPU_VERSION=${CPU_VERSION:-0}
	# See <sys/unistd.h> for further info on CPU_VERSION.
	if   [ $CPU_VERSION -ge 768 ]; then	# IA-64 CPU
	     echo "NOTICE! 64-bit is the only ABI currently operational on HP-UXi."
	     echo "        Post request to openssl-dev@@openssl.org for 32-bit support."
	     if [ "$TEST" = "false" ]; then
		(stty -icanon min 0 time 50; read waste) < /dev/tty
	     fi
	     OUT="hpux64-ia64-cc"
	elif [ $CPU_VERSION -ge 532 ]; then	# PA-RISC 2.x CPU
	     if [ "$CC" = "cc" ]; then
		OUT="hpux-parisc2-cc" # can't we have hpux-parisc2-gcc?
	     fi
	     if [ $KERNEL_BITS -eq 64 -a "$CC" = "cc" ]; then
		echo "WARNING! If you wish to build 64-bit library then you have to"
		echo "         invoke './Configure hpux64-parisc2-cc' *manually*."
		if [ "$TEST" = "false" ]; then
		  echo "         You have about 5 seconds to press Ctrl-C to abort."
		  (stty -icanon min 0 time 50; read waste) < /dev/tty
		fi
	     fi
	elif [ $CPU_VERSION -ge 528 ]; then	# PA-RISC 1.1+ CPU
	     :
	elif [ $CPU_VERSION -ge 523 ]; then	# PA-RISC 1.0 CPU
	     :
	else					# Motorola(?) CPU
	     OUT="hpux-$CC"
	fi
a632 1
  nsr-tandem-nsk) OUT="tandem-c89" ;;
a635 6
# NB: This atalla support has been superceded by the ENGINE support
# That contains its own header and definitions anyway. Support can
# be enabled or disabled on any supported platform without external
# headers, eg. by adding the "hw-atalla" switch to ./config or
# perl Configure
#
d637 4
a640 4
#if [ -f /usr/include/atasi.h ]
#then
#  options="$options -DATALLA"
#fi
d661 1
a661 1
for i in bf cast des dh dsa ec hmac idea md2 md5 mdc2 rc2 rc4 rc5 aes ripemd rsa sha
a667 21

# Discover Kerberos 5 (since it's still a prototype, we don't
# do any guesses yet, that's why this section is commented away.
#if [ -d /usr/kerberos ]; then
#    krb5_dir=/usr/kerberos
#    if [ \( -f $krb5_dir/lib/libgssapi_krb5.a -o -f $krb5_dir/lib/libgssapi_krb5.so* \)\
#	-a \( -f $krb5_dir/lib/libkrb5.a -o -f $krb5_dir/lib/libkrb5.so* \)\
#	-a \( -f $krb5_dir/lib/libcom_err.a -o -f $krb5_dir/lib/libcom_err.so* \)\
#	-a \( -f $krb5_dir/lib/libk5crypto.a -o -f $krb5_dir/lib/libk5crypto.so* \)\
#	-a \( -f $krb5_dir/include/krb5.h \) ]; then
#	options="$options --with-krb5-flavor=MIT"
#    fi
#elif [ -d /usr/heimdal ]; then
#    krb5_dir=/usr/heimdal
#    if [ \( -f $krb5_dir/lib/libgssapi.a -o -f $krb5_dir/lib/libgssapi.so* \)\
#	-a \( -f $krb5_dir/lib/libkrb5.a -o -f $krb5_dir/lib/libkrb5.so* \)\
#	-a \( -f $krb5_dir/lib/libcom_err.a -o -f $krb5_dir/lib/libcom_err.so* \)\
#	-a \( -f $krb5_dir/include/krb5.h \) ]; then
#	options="$options --with-krb5-flavor=Heimdal"
#    fi
#fi
@


1.1.1.12
log
@Vendor import of OpenSSL 0.9.7a.
@
text
@d77 15
a91 5
		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
d94 6
a99 1
		echo "i386-whatever-unixware1"; exit 0
d102 3
a104 11
		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.
		    x7*)  echo "i586-sco-unixware7";           exit 0 ;;
		    x8*)  echo "i586-unkn-OpenUNIX${VERSION}"; exit 0 ;;
		esac
d199 1
a199 1
    FreeBSD:*:*:*386*)
d208 1
a216 4
    FreeBSD:*)
	echo "${MACHINE}-whatever-freebsd"; exit 0
	;;

a463 4
if [ "${SYSTEM}" = "AIX" ]; then	# favor vendor cc over gcc
    (cc) 2>&1 | grep -iv "command not found" > /dev/null && CC=cc
fi

d550 1
a550 1
	echo "WARNING! If you *know* that your GNU C supports 64-bit/V9 ABI"
a642 2
  sparc64-*-freebsd*) OUT="FreeBSD-sparc64" ;;
  ia64-*-freebsd*) OUT="FreeBSD-ia64" ;;
d699 2
a700 3
	     echo "WARNING! 64-bit ABI is the default configured ABI on HP-UXi."
	     echo "         If you wish to build 32-bit library, the you have to"
	     echo "         invoke './Configure hpux-ia32-cc' *manually*."
a701 1
		echo "         You have about 5 seconds to press Ctrl-C to abort."
@


1.1.1.13
log
@Vendor import of OpenSSL 0.9.7c
@
text
@d461 1
a461 1
    (cc) 2>&1 | grep -iv "not found" > /dev/null && CC=cc
d476 1
a476 1
	CPU=`(hinv -t cpu) 2>/dev/null | head -1 | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'`
d484 1
a484 1
	CPU=`(hinv -t cpu) 2>/dev/null | head -1 | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'`
d500 1
a500 1
        CPU=`(hinv -t cpu) 2>/dev/null | head -1 | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'`
@


1.1.1.14
log
@Vendor import of OpenSSL 0.9.7d.
@
text
@d137 1
a137 1
		echo "${MACHINE}-hp-hpux1x"; exit 0
d413 3
a415 4
    # 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
d688 1
a688 1
	    OUT="hpux64-parisc2-gcc"
d703 1
a703 1
	     echo "         invoke './Configure hpux-ia64-cc' *manually*."
@


1.1.1.14.2.1
log
@MFC update OpenSSL 0.9.7d -> 0.9.7e.
@
text
@a25 1
EXE=""
a290 8
    VOS:*:*:i786)
     echo "i386-stratus-vos"; exit 0
     ;;

    VOS:*:*:*)
     echo "hppa1.1-stratus-vos"; exit 0
     ;;

a681 4
  *-*-vos)
	options="$options no-threads no-shared no-asm no-dso"
	EXE=".pm"
	OUT="vos-$CC" ;;
d809 2
a810 2
		if [ -f "$i/perl5$EXE" ] ; then
			PERL="$i/perl5$EXE"
d818 3
a820 3
		if [ -f "$i/perl$EXE" ] ; then
			if "$i/perl$EXE" -e 'exit($]<5.0)'; then
				PERL="$i/perl$EXE"
@


1.1.1.15
log
@Vendor import of OpenSSL 0.9.7e.
@
text
@a25 1
EXE=""
a290 8
    VOS:*:*:i786)
     echo "i386-stratus-vos"; exit 0
     ;;

    VOS:*:*:*)
     echo "hppa1.1-stratus-vos"; exit 0
     ;;

a681 4
  *-*-vos)
	options="$options no-threads no-shared no-asm no-dso"
	EXE=".pm"
	OUT="vos-$CC" ;;
d809 2
a810 2
		if [ -f "$i/perl5$EXE" ] ; then
			PERL="$i/perl5$EXE"
d818 3
a820 3
		if [ -f "$i/perl$EXE" ] ; then
			if "$i/perl$EXE" -e 'exit($]<5.0)'; then
				PERL="$i/perl$EXE"
@


1.1.1.16
log
@Vendor import of OpenSSL 0.9.8b
@
text
@d85 1
a85 1
		echo "whatever-whatever-unixware1"; exit 0
d87 1
a87 1
	    5*)
d96 2
a97 1
		    x[678]*)  echo "i586-sco-unixware7"; exit 0 ;;
d114 2
a115 2
    AIX:[3-9]:4:*)
	echo "${MACHINE}-ibm-aix"; exit 0
d118 2
a119 2
    AIX:*:[5-9]:*)
	echo "${MACHINE}-ibm-aix"; exit 0
d123 1
a123 1
	echo "${MACHINE}-ibm-aix3"; exit 0
a339 3
    MINGW*)
	echo "${MACHINE}-whatever-mingw"; exit 0;
	;;
d407 1
a407 1
  GCCVER=`echo $GCCVER | LC_ALL=C sed 's/^[a-zA-Z]*\-//'`
d445 1
a445 1
  if [ $MACHINE != i86pc -a $CCVER -gt 40 ]; then
d452 2
d494 7
a500 7
	#CPU=`(hinv -t cpu) 2>/dev/null | head -1 | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'`
	#CPU=${CPU:-0}
	#if [ $CPU -ge 5000 ]; then
	#	options="$options -mips4"
	#else
	#	options="$options -mips3"
	#fi
d506 1
a506 1
	if [ "$TEST" = "false" -a -t 1 ]; then
d508 1
a508 1
	  (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
d510 7
a516 7
        #CPU=`(hinv -t cpu) 2>/dev/null | head -1 | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'`
        #CPU=${CPU:-0}
        #if [ $CPU -ge 5000 ]; then
        #        options="$options -mips4"
        #else
        #        options="$options -mips3"
        #fi
a518 3
  ppc-apple-rhapsody) OUT="rhapsody-ppc-cc" ;;
  ppc-apple-darwin*) OUT="darwin-ppc-cc" ;;
  i386-apple-darwin*) OUT="darwin-i386-cc" ;;
d520 1
a520 1
        ISA=`awk '/cpu model/{print$4;exit(0);}' /proc/cpuinfo`
d522 1
a522 1
	*[678])	OUT="linux-alpha+bwx-$CC" ;;
d529 1
a529 1
	    *)			options="$options -mcpu=ev6";;
d533 16
d550 3
a552 8
	echo "WARNING! If you wish to build 64-bit library, then you have to"
	echo "         invoke './Configure linux-ppc64' *manually*."
	if [ "$TEST" = "false" -a -t 1 ]; then
	    echo "         You have about 5 seconds to press Ctrl-C to abort."
	    (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
	fi
	OUT="linux-ppc"
	;;
d554 1
d556 3
d563 1
a563 1
	if [ "$TEST" = "false" -a -t 1 ]; then
d565 1
a565 1
	  (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
d569 1
a569 1
	KARCH=`awk '/^type/{print$3;exit(0);}' /proc/cpuinfo`
d574 1
a574 1
	*)	OUT="linux-generic32"; options="$options -DB_ENDIAN" ;;
d576 3
a578 5
  parisc*-*-linux2)
	# 64-bit builds under parisc64 linux are not supported and
	# compiler is expected to generate 32-bit objects...
	CPUARCH=`awk '/cpu family/{print substr($5,1,3); exit(0);}' /proc/cpuinfo`
	CPUSCHEDULE=`awk '/^cpu.[ 	]*: PA/{print substr($3,3); exit(0);}' /proc/cpuinfo`
d591 1
a591 1
	CPUSCHEDULE=`echo $CPUSCHEDULE|sed -e 's/7300LC/7100LC/' -e 's/8.00/8000/'`
d594 5
a598 5
	options="$options -DB_ENDIAN -mschedule=$CPUSCHEDULE -march=$CPUARCH"
	OUT="linux-generic32" ;;
  arm*b-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN" ;;
  arm*l-*-linux2) OUT="linux-generic32"; options="$options -DL_ENDIAN" ;;
  s390*-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN -DNO_ASM" ;;
d600 1
a600 1
  *86-*-linux2) OUT="linux-elf"
d603 1
a603 1
	    options="$options -mcpu=pentium"
d606 1
a606 1
	    options="$options -mcpu=pentiumpro"
d609 1
a609 1
	    options="$options -mcpu=k6"
a612 1
  *-*-linux2) OUT="linux-generic32" ;;
d620 1
a620 1
		if [ "$TEST" = "false" -a -t 1 ]; then
d622 1
a622 1
		  (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
d632 1
a632 1
		if [ "$TEST" = "false" -a -t 1 ]; then
d634 1
a634 1
		  (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
d640 1
a640 1
		if [ "$TEST" = "false" -a -t 1 ]; then
d642 1
a642 1
		  (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
d650 26
a675 35
  *86*-*-solaris2)
	ISA64=`(isalist) 2>/dev/null | grep amd64`
	if [ "$ISA64" != "" ]; then
	    OUT="solaris64-x86_64-$CC"
	else
	    OUT="solaris-x86-$CC"
	    if [ `uname -r | sed -e 's/5\.//'` -lt 10 ]; then
		options="$options no-sse2"
	    fi
	fi
	;;
  *-*-sunos4)		OUT="sunos-$CC" ;;

  *86*-*-bsdi4)		OUT="BSD-x86-elf"; options="$options no-sse2 -ldl" ;;
  alpha*-*-*bsd*)	OUT="BSD-generic64; options="$options -DL_ENDIAN" ;;
  powerpc64-*-*bsd*)	OUT="BSD-generic64; options="$options -DB_ENDIAN" ;;
  sparc64-*-*bsd*)	OUT="BSD-sparc64" ;;
  ia64-*-*bsd*)		OUT="BSD-ia64" ;;
  amd64-*-*bsd*)	OUT="BSD-x86_64" ;;
  *86*-*-*bsd*)		# mimic ld behaviour when it's looking for libc...
			if [ -L /usr/lib/libc.so ]; then	# [Free|Net]BSD
			    libc=/usr/lib/libc.so
			else					# OpenBSD
			    # ld searches for highest libc.so.* and so do we
			    libc=`(ls /usr/lib/libc.so.* | tail -1) 2>/dev/null`
			fi
			case "`(file -L $libc) 2>/dev/null`" in
			*ELF*)	OUT="BSD-x86-elf" ;;
			*)	OUT="BSD-x86"; options="$options no-sse2" ;;
			esac ;;
  *-*-*bsd*)		OUT="BSD-generic32" ;;

  *-*-osf)		OUT="osf1-alpha-cc" ;;
  *-*-tru64)		OUT="tru64-alpha-cc" ;;
  *-*-[Uu]nix[Ww]are7)
d677 1
a677 1
	  OUT="unixware-7-gcc" ; options="$options no-sse2"
d679 1
a679 1
	  OUT="unixware-7" ; options="$options no-sse2 -D__i386__"
d682 9
a690 2
  *-*-[Uu]nix[Ww]are20*) OUT="unixware-2.0"; options="$options no-sse2 no-sha512" ;;
  *-*-[Uu]nix[Ww]are21*) OUT="unixware-2.1"; options="$options no-sse2 no-sha512" ;;
d699 3
a701 1
	if [ $CC = "gcc" -a $GCC_BITS = "64" ]; then
d703 5
d718 1
a718 1
	     if [ "$TEST" = "false" -a -t 1 ]; then
d720 1
a720 1
		(trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
d724 3
a726 1
	     OUT=${OUT:-"hpux-parisc2-${CC}"}
d730 1
a730 1
		if [ "$TEST" = "false" -a -t 1 ]; then
d732 1
a732 1
		  (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
d736 1
a736 1
	     OUT="hpux-parisc-${CC}
d738 1
a738 1
	     OUT="hpux-parisc-${CC}
a743 26
  *-aix)
	KERNEL_BITS=`(getconf KERNEL_BITMODE) 2>/dev/null`
	KERNEL_BITS=${KERNEL_BITS:-32}
	OBJECT_MODE=${OBJECT_MODE:-32}
	if [ "$CC" = "gcc" ]; then
	    OUT="aix-gcc"
	elif [ $OBJECT_MODE -eq 64 ]; then
	    echo 'Your $OBJECT_MODE was found to be set to 64' 
	    OUT="aix64-cc"
	else
	    OUT="aix-cc"
	    if [ $KERNEL_BITS -eq 64 ]; then
		echo "WARNING! If you wish to build 64-bit kit, then you have to"
		echo "         invoke './Configure aix64-cc' *manually*."
		if [ "$TEST" = "false" -a -t 1 ]; then
		    echo "         You have ~5 seconds to press Ctrl-C to abort."
		    (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
		fi
	    fi
	fi
	if (lsattr -E -O -l proc0 | grep -i powerpc) >/dev/null 2>&1; then
	    :	# this applies even to Power3 and later, as they return PowerPC_POWER[345]
	else
	    options="$options no-asm"
	fi
	;;
d745 1
d771 1
a771 2
  echo "WARNING! Falling down to 'solaris-sparcv8-gcc'."
  echo "         Upgrade to gcc-2.8 or later."
d773 1
a773 1
  OUT=solaris-sparcv8-gcc
@


1.1.1.17
log
@Vendor import of OpenSSL 0.9.8d.
@
text
@d720 1
a720 1
	     OUT="hpux-parisc-${CC}"
d722 1
a722 1
	     OUT="hpux-parisc-${CC}"
d797 1
a797 1
for i in aes bf camellia cast des dh dsa ec hmac idea md2 md5 mdc2 rc2 rc4 rc5 ripemd rsa sha
@


1.1.1.18
log
@Vendor import of OpenSSL 0.9.8e.
@
text
@d530 3
a532 3
	    EV5|EV45)		options="$options -march=ev5";;
	    EV56|PCA56)		options="$options -march=ev56";;
	    *)			options="$options -march=ev6";;
a587 3
  sh*b-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN" ;;
  sh*-*-linux2)  OUT="linux-generic32"; options="$options -DL_ENDIAN" ;;
  m68k*-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN" ;;
d593 1
a593 1
	    options="$options -march=pentium"
d596 1
a596 1
	    options="$options -march=pentiumpro"
d599 1
a599 1
	    options="$options -march=k6"
d777 1
a777 1
# gcc < 2.8 does not support -march=ultrasparc
@


1.1.1.18.2.1
log
@SVN rev 215997 on 2010-11-28 13:45:51Z by simon

Merge OpenSSL 0.9.8p into stable/7.

This merges up to and including head/crypto/openssl/ r215697; and
head/secure/lib/libcrypto/, head/secure/lib/libssl/,
head/secure/usr.bin/openssl/ r215698.

To make the merge simpler, a hack was added to set MACHINE_CPUARCH.

A few old OpenSSL security fixes are still the stable/7 tree - these
will be backed out to the vendor version shortly.

Security:	CVE-2010-2939, CVE-2010-3864
Security:	http://www.openssl.org/news/secadv_20101116.txt
Security:	FreeBSD-SA-10:10.openssl
Approved by:	re (implicitly - they did not object of the general idea
		of OpenSSL update)
@
text
@d32 1
a32 1
-d) PREFIX="debug-";;
d51 4
a54 4
[ "$MACHINE" ] || MACHINE=`(uname -m) 2>/dev/null` || MACHINE="unknown"
[ "$RELEASE" ] || RELEASE=`(uname -r) 2>/dev/null` || RELEASE="unknown"
[ "$SYSTEM" ] || SYSTEM=`(uname -s) 2>/dev/null`  || SYSTEM="unknown"
[ "$BUILD" ] || VERSION=`(uname -v) 2>/dev/null` || VERSION="unknown"
d402 2
d406 1
d415 2
a416 11
fi

# Only set CC if not supplied already
if [ -z "$CC" ]; then
# figure out if gcc is available and if so we use it otherwise
# we fallback to whatever cc does on the system
  if [ "$GCCVER" != "" ]; then
    CC=gcc
  else
    CC=cc
  fi
d530 3
a532 3
	    EV5|EV45)		options="$options -mcpu=ev5";;
	    EV56|PCA56)		options="$options -mcpu=ev56";;
	    *)			options="$options -mcpu=ev6";;
d591 1
a591 2
  s390-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN -DNO_ASM" ;;
  s390x-*-linux2) OUT="linux-generic64"; options="$options -DB_ENDIAN" ;;
d607 1
a607 1
  sun4[uv]*-*-solaris2)
d658 2
a659 2
  alpha*-*-*bsd*)	OUT="BSD-generic64"; options="$options -DL_ENDIAN" ;;
  powerpc64-*-*bsd*)	OUT="BSD-generic64"; options="$options -DB_ENDIAN" ;;
a736 4
          if [ $OBJECT_MODE -eq 64 ]; then
            echo 'Your $OBJECT_MODE was found to be set to 64'
            OUT="aix64-gcc"
          fi
d751 1
a751 1
	if (lsattr -E -O -l `lsdev -c processor|awk '{print$1;exit}'` | grep -i powerpc) >/dev/null 2>&1; then
a764 2
  x86pc-*-qnx6) OUT="QNX6-i386" ;;
  *-*-qnx6) OUT="QNX6" ;;
d800 1
a800 1
for i in aes bf camellia cast des dh dsa ec hmac idea md2 md5 mdc2 rc2 rc4 rc5 ripemd rsa seed sha
@


1.1.1.18.2.2
log
@SVN rev 238001 on 2012-07-02 16:24:43Z by jkim

MFC:	r237657, r237658, r237666

Merge OpenSSL 0.9.8x and regen manual pages.
@
text
@a792 4
($CC -Wa,--help -c -o /dev/null -x assembler /dev/null 2>&1 | \
 grep \\--noexecstack) 2>&1 > /dev/null && \
  options="$options -Wa,--noexecstack"

@


