diff options
author | abs <abs@pkgsrc.org> | 2009-01-28 23:30:50 +0000 |
---|---|---|
committer | abs <abs@pkgsrc.org> | 2009-01-28 23:30:50 +0000 |
commit | e50af1f886d7b35db20e6b642da16f86d6a6bfb3 (patch) | |
tree | c7dd446f04fff0853e4cc149236d64e292a2b125 | |
parent | cd89639e0230f110ec2c40d0215766b2c07e3119 (diff) | |
download | pkgsrc-e50af1f886d7b35db20e6b642da16f86d6a6bfb3.tar.gz |
Updated devel/cpuflags to 1.37
Substitute @SH@ so we can use $() everywhere (Solaris)
-rw-r--r-- | devel/cpuflags/Makefile | 9 | ||||
-rw-r--r-- | devel/cpuflags/files/cpuflags.mk | 4 | ||||
-rwxr-xr-x | devel/cpuflags/files/cpuflags.sh | 26 | ||||
-rwxr-xr-x | devel/cpuflags/files/subr_SunOS | 10 |
4 files changed, 26 insertions, 23 deletions
diff --git a/devel/cpuflags/Makefile b/devel/cpuflags/Makefile index f16b00826ec..7bc6c63627c 100644 --- a/devel/cpuflags/Makefile +++ b/devel/cpuflags/Makefile @@ -1,6 +1,6 @@ -# $NetBSD: Makefile,v 1.142 2009/01/23 00:04:45 abs Exp $ +# $NetBSD: Makefile,v 1.143 2009/01/28 23:30:50 abs Exp $ -DISTNAME= cpuflags-1.36 +DISTNAME= cpuflags-1.37 CATEGORIES= devel sysutils MASTER_SITES= # empty DISTFILES= # empty @@ -16,6 +16,11 @@ USE_LANGUAGES= # empty NO_CHECKSUM= yes NO_CONFIGURE= yes +SUBST_CLASSES+= cpuflags +SUBST_STAGE.cpuflags= post-patch +SUBST_FILES.cpuflags= cpuflags.sh +SUBST_SED.cpuflags= -e s,@@SH@@,${SH:Q}, + do-extract: ${MKDIR} ${WRKSRC} ${CP} ${FILESDIR}/Makefile ${WRKSRC} diff --git a/devel/cpuflags/files/cpuflags.mk b/devel/cpuflags/files/cpuflags.mk index 7d09455c14c..57c3e2bf2ff 100644 --- a/devel/cpuflags/files/cpuflags.mk +++ b/devel/cpuflags/files/cpuflags.mk @@ -1,4 +1,4 @@ -# $Id: cpuflags.mk,v 1.19 2009/01/20 17:26:21 abs Exp $ +# $Id: cpuflags.mk,v 1.20 2009/01/28 23:30:50 abs Exp $ # Makefile include fragment to simplify use of cpuflags in pkgsrc # abs@absd.org - freely distributable, no warrenties, stick no bills. @@ -16,7 +16,7 @@ .ifndef CPU_FLAGS . if exists(${.PARSEDIR}/cpuflags.sh) -_CPUFLAGS_SH=${.PARSEDIR}/cpuflags.sh +_CPUFLAGS_SH=${SH} ${.PARSEDIR}/cpuflags.sh . else _CPUFLAGS_SH=@PREFIX@/bin/cpuflags . endif diff --git a/devel/cpuflags/files/cpuflags.sh b/devel/cpuflags/files/cpuflags.sh index 459d5b35c89..beac79c0c4d 100755 --- a/devel/cpuflags/files/cpuflags.sh +++ b/devel/cpuflags/files/cpuflags.sh @@ -1,14 +1,12 @@ -#!/bin/sh -# $NetBSD: cpuflags.sh,v 1.6 2009/01/23 00:04:45 abs Exp $ +#!@@SH@@ +# $NetBSD: cpuflags.sh,v 1.7 2009/01/28 23:30:50 abs Exp $ PATH=/sbin:/usr/sbin:/bin:/usr/bin:$PATH -# Note - this script needs to run on Solaris sh, so no use of $(...) - # cd to the directory containing the binary, so we can usefully check for # include files from there case "$0" in - /*) cd `dirname $0`;; - *) cd `dirname $PWD/$0`;; + /*) cd $(dirname $0);; + *) cd $(dirname $PWD/$0);; esac include() @@ -29,7 +27,7 @@ verbose() return 0 } -UNAME=`uname` +UNAME=$(uname) if [ "$1" = -v ] ; then shift @@ -60,25 +58,25 @@ M_ARCH_NATIVE='-march=native' # Determine the flags for this OS/machine extract_hw_details -if [ `gcc_ser $CC` -gt 4002 ] ; then +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() - l_arch=`flags_fixup_x86arch "$ARCH" "$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 @@ -91,7 +89,7 @@ if [ -n "$opt_v" ] ; then ARCH : $ARCH FEATURES : $FEATURES CPUFLAGS : $CPUFLAGS -GCC version : `gcc_ver $CC` +GCC version : $(gcc_ver $CC) END display_hw_details exit; diff --git a/devel/cpuflags/files/subr_SunOS b/devel/cpuflags/files/subr_SunOS index 162225850d0..5b23d7f473b 100755 --- a/devel/cpuflags/files/subr_SunOS +++ b/devel/cpuflags/files/subr_SunOS @@ -1,4 +1,4 @@ -# $NetBSD: subr_SunOS,v 1.3 2008/12/18 01:01:33 abs Exp $ +# $NetBSD: subr_SunOS,v 1.4 2009/01/28 23:30:50 abs Exp $ AWK=nawk SED=sed @@ -6,7 +6,7 @@ SED=sed display_hw_details() { cat <<END -OS : '`uname`' +OS : '$(uname)' arch : '$hw_arch' psrinfo : '$hw_psrinfo' END @@ -14,8 +14,8 @@ END extract_hw_details() { - hw_arch=`/usr/bin/uname -m` - hw_psrinfo=`psrinfo -pv | $AWK 'NR==3{print}'` # Just gets the first CPU + hw_arch=$(/usr/bin/uname -m) + hw_psrinfo=$(psrinfo -pv | $AWK 'NR==3{print}') # Just gets the first CPU } determine_arch() @@ -27,7 +27,7 @@ determine_arch() sun4u ) ARCH='-mcpu=v9' ;; i86pc ) include subr_x86 # this provides map_x86_brand_string() - ARCH=`map_x86_brand_string "$cpu_brand"` + ARCH=$(map_x86_brand_string "$cpu_brand") if [ -z "$ARCH" ] ; then case "$hw_psrinfo" in *) |