Subject: tools.mk, USE_GNU_TOOLS=yacc and _TOOLS_REPLACE_OPSYS
To: None <tech-pkg@netbsd.org>
From: Jeremy C. Reed <reed@reedmedia.net>
List: tech-pkg
Date: 03/09/2004 20:44:45
devel/libbonobo failed under Linux for me with:

Making all in activation-server
make[2]: Entering directory
`/scratch/pkgsrc/devel/libbonobo/work.puget/libbonobo-2.4.3/activation-server'
yacc -d -v ./activation-context-query-parser.y
make[2]: yacc: Command not found
make[2]: *** [stamp-parser] Error 127
make[2]: Leaving directory
`/scratch/pkgsrc/devel/libbonobo/work.puget/libbonobo-2.4.3/activation-server'

Now that tools.mk supports yacc, this is any easy fix by adding "yacc" to
USE_GNU_TOOLS. So I thought.

Some minutes later failed the same: "make[2]: yacc: Command not found".

I have bison.

tools.mk says:
# These platforms already have GNU versions of the tools in the base
# system, so no need to pull in the pkgsrc versions; we will use these
# instead.
...
_TOOLS_OPSYS_HAS_GNU.yacc+=     FreeBSD-*-* Linux-*-* NetBSD-*-* OpenBSD-*-*

I have:

 reed@puget:/usr/pkgsrc/devel/libbonobo$ bmake show-var VARNAME=_TOOLS_NEED_GNU.yacc
 NO
 reed@puget:/usr/pkgsrc/devel/libbonobo$ bmake show-var VARNAME=_TOOLS_REPLACE.yacc
 NO
 reed@puget:/usr/pkgsrc/devel/libbonobo$ bmake show-var VARNAME=YACC
 yacc

Who uses Linux here?

Do all Linux systems include a "yacc" called yacc?

Do all Linux systems include a "lex" called "lex"?

Do all Linux systems come with "patch" by default?

Do all Linux systems come with GNU "make" by default?

Do all Linux systems come with a GNU "awk" by default?

I have been doing continuous Linux admin work on a wide variety of Linux
systems for around seven years. I'd only answer "yes" consistently to awk
(because awk alternatives are good enough).

What do you think of the following?

--- mk/tools.mk	18 Feb 2004 14:23:42 -0000	1.29
+++ mk/tools.mk	10 Mar 2004 04:40:39 -0000
@@ -134,13 +134,13 @@
 _TOOLS_OPSYS_HAS_GNU.awk+=	FreeBSD-*-* Linux-*-* NetBSD-*-* OpenBSD-*-*
 _TOOLS_OPSYS_HAS_GNU.grep+=	Darwin-*-* FreeBSD-*-* Linux-*-*
 _TOOLS_OPSYS_HAS_GNU.grep+=	NetBSD-*-* OpenBSD-*-*
-_TOOLS_OPSYS_HAS_GNU.lex+=	FreeBSD-*-* Linux-*-* NetBSD-*-* OpenBSD-*-*
+_TOOLS_OPSYS_HAS_GNU.lex+=	FreeBSD-*-* NetBSD-*-* OpenBSD-*-*
 _TOOLS_OPSYS_HAS_GNU.m4+=	# empty
 _TOOLS_OPSYS_HAS_GNU.make+=	Darwin-*-*
-_TOOLS_OPSYS_HAS_GNU.patch+=	Darwin-*-* FreeBSD-*-* Linux-*-* NetBSD-*-*
+_TOOLS_OPSYS_HAS_GNU.patch+=	Darwin-*-* FreeBSD-*-* NetBSD-*-*
 _TOOLS_OPSYS_HAS_GNU.patch+=	OpenBSD-*-*
 _TOOLS_OPSYS_HAS_GNU.sed+=	Linux-*-* NetBSD-*-*
-_TOOLS_OPSYS_HAS_GNU.yacc+=	FreeBSD-*-* Linux-*-* NetBSD-*-* OpenBSD-*-*
+_TOOLS_OPSYS_HAS_GNU.yacc+=	FreeBSD-*-* NetBSD-*-* OpenBSD-*-*

 # These platforms have GNUish versions of the tools available in the base
 # system, which we already define as ${AWK}, ${SED}, etc. (refer to

The above also ensures that we have a good version of the software
available.

   Jeremy C. Reed
   http://bsd.reedmedia.net/