Wed Feb 27 15:26:34 2008 UTC ()
+ Define BUILTIN_LIBNAME.* unconditionally so that their values can
  always be used in other builtin.mk files.

+ In the USE_BUILTIN.* == "yes" case, set BUILDLINK_LIBNAME.* to the
  corresponding BUILTIN_LIBNAME.* value so that BUILDLINK_LIBNAME.*
  can always be used in other buildlink3.mk files.


(jlam)
diff -r1.18 -r1.19 pkgsrc/devel/ncurses/builtin.mk
diff -r1.9 -r1.10 pkgsrc/mk/curses.buildlink3.mk
diff -r1.4 -r1.5 pkgsrc/mk/curses.builtin.mk
diff -r1.1 -r1.2 pkgsrc/mk/termlib.builtin.mk

cvs diff -r1.18 -r1.19 pkgsrc/devel/ncurses/builtin.mk (expand / switch to unified diff)

--- pkgsrc/devel/ncurses/builtin.mk 2008/02/27 06:14:23 1.18
+++ pkgsrc/devel/ncurses/builtin.mk 2008/02/27 15:26:34 1.19
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: builtin.mk,v 1.18 2008/02/27 06:14:23 jlam Exp $ 1# $NetBSD: builtin.mk,v 1.19 2008/02/27 15:26:34 jlam Exp $
2 2
3BUILTIN_PKG:= ncurses 3BUILTIN_PKG:= ncurses
4 4
5BUILTIN_FIND_LIBS:= ncurses curses 5BUILTIN_FIND_LIBS:= ncurses curses
6BUILTIN_FIND_FILES_VAR:= H_NCURSES 6BUILTIN_FIND_FILES_VAR:= H_NCURSES
7BUILTIN_FIND_FILES.H_NCURSES= /usr/include/ncurses.h /usr/include/curses.h 7BUILTIN_FIND_FILES.H_NCURSES= /usr/include/ncurses.h /usr/include/curses.h
8BUILTIN_FIND_GREP.H_NCURSES= \#define[ ]*NCURSES_VERSION 8BUILTIN_FIND_GREP.H_NCURSES= \#define[ ]*NCURSES_VERSION
9 9
10.include "../../mk/buildlink3/bsd.builtin.mk" 10.include "../../mk/buildlink3/bsd.builtin.mk"
11 11
12### 12###
13### Determine if there is a built-in implementation of the package and 13### Determine if there is a built-in implementation of the package and
14### set IS_BUILTIN.<pkg> appropriately ("yes" or "no"). 14### set IS_BUILTIN.<pkg> appropriately ("yes" or "no").
@@ -90,54 +90,53 @@ USE_BUILTIN.ncurses= no @@ -90,54 +90,53 @@ USE_BUILTIN.ncurses= no
90. endif # PREFER.ncurses 90. endif # PREFER.ncurses
91.endif 91.endif
92MAKEVARS+= USE_BUILTIN.ncurses 92MAKEVARS+= USE_BUILTIN.ncurses
93 93
94# If USE_NCURSES is defined, then force the use of an ncurses 94# If USE_NCURSES is defined, then force the use of an ncurses
95# implementation. 95# implementation.
96# 96#
97.if defined(USE_NCURSES) 97.if defined(USE_NCURSES)
98. if !empty(IS_BUILTIN.ncurses:M[nN][oO]) 98. if !empty(IS_BUILTIN.ncurses:M[nN][oO])
99USE_BUILTIN.ncurses= no 99USE_BUILTIN.ncurses= no
100. endif 100. endif
101.endif 101.endif
102 102
103# Define BUILTIN_LIBNAME.ncurses to be the built-in ncurses library 103# Define BUILTIN_LIBNAME.ncurses to be the base name of the built-in
104# only if we're using the built-in ncurses. 104# ncurses library.
105# 105#
106.if !empty(USE_BUILTIN.ncurses:M[yY][eE][sS]) 106.if !empty(BUILTIN_LIB_FOUND.ncurses:M[nN][oO]) && \
107. if !empty(BUILTIN_LIB_FOUND.ncurses:M[nN][oO]) && \ 107 !empty(BUILTIN_LIB_FOUND.curses:M[yY][eE][sS])
108 !empty(BUILTIN_LIB_FOUND.curses:M[yY][eE][sS]) 
109BUILTIN_LIBNAME.ncurses= curses 108BUILTIN_LIBNAME.ncurses= curses
110. endif 109.endif
111# 110#
112# On Interix, there is a libncurses.a and a libcurses.so but strangely, 111# On Interix, there is a libncurses.a and a libcurses.so but strangely,
113# no libncurses.so. We want to link against the shared library, so 112# no libncurses.so. We want to link against the shared library, so
114# turn "-lncurses" into "-lcurses". 113# turn "-lncurses" into "-lcurses".
115# 114#
116. if (${OPSYS} == "Interix") && \ 115.if (${OPSYS} == "Interix") && \
117 !empty(BUILTIN_LIB_FOUND.curses:M[yY][eE][sS]) 116 !empty(BUILTIN_LIB_FOUND.curses:M[yY][eE][sS])
118BUILTIN_LIBNAME.ncurses= curses 117BUILTIN_LIBNAME.ncurses= curses
119. endif 
120.endif 118.endif
121 119
122### 120###
123### The section below only applies if we are not including this file 121### The section below only applies if we are not including this file
124### solely to determine whether a built-in implementation exists. 122### solely to determine whether a built-in implementation exists.
125### 123###
126CHECK_BUILTIN.ncurses?= no 124CHECK_BUILTIN.ncurses?= no
127.if !empty(CHECK_BUILTIN.ncurses:M[nN][oO]) 125.if !empty(CHECK_BUILTIN.ncurses:M[nN][oO])
128 126
129BUILDLINK_TRANSFORM+= l:ncurses:${BUILDLINK_LIBNAME.ncurses} 127BUILDLINK_TRANSFORM+= l:ncurses:${BUILDLINK_LIBNAME.ncurses}
130. if !empty(USE_BUILTIN.ncurses:M[yY][eE][sS]) 128. if !empty(USE_BUILTIN.ncurses:M[yY][eE][sS])
 129BUILDLINK_LIBNAME.ncurses= ${BUILTIN_LIBNAME.ncurses}
