pkgsrc-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/pkgsrc/rev/ddfda637e733
branches:  trunk
changeset: 532468:ddfda637e733
user:      abs <abs%pkgsrc.org@localhost>
date:      Mon Aug 20 11:21:19 2007 +0000

description:
Update cpuflags to 1.10:
Refactor cpuflags into a common part (cpuflags.sh), which calls the
appropriate per OS (subr_NetBSD, subr_SunOS or subr_Linux) and per
compiler (subr_gcc) portions

diffstat:

 devel/cpuflags/Makefile              |    6 +-
 devel/cpuflags/PLIST                 |    7 +-
 devel/cpuflags/files/Makefile        |   27 +-
 devel/cpuflags/files/cpuflags.Linux  |  169 -------------------
 devel/cpuflags/files/cpuflags.NetBSD |  307 -----------------------------------
 devel/cpuflags/files/cpuflags.SunOS  |  142 ----------------
 devel/cpuflags/files/cpuflags.sh     |   85 +++++++++
 devel/cpuflags/files/subr_Linux      |   83 +++++++++
 devel/cpuflags/files/subr_NetBSD     |  222 +++++++++++++++++++++++++
 devel/cpuflags/files/subr_SunOS      |   40 ++++
 devel/cpuflags/files/subr_gcc        |  104 +++++++++++
 11 files changed, 558 insertions(+), 634 deletions(-)

diffs (truncated from 1271 to 300 lines):

diff -r 9cc1ed81740d -r ddfda637e733 devel/cpuflags/Makefile
--- a/devel/cpuflags/Makefile   Mon Aug 20 11:04:02 2007 +0000
+++ b/devel/cpuflags/Makefile   Mon Aug 20 11:21:19 2007 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.112 2007/08/13 10:31:06 abs Exp $
+# $NetBSD: Makefile,v 1.113 2007/08/20 11:21:19 abs Exp $
 #
 
-DISTNAME=      cpuflags-1.09
+DISTNAME=      cpuflags-1.10
 CATEGORIES=    sysutils
 MASTER_SITES=  # empty
 DISTFILES=     # empty
@@ -17,6 +17,6 @@
 
 do-extract:
        ${MKDIR} ${WRKSRC}
