head	1.12;
access;
symbols
	pkgsrc-2013Q2:1.12.0.24
	pkgsrc-2013Q2-base:1.12
	pkgsrc-2012Q4:1.12.0.22
	pkgsrc-2012Q4-base:1.12
	pkgsrc-2011Q4:1.12.0.20
	pkgsrc-2011Q4-base:1.12
	pkgsrc-2011Q2:1.12.0.18
	pkgsrc-2011Q2-base:1.12
	pkgsrc-2009Q4:1.12.0.16
	pkgsrc-2009Q4-base:1.12
	pkgsrc-2008Q4:1.12.0.14
	pkgsrc-2008Q4-base:1.12
	pkgsrc-2008Q3:1.12.0.12
	pkgsrc-2008Q3-base:1.12
	cube-native-xorg:1.12.0.10
	cube-native-xorg-base:1.12
	pkgsrc-2008Q2:1.12.0.8
	pkgsrc-2008Q2-base:1.12
	pkgsrc-2008Q1:1.12.0.6
	pkgsrc-2008Q1-base:1.12
	pkgsrc-2007Q4:1.12.0.4
	pkgsrc-2007Q4-base:1.12
	pkgsrc-2007Q3:1.12.0.2
	pkgsrc-2007Q3-base:1.12
	pkgsrc-2007Q2:1.11.0.4
	pkgsrc-2007Q2-base:1.11
	pkgsrc-2007Q1:1.11.0.2
	pkgsrc-2007Q1-base:1.11
	pkgsrc-2006Q4:1.10.0.4
	pkgsrc-2006Q4-base:1.10
	pkgsrc-2006Q3:1.10.0.2
	pkgsrc-2006Q3-base:1.10
	pkgsrc-2006Q2:1.8.0.8
	pkgsrc-2006Q2-base:1.8
	pkgsrc-2006Q1:1.8.0.6
	pkgsrc-2006Q1-base:1.8
	pkgsrc-2005Q4:1.8.0.4
	pkgsrc-2005Q4-base:1.8
	pkgsrc-2005Q3:1.8.0.2
	pkgsrc-2005Q3-base:1.8
	pkgsrc-2005Q2:1.7.0.2
	pkgsrc-2005Q2-base:1.7
	pkgsrc-2005Q1:1.6.0.2
	pkgsrc-2005Q1-base:1.6
	pkgsrc-2004Q4:1.5.0.2
	pkgsrc-2004Q4-base:1.5
	pkgsrc-2004Q3:1.3.0.2
	pkgsrc-2004Q3-base:1.3
	pkgsrc-2004Q2:1.2.0.12
	pkgsrc-2004Q2-base:1.2
	pkgsrc-2004Q1:1.2.0.10
	pkgsrc-2004Q1-base:1.2
	pkgsrc-2003Q4:1.2.0.8
	pkgsrc-2003Q4-base:1.2
	netbsd-1-6-1:1.2.0.4
	netbsd-1-6-1-base:1.2
	netbsd-1-6:1.2.0.6
	netbsd-1-6-RELEASE-base:1.2
	pkgviews:1.2.0.2
	pkgviews-base:1.2
	buildlink2-base:1.1
	buildlink2:1.1.0.2;
locks; strict;
comment	@# @;


1.12
date	2007.08.20.11.21.21;	author abs;	state dead;
branches;
next	1.11;

1.11
date	2007.03.21.15.05.08;	author abs;	state Exp;
branches;
next	1.10;

1.10
date	2006.10.01.00.59.36;	author dmcmahill;	state Exp;
branches;
next	1.9;

1.9
date	2006.09.15.14.37.32;	author abs;	state Exp;
branches;
next	1.8;

1.8
date	2005.07.22.12.13.12;	author abs;	state Exp;
branches;
next	1.7;

1.7
date	2005.05.01.22.03.37;	author abs;	state Exp;
branches;
next	1.6;

1.6
date	2004.12.22.15.12.18;	author abs;	state Exp;
branches;
next	1.5;

1.5
date	2004.11.03.18.16.27;	author abs;	state Exp;
branches;
next	1.4;

1.4
date	2004.09.23.11.41.10;	author abs;	state Exp;
branches;
next	1.3;

1.3
date	2004.08.04.11.39.44;	author abs;	state Exp;
branches;
next	1.2;

1.2
date	2002.07.13.11.27.29;	author wiz;	state Exp;
branches;
next	1.1;

1.1
date	2002.06.21.11.35.16;	author abs;	state Exp;
branches
	1.1.2.1;
next	;

1.1.2.1
date	2002.06.21.11.35.16;	author jlam;	state dead;
branches;
next	1.1.2.2;

1.1.2.2
date	2002.06.23.18.44.00;	author jlam;	state Exp;
branches;
next	;


desc
@@


1.12
log
@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
@
text
@#!/bin/sh
# $NetBSD: cpuflags.SunOS,v 1.11 2007/03/21 15:05:08 abs Exp $
PATH=/sbin:/usr/sbin:/bin:/usr/bin:$PATH