131BUILDLINK_TARGETS+= buildlink-curses-ncurses-h 130BUILDLINK_TARGETS+= buildlink-curses-ncurses-h
132BUILDLINK_TARGETS+= buildlink-ncurses-extra-includes 131BUILDLINK_TARGETS+= buildlink-ncurses-extra-includes
133. endif 132. endif
134 133
135# A full ncurses implementation provides more headers than some curses 134# A full ncurses implementation provides more headers than some curses
136# implementations. Touch empty replacements for those headers so that 135# implementations. Touch empty replacements for those headers so that
137# packages can continue to use the familiar ncurses header names. 136# packages can continue to use the familiar ncurses header names.
138# 137#
139. if !target(buildlink-ncurses-extra-includes) 138. if !target(buildlink-ncurses-extra-includes)
140.PHONY: buildlink-ncurses-extra-includes 139.PHONY: buildlink-ncurses-extra-includes
141buildlink-ncurses-extra-includes: 140buildlink-ncurses-extra-includes:
142 ${RUN} \ 141 ${RUN} \
143 extra_includes="include/term.h"; \ 142 extra_includes="include/term.h"; \

cvs diff -r1.9 -r1.10 pkgsrc/mk/curses.buildlink3.mk (expand / switch to unified diff)

--- pkgsrc/mk/curses.buildlink3.mk 2008/02/27 06:15:04 1.9
+++ pkgsrc/mk/curses.buildlink3.mk 2008/02/27 15:26:34 1.10
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: curses.buildlink3.mk,v 1.9 2008/02/27 06:15:04 jlam Exp $ 1# $NetBSD: curses.buildlink3.mk,v 1.10 2008/02/27 15:26:34 jlam Exp $
2# 2#
3# This Makefile fragment is meant to be included by packages that require 3# This Makefile fragment is meant to be included by packages that require
4# any curses implementation instead of one particular one. The available 4# any curses implementation instead of one particular one. The available
5# curses implementations are "curses" if built-in, "ncurses", and 5# curses implementations are "curses" if built-in, "ncurses", and
6# "pdcurses". 6# "pdcurses".
7# 7#
8# If a package genuinely requires ncurses or pdcurses, then it should 8# If a package genuinely requires ncurses or pdcurses, then it should
9# directly include the appropriate buildlink3.mk instead of this file in 9# directly include the appropriate buildlink3.mk instead of this file in
10# the package Makefile. 10# the package Makefile.
11# 11#
12# === User-settable variables === 12# === User-settable variables ===
13# 13#
14# CURSES_DEFAULT 14# CURSES_DEFAULT
@@ -77,26 +77,25 @@ BUILD_DEFS_EFFECTS+= CURSES_TYPE @@ -77,26 +77,25 @@ BUILD_DEFS_EFFECTS+= CURSES_TYPE
77# <curses.h> and -lcurses. 77# <curses.h> and -lcurses.
78# 78#
79_PKG_USE_CURSES= yes 79_PKG_USE_CURSES= yes
80 80
81.endif # CURSES_BUILDLINK3_MK 81.endif # CURSES_BUILDLINK3_MK
82 82
83.if ${CURSES_TYPE} == "none" 83.if ${CURSES_TYPE} == "none"
84PKG_FAIL_REASON= \ 84PKG_FAIL_REASON= \
85 "${_CURSES_TYPE} is not an acceptable curses type for ${PKGNAME}." 85 "${_CURSES_TYPE} is not an acceptable curses type for ${PKGNAME}."
86.elif ${CURSES_TYPE} == "curses" 86.elif ${CURSES_TYPE} == "curses"
87BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Ncurses} 87BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Ncurses}
88BUILDLINK_PACKAGES+= curses 88BUILDLINK_PACKAGES+= curses
89BUILDLINK_ORDER:= ${BUILDLINK_ORDER} ${BUILDLINK_DEPTH}curses 89BUILDLINK_ORDER:= ${BUILDLINK_ORDER} ${BUILDLINK_DEPTH}curses
90BUILDLINK_LIBNAME.curses?= ${BUILTIN_LIBNAME.curses} 
91BUILDLINK_LDADD.curses?= ${BUILDLINK_LIBNAME.curses:S/^/-l/} 90BUILDLINK_LDADD.curses?= ${BUILDLINK_LIBNAME.curses:S/^/-l/}
92BUILDLINK_BUILTIN_MK.curses= ../../mk/curses.builtin.mk 91BUILDLINK_BUILTIN_MK.curses= ../../mk/curses.builtin.mk
93.elif ${CURSES_TYPE} == "ncurses" 92.elif ${CURSES_TYPE} == "ncurses"
94USE_NCURSES= yes 93USE_NCURSES= yes
95. include "../../devel/ncurses/buildlink3.mk" 94. include "../../devel/ncurses/buildlink3.mk"
96BUILDLINK_LIBNAME.curses?= ${BUILDLINK_LIBNAME.ncurses} 95BUILDLINK_LIBNAME.curses?= ${BUILDLINK_LIBNAME.ncurses}
97BUILDLINK_LDADD.curses?= ${BUILDLINK_LDADD.ncurses} 96BUILDLINK_LDADD.curses?= ${BUILDLINK_LDADD.ncurses}
98.elif ${CURSES_TYPE} == "pdcurses" 97.elif ${CURSES_TYPE} == "pdcurses"
99. include "../../devel/pdcurses/buildlink3.mk" 98. include "../../devel/pdcurses/buildlink3.mk"
100BUILDLINK_LIBNAME.curses?= ${BUILDLINK_LIBNAME.pdcurses} 99BUILDLINK_LIBNAME.curses?= ${BUILDLINK_LIBNAME.pdcurses}
101BUILDLINK_LDADD.curses?= ${BUILDLINK_LDADD.pdcurses} 100BUILDLINK_LDADD.curses?= ${BUILDLINK_LDADD.pdcurses}
102.endif 101.endif