-       ${CP} ${FILESDIR}/Makefile ${FILESDIR}/*.* ${WRKSRC}
+       ${CP} ${FILESDIR}/Makefile ${FILESDIR}/[a-z]* ${WRKSRC}
 
 .include "../../mk/bsd.pkg.mk"
diff -r 9cc1ed81740d -r ddfda637e733 devel/cpuflags/PLIST
--- a/devel/cpuflags/PLIST      Mon Aug 20 11:04:02 2007 +0000
+++ b/devel/cpuflags/PLIST      Mon Aug 20 11:21:19 2007 +0000
@@ -1,5 +1,10 @@
-@comment $NetBSD: PLIST,v 1.2 2003/05/29 11:45:50 abs Exp $
+@comment $NetBSD: PLIST,v 1.3 2007/08/20 11:21:20 abs Exp $
 bin/cpuflags
 man/man1/cpuflags.1
+share/cpuflags/subr_Linux
+share/cpuflags/subr_NetBSD
+share/cpuflags/subr_SunOS
+share/cpuflags/subr_gcc
 share/mk/cpuflags.mk
 share/mk/optimize_gcc.mk
+@dirrm share/cpuflags
diff -r 9cc1ed81740d -r ddfda637e733 devel/cpuflags/files/Makefile
--- a/devel/cpuflags/files/Makefile     Mon Aug 20 11:04:02 2007 +0000
+++ b/devel/cpuflags/files/Makefile     Mon Aug 20 11:21:19 2007 +0000
@@ -1,12 +1,13 @@
-# $Id: Makefile,v 1.7 2006/02/09 13:45:04 abs Exp $
+# $Id: Makefile,v 1.8 2007/08/20 11:21:20 abs Exp $
 
-VERSION=0.98
+VERSION=1.10
 
 PREFIX?=/usr/local
 OPSYS?=`uname`
 
 MANDIR?=${PREFIX}/man/man1
-MKDIR?=${PREFIX}/share/mk
+SUBRDIR?=${PREFIX}/share/cpuflags
+SHAREMKDIR?=${PREFIX}/share/mk
 BINDIR?=${PREFIX}/bin
 INSTALL?=install
 SED?=sed
@@ -14,19 +15,21 @@
 all:
        ${SED} -e 's|@PREFIX@|${PREFIX}|g' cpuflags.1 > cpuflags.1.out
        ${SED} -e 's|@PREFIX@|${PREFIX}|g' cpuflags.mk > cpuflags.mk.out
+       ${SED} -e 's|@PREFIX@|${PREFIX}|g' cpuflags.sh > cpuflags.sh.out
        
 clean:
-       rm -rf *.out out
+       rm -rf *.out DIST
 
 install:
-       mkdir -p ${BINDIR} ${MANDIR}    ${MKDIR}
-       ${INSTALL} cpuflags.${OPSYS}    ${BINDIR}/cpuflags
+       mkdir -p ${BINDIR} ${MANDIR} ${SHAREMKDIR} ${SUBRDIR}
+       ${INSTALL} cpuflags.sh.out      ${BINDIR}/cpuflags
        ${INSTALL} cpuflags.1.out       ${MANDIR}/cpuflags.1
-       ${INSTALL} optimize_gcc.mk      ${MKDIR}/optimize_gcc.mk
-       ${INSTALL} cpuflags.mk.out      ${MKDIR}/cpuflags.mk
+       ${INSTALL} optimize_gcc.mk      ${SHAREMKDIR}/optimize_gcc.mk
+       ${INSTALL} cpuflags.mk.out      ${SHAREMKDIR}/cpuflags.mk
+       ${INSTALL} subr_*               ${SUBRDIR}
 
 dist:
-       mkdir -p out/cpuflags-${VERSION}
-       cp Makefile *.* out/cpuflags-${VERSION}
-       (cd out;pax -w cpuflags-${VERSION} | bzip2 -9 > cpuflags-${VERSION}.tbz)
-       rm -rf out/cpuflags-${VERSION}
+       mkdir -p DIST/cpuflags-${VERSION}
+       cp Makefile [a-z]* DIST/cpuflags-${VERSION}
+       (cd DIST;pax -w cpuflags-${VERSION}|bzip2 -9 > cpuflags-${VERSION}.tbz)
+       rm -rf DIST/cpuflags-${VERSION}
diff -r 9cc1ed81740d -r ddfda637e733 devel/cpuflags/files/cpuflags.Linux
--- a/devel/cpuflags/files/cpuflags.Linux       Mon Aug 20 11:04:02 2007 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,169 +0,0 @@
-#!/bin/sh
-# $NetBSD: cpuflags.Linux,v 1.22 2007/03/21 15:05:08 abs Exp $
-PATH=/sbin:/usr/sbin:/bin:/usr/bin:$PATH
-
-AWK=awk
-
-display_hw_details()
-    {
-    echo "  OS             : '$(uname)'"
-    echo "  proc model     : '$hw_model'"
-    echo "  machine_arch    : '$hw_machine_arch'"
-    echo "  proc flags     : '$hw_flags'"
-    }
-
-hw_machine_arch=$(uname -m)
-if [ ! -f /proc/cpuinfo ] ; then
-    echo "Unable to open /proc/cpuinfo"
-    hw_model=Unknown
-else
-    hw_model=$($AWK -F: '/^model name/{sub(" ","",$2);print $2;exit}' /proc/cpuinfo)
-    hw_flags=$($AWK -F: '/^flags/{sub(" ","",$2);print $2;exit}' /proc/cpuinfo)
-fi
-
-case $hw_machine_arch in
-    parisc) case $hw_model in
-       "Mirage 100+")                  FLAGS='-march=1.1'              ;;
-    esac ;;
-    i386)                              FLAGS='-march=i386'             ;;
-    i486)                              FLAGS='-march=i486'             ;;
-    i686) case $hw_model in
-       "AMD Athlon(TM) XP "*)          FLAGS='-march=athlon-xp'        ;;
-       "AMD Athlon(tm) XP "*)          FLAGS='-march=athlon-xp'        ;;
-       "AMD Duron(TM)")                FLAGS='-march=athlon'           ;;
-       "AMD Duron(tm) ")               FLAGS='-march=athlon'           ;;
-       "Pentium II (Deschutes)")       FLAGS='-march=pentium2'         ;;
-       "Celeron (Coppermine)")         FLAGS='-march=pentium3'         ;;
-       "Intel(R) Pentium(R) 4 CPU "*)  FLAGS='-march=pentium4'         ;;
-       "Intel(R) Pentium(R) III Mobile CPU"*) FLAGS='-march=pentium3m' ;;
-       "Intel(R) Pentium(R) M processor"*) FLAGS='-march=pentium3m'    ;;
-       "Mobile Intel(R) Pentium(R) 4 - M "*) FLAGS='-march=pentium4m'  ;;
-       "Pentium III (Coppermine)")     FLAGS='-march=pentium3'         ;;
-       "Pentium III (Katmai)")         FLAGS='-march=pentium3'         ;;
-       "AMD Athlon(tm) 64"*)           FLAGS='-march=athlon-xp'        ;;
-       "AMD Opteron(tm) Processor "*)  FLAGS='-march=opteron'          ;;
-       "Intel(R) Celeron(R) CPU "* | "Intel(R) Xeon(TM) CPU "*)
-           case "$hw_flags" in
-               *" sse2 "*)
-                                       FLAGS='-march=pentium4'         ;;
-           esac
-
-    esac ;;
-
-esac
-
-############
-# Everything from this point common between all cpuflags variants.
-
-if [ "$1" = -v ] ; then
-    shift
-    opt_v=1
-fi
-if [ -n "$1" ]; then
-    CC=$1
-else
-    CC=gcc
-fi
-
-if [ -n "$opt_v" ] ; then
-    if [ -n "$FLAGS" ]; then
-       echo "CPUFLAGS=$FLAGS"
-    elif [ -z "$NONE" ] ; then
-       echo "CPUFLAGS=Unknown"
-    else
-       echo "CPUFLAGS=None"
-    fi
-    display_hw_details
-    exit
-fi
-if [ -z "$FLAGS" -a -z "$NONE" ] ; then
-    echo 'Unknown machine - please send details to abs%absd.org@localhost'     >&2
-    display_hw_details                                                 >&2
-fi
-
-# Fixup options for older gccs.
-# Entries can be recursive - eg:
-#   -march=k6-3 -> -march=k6 -> -march=pentium -> -march=i486
-#
-# The format of table is
-#   gcc_version_in_which_option_was_introduced new_option  old_option
-
-if [ -n "$FLAGS" ]; then
-    gcc_ver=`${CC} -dumpversion | sed 's/^egcs-//'`
-    FLAGS=`$AWK -F: -v "flags=$FLAGS" -v "gcc_ver=$gcc_ver" '
-       { if (gcc_ver < $1){map[$2] = ""$3} }
-       END { while (flags in map) {flags = map[flags]} print flags }
-       ' <<EOD
-2.90:-march=i386:-mno-486
-2.90:-march=i486:-m486
-2.90:-march=pentium:-m486
-2.90:-march=pentiumpro:-m486
-2.90:-mcpu=21164a:
-2.90:-mcpu=arm610:-m6
-2.90:-mcpu=arm710:-m6
-2.90:-mcpu=cypress:-mcypress
-2.90:-mcpu=sparclite:-msparclite
-2.90:-mcpu=strongarm110:-m6
-2.90:-mcpu=supersparc:-msupersparc
-2.90:-mcpu=v9:-mv8
-2.95:-march=k6:-march=pentium
-3.0:-march=athlon:-march=pentiumpro
-3.1:-march=athlon-4:-march=athlon
-3.1:-march=athlon-mp:-march=athlon
-3.1:-march=athlon-tbird:-march=athlon
-3.1:-march=athlon-xp:-march=athlon
-3.1:-march=k6-2:-march=k6
-3.1:-march=k6-3:-march=k6
-3.1:-march=pentium-mmx:-march=pentium
-3.1:-march=pentium2:-march=pentiumpro
-3.1:-march=pentium3 -mno-sse:-march=pentiumpro
-3.1:-march=pentium3:-march=pentiumpro
-3.1:-march=pentium4:-march=pentiumpro
-3.1:-march=r2000:-cpu=r2000
-3.1:-march=r3000:-cpu=r3000
-3.1:-march=r3900:-cpu=r3900
-3.1:-march=r4000:-cpu=r4000
-3.1:-march=r4100:-cpu=r4100
-3.1:-march=r4300:-cpu=r4300
-3.1:-march=r4400:-cpu=r4400
-3.1:-march=r4600:-cpu=r4600
-3.1:-march=r5000:-cpu=r5000
-3.1:-march=r6000:-cpu=r6000
-3.1:-march=r8000:-cpu=r8000
-3.1:-mcpu=21264a:-mcpu=21264
-3.1:-mcpu=7400:-mcpu=750
-3.1:-mcpu=7450:-mcpu=750
-3.1:-mfpmath=sse:
-3.1:-msse2:
-3.1:-msse:
-3.1:-mtune=r2000:-cpu=r2000
-3.1:-mtune=r3000:-cpu=r3000
-3.1:-mtune=r3900:-cpu=r3900
-3.1:-mtune=r4000:-cpu=r4000
-3.1:-mtune=r4100:-cpu=r4100
-3.1:-mtune=r4300:-cpu=r4300
-3.1:-mtune=r4400:-cpu=r4400
-3.1:-mtune=r4600:-cpu=r4600
-3.1:-mtune=r5000:-cpu=r5000
-3.1:-mtune=r6000:-cpu=r6000
-3.1:-mtune=r8000:-cpu=r8000
-3.3:-march=c3:-march=i586
-3.3:-march=winchip-c6:-march=i586
-3.3:-march=winchip2:-march=i586
-3.4:-march=athlon-fx:-march=athlon-xp
-3.4:-march=athlon64:-march=athlon-xp
-3.4:-march=c3-2:-march=c3
-3.4:-march=k8:-march=athlon-xp
-3.4:-march=nocona:-march=pentium4
-3.4:-march=opteron:-march=athlon-xp
-3.4:-march=pentium-m:-march=pentium3
-3.4:-march=pentium3m:-march=pentium3
-3.4:-march=pentium4m:-march=pentium4
-3.4:-march=prescott:-march=pentium4
-EOD
-`
-fi
-
-echo $FLAGS
-
-exit 0
diff -r 9cc1ed81740d -r ddfda637e733 devel/cpuflags/files/cpuflags.NetBSD
--- a/devel/cpuflags/files/cpuflags.NetBSD      Mon Aug 20 11:04:02 2007 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,307 +0,0 @@
-#!/bin/sh
-# $NetBSD: cpuflags.NetBSD,v 1.69 2007/04/24 22:44:20 abs Exp $
-PATH=/sbin:/usr/sbin:/bin:/usr/bin:$PATH
-
-AWK=awk
-
-display_hw_details()
-    {
-    echo "  OS             : '$(uname)'"
-    echo "  hw.model       : '$hw_model'"
-    echo "  hw.machine     : '$hw_machine'"
-    echo "  hw.machine_arch : '$hw_machine_arch'"
-    echo "  cpu details            :"
-    sed -n -e 's/^/    /' -e '/^    cpu/p' /var/run/dmesg.boot
-    }
-
-hw_model=$(sysctl -n hw.model)
-hw_machine=$(sysctl -n hw.machine)
-hw_machine_arch=$(sysctl -n hw.machine_arch)
-
-# We're almost certainly crosscompiling
-if [ -n "$MACHINE" -a $hw_machine != "$MACHINE" ]; then
-    echo
-    exit
-fi
-
-# When adding $hw_model tests use maximum context (such as trailing space)
-case $hw_machine_arch in
-
-    alpha)
-       # cpu0 at mainbus0: ID 0 (primary), 21164A-0 (unknown ...
-       case "$(egrep '^cpu0 ' /var/run/dmesg.boot)" in
-           *[\(\ ]2106[46][-A\ \)]*)   FLAGS="-mcpu=21064"     ;;
-           *[\(\ ]21164[-\ \)]*)       FLAGS="-mcpu=21164"     ;;
-           *[\(\ ]21164A[-\ \)]*)      FLAGS="-mcpu=21164a"    ;;
-           *[\(\ ]21264[-\ \)]*)       FLAGS="-mcpu=21264"     ;;



Home | Main Index | Thread Index | Old Index