From 46e29fa100eacda9a9e2d5a2bd57dfdacbc217d9 Mon Sep 17 00:00:00 2001 From: abs Date: Mon, 1 Dec 2008 17:51:40 +0000 Subject: Updated devel/cpuflags to 1.19 Completely rework i386 and x86_64 processor checking on NetBSD: If cpuctl is present, use the first list of its output, otherwise rely on the first cpu0: line in /var/run/dmesg.boot Unfortunately this means we will need to reenter some of the older CPU details. --- devel/cpuflags/Makefile | 5 ++- devel/cpuflags/files/subr_NetBSD | 74 +++++++++++++++++----------------------- devel/cpuflags/files/subr_gcc | 3 +- 3 files changed, 35 insertions(+), 47 deletions(-) (limited to 'devel/cpuflags') diff --git a/devel/cpuflags/Makefile b/devel/cpuflags/Makefile index c5f09bae525..ca97f1d9df0 100644 --- a/devel/cpuflags/Makefile +++ b/devel/cpuflags/Makefile @@ -1,7 +1,6 @@ -# $NetBSD: Makefile,v 1.124 2008/11/22 00:07:21 wiz Exp $ +# $NetBSD: Makefile,v 1.125 2008/12/01 17:51:40 abs Exp $ -DISTNAME= cpuflags-1.18 -PKGREVISION= 1 +DISTNAME= cpuflags-1.19 CATEGORIES= devel sysutils MASTER_SITES= # empty DISTFILES= # empty diff --git a/devel/cpuflags/files/subr_NetBSD b/devel/cpuflags/files/subr_NetBSD index 4c455e8e06a..df01bdf5e78 100755 --- a/devel/cpuflags/files/subr_NetBSD +++ b/devel/cpuflags/files/subr_NetBSD @@ -1,4 +1,4 @@ -# $NetBSD: subr_NetBSD,v 1.2 2007/09/11 05:03:30 bjs Exp $ +# $NetBSD: subr_NetBSD,v 1.3 2008/12/01 17:51:40 abs Exp $ AWK=awk SED=sed @@ -10,16 +10,27 @@ OS : '$(uname)' hw.model : '$hw_model' hw.machine : '$hw_machine' hw.machine_arch : '$hw_machine_arch' -cpu details : +cpu details : '$cpu' END + sed -n -e 's/^/ /' -e '/^ cpu/p' /var/run/dmesg.boot + if [ -x /usr/sbin/cpuctl ]; then + cpuctl identify 0 + fi } extract_hw_details() { - hw_model=$(sysctl -n hw.model) + hw_model=$(sysctl -n hw.model | sed 's/^ *//') hw_machine=$(sysctl -n hw.machine) hw_machine_arch=$(sysctl -n hw.machine_arch) + if [ "$hw_machine_arch" = i386 -o "$hw_machine_arch" = x86_64 ] ; then + if [ -x /usr/sbin/cpuctl ] ; then + cpu=$(cpuctl identify 0|awk '/cpu0:/{sub("cpu0: ","");print;exit}') + else + cpu=$(awk '/cpu0:/{sub("cpu0: ","");print;exit}'