summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-06-13 23:10:33 +0000
committerMike Frysinger <vapier@gentoo.org>2005-06-13 23:10:33 +0000
commite828ae74594a42174cbb9d438d316d573e3b5ac0 (patch)
treedc50f71f550361770e51b987b6b9fcde47e8d928 /dev-libs
parentMarked ~alpha for bug #62644 (diff)
downloadgentoo-2-e828ae74594a42174cbb9d438d316d573e3b5ac0.tar.gz
gentoo-2-e828ae74594a42174cbb9d438d316d573e3b5ac0.tar.bz2
gentoo-2-e828ae74594a42174cbb9d438d316d573e3b5ac0.zip
add test cases, fix system detection for linux, and touch up machine syntax
(Portage version: 2.0.51.22-r1)
Diffstat (limited to 'dev-libs')
-rwxr-xr-xdev-libs/openssl/files/gentoo.config-0.9.7g71
1 files changed, 51 insertions, 20 deletions
diff --git a/dev-libs/openssl/files/gentoo.config-0.9.7g b/dev-libs/openssl/files/gentoo.config-0.9.7g
index d80af908e7cb..c3c6e63e0e6e 100755
--- a/dev-libs/openssl/files/gentoo.config-0.9.7g
+++ b/dev-libs/openssl/files/gentoo.config-0.9.7g
@@ -1,31 +1,66 @@
#!/bin/bash
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-libs/openssl/files/gentoo.config-0.9.7g,v 1.5 2005/06/13 14:34:56 flameeyes Exp $
-
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/openssl/files/gentoo.config-0.9.7g,v 1.6 2005/06/13 23:10:33 vapier Exp $
+#
# Openssl doesn't play along nicely with cross-compiling
# like autotools based projects, so let's teach it new tricks.
-
+#
# Review the bundled 'config' script to see why kind of targets
# we can pass to the 'Configure' script.
+# Testing routines
+if [[ $1 == "test" ]] ; then
+ for c in \
+ "arm-gentoo-linux-uclibc |linux-elf-arm -DL_ENDIAN" \
+ "armv5b-linux-gnu |linux-elf-arm -DB_ENDIAN" \
+ "x86_64-pc-linux-gnu |linux-x86_64" \
+ "alphaev56-unknown-linux-gnu |linux-alpha+bwx-gcc" \
+ "whatever-gentoo-freebsdX.Y |FreeBSD-elf" \
+ "sparc64-alpha-freebsdX.Y |FreeBSD-sparc64" \
+ "ia64-gentoo-freebsd5.99234 |FreeBSD-ia64" \
+ "hppa64-aldsF-linux-gnu5.3 |linux-parisc" \
+ "powerpc-gentOO-linux-uclibc |linux-ppc" \
+ "powerpc64-unk-linux-gnu |linux-ppc64" \
+ ;do
+ CHOST=${c/|*}
+ ret_want=${c/*|}
+ ret_got=$(CHOST=${CHOST} "$0")
+
+ if [[ ${ret_want} == "${ret_got}" ]] ; then
+ echo "PASS: ${CHOST}"
+ else
+ echo "FAIL: ${CHOST}"
+ echo -e "\twanted: ${ret_want}"
+ echo -e "\twe got: ${ret_got}"
+ fi
+ done
+ exit 0
+fi
+
+
+# Detect the operating system
case ${CHOST} in
- *-uclibc*) system="linux";;
- *-gnu*) system="linux";;
+ *-linux*) system="linux";;
*-freebsd*) system="FreeBSD";;
*) exit 0;;
esac
+
+# Compiler munging
compiler="gcc"
if [[ ${CC} == "ccc" ]] ; then
compiler=${CC}
fi
+
+# Detect target arch
+machine=""
+chost_machine=${CHOST%%-*}
case ${system} in
linux)
- machine=""
- case ${CHOST} in
+ case ${chost_machine} in
alphaev56*) machine=alpha+bwx-${compiler};;
alphaev[67]*) machine=alpha+bwx-${compiler};;
alpha*)
@@ -36,12 +71,12 @@ linux)
currmachine=$(strings /usr/lib/libcrypto.so | grep ^linux-alpha | sed -e s:linux-::)
fi
machine=${currmachine:-alpha-${compiler}}
-
+
# NOTE: drop this crap next time SSL changes ABI #'s
[[ ${PV:0:5} != "0.9.7" ]] && machine="plzupdatemekthxbye"
;;
-
- arm*eb*) machine="elf-arm -DB_ENDIAN";;
+
+ arm*b*) machine="elf-arm -DB_ENDIAN";;
arm*) machine="elf-arm -DL_ENDIAN";;
# hppa64*) machine=parisc64;;
hppa*) machine=parisc;;
@@ -62,21 +97,17 @@ linux)
s390*) machine=s390;;
x86_64*) machine=x86_64;;
esac
-;;
+ ;;
FreeBSD)
- machine=""
- case ${CHOST} in
+ case ${chost_machine} in
sparc64*) machine=sparc64;;
ia64*) machine=ia64;;
alpha*) machine=alpha;;
*) machine=elf;;
esac
-;;
-*)
- exit 0
-;;
+ ;;
esac
-if [ -n "${machine}" ] ; then
- echo ${system}-${machine}
-fi
+
+# If we have something, show it
+[[ -n ${machine} ]] && echo ${system}-${machine}