summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorjlam <jlam>2005-05-15 23:20:38 +0000
committerjlam <jlam>2005-05-15 23:20:38 +0000
commit9f99d48b16a73630d56573b8f580e32669f3b0c8 (patch)
treeb698c24fcd2bc1972d4dcd2b0268c02182a5cccd /mk
parentbfec075a77056b93e51900f1bda28adf62ed3966 (diff)
downloadpkgsrc-9f99d48b16a73630d56573b8f580e32669f3b0c8.tar.gz
Asking the tools framework for "bison" now provides two distinct tools:
"bison" and "bison-yacc". bison is just a symlink to the real bison, but "bison-yacc" provides a "yacc" in ${TOOLS_DIR} that does "bison -y". This allows the tools framework to provide everything that a package might look for when asking for "bison" and avoids relying on the bison being available in the PATH.
Diffstat (limited to 'mk')
-rw-r--r--mk/tools/defaults.mk4
-rw-r--r--mk/tools/replace.mk27
-rw-r--r--mk/tools/tools.Linux.mk3
3 files changed, 26 insertions, 8 deletions
diff --git a/mk/tools/defaults.mk b/mk/tools/defaults.mk
index e6002feab0b..661e904e4be 100644
--- a/mk/tools/defaults.mk
+++ b/mk/tools/defaults.mk
@@ -1,4 +1,4 @@
-# $NetBSD: defaults.mk,v 1.14 2005/05/14 21:15:07 jlam Exp $
+# $NetBSD: defaults.mk,v 1.15 2005/05/15 23:20:38 jlam Exp $
.if !defined(TOOLS_DEFAULTS_MK)
TOOLS_DEFAULTS_MK= defined
@@ -16,7 +16,7 @@ TOOLS_DEFAULTS_MK= defined
# "TOOL" variable names associated with each of the tools
_TOOLS_VARNAME.awk= AWK
_TOOLS_VARNAME.basename= BASENAME
-_TOOLS_VARNAME.bison= YACC
+_TOOLS_VARNAME.bison-yacc= YACC
_TOOLS_VARNAME.bzcat= BZCAT
_TOOLS_VARNAME.cat= CAT
_TOOLS_VARNAME.chgrp= CHGRP
diff --git a/mk/tools/replace.mk b/mk/tools/replace.mk
index cf5801a94fa..45c6297ddbf 100644
--- a/mk/tools/replace.mk
+++ b/mk/tools/replace.mk
@@ -1,4 +1,4 @@
-# $NetBSD: replace.mk,v 1.77 2005/05/15 22:34:43 jlam Exp $
+# $NetBSD: replace.mk,v 1.78 2005/05/15 23:20:38 jlam Exp $
#
# This Makefile fragment handles "replacements" of system-supplied
# tools with pkgsrc versions.
@@ -53,6 +53,11 @@ USE_TOOLS+= ${USE_GNU_TOOLS:S/^awk$/gawk/:S/^make$/gmake/:S/^sed$/gsed/}
USE_TOOLS+= tbl
.endif
+# bison implies "bison-yacc"
+.if !empty(USE_TOOLS:Mbison)
+USE_TOOLS+= bison-yacc
+.endif
+
.include "../../mk/tools/imake.mk"
######################################################################
@@ -64,7 +69,7 @@ USE_TOOLS+= tbl
.if !defined(_USE_TOOLS)
_USE_TOOLS:= ${PKGSRC_USE_TOOLS} ${USE_TOOLS}
_USE_TOOLS:= ${_USE_TOOLS:O:u}
-. if !empty(USE_TOOLS:Mbison) # bison > yacc
+. if !empty(USE_TOOLS:Mbison-yacc) # bison-yacc > yacc
_USE_TOOLS:= ${_USE_TOOLS:Nyacc}
. endif
. if !empty(USE_TOOLS:Mgawk) # gawk > awk
@@ -155,10 +160,22 @@ TOOLS_DEPENDS.bison?= bison>=1.0:../../devel/bison
TOOLS_CREATE+= bison
TOOLS_FIND_PREFIX+= TOOLS_PREFIX.bison=bison
TOOLS_REAL_CMD.bison= ${TOOLS_PREFIX.bison}/bin/bison
-TOOLS_REAL_ARGS.bison= -y
-TOOLS_${_TOOLS_VARNAME.bison}= ${TOOLS_REAL_CMD.bison} ${TOOLS_REAL_ARGS.bison}
. endif
-TOOLS_CMD.bison= ${TOOLS_DIR}/bin/yacc
+.endif
+
+.if !defined(TOOLS_IGNORE.bison-yacc) && !empty(_USE_TOOLS:Mbison-yacc)
+. if !empty(PKGPATH:Mdevel/bison)
+MAKEFLAGS+= TOOLS_IGNORE.bison-yacc=
+. elif !empty(_TOOLS_USE_PKGSRC.bison-yacc:M[yY][eE][sS])
+TOOLS_DEPENDS.bison-yacc?= bison>=1.0:../../devel/bison
+TOOLS_CREATE+= bison-yacc
+TOOLS_FIND_PREFIX+= TOOLS_PREFIX.bison-yacc=bison
+TOOLS_REAL_CMD.bison-yacc= ${TOOLS_PREFIX.bison-yacc}/bin/bison
+TOOLS_REAL_ARGS.bison-yacc= -y
+TOOLS_${_TOOLS_VARNAME.bison-yacc}= \
+ ${TOOLS_REAL_CMD.bison-yacc} ${TOOLS_REAL_ARGS.bison-yacc}
+. endif
+TOOLS_CMD.bison-yacc= ${TOOLS_DIR}/bin/yacc
.endif
.if !defined(TOOLS_IGNORE.bzcat) && !empty(_USE_TOOLS:Mbzcat)
diff --git a/mk/tools/tools.Linux.mk b/mk/tools/tools.Linux.mk
index baa7920cce3..32a685695f5 100644
--- a/mk/tools/tools.Linux.mk
+++ b/mk/tools/tools.Linux.mk
@@ -1,4 +1,4 @@
-# $NetBSD: tools.Linux.mk,v 1.16 2005/05/15 22:37:46 jlam Exp $
+# $NetBSD: tools.Linux.mk,v 1.17 2005/05/15 23:20:38 jlam Exp $
#
# System-supplied tools for the Linux operating system.
@@ -11,6 +11,7 @@ TOOLS_PLATFORM.basename?= /usr/bin/basename
.endif
.if exists(/usr/bin/bison)
TOOLS_PLATFORM.bison?= /usr/bin/bison
+TOOLS_PLATFORM.bison-yacc?= /usr/bin/bison -y
.endif
TOOLS_PLATFORM.cat?= /bin/cat
TOOLS_PLATFORM.chgrp?= /bin/chgrp