+ 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.diff -r1.18 -r1.19 pkgsrc/devel/ncurses/builtin.mk
(jlam)
@@ -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 | |||
3 | BUILTIN_PKG:= ncurses | 3 | BUILTIN_PKG:= ncurses | |
4 | 4 | |||
5 | BUILTIN_FIND_LIBS:= ncurses curses | 5 | BUILTIN_FIND_LIBS:= ncurses curses | |
6 | BUILTIN_FIND_FILES_VAR:= H_NCURSES | 6 | BUILTIN_FIND_FILES_VAR:= H_NCURSES | |
7 | BUILTIN_FIND_FILES.H_NCURSES= /usr/include/ncurses.h /usr/include/curses.h | 7 | BUILTIN_FIND_FILES.H_NCURSES= /usr/include/ncurses.h /usr/include/curses.h | |
8 | BUILTIN_FIND_GREP.H_NCURSES= \#define[ ]*NCURSES_VERSION | 8 | BUILTIN_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 | |
92 | MAKEVARS+= USE_BUILTIN.ncurses | 92 | MAKEVARS+= 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]) | |
99 | USE_BUILTIN.ncurses= no | 99 | USE_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]) | |||
109 | BUILTIN_LIBNAME.ncurses= curses | 108 | BUILTIN_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]) | |
118 | BUILTIN_LIBNAME.ncurses= curses | 117 | BUILTIN_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 | ### | |
126 | CHECK_BUILTIN.ncurses?= no | 124 | CHECK_BUILTIN.ncurses?= no | |
127 | .if !empty(CHECK_BUILTIN.ncurses:M[nN][oO]) | 125 | .if !empty(CHECK_BUILTIN.ncurses:M[nN][oO]) | |
128 | 126 | |||
129 | BUILDLINK_TRANSFORM+= l:ncurses:${BUILDLINK_LIBNAME.ncurses} | 127 | BUILDLINK_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]) | |
129 | BUILDLINK_LIBNAME.ncurses= ${BUILTIN_LIBNAME.ncurses} | |||
131 | BUILDLINK_TARGETS+= buildlink-curses-ncurses-h | 130 | BUILDLINK_TARGETS+= buildlink-curses-ncurses-h | |
132 | BUILDLINK_TARGETS+= buildlink-ncurses-extra-includes | 131 | BUILDLINK_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 | |
141 | buildlink-ncurses-extra-includes: | 140 | buildlink-ncurses-extra-includes: | |
142 | ${RUN} \ | 141 | ${RUN} \ | |
143 | extra_includes="include/term.h"; \ | 142 | extra_includes="include/term.h"; \ |
@@ -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" | |
84 | PKG_FAIL_REASON= \ | 84 | PKG_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" | |
87 | BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Ncurses} | 87 | BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Ncurses} | |
88 | BUILDLINK_PACKAGES+= curses | 88 | BUILDLINK_PACKAGES+= curses | |
89 | BUILDLINK_ORDER:= ${BUILDLINK_ORDER} ${BUILDLINK_DEPTH}curses | 89 | BUILDLINK_ORDER:= ${BUILDLINK_ORDER} ${BUILDLINK_DEPTH}curses | |
90 | BUILDLINK_LIBNAME.curses?= ${BUILTIN_LIBNAME.curses} | |||
91 | BUILDLINK_LDADD.curses?= ${BUILDLINK_LIBNAME.curses:S/^/-l/} | 90 | BUILDLINK_LDADD.curses?= ${BUILDLINK_LIBNAME.curses:S/^/-l/} | |
92 | BUILDLINK_BUILTIN_MK.curses= ../../mk/curses.builtin.mk | 91 | BUILDLINK_BUILTIN_MK.curses= ../../mk/curses.builtin.mk | |
93 | .elif ${CURSES_TYPE} == "ncurses" | 92 | .elif ${CURSES_TYPE} == "ncurses" | |
94 | USE_NCURSES= yes | 93 | USE_NCURSES= yes | |
95 | . include "../../devel/ncurses/buildlink3.mk" | 94 | . include "../../devel/ncurses/buildlink3.mk" | |
96 | BUILDLINK_LIBNAME.curses?= ${BUILDLINK_LIBNAME.ncurses} | 95 | BUILDLINK_LIBNAME.curses?= ${BUILDLINK_LIBNAME.ncurses} | |
97 | BUILDLINK_LDADD.curses?= ${BUILDLINK_LDADD.ncurses} | 96 | BUILDLINK_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" | |
100 | BUILDLINK_LIBNAME.curses?= ${BUILDLINK_LIBNAME.pdcurses} | 99 | BUILDLINK_LIBNAME.curses?= ${BUILDLINK_LIBNAME.pdcurses} | |
101 | BUILDLINK_LDADD.curses?= ${BUILDLINK_LDADD.pdcurses} | 100 | BUILDLINK_LDADD.curses?= ${BUILDLINK_LDADD.pdcurses} | |
102 | .endif | 101 | .endif |
@@ -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 | |||
3 | BUILTIN_PKG:= curses | 3 | BUILTIN_PKG:= curses | |
4 | 4 | |||
5 | BUILTIN_FIND_LIBS:= curses | 5 | BUILTIN_FIND_LIBS:= curses | |
6 | BUILTIN_FIND_FILES_VAR:= H_CURSES | 6 | BUILTIN_FIND_FILES_VAR:= H_CURSES | |
7 | BUILTIN_FIND_FILES.H_CURSES= /usr/include/curses.h | 7 | BUILTIN_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 | |||
36 | USE_BUILTIN.curses!= \ | 36 | USE_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 | |
47 | MAKEVARS+= USE_BUILTIN.curses | 47 | MAKEVARS+= 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]) | |||
54 | BUILTIN_LIBNAME.curses= curses | 53 | BUILTIN_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 | ### | |
62 | CHECK_BUILTIN.curses?= no | 60 | CHECK_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}) | |
67 | BUILDLINK_INCDIRS.curses?= ${H_CURSES:H:S/^${BUILDLINK_PREFIX.curses}\///} | 65 | BUILDLINK_INCDIRS.curses?= ${H_CURSES:H:S/^${BUILDLINK_PREFIX.curses}\///} | |
68 | . endif | 66 | . endif | |
67 | BUILDLINK_LIBNAME.curses= ${BUILTIN_LIBNAME.curses} | |||
69 | . endif | 68 | . endif | |
70 | 69 | |||
71 | .endif # CHECK_BUILTIN.curses | 70 | .endif # CHECK_BUILTIN.curses |
@@ -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 | |||
3 | BUILTIN_PKG:= termlib | 3 | BUILTIN_PKG:= termlib | |
4 | 4 | |||
5 | BUILTIN_FIND_LIBS:= termcap curses | 5 | BUILTIN_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) | |
14 | IS_BUILTIN.termlib= no | 14 | IS_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" | |
28 | USE_BUILTIN.termlib= no | 28 | USE_BUILTIN.termlib= no | |
29 | . else | 29 | . else | |
30 | USE_BUILTIN.termlib= ${IS_BUILTIN.termlib} | 30 | USE_BUILTIN.termlib= ${IS_BUILTIN.termlib} | |
31 | . endif # PREFER.termlib | 31 | . endif # PREFER.termlib | |
32 | .endif | 32 | .endif | |
33 | MAKEVARS+= USE_BUILTIN.termlib | 33 | MAKEVARS+= 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]) | |||
40 | BUILTIN_LIBNAME.termlib= termcap | 39 | BUILTIN_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]) | |
42 | BUILTIN_LIBNAME.termlib= curses | 41 | BUILTIN_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 | ### | |||
48 | CHECK_BUILTIN.termlib?= no | |||
49 | .if !empty(CHECK_BUILTIN.termlib:M[nN][oO]) | |||
50 | ||||
51 | . if !empty(USE_BUILTIN.termlib:M[yY][eE][sS]) | |||
52 | BUILDLINK_LIBNAME.termlib= ${BUILTIN_LIBNAME.termlib} | |||
53 | . endif | |||
54 | ||||
55 | .endif # CHECK_BUILTIN.termlib |