cvs diff -r1.4 -r1.5 pkgsrc/mk/curses.builtin.mk (expand / switch to unified diff)

--- pkgsrc/mk/curses.builtin.mk 2008/02/27 06:14:23 1.4
+++ pkgsrc/mk/curses.builtin.mk 2008/02/27 15:26:34 1.5
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: curses.builtin.mk,v 1.4 2008/02/27 06:14:23 jlam Exp $ 1# $NetBSD: curses.builtin.mk,v 1.5 2008/02/27 15:26:34 jlam Exp $
2 2
3BUILTIN_PKG:= curses 3BUILTIN_PKG:= curses
4 4
5BUILTIN_FIND_LIBS:= curses 5BUILTIN_FIND_LIBS:= curses
6BUILTIN_FIND_FILES_VAR:= H_CURSES 6BUILTIN_FIND_FILES_VAR:= H_CURSES
7BUILTIN_FIND_FILES.H_CURSES= /usr/include/curses.h 7BUILTIN_FIND_FILES.H_CURSES= /usr/include/curses.h
8 8
9.include "buildlink3/bsd.builtin.mk" 9.include "buildlink3/bsd.builtin.mk"
10 10
11### 11###
12### Determine if there is a built-in implementation of the package and 12### Determine if there is a built-in implementation of the package and
13### set IS_BUILTIN.<pkg> appropriately ("yes" or "no"). 13### set IS_BUILTIN.<pkg> appropriately ("yes" or "no").
14### 14###
@@ -36,36 +36,35 @@ USE_BUILTIN.curses= yes @@ -36,36 +36,35 @@ USE_BUILTIN.curses= yes
36USE_BUILTIN.curses!= \ 36USE_BUILTIN.curses!= \
37 if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.curses:Q}; then \ 37 if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.curses:Q}; then \
38 ${ECHO} yes; \ 38 ${ECHO} yes; \
39 else \ 39 else \
40 ${ECHO} no; \ 40 ${ECHO} no; \
41 fi 41 fi
42. endif 42. endif
43. endfor 43. endfor
44. endif 44. endif
45. endif # PREFER.curses 45. endif # PREFER.curses
46.endif 46.endif
47MAKEVARS+= USE_BUILTIN.curses 47MAKEVARS+= USE_BUILTIN.curses
48 48
49# Define BUILTIN_LIBNAME.curses to be the built-in curses library only if 49# Define BUILTIN_LIBNAME.curses to be the base name of the built-in
50# we're using the built-in curses. 50# curses library.
51# 51#
52.if !empty(USE_BUILTIN.curses:M[yY][eE][sS]) 52.if !empty(BUILTIN_LIB_FOUND.curses:M[yY][eE][sS])
53. if !empty(BUILTIN_LIB_FOUND.curses:M[yY][eE][sS]) 
54BUILTIN_LIBNAME.curses= curses 53BUILTIN_LIBNAME.curses= curses
55. endif 
56.endif 54.endif
57 55
58### 56###
59### The section below only applies if we are not including this file 57### The section below only applies if we are not including this file
60### solely to determine whether a built-in implementation exists. 58### solely to determine whether a built-in implementation exists.
61### 59###
62CHECK_BUILTIN.curses?= no 60CHECK_BUILTIN.curses?= no
63.if !empty(CHECK_BUILTIN.curses:M[nN][oO]) 61.if !empty(CHECK_BUILTIN.curses:M[nN][oO])
64 62
65. if !empty(USE_BUILTIN.curses:M[yY][eE][sS]) 63. if !empty(USE_BUILTIN.curses:M[yY][eE][sS])
66. if exists(${H_CURSES}) 64. if exists(${H_CURSES})
67BUILDLINK_INCDIRS.curses?= ${H_CURSES:H:S/^${BUILDLINK_PREFIX.curses}\///} 65BUILDLINK_INCDIRS.curses?= ${H_CURSES:H:S/^${BUILDLINK_PREFIX.curses}\///}
68. endif 66. endif
 67BUILDLINK_LIBNAME.curses= ${BUILTIN_LIBNAME.curses}
69. endif 68. endif
70 69
71.endif # CHECK_BUILTIN.curses 70.endif # CHECK_BUILTIN.curses

cvs diff -r1.1 -r1.2 pkgsrc/mk/Attic/termlib.builtin.mk (expand / switch to unified diff)

--- pkgsrc/mk/Attic/termlib.builtin.mk 2008/02/27 04:47:02 1.1
+++ pkgsrc/mk/Attic/termlib.builtin.mk 2008/02/27 15:26:34 1.2
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: termlib.builtin.mk,v 1.1 2008/02/27 04:47:02 jlam Exp $ 1# $NetBSD: termlib.builtin.mk,v 1.2 2008/02/27 15:26:34 jlam Exp $
2 2
3BUILTIN_PKG:= termlib 3BUILTIN_PKG:= termlib
4 4
5BUILTIN_FIND_LIBS:= termcap curses 5BUILTIN_FIND_LIBS:= termcap curses
6 6
7.include "buildlink3/bsd.builtin.mk" 7.include "buildlink3/bsd.builtin.mk"
8 8
9### 9###
10### Determine if there is a built-in implementation of the package and 10### Determine if there is a built-in implementation of the package and
11### set IS_BUILTIN.<pkg> appropriately ("yes" or "no"). 11### set IS_BUILTIN.<pkg> appropriately ("yes" or "no").
12### 12###
13.if !defined(IS_BUILTIN.termlib) 13.if !defined(IS_BUILTIN.termlib)
14IS_BUILTIN.termlib= no 14IS_BUILTIN.termlib= no
@@ -22,23 +22,34 @@ MAKEVARS+= IS_BUILTIN.termlib @@ -22,23 +22,34 @@ MAKEVARS+= IS_BUILTIN.termlib
22### 22###
23### Determine whether we should use the built-in implementation if it 23### Determine whether we should use the built-in implementation if it
24### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no"). 24### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no").
25### 25###
26.if !defined(USE_BUILTIN.termlib) 26.if !defined(USE_BUILTIN.termlib)
27. if ${PREFER.termlib} == "pkgsrc" 27. if ${PREFER.termlib} == "pkgsrc"
28USE_BUILTIN.termlib= no 28USE_BUILTIN.termlib= no
29. else 29. else
30USE_BUILTIN.termlib= ${IS_BUILTIN.termlib} 30USE_BUILTIN.termlib= ${IS_BUILTIN.termlib}
31. endif # PREFER.termlib 31. endif # PREFER.termlib
32.endif 32.endif
33MAKEVARS+= USE_BUILTIN.termlib 33MAKEVARS+= USE_BUILTIN.termlib
34 34
35# Define BUILTIN_LIBNAME.termlib to be the built-in terminal library 35# Define BUILTIN_LIBNAME.termlib to be the base name of the built-in
36# only if we're using the built-in termlib. 36# terminal library.
37# 37#
38.if !empty(USE_BUILTIN.termlib:M[yY][eE][sS]) 38.if !empty(BUILTIN_LIB_FOUND.termcap:M[yY][eE][sS])
39. if !empty(BUILTIN_LIB_FOUND.termcap:M[yY][eE][sS]) 
40BUILTIN_LIBNAME.termlib= termcap 39BUILTIN_LIBNAME.termlib= termcap
41. elif !empty(BUILTIN_LIB_FOUND.curses:M[yY][eE][sS]) 40.elif !empty(BUILTIN_LIB_FOUND.curses:M[yY][eE][sS])
42BUILTIN_LIBNAME.termlib= curses 41BUILTIN_LIBNAME.termlib= curses
43. endif 
44.endif 42.endif
 43
 44###
 45### The section below only applies if we are not including this file
 46### solely to determine whether a built-in implementation exists.
 47###
 48CHECK_BUILTIN.termlib?= no
 49.if !empty(CHECK_BUILTIN.termlib:M[nN][oO])
 50
 51. if !empty(USE_BUILTIN.termlib:M[yY][eE][sS])
 52BUILDLINK_LIBNAME.termlib= ${BUILTIN_LIBNAME.termlib}
 53. endif
 54
 55.endif # CHECK_BUILTIN.termlib