Thu Jan 28 19:11:30 2016 UTC ()
Update cpuflags to 1.43
Handle '(' & ')' in cpuctl output
Note that for modern gcc -march=native may be a better alternative


(abs)
diff -r1.1 -r1.2 pkgsrc/devel/cpuflags/DESCR
diff -r1.152 -r1.153 pkgsrc/devel/cpuflags/Makefile
diff -r1.12 -r1.13 pkgsrc/devel/cpuflags/files/subr_NetBSD

cvs diff -r1.1 -r1.2 pkgsrc/devel/cpuflags/DESCR (expand / switch to unified diff)

--- pkgsrc/devel/cpuflags/DESCR 2001/11/01 01:22:50 1.1
+++ pkgsrc/devel/cpuflags/DESCR 2016/01/28 19:11:30 1.2
@@ -1,2 +1,6 @@ @@ -1,2 +1,6 @@
1cpuflags returns the appropriate gcc flags to optimise compilation for the 1cpuflags returns the appropriate gcc flags to optimise compilation
2current CPU. 2for the current CPU.
 3
 4With modern gcc it is probably best to just set -march=native for
 5at least x86, but cpuflags may still be useful for older and less
 6usual architectures

cvs diff -r1.152 -r1.153 pkgsrc/devel/cpuflags/Makefile (expand / switch to unified diff)

--- pkgsrc/devel/cpuflags/Makefile 2015/01/04 04:48:10 1.152
+++ pkgsrc/devel/cpuflags/Makefile 2016/01/28 19:11:30 1.153
@@ -1,22 +1,23 @@ @@ -1,22 +1,23 @@
1# $NetBSD: Makefile,v 1.152 2015/01/04 04:48:10 dholland Exp $ 1# $NetBSD: Makefile,v 1.153 2016/01/28 19:11:30 abs Exp $
2 2
3DISTNAME= cpuflags-1.42 3DISTNAME= cpuflags-1.43
4CATEGORIES= devel sysutils 4CATEGORIES= devel sysutils
5MASTER_SITES= # empty 5MASTER_SITES= # empty
6DISTFILES= # empty 6DISTFILES= # empty
7 7
8MAINTAINER= abs@NetBSD.org 8MAINTAINER= abs@NetBSD.org
9COMMENT= Determine compiler flags to best target current cpu 9COMMENT= Determine compiler flags to best target current cpu
 10LICENSE= 2-clause-bsd
10 11
11# each OS needs explicit support (files/subr_*) 12# each OS needs explicit support (files/subr_*)
12ONLY_FOR_PLATFORM= NetBSD-*-* Linux-*-* SunOS-*-* FreeBSD-*-* Darwin-*-* 13ONLY_FOR_PLATFORM= NetBSD-*-* Linux-*-* SunOS-*-* FreeBSD-*-* Darwin-*-*
13 14
14USE_LANGUAGES= # empty 15USE_LANGUAGES= # empty
15NO_CONFIGURE= yes 16NO_CONFIGURE= yes
16 17
17MAKE_FLAGS+= INSTALL_DATA=${INSTALL_DATA:Q} 18MAKE_FLAGS+= INSTALL_DATA=${INSTALL_DATA:Q}
18MAKE_FLAGS+= INSTALL_MAN=${INSTALL_MAN:Q} 19MAKE_FLAGS+= INSTALL_MAN=${INSTALL_MAN:Q}
19MAKE_FLAGS+= INSTALL_SCRIPT=${INSTALL_SCRIPT:Q} 20MAKE_FLAGS+= INSTALL_SCRIPT=${INSTALL_SCRIPT:Q}
20MAKE_FLAGS+= INSTALL_PROGRAM_DIR=${INSTALL_PROGRAM_DIR:Q} 21MAKE_FLAGS+= INSTALL_PROGRAM_DIR=${INSTALL_PROGRAM_DIR:Q}
21MAKE_FLAGS+= INSTALL_MAN_DIR=${INSTALL_MAN_DIR:Q} 22MAKE_FLAGS+= INSTALL_MAN_DIR=${INSTALL_MAN_DIR:Q}
22MAKE_FLAGS+= INSTALL_DATA_DIR=${INSTALL_DATA_DIR:Q} 23MAKE_FLAGS+= INSTALL_DATA_DIR=${INSTALL_DATA_DIR:Q}

