pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/devel/cpuflags Update devel/cpuflags to 1.14:



details:   https://anonhg.NetBSD.org/pkgsrc/rev/e70ecb2f4171
branches:  trunk
changeset: 532649:e70ecb2f4171
user:      abs <abs%pkgsrc.org@localhost>
date:      Mon Aug 27 10:08:29 2007 +0000

description:
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:

 devel/cpuflags/Makefile              |   6 +-
 devel/cpuflags/files/Makefile        |   4 +-
 devel/cpuflags/files/cpuflags.sh     |  31 ++++++++++----
 devel/cpuflags/files/optimize_gcc.mk |   4 +-
 devel/cpuflags/files/subr_FreeBSD    |   1 +
 devel/cpuflags/files/subr_gcc        |   1 +
 devel/cpuflags/files/subr_x86        |  79 ++++++++++++++++++++++++++++++++++++
 7 files changed, 110 insertions(+), 16 deletions(-)

diffs (219 lines):

diff -r ecbf62fb1461 -r e70ecb2f4171 devel/cpuflags/Makefile
--- a/devel/cpuflags/Makefile   Mon Aug 27 08:41:06 2007 +0000
+++ b/devel/cpuflags/Makefile   Mon Aug 27 10:08:29 2007 +0000
@@ -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 @@
 MAINTAINER=    abs%NetBSD.org@localhost
 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 -r ecbf62fb1461 -r e70ecb2f4171 devel/cpuflags/files/Makefile
--- a/devel/cpuflags/files/Makefile     Mon Aug 27 08:41:06 2007 +0000
+++ b/devel/cpuflags/files/Makefile     Mon Aug 27 10:08:29 2007 +0000
@@ -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 -r ecbf62fb1461 -r e70ecb2f4171 devel/cpuflags/files/cpuflags.sh
--- a/devel/cpuflags/files/cpuflags.sh  Mon Aug 27 08:41:06 2007 +0000
+++ b/devel/cpuflags/files/cpuflags.sh  Mon Aug 27 10:08:29 2007 +0000
@@ -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 @@
 verbose()
     {
     [ -n "$opt_v" ] && echo $* >&2
+    return 0
     }
 
-UNAME=$(uname)
+UNAME=`uname`
 
 if [ "$1" = -v ] ; then
     shift
@@ -45,19 +46,31 @@
 #
 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 @@
 ARCH            : $ARCH
 FEATURES        : $FEATURES
 CPUFLAGS        : $CPUFLAGS
-GCC version     : $(gcc_ver $CC)
+GCC version     : `gcc_ver $CC`
 END
     display_hw_details
     exit;
diff -r ecbf62fb1461 -r e70ecb2f4171 devel/cpuflags/files/optimize_gcc.mk
--- a/devel/cpuflags/files/optimize_gcc.mk      Mon Aug 27 08:41:06 2007 +0000
+++ b/devel/cpuflags/files/optimize_gcc.mk      Mon Aug 27 10:08:29 2007 +0000
@@ -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 @@
 # -----------------------------------------------------------------------------
 # 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 -r ecbf62fb1461 -r e70ecb2f4171 devel/cpuflags/files/subr_FreeBSD
--- a/devel/cpuflags/files/subr_FreeBSD Mon Aug 27 08:41:06 2007 +0000
+++ b/devel/cpuflags/files/subr_FreeBSD Mon Aug 27 10:08:29 2007 +0000
@@ -1,3 +1,4 @@
+# $NetBSD: subr_FreeBSD,v 1.2 2007/08/27 10:08:29 abs Exp $
 
 AWK=awk
 SED=sed
diff -r ecbf62fb1461 -r e70ecb2f4171 devel/cpuflags/files/subr_gcc
--- a/devel/cpuflags/files/subr_gcc     Mon Aug 27 08:41:06 2007 +0000
+++ b/devel/cpuflags/files/subr_gcc     Mon Aug 27 10:08:29 2007 +0000
@@ -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 -r ecbf62fb1461 -r e70ecb2f4171 devel/cpuflags/files/subr_x86
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/cpuflags/files/subr_x86     Mon Aug 27 10:08:29 2007 +0000
@@ -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 ...
+    }



Home | Main Index | Thread Index | Old Index