diff options
author | abs <abs@pkgsrc.org> | 2007-08-27 10:08:29 +0000 |
---|---|---|
committer | abs <abs@pkgsrc.org> | 2007-08-27 10:08:29 +0000 |
commit | a3f13d197a0ba6bf5bcc993e86b78b6289667a48 (patch) | |
tree | ec78f1982d8b362231723eedf21ab7c51c1b4924 /devel | |
parent | 3621c61c1757f004c64f9c5370ce5e67d26d6ba8 (diff) | |
download | pkgsrc-a3f13d197a0ba6bf5bcc993e86b78b6289667a48.tar.gz |
Update devel/cpuflags to 1.14:
- return 0 in verbose() to fix issue with 'set -e'
- ONLY_FOR_PLATFORM += FreeBSD-*-*
- Use `` rather than $() to unbreak Solaris
- Add x86 arch fixup/corrections in files/subr_x86
All from Yakovetsky Vladimir
Diffstat (limited to 'devel')
-rw-r--r-- | devel/cpuflags/Makefile | 6 | ||||
-rw-r--r-- | devel/cpuflags/files/Makefile | 4 | ||||
-rwxr-xr-x | devel/cpuflags/files/cpuflags.sh | 31 | ||||
-rw-r--r-- | devel/cpuflags/files/optimize_gcc.mk | 4 | ||||
-rw-r--r-- | devel/cpuflags/files/subr_FreeBSD | 1 | ||||
-rw-r--r-- | devel/cpuflags/files/subr_gcc | 1 | ||||
-rw-r--r-- | devel/cpuflags/files/subr_x86 | 79 |
7 files changed, 110 insertions, 16 deletions
diff --git a/devel/cpuflags/Makefile b/devel/cpuflags/Makefile index 08744693f6b..594da14f18c 100644 --- a/devel/cpuflags/Makefile +++ b/devel/cpuflags/Makefile @@ -1,6 +1,6 @@ -# $NetBSD: Makefile,v 1.116 2007/08/22 11:50:18 tron Exp $ +# $NetBSD: Makefile,v 1.117 2007/08/27 10:08:29 abs Exp $ -DISTNAME= cpuflags-1.13 +DISTNAME= cpuflags-1.14 CATEGORIES= sysutils MASTER_SITES= # empty DISTFILES= # empty @@ -8,7 +8,7 @@ DISTFILES= # empty MAINTAINER= abs@NetBSD.org COMMENT= Determine compiler flags to best target current cpu -ONLY_FOR_PLATFORM= NetBSD-*-* Linux-*-* SunOS-*-* +ONLY_FOR_PLATFORM= NetBSD-*-* Linux-*-* SunOS-*-* FreeBSD-*-* USE_LANGUAGES= # empty NO_CHECKSUM= yes diff --git a/devel/cpuflags/files/Makefile b/devel/cpuflags/files/Makefile index c99f5f5115d..1ebbd1f20fc 100644 --- a/devel/cpuflags/files/Makefile +++ b/devel/cpuflags/files/Makefile @@ -1,6 +1,6 @@ -# $Id: Makefile,v 1.11 2007/08/22 11:50:18 tron Exp $ +# $Id: Makefile,v 1.12 2007/08/27 10:08:29 abs Exp $ -VERSION=1.13 +VERSION=1.14 PREFIX?=/usr/local OPSYS?=`uname` diff --git a/devel/cpuflags/files/cpuflags.sh b/devel/cpuflags/files/cpuflags.sh index 02fa429c5ea..19cb288b65f 100755 --- a/devel/cpuflags/files/cpuflags.sh +++ b/devel/cpuflags/files/cpuflags.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $NetBSD: cpuflags.sh,v 1.1 2007/08/20 11:21:21 abs Exp $ +# $NetBSD: cpuflags.sh,v 1.2 2007/08/27 10:08:29 abs Exp $ PATH=/sbin:/usr/sbin:/bin:/usr/bin:$PATH include() @@ -17,9 +17,10 @@ include() verbose() { [ -n "$opt_v" ] && echo $* >&2 + return 0 } -UNAME=$(uname) +UNAME=`uname` if [ "$1" = -v ] ; then shift @@ -45,19 +46,31 @@ include subr_${UNAME} # include subr_gcc +# native arch +M_ARCH_NATIVE='-march=native' + # Determine the flags for this OS/machine extract_hw_details -if [ $(gcc_ser $CC) -gt 4002 ] ; then - ARCH='-march=native' +if [ `gcc_ser $CC` -gt 4002 ] ; then + ARCH="$M_ARCH_NATIVE" else - ARCH=$(determine_arch) + ARCH=`determine_arch` fi -FEATURES=$(determine_features) +FEATURES=`determine_features` + +test "x$ARCH" != "x$M_ARCH_NATIVE" && # gcc have not autodetection + case "$hw_machine_arch" in # all known x86 mnemonics + i386|i486|i586|i686|x86_64|amd64|i86pc) + include subr_x86 # this provides flags_fixup_x86arch() + echo $FEATURES + l_arch=`flags_fixup_x86arch "$ARCH" "$FEATURES"` + test -n "$l_arch" && ARCH="-march=$l_arch" + esac # Fixup any flags which are too new for our gcc version # -CPUFLAGS="$(gcc_fixup_arch_flags $CC $ARCH $FEATURES)" -CPUFLAGS="$(echo $CPUFLAGS)" +CPUFLAGS=`gcc_fixup_arch_flags $CC $ARCH $FEATURES` +CPUFLAGS=`echo $CPUFLAGS` if [ -n "$opt_v" ] ; then if [ -n "$NOARCH" ] ; then @@ -70,7 +83,7 @@ if [ -n "$opt_v" ] ; then ARCH : $ARCH FEATURES : $FEATURES CPUFLAGS : $CPUFLAGS -GCC version : $(gcc_ver $CC) +GCC version : `gcc_ver $CC` END display_hw_details exit; diff --git a/devel/cpuflags/files/optimize_gcc.mk b/devel/cpuflags/files/optimize_gcc.mk index 8a1a200d754..96544607db9 100644 --- a/devel/cpuflags/files/optimize_gcc.mk +++ b/devel/cpuflags/files/optimize_gcc.mk @@ -1,4 +1,4 @@ -# $Id: optimize_gcc.mk,v 1.33 2007/08/20 11:34:05 abs Exp $ +# $Id: optimize_gcc.mk,v 1.34 2007/08/27 10:08:29 abs Exp $ # This file is 'experimental' - which is doublespeak for unspeakably # ugly, and quite broken by design. @@ -48,7 +48,7 @@ PKG_EXCLUDE_FAST_MATH+=x11/qt3-libs # ----------------------------------------------------------------------------- # Assign default flags, then remove values based on settings above # -COPT_FLAGS=-finline-functions -fomit-frame-pointer -ffast-math +COPT_FLAGS=-finline-functions -fomit-frame-pointer -ffast-math .if !empty(PKG_EXCLUDE_OMIT_FRAME_POINTER:M${PKGPATH}) COPT_FLAGS:= ${COPT_FLAGS:S/-fomit-frame-pointer//} diff --git a/devel/cpuflags/files/subr_FreeBSD b/devel/cpuflags/files/subr_FreeBSD index 4276a120dab..9da384d48ee 100644 --- a/devel/cpuflags/files/subr_FreeBSD +++ b/devel/cpuflags/files/subr_FreeBSD @@ -1,3 +1,4 @@ +# $NetBSD: subr_FreeBSD,v 1.2 2007/08/27 10:08:29 abs Exp $ AWK=awk SED=sed diff --git a/devel/cpuflags/files/subr_gcc b/devel/cpuflags/files/subr_gcc index 20b8b7cf636..64c41ab0ddb 100644 --- a/devel/cpuflags/files/subr_gcc +++ b/devel/cpuflags/files/subr_gcc @@ -1,3 +1,4 @@ +# $NetBSD: subr_gcc,v 1.2 2007/08/27 10:08:30 abs Exp $ # Return gcc version string gcc_ver() diff --git a/devel/cpuflags/files/subr_x86 b/devel/cpuflags/files/subr_x86 new file mode 100644 index 00000000000..6ad7fde7c3f --- /dev/null +++ b/devel/cpuflags/files/subr_x86 @@ -0,0 +1,79 @@ +# $NetBSD: subr_x86,v 1.1 2007/08/27 10:08:30 abs Exp $ + +flags_fixup_x86arch() + { + arch=$1 + features=$2 + # Fixup ARCH for x86 + # + # The format of table is + # feature:lowend_arch:fix_arch + # + echo $AWK -v "arch=${arch#-march=}" -v "features=$features" >&2 + $AWK -v "arch=${arch#-march=}" -v "features=$features" ' + BEGIN { split(features,ar); FS=":" } + { for (af in ar) + { if ((ar[af] == $1) && (arch == $3)) { print $2; exit;} } + } + ' <<EOD +-msse:pentium3:i386 +-msse:pentium3:i486 +-msse:pentium3:i586 +-msse:pentium3:i686 +-msse:pentium3:pentium +-msse:pentium3:pentium-mmx +-msse:pentium3:pentiumpro +-msse:pentium3:pentium2 +-msse:athlon:k6 +-msse:athlon:k6-2 +-msse:athlon:k6-3 +-msse2:pentium4:i386 +-msse2:pentium4:i386 +-msse2:pentium4:i486 +-msse2:pentium4:i586 +-msse2:pentium4:i686 +-msse2:pentium4:pentium +-msse2:pentium4:pentium-mmx +-msse2:pentium4:pentiumpro +-msse2:pentium4:pentium2 +-msse2:pentium4:pentium3 +-msse2:pentium4:pentium3m +-msse2:k8:k6 +-msse2:k8:k6-2 +-msse2:k8:k6-3 +-msse2:k8:athlon +-msse2:k8:athlon-tbird +-msse2:k8:athlon-4 +-msse2:k8:athlon-xp +-msse2:k8:athlon-mp +-msse3:prescott:i386 +-msse3:prescott:i386 +-msse3:prescott:i486 +-msse3:prescott:i586 +-msse3:prescott:i686 +-msse3:prescott:pentium +-msse3:prescott:pentium-mmx +-msse3:prescott:pentiumpro +-msse3:prescott:pentium2 +-msse3:prescott:pentium3 +-msse3:prescott:pentium3m +-msse3:prescott:pentium-m +-msse3:prescott:pentium4 +-msse3:prescott:pentium4m +-msse3:k8:k6 +-msse3:k8:k6-2 +-msse3:k8:k6-3 +-msse3:k8:athlon +-msse3:k8:athlon-tbird +-msse3:k8:athlon-4 +-msse3:k8:athlon-xp +-msse3:k8:athlon-mp +-m3dnow:athlon:k6 +-m3dnow:athlon:k6-2 +-m3dnow:athlon:k6-3 +EOD + +## in future +#-mssse3:nocona:prescott ... +#-msse4:nehalem:nocona ... + } |