pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk/tools Asking the tools framework for "bison" now pr...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/795a0ef4f579
branches:  trunk
changeset: 493863:795a0ef4f579
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Sun May 15 23:20:38 2005 +0000

description:
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:

 mk/tools/defaults.mk    |   4 ++--
 mk/tools/replace.mk     |  27 ++++++++++++++++++++++-----
 mk/tools/tools.Linux.mk |   3 ++-
 3 files changed, 26 insertions(+), 8 deletions(-)

diffs (91 lines):

diff -r a0aad1cb8bfc -r 795a0ef4f579 mk/tools/defaults.mk
--- a/mk/tools/defaults.mk      Sun May 15 22:53:57 2005 +0000
+++ b/mk/tools/defaults.mk      Sun May 15 23:20:38 2005 +0000
@@ -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 @@
 # "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 -r a0aad1cb8bfc -r 795a0ef4f579 mk/tools/replace.mk
--- a/mk/tools/replace.mk       Sun May 15 22:53:57 2005 +0000
+++ b/mk/tools/replace.mk       Sun May 15 23:20:38 2005 +0000
@@ -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+=    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 @@
 .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_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 -r a0aad1cb8bfc -r 795a0ef4f579 mk/tools/tools.Linux.mk
--- a/mk/tools/tools.Linux.mk   Sun May 15 22:53:57 2005 +0000
+++ b/mk/tools/tools.Linux.mk   Sun May 15 23:20:38 2005 +0000
@@ -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 @@
 .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



Home | Main Index | Thread Index | Old Index