AWK=nawk

display_hw_details()
    {
    echo "  OS      : '`uname`'"
    echo "  arch    : '$hw_arch'"
    echo "  psrinfo : '$hw_psrinfo'"
    }

hw_arch=`/usr/bin/uname -m`
hw_psrinfo=`psrinfo -v | $AWK 'NR==3{print}'` # Just gets the first CPU

case $hw_arch in
    sun4c | sun4 )		FLAGS='-mcpu=cypress' ;;
    sun4m )			FLAGS='-mcpu=supersparc' ;;
    sun4u )			FLAGS='-mcpu=v9' ;;
    i86pc )
	case "$hw_psrinfo" in
	    *AMD\ Opteron\(tm\)*)	FLAGS="-mcpu=opteron"	;;
	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'	>&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
@


1.11
log
@Update cpuflags to 1.06:
On NetBSD use 'sysctl -n machdep.sse2' and 'sysctl -n machdep.sse'
to determine whether to add '-mfpmath=sse -msse2' or '-mfpmath=sse
-msse' to CPUFLAGS. This ensures these values are set correctly in
the event of the kernel not providing sufficient identification
details on the CPU.  - from Blair Sadewitz
@
text
@d2 1
a2 1
# $NetBSD: cpuflags.SunOS,v 1.10 2006/10/01 00:59:36 dmcmahill Exp $
@


1.10
log
@use psrinfo -v instead of -pv.  On solaris-2.8, -p is supported (or so
says the man page) but seems to cause nothing to come out even with -v.
On solaris-2.9 (sparc), -p isn't supported which causes major failures.
On solaris-2.9 (i386), -p causes a failure.
@
text
@d2 1
a2 1
# $NetBSD: cpuflags.SunOS,v 1.9 2006/09/15 14:37:32 abs Exp $
d109 3
@


1.9
log
@Update devel/cpuflags to 1.02
- Linux uses both 'AMD Athlon(TM) XP' and 'AMD Athlon(tm) XP'
- Add at least Opteron recognition to solaris via 'psrinfo -pv'
- Cleanup trailing whitespace
@
text
@d2 1
a2 1
# $NetBSD: cpuflags.SunOS,v 1.8 2005/07/22 12:13:12 abs Exp $
d15 1
a15 1
hw_psrinfo=`psrinfo -pv | $AWK 'NR==3{print}'` # Just gets the first CPU
@


1.8
log
@Update cpuflags to 0.90
	NetBSD: treat 'AMD Unknown K7 (Athlon)' as -march=athlon
	All: If -v is given, also correctly display CPUFLAGS value
@
text
@d2 1
a2 1
# $NetBSD: cpuflags.SunOS,v 1.7 2005/05/01 22:03:37 abs Exp $
d9 3
a11 2
    echo "  OS              : '`uname`'"
    echo "  arch            : '$hw_arch'"
d15 1
d21 5
@


1.7
log
@update cpuflags to 0.87:
    - Added linux "Mobile Intel(R) Pentium(R) 4 - M ", from pancake
    - Add a dist target to simplify updating freshmeat copy
    - Change feedback email to abs@@absd.org
@
text
@d2 1
a2 1
# $NetBSD: cpuflags.SunOS,v 1.6 2004/12/22 15:12:18 abs Exp $
d35 3
a37 1
    if [ -z "$NONE" ] ; then
@


1.6
log
@Update cpuflags to 0.79:
    - Shuffle the various cpuflags.<OS> to group more common lines
    - Use nawk on solaris [Jonathan A. Kollasch PR pkg/26572]
    - Add Linux 'Intel(R) Pentium(R) 4 CPU'
    - Add NetBSD/i386 'AMD Athlon Model 4 (Thunderbird)' [Rob Quinn]
    - Add NetBSD/macppc 604e [John Klos]
    - Add NetBSD/chocolate [Al]
@
text
@d2 1
a2 1
# $NetBSD: cpuflags.SunOS,v 1.5 2004/11/03 18:16:27 abs Exp $
d44 1
a44 1
    echo 'Unknown machine - please send details to abs@@netbsd.org'	>&2
@


1.5
log
@Update cpuflags to 0.77
    Correctly identify 7400 and 7450 cpus (from Timo Schöler), and fall back
    to 750 not 740 for older gcc versions.
@
text
@d2 1
a2 1
# $NetBSD: cpuflags.SunOS,v 1.4 2004/09/23 11:41:10 abs Exp $
d5 1
a5 9
if [ "$1" = -v ] ; then
    shift
    opt_v=1
fi
if [ -n "$1" ]; then
    CC=$1
else
    CC=gcc
