Subject: USE_GNU_TOOLS broken for GNU tools
To: None <tech-pkg@netbsd.org>
From: Jonathan Perkin <jonathan@perkin.org.uk>
List: tech-pkg
Date: 12/01/2003 11:11:02
--MfFXiAuoTsnnDAfZ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
I ran into this when rebuilding my box @ work with fresh pkgsrc.
lang/gawk/Makefile:
USE_GMAKE= # defined
but tools.mk currently disables USE_GNU_TOOLS for all GNU tools
supported by it, losing the gawk build (probably not noticed before
because people are likely to have gmake already installed).
+ cd /tmp/pkgsrc/lang/gawk/work.desk06/gawk-3.1.3
+ ... /home/jonp/pkg/bin/gmake -f Makefile all
/usr/bin/env: No such file or directory
*** Error code 127
/home/jonp/pkg/bin/gmake: No such file or directory
The attached patch fixes the problem, but I'd like some comments
in case I missed something obvious.
Thanks,
--
Jonathan Perkin <jonathan@perkin.org.uk>
BBC Internet Services http://www.perkin.org.uk/jonathan/
--MfFXiAuoTsnnDAfZ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="tools.mk.diff"
Index: tools.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/tools.mk,v
retrieving revision 1.15
diff -u -r1.15 tools.mk
--- tools.mk 2003/09/21 17:40:40 1.15
+++ tools.mk 2003/12/01 10:58:22
@@ -115,10 +115,13 @@
_TOOLS= awk grep m4 make sed
-.if defined(_IGNORE_USE_GNU_TOOLS)
-USE_GNU_TOOLS:= # empty
-.else
-USE_GNU_TOOLS?= # empty
+.if defined(_IGNORE_GNU_TOOL) && defined(USE_GNU_TOOLS)
+. for _tool_ in ${USE_GNU_TOOLS}
+. if empty(_IGNORE_GNU_TOOL:M${_tool_})
+_tools+= ${_tool_}
+. endif
+. endfor
+USE_GNU_TOOLS= ${_tools}
.endif
# These platforms already have GNU versions of the tools in the base
@@ -204,7 +207,7 @@
.endif
.if !empty(PKGPATH:Mlang/gawk)
_TOOLS_OVERRIDE.awk= NO
-MAKEFLAGS+= _IGNORE_USE_GNU_TOOLS=
+MAKEFLAGS+= _IGNORE_GNU_TOOL=awk
.endif
.if ${_TOOLS_REPLACE.grep} == "YES"
@@ -221,7 +224,7 @@
.endif
.if !empty(PKGPATH:Mtextproc/grep)
_TOOLS_OVERRIDE.grep= NO
-MAKEFLAGS+= _IGNORE_USE_GNU_TOOLS=
+MAKEFLAGS+= _IGNORE_GNU_TOOL=grep
.endif
.if ${_TOOLS_REPLACE.m4} == "YES"
@@ -238,7 +241,7 @@
.endif
.if !empty(PKGPATH:Mdevel/m4)
_TOOLS_OVERRIDE.m4= NO
-MAKEFLAGS+= _IGNORE_USE_GNU_TOOLS=
+MAKEFLAGS+= _IGNORE_GNU_TOOL=m4
.endif
.if ${_TOOLS_REPLACE.make} == "YES"
@@ -255,7 +258,7 @@
.endif
.if !empty(PKGPATH:Mdevel/gmake)
_TOOLS_OVERRIDE.make= NO
-MAKEFLAGS+= _IGNORE_USE_GNU_TOOLS=
+MAKEFLAGS+= _IGNORE_GNU_TOOL=make
.endif
.if ${_TOOLS_REPLACE.sed} == "YES"
@@ -272,7 +275,7 @@
.endif
.if !empty(PKGPATH:Mtextproc/gsed)
_TOOLS_OVERRIDE.sed= NO
-MAKEFLAGS+= _IGNORE_USE_GNU_TOOLS=
+MAKEFLAGS+= _IGNORE_GNU_TOOL=sed
.endif
# If _TOOLS_OVERRIDE.<tool> is actually set to "YES", then we override
--MfFXiAuoTsnnDAfZ--