From 772457add36bdf965bf186de643bf07b5a40f356 Mon Sep 17 00:00:00 2001 From: hans Date: Wed, 14 Sep 2011 15:14:53 +0000 Subject: Use more host tools on SunOS. Default to GNU tools when available. --- bootstrap/bootstrap | 14 +++++-- mk/tools/tools.SunOS.mk | 104 +++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 100 insertions(+), 18 deletions(-) diff --git a/bootstrap/bootstrap b/bootstrap/bootstrap index 9252b3fbcc7..89b5bef9efe 100755 --- a/bootstrap/bootstrap +++ b/bootstrap/bootstrap @@ -1,6 +1,6 @@ #! /bin/sh -# $NetBSD: bootstrap,v 1.169 2011/06/12 17:46:02 agc Exp $ +# $NetBSD: bootstrap,v 1.170 2011/09/14 15:14:53 hans Exp $ # # Copyright (c) 2001-2011 Alistair Crooks # All rights reserved. @@ -666,8 +666,16 @@ SunOS) fi root_group=root need_bsd_install=yes - need_awk=yes - need_sed=yes + if [ -x "/usr/gnu/bin/awk" ]; then + need_awk=no + else + need_awk=yes + fi + if [ -x "/usr/gnu/bin/sed" ]; then + need_sed=no + else + need_sed=yes + fi need_ksh=yes set_opsys=no groupsprog="/usr/xpg4/bin/id -gn" diff --git a/mk/tools/tools.SunOS.mk b/mk/tools/tools.SunOS.mk index f6fe0b70069..d4e2401f2f5 100644 --- a/mk/tools/tools.SunOS.mk +++ b/mk/tools/tools.SunOS.mk @@ -1,15 +1,23 @@ -# $NetBSD: tools.SunOS.mk,v 1.31 2011/07/15 15:33:15 hans Exp $ +# $NetBSD: tools.SunOS.mk,v 1.32 2011/09/14 15:14:53 hans Exp $ # # System-supplied tools for the Solaris operating system. # # We bootstrap a pdksh shell on this platform. TOOLS_PLATFORM.[?= [ # shell builtin +.if exists(/usr/bin/gawk) +TOOLS_PLATFORM.awk?= /usr/bin/gawk +.else TOOLS_PLATFORM.awk?= /usr/bin/nawk +.endif TOOLS_PLATFORM.basename?= /usr/bin/basename .if exists(/bin/bash) TOOLS_PLATFORM.bash?= /bin/bash .endif +.if exists(/usr/bin/bison) +TOOLS_PLATFORM.bison?= /usr/bin/bison +TOOLS_PLATFORM.bison-yacc?= /usr/bin/bison -y +.endif .if exists(/usr/bin/bzcat) TOOLS_PLATFORM.bzcat?= /usr/bin/bzcat .endif @@ -29,19 +37,27 @@ TOOLS_PLATFORM.cp?= /bin/cp TOOLS_PLATFORM.csh?= /bin/csh TOOLS_PLATFORM.cut?= /usr/bin/cut TOOLS_PLATFORM.date?= /usr/xpg4/bin/date -.if exists(/bin/diff) -TOOLS_PLATFORM.diff?= /bin/diff -.elif exists(/usr/bin/diff) +.if exists(/usr/bin/gdiff) +TOOLS_PLATFORM.diff?= /usr/bin/gdiff +.else TOOLS_PLATFORM.diff?= /usr/bin/diff .endif -.if exists(/bin/diff3) -TOOLS_PLATFORM.diff3?= /bin/diff3 -.elif exists(/usr/bin/diff3) +.if exists(/usr/bin/gdiff3) +TOOLS_PLATFORM.diff3?= /usr/bin/gdiff3 +.else TOOLS_PLATFORM.diff3?= /usr/bin/diff3 .endif TOOLS_PLATFORM.dirname?= /usr/bin/dirname TOOLS_PLATFORM.echo?= echo # shell builtin +.if exists(/usr/gnu/bin/grep) +TOOLS_PLATFORM.grep?= /usr/gnu/bin/grep +TOOLS_PLATFORM.egrep?= /usr/gnu/bin/grep -E +TOOLS_PLATFORM.fgrep?= /usr/gnu/bin/fgrep +.else +TOOLS_PLATFORM.grep?= /usr/xpg4/bin/grep TOOLS_PLATFORM.egrep?= /usr/xpg4/bin/grep -E +TOOLS_PLATFORM.fgrep?= /usr/xpg4/bin/fgrep +.endif TOOLS_PLATFORM.env?= /usr/bin/env TOOLS_PLATFORM.expr?= /usr/xpg4/bin/expr .if exists(/usr/gnu/bin/false) # if we are using OpenSolaris @@ -49,10 +65,39 @@ TOOLS_PLATFORM.false?= /usr/gnu/bin/false .else TOOLS_PLATFORM.false?= false # shell builtin .endif -TOOLS_PLATFORM.fgrep?= /usr/xpg4/bin/fgrep TOOLS_PLATFORM.file?= /usr/bin/file +.if exists(/usr/gnu/bin/find) +TOOLS_PLATFORM.find?= /usr/gnu/bin/find +.else TOOLS_PLATFORM.find?= /usr/bin/find -TOOLS_PLATFORM.grep?= /usr/xpg4/bin/grep +.endif +.if exists(/usr/bin/flex) +TOOLS_PLATFORM.flex?= /usr/bin/flex +TOOLS_PLATFORM.lex?= /usr/bin/flex +.endif +.if exists(/usr/bin/gawk) +TOOLS_PLATFORM.gawk?= /usr/bin/gawk +.endif +.if exists(/usr/bin/gm4) +TOOLS_PLATFORM.gm4?= /usr/bin/gm4 +.endif +.if exists(/usr/bin/gmake) +TOOLS_PLATFORM.gmake?= /usr/bin/gmake +.endif +.if exists(/usr/bin/groff) +TOOLS_PLATFORM.groff?= /usr/bin/groff +.endif +.if exists(/usr/bin/gsed) +TOOLS_PLATFORM.gsed?= /usr/bin/gsed +.endif +.if exists(/usr/bin/gsoelim) +TOOLS_PLATFORM.gsoelim?= /usr/bin/gsoelim +.endif +.if exists(/usr/bin/gtar) +TOOLS_PLATFORM.bsdtar?= /usr/bin/gtar +TOOLS_PLATFORM.gtar?= /usr/bin/gtar +TOOLS_PLATFORM.tar?= /usr/bin/gtar +.endif .if exists(/usr/bin/gzip) TOOLS_PLATFORM.gunzip?= /usr/bin/gzip -df TOOLS_PLATFORM.gzcat?= /usr/bin/gzip -cd @@ -61,6 +106,9 @@ TOOLS_PLATFORM.gzip?= /usr/bin/gzip -nf ${GZIP} TOOLS_PLATFORM.head?= /usr/bin/head TOOLS_PLATFORM.hostname?= /bin/hostname TOOLS_PLATFORM.id?= /usr/xpg4/bin/id +.if exists(/usr/bin/install-info) +TOOLS_PLATFORM.install-info?= /usr/bin/install-info +.endif .if exists(/usr/bin/ginstall) # if we are using OpenSolaris TOOLS_PLATFORM.install?= /usr/bin/ginstall .else @@ -70,30 +118,47 @@ TOOLS_PLATFORM.ln?= /usr/bin/ln TOOLS_PLATFORM.ls?= /usr/bin/ls TOOLS_PLATFORM.m4?= /usr/ccs/bin/m4 TOOLS_PLATFORM.mail?= /usr/bin/mailx +.if exists(/usr/bin/makeinfo) +TOOLS_PLATFORM.makeinfo?= /usr/bin/makeinfo +.endif TOOLS_PLATFORM.mkdir?= /usr/bin/mkdir -p .if exists(/usr/bin/mktemp) TOOLS_PLATFORM.mktemp?= /usr/bin/mktemp .endif TOOLS_PLATFORM.mv?= /usr/bin/mv TOOLS_PLATFORM.nice?= /usr/xpg4/bin/nice -.if exists(/usr/bin/nroff) -TOOLS_PLATFORM.nroff?= /usr/bin/nroff +.if exists(/usr/bin/gnroff) +TOOLS_PLATFORM.nroff?= /usr/bin/gnroff .endif .if exists(/usr/bin/openssl) TOOLS_PLATFORM.openssl?= /usr/bin/openssl .endif .if exists(/usr/bin/gpatch) +TOOLS_PLATFORM.gpatch?= /usr/bin/gpatch TOOLS_PLATFORM.patch?= /usr/bin/gpatch .endif +.if exists(/usr/bin/perl) +TOOLS_PLATFORM.perl?= /usr/bin/perl +TOOLS_PLATFORM.pod2man?= /usr/perl5/bin/pod2man +.endif +.if exists(/usr/bin/pkg-config) +TOOLS_PLATFORM.pkg-config?= /usr/bin/pkg-config +.endif TOOLS_PLATFORM.printf?= /bin/printf TOOLS_PLATFORM.pwd?= /bin/pwd +.if exists(/usr/gnu/bin/readelf) +TOOLS_PLATFORM.readelf?= /usr/gnu/bin/readelf +.endif TOOLS_PLATFORM.rm?= /usr/bin/rm TOOLS_PLATFORM.rmdir?= /usr/bin/rmdir -.if exists(/bin/sdiff) -TOOLS_PLATFORM.sdiff?= /bin/sdiff -.elif exists(/usr/bin/sdiff) +.if exists(/usr/bin/gsdiff) +TOOLS_PLATFORM.sdiff?= /usr/bin/gsdiff +.else TOOLS_PLATFORM.sdiff?= /usr/bin/sdiff .endif +.if exists(/usr/gnu/bin/sed) +TOOLS_PLATFORM.sed?= /usr/gnu/bin/sed +.endif TOOLS_PLATFORM.sh?= /bin/ksh TOOLS_PLATFORM.sleep?= /bin/sleep .if exists(/usr/bin/soelim) @@ -107,9 +172,18 @@ TOOLS_PLATFORM.tbl?= /usr/bin/tbl .endif TOOLS_PLATFORM.tee?= /usr/bin/tee TOOLS_PLATFORM.test?= test # shell builtin +.if exists(/usr/bin/texi2html) +TOOLS_PLATFORM.texi2html?= /usr/bin/texi2html +.endif TOOLS_PLATFORM.touch?= /usr/bin/touch -TOOLS_PLATFORM.tr?= /usr/bin/tr +TOOLS_PLATFORM.tr?= /usr/xpg4/bin/tr TOOLS_PLATFORM.true?= true # shell builtin TOOLS_PLATFORM.tsort?= /usr/ccs/bin/tsort +.if exists(/usr/bin/unzip) +TOOLS_PLATFORM.unzip?= /usr/bin/unzip +.endif TOOLS_PLATFORM.wc?= /usr/bin/wc TOOLS_PLATFORM.xargs?= /usr/bin/xargs +.if exists(/usr/bin/yacc) +TOOLS_PLATFORM.yacc?= /usr/bin/yacc +.endif -- cgit v1.2.3