fi
d24 10
d57 1
a57 1
    FLAGS=`awk -F: -v "flags=$FLAGS" -v "gcc_ver=$gcc_ver" '
@


1.4
log
@Update cpuflags to 0.76:
    Add 'Intel(R) Pentium(R) M processor' under Linux, plus make each
    version report the OS in the event of an unrecognised CPU.
@
text
@d2 1
a2 1
# $NetBSD: cpuflags.SunOS,v 1.3 2004/08/04 11:39:44 abs Exp $
d96 2
d112 1
a113 1
3.4:-march=athlon-fx:-march=athlon-xp
@


1.3
log
@Update cpuflags to 0.75
  - all:
    Implement 'cpuflags -v' which indicates the values used to determine flags
    Sync the latest fixup options for older gccs
  - cpuflags.NetBSD:
    Use -march=pentium3m and -march=pentium4m for gcc 3.4.x
    Set -mcpu=hypersparc for RT620/625 and -mcpu=cypress for L64811
  - cpuflags.Linux:
    Handle two different Celeron cases (thanks to Marc Recht & Jeremy C. Reed)
@
text
@d2 1
a2 1
# $NetBSD: cpuflags.SunOS,v 1.2 2002/07/13 11:27:29 wiz Exp $
d17 1
@


1.2
log
@Bump to 0.25: Use nawk instead of awk on Solaris. Closes pkg/17587.
@
text
@d2 2
a3 1
# $NetBSD: cpuflags.SunOS,v 1.1 2002/06/21 11:35:16 abs Exp $
d5 16
a20 1
arch=`/usr/bin/uname -m`
d22 1
a22 1
case $arch in
d28 12
d42 1
a42 1
    echo "  arch            : '$arch'"				>&2
d45 7
a51 1
# Fixup flags for old gcc
d53 4
a56 4
    gcc_ver=`gcc -v 2>&1 | nawk '/gcc version/ {sub("egcs-","");print $3}'`
    FLAGS=`nawk -v "flags=$FLAGS" -v "gcc_ver=$gcc_ver" '
	{if (gcc_ver < $1){map[$2] = ""$3}}
	END{if (flags in map) {print map[flags]}else {print flags}}
d58 61
a118 13
2.90	-mcpu=21164a	
2.90	-march=i386		-mno-486
2.90	-march=i486		-m486
2.90	-march=pentium		-m486
2.90	-march=pentiumpro	-m486
2.90	-mcpu=supersparc	-msupersparc
2.90	-mcpu=sparclite		-msparclite
2.90	-mcpu=cypress		-mcypress
2.90	-mcpu=v9		-mv8
2.90	-mcpu=arm610		-m6
2.90	-mcpu=strongarm110	-m6
2.90	-mcpu=arm710		-m6
2.95	-march=k6		-march=pentium
@


1.1
log
@Updated cpuflags to 0.23
    Initial version of SunOS (Solaris)
@
text
@d2 1
a2 1
# $NetBSD$
d19 2
a20 2
    gcc_ver=`gcc -v 2>&1 | awk '/gcc version/ {sub("egcs-","");print $3}'`
    FLAGS=`awk -v "flags=$FLAGS" -v "gcc_ver=$gcc_ver" '
@


1.1.2.1
log
@file cpuflags.SunOS was added on branch buildlink2 on 2002-06-23 18:44:00 +0000
@
text
@d1 43
@


1.1.2.2
log
@Merge from pkgsrc-current to buildlink2 branch.
@
text
@a0 43
#!/bin/sh
# $NetBSD: cpuflags.SunOS,v 1.1.2.1 2002/06/23 18:44:00 jlam Exp $

arch=`/usr/bin/uname -m`

case $arch in
    sun4c | sun4 )		FLAGS='-mcpu=cypress' ;;
    sun4m )			FLAGS='-mcpu=supersparc' ;;
    sun4u )			FLAGS='-mcpu=v9' ;;
esac

if [ -z "$FLAGS" -a -z "$NONE" ] ; then
    echo 'Unknown machine - please send details to abs@@netbsd.org'	>&2
    echo "  arch            : '$arch'"				>&2
fi

# Fixup flags for old gcc
if [ -n "$FLAGS" ]; then
    gcc_ver=`gcc -v 2>&1 | awk '/gcc version/ {sub("egcs-","");print $3}'`
    FLAGS=`awk -v "flags=$FLAGS" -v "gcc_ver=$gcc_ver" '
	{if (gcc_ver < $1){map[$2] = ""$3}}
	END{if (flags in map) {print map[flags]}else {print flags}}
	' <<EOD
2.90	-mcpu=21164a	
2.90	-march=i386		-mno-486
2.90	-march=i486		-m486
2.90	-march=pentium		-m486
2.90	-march=pentiumpro	-m486
2.90	-mcpu=supersparc	-msupersparc
2.90	-mcpu=sparclite		-msparclite
2.90	-mcpu=cypress		-mcypress
2.90	-mcpu=v9		-mv8
2.90	-mcpu=arm610		-m6
2.90	-mcpu=strongarm110	-m6
2.90	-mcpu=arm710		-m6
2.95	-march=k6		-march=pentium
EOD
`
fi

echo $FLAGS

exit 0
@