cvs diff -r1.12 -r1.13 pkgsrc/devel/cpuflags/files/subr_NetBSD (expand / switch to unified diff)

--- pkgsrc/devel/cpuflags/files/subr_NetBSD 2010/12/05 11:19:39 1.12
+++ pkgsrc/devel/cpuflags/files/subr_NetBSD 2016/01/28 19:11:30 1.13
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: subr_NetBSD,v 1.12 2010/12/05 11:19:39 abs Exp $ 1# $NetBSD: subr_NetBSD,v 1.13 2016/01/28 19:11:30 abs Exp $
2 2
3AWK=awk 3AWK=awk
4SED=sed 4SED=sed
5 5
6display_hw_details() 6display_hw_details()
7 { 7 {
8 cat <<END 8 cat <<END
9OS : '$(uname)' 9OS : '$(uname)'
10OS version : '$(uname -r)' 10OS version : '$(uname -r)'
11hw.model : '$hw_model' 11hw.model : '$hw_model'
12hw.machine : '$hw_machine' 12hw.machine : '$hw_machine'
13hw.machine_arch : '$hw_machine_arch' 13hw.machine_arch : '$hw_machine_arch'
14CPU : '$cpu' 14CPU : '$cpu'
@@ -34,40 +34,40 @@ extract_hw_details() @@ -34,40 +34,40 @@ extract_hw_details()
34 # We're almost certainly crosscompiling 34 # We're almost certainly crosscompiling
35 if [ -n "$MACHINE" -a "$hw_machine" != "$MACHINE" ]; then 35 if [ -n "$MACHINE" -a "$hw_machine" != "$MACHINE" ]; then
36 echo 36 echo
37 exit 37 exit
38 fi 38 fi
39 } 39 }
40 40
41extract_x86_cpu_vars() 41extract_x86_cpu_vars()
42 { 42 {
43 # Set: cpu_feature_FOO=1 for each 'FOO' feature reported 43 # Set: cpu_feature_FOO=1 for each 'FOO' feature reported
44 # cpu_name="NAME" taken from the first cpu0: line 44 # cpu_name="NAME" taken from the first cpu0: line
45 # cpu_brand="BRAND" the CPU branding string 45 # cpu_brand="BRAND" the CPU branding string
46 echo "$cpu_details" | $AWK ' 46 echo "$cpu_details" | $AWK '
 47 { gsub("[()]","") }
47 { if (/cpu0:/ && !n) { sub("cpu0: ",""); n=1; print "cpu_name=\""$0"\"" } } 48 { if (/cpu0:/ && !n) { sub("cpu0: ",""); n=1; print "cpu_name=\""$0"\"" } }
48 /cpu0: ".*"/ { sub("[^\"]*", ""); print "cpu_brand="$0 } 49 /cpu0: ".*"/ { sub("[^\"]*", ""); print "cpu_brand="$0 }
49 /cpu0: features/ { 50 /cpu0: features\d?/ {
50 sub(".*<",""); 51 sub(".*<","");
51 sub(">.*",""); 52 sub(">.*","");
52 gsub("[^,A-Z0-9]","_"); 53 gsub("[^,A-Z0-9]","_");
53 split($0, features, /,/) 54 split($0, features, /,/)
54 for (f in features) 55 for (f in features)
55 print "cpu_feature_"features[f]"=1"; 56 print "cpu_feature_"features[f]"=1";
56 } 57 }
57 /cpu0: family/ { 58 /cpu0: family/ {
58 for (i = 2; i < NF; i = i + 2) { 59 for (i = 2; i < NF; i = i + 2) {
59 f=$(i+1); 60 f=$(i+1);
60 sub(/^0/, "", f); 
61 print "cpu_"$i"="f 61 print "cpu_"$i"="f
62 } 62 }
63 } 63 }
64 ' 64 '
65 } 65 }
66 66
67determine_arch() 67determine_arch()
68 { 68 {
69 ARCH= 69 ARCH=
70 # When adding $hw_model tests use maximum context (such as trailing space) 70 # When adding $hw_model tests use maximum context (such as trailing space)
71 case $hw_machine_arch in 71 case $hw_machine_arch in
72 72
73 alpha) 73 alpha)