Move the logic for testing if system curses supports the needed functions from devel/ncurses to the mk infrastructure. FAKE_NCURSES=yes Provides the system curses as ncurses.h and libncurses. USE_CURSES=wide Links to system curses if they provide wide support, otherwise ncursesw. wide-curses in the package options also triggers this.diff -r1.17 -r1.18 pkgsrc/mk/curses.buildlink3.mk
(roy)
@@ -1,93 +1,130 @@ | @@ -1,93 +1,130 @@ | |||
1 | # $NetBSD: curses.buildlink3.mk,v 1.17 2010/02/07 10:28:13 roy Exp $ | 1 | # $NetBSD: curses.buildlink3.mk,v 1.18 2014/03/09 10:15:32 roy 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 | |
15 | # This value represents the type of curses we wish to use on the | 15 | # This value represents the type of curses we wish to use on the | |
16 | # system. Setting this to "curses" means that the system curses | 16 | # system. Setting this to "curses" means that the system curses | |
17 | # implementation is fine. | 17 | # implementation is fine. | |
18 | # | 18 | # | |
19 | # Possible: curses, ncurses, pdcurses | 19 | # Possible: curses, ncurses, ncursesw, pdcurses | |
20 | # Default: (depends) | 20 | # Default: (depends) | |
21 | # | 21 | # | |
22 | # === Variables set by this file === | 22 | # === Variables set by this file === | |
23 | # | 23 | # | |
24 | # CURSES_TYPE | 24 | # CURSES_TYPE | |
25 | # The name of the selected curses implementation. | 25 | # The name of the selected curses implementation. | |
26 | 26 | |||
27 | CURSES_BUILDLINK3_MK:= ${CURSES_BUILDLINK3_MK}+ | 27 | CURSES_BUILDLINK3_MK:= ${CURSES_BUILDLINK3_MK}+ | |
28 | .include "bsd.fast.prefs.mk" | 28 | .include "bsd.fast.prefs.mk" | |
29 | 29 | |||
30 | .if !empty(CURSES_BUILDLINK3_MK:M+) | 30 | .if !empty(CURSES_BUILDLINK3_MK:M+) | |
31 | 31 | |||
32 | .if !defined(USE_CURSES) && !empty(PKG_OPTIONS:Mwide-curses) | |||
33 | USE_CURSES?= wide | |||
34 | .endif | |||
35 | ||||
32 | # _CURSES_PKGS is an exhaustive list of all of the curses implementations | 36 | # _CURSES_PKGS is an exhaustive list of all of the curses implementations | |
33 | # that may be used with curses.buildlink3.mk. | 37 | # that may be used with curses.buildlink3.mk. | |
34 | # | 38 | # | |
35 | _CURSES_PKGS?= curses ncurses pdcurses | 39 | _CURSES_PKGS?= curses ncurses ncursesw pdcurses | |
36 | 40 | |||
37 | CHECK_BUILTIN.curses:= yes | 41 | CHECK_BUILTIN.curses:= yes | |
38 | . include "curses.builtin.mk" | 42 | . include "curses.builtin.mk" | |
39 | CHECK_BUILTIN.curses:= no | 43 | CHECK_BUILTIN.curses:= no | |
40 | 44 | |||
41 | # Set the value of CURSES_DEFAULT depending on the platform and what's | 45 | # Set the value of CURSES_DEFAULT depending on the platform and what's | |
42 | # available in the base system. | 46 | # available in the base system. | |
43 | # | 47 | # | |
44 | .if defined(USE_BUILTIN.curses) && !empty(USE_BUILTIN.curses:M[yY][eE][sS]) | 48 | .if defined(USE_BUILTIN.curses) && !empty(USE_BUILTIN.curses:M[yY][eE][sS]) | |
45 | CURSES_DEFAULT?= curses | 49 | CURSES_DEFAULT?= curses | |
50 | .elif !empty(USE_CURSES:Mwide) || !empty(PKG_OPTIONS:Mwide-curses) | |||
51 | CURSES_DEFAULT?= ncursesw | |||
46 | .else | 52 | .else | |
47 | CURSES_DEFAULT?= ncurses | 53 | CURSES_DEFAULT?= ncurses | |
48 | .endif | 54 | .endif | |
49 | 55 | |||
50 | _CURSES_ACCEPTED= # empty | 56 | _CURSES_ACCEPTED= # empty | |
51 | .if defined(USE_BUILTIN.curses) && !empty(USE_BUILTIN.curses:M[yY][eE][sS]) | 57 | .if defined(USE_BUILTIN.curses) && !empty(USE_BUILTIN.curses:M[yY][eE][sS]) | |
52 | _CURSES_ACCEPTED+= curses # system curses exists | 58 | _CURSES_ACCEPTED+= curses # system curses exists | |
53 | .endif | 59 | .endif | |
60 | .if defined(USE_BUILTIN.cursesw) && !empty(USE_BUILTIN.cursesw:M[yY][eE][sS]) | |||
61 | _CURSES_ACCEPTED+= curses # system curses exists | |||
62 | .endif | |||
54 | _CURSES_ACCEPTED+= ncurses # pkgsrc ncurses | 63 | _CURSES_ACCEPTED+= ncurses # pkgsrc ncurses | |
64 | _CURSES_ACCEPTED+= ncursesw # pkgsrc ncursesw | |||
55 | _CURSES_ACCEPTED+= pdcurses # pkgsrc pdcurses | 65 | _CURSES_ACCEPTED+= pdcurses # pkgsrc pdcurses | |
56 | 66 | |||
57 | _CURSES_TYPE= ${CURSES_DEFAULT} | 67 | _CURSES_TYPE= ${CURSES_DEFAULT} | |
58 | . if !empty(_CURSES_ACCEPTED:M${_CURSES_TYPE}) | 68 | . if !empty(_CURSES_ACCEPTED:M${_CURSES_TYPE}) | |
59 | CURSES_TYPE= ${_CURSES_TYPE} | 69 | CURSES_TYPE= ${_CURSES_TYPE} | |
60 | . else | 70 | . else | |
61 | CURSES_TYPE= none | 71 | CURSES_TYPE= none | |
62 | . endif | 72 | . endif | |
63 | 73 | |||
64 | BUILD_DEFS+= CURSES_DEFAULT | 74 | BUILD_DEFS+= CURSES_DEFAULT | |
65 | BUILD_DEFS_EFFECTS+= CURSES_TYPE | 75 | BUILD_DEFS_EFFECTS+= CURSES_TYPE | |
66 | 76 | |||
67 | # _PKG_USE_CURSES is a flag for use by the curses packages' buildlink3.mk | 77 | # _PKG_USE_CURSES is a flag for use by the curses packages' buildlink3.mk | |
68 | # files to indicate that the headers and libraries should be usable as | 78 | # files to indicate that the headers and libraries should be usable as | |
69 | # <curses.h> and -lcurses. | 79 | # <curses.h> and -lcurses. | |
70 | # | 80 | # | |
71 | _PKG_USE_CURSES= yes | 81 | _PKG_USE_CURSES= yes | |
72 | 82 | |||
83 | .PHONY: buildlink-curses-ncurses-h | |||
84 | buildlink-curses-ncurses-h: | |||
85 | ${RUN} \ | |||
86 | src="${H_CURSES}"; \ | |||
87 | dest=${BUILDLINK_DIR}"/include/ncurses.h"; \ | |||
88 | if ${TEST} ! -f "$$dest" -a -f "$$src"; then \ | |||
89 | ${ECHO_BUILDLINK_MSG} "Linking ${H_CURSES} -> ncurses.h.";\ | |||
90 | ${MKDIR} `${DIRNAME} "$$dest"`; \ | |||
91 | ${LN} -s "$$src" "$$dest"; \ | |||
92 | fi | |||
93 | ||||
94 | ||||
73 | .endif # CURSES_BUILDLINK3_MK | 95 | .endif # CURSES_BUILDLINK3_MK | |
74 | 96 | |||
75 | .if ${CURSES_TYPE} == "none" | 97 | .if ${CURSES_TYPE} == "none" | |
76 | PKG_FAIL_REASON= \ | 98 | PKG_FAIL_REASON= \ | |
77 | "${_CURSES_TYPE} is not an acceptable curses type for ${PKGNAME}." | 99 | "${_CURSES_TYPE} is not an acceptable curses type for ${PKGNAME}." | |
78 | .elif ${CURSES_TYPE} == "curses" | 100 | .elif ${CURSES_TYPE} == "curses" | |
101 | . include "curses.builtin.mk" | |||
79 | BUILDLINK_TREE+= curses -curses | 102 | BUILDLINK_TREE+= curses -curses | |
80 | BUILDLINK_LDADD.curses?= ${BUILDLINK_LIBNAME.curses:S/^/-l/:S/^-l$//} | 103 | BUILDLINK_LDADD.curses?= ${BUILDLINK_LIBNAME.curses:S/^/-l/:S/^-l$//} | |
81 | BUILDLINK_BUILTIN_MK.curses= ../../mk/curses.builtin.mk | 104 | BUSILDLINK_BUILTIN_MK.curses= ../../mk/curses.builtin.mk | |
105 | # Some packages only look for ncurses | |||
106 | # The correct action would be to write a patch and pass it upstream | |||
107 | # but by setting FAKE_NCURSES=yes in the package we can temporarily work | |||
108 | # around the short-coming. | |||
109 | . if !empty(FAKE_NCURSES:M[yY][eE][sS]) | |||
110 | BUILDLINK_TARGETS+= buildlink-curses-ncurses-h | |||
111 | BUILDLINK_TRANSFORM+= l:ncurses:${BUILDLINK_LIBNAME.curses} | |||
112 | BUILDLINK_TRANSFORM+= l:ncursesw:${BUILDLINK_LIBNAME.curses} | |||
113 | . endif | |||
82 | .elif ${CURSES_TYPE} == "ncurses" | 114 | .elif ${CURSES_TYPE} == "ncurses" | |
83 | USE_NCURSES= yes | 115 | USE_NCURSES= yes | |
84 | . include "../../devel/ncurses/buildlink3.mk" | 116 | . include "../../devel/ncurses/buildlink3.mk" | |
85 | BUILDLINK_PREFIX.curses?= ${BUILDLINK_PREFIX.ncurses} | 117 | BUILDLINK_PREFIX.curses?= ${BUILDLINK_PREFIX.ncurses} | |
86 | BUILDLINK_LIBNAME.curses?= ${BUILDLINK_LIBNAME.ncurses} | 118 | BUILDLINK_LIBNAME.curses?= ${BUILDLINK_LIBNAME.ncurses} | |
87 | BUILDLINK_LDADD.curses?= ${BUILDLINK_LDADD.ncurses} | 119 | BUILDLINK_LDADD.curses?= ${BUILDLINK_LDADD.ncurses} | |
120 | .elif ${CURSES_TYPE} == "ncursesw" | |||
121 | . include "../../devel/ncursesw/buildlink3.mk" | |||
122 | BUILDLINK_PREFIX.curses?= ${BUILDLINK_PREFIX.ncursesw} | |||
123 | BUILDLINK_LIBNAME.curses?= ${BUILDLINK_LIBNAME.ncursesw} | |||
124 | BUILDLINK_LDADD.curses?= ${BUILDLINK_LDADD.ncursesw} | |||
88 | .elif ${CURSES_TYPE} == "pdcurses" | 125 | .elif ${CURSES_TYPE} == "pdcurses" | |
89 | . include "../../devel/pdcurses/buildlink3.mk" | 126 | . include "../../devel/pdcurses/buildlink3.mk" | |
90 | BUILDLINK_PREFIX.curses?= ${BUILDLINK_PREFIX.pdcurses} | 127 | BUILDLINK_PREFIX.curses?= ${BUILDLINK_PREFIX.pdcurses} | |
91 | BUILDLINK_LIBNAME.curses?= ${BUILDLINK_LIBNAME.pdcurses} | 128 | BUILDLINK_LIBNAME.curses?= ${BUILDLINK_LIBNAME.pdcurses} | |
92 | BUILDLINK_LDADD.curses?= ${BUILDLINK_LDADD.pdcurses} | 129 | BUILDLINK_LDADD.curses?= ${BUILDLINK_LDADD.pdcurses} | |
93 | .endif | 130 | .endif |
@@ -1,21 +1,49 @@ | @@ -1,21 +1,49 @@ | |||
1 | # $NetBSD: curses.builtin.mk,v 1.7 2013/11/23 09:10:14 obache Exp $ | 1 | # $NetBSD: curses.builtin.mk,v 1.8 2014/03/09 10:15:32 roy 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_HEADERS_VAR:= H_CURSES | 6 | BUILTIN_FIND_HEADERS_VAR:= H_CURSES | |
7 | BUILTIN_FIND_HEADERS.H_CURSES= curses.h | 7 | BUILTIN_FIND_HEADERS.H_CURSES= curses.h | |
8 | 8 | |||
9 | BUILTIN_FIND_FILES_VAR+= H_CURSES_HALFDELAY | |||
10 | BUILTIN_FIND_FILES.H_CURSES_HALFDELAY= ${BUILTIN_FIND_FILES.H_CURSES} | |||
11 | BUILTIN_FIND_GREP.H_CURSES_HALFDELAY= halfdelay | |||
12 | ||||
13 | BUILTIN_FIND_FILES_VAR+= H_CURSES_RESIZETERM | |||
14 | BUILTIN_FIND_FILES.H_CURSES_RESIZETERM= ${BUILTIN_FIND_FILES.H_CURSES} | |||
15 | BUILTIN_FIND_GREP.H_CURSES_RESIZETERM= resizeterm | |||
16 | ||||
17 | BUILTIN_FIND_FILES_VAR+= H_CURSES_PUTWIN | |||
18 | BUILTIN_FIND_FILES.H_CURSES_PUTWIN= ${BUILTIN_FIND_FILES.H_CURSES} | |||
19 | BUILTIN_FIND_GREP.H_CURSES_PUTWIN= putwin | |||
20 | ||||
21 | BUILTIN_FIND_FILES_VAR+= H_CURSES_WA_NORMAL | |||
22 | BUILTIN_FIND_FILES.H_CURSES_WA_NORMAL= ${BUILTIN_FIND_FILES.H_CURSES} | |||
23 | BUILTIN_FIND_GREP.H_CURSES_WA_NORMAL= WA_NORMAL | |||
24 | ||||
25 | BUILTIN_FIND_FILES_VAR+= H_CURSES_WGETNSTR | |||
26 | BUILTIN_FIND_FILES.H_CURSES_WGETNSTR= ${BUILTIN_FIND_FILES.H_CURSES} | |||
27 | BUILTIN_FIND_GREP.H_CURSES_WGETNSTR= wgetnstr | |||
28 | ||||
29 | BUILTIN_FIND_FILES_VAR+= H_CURSES_WSYNCUP | |||
30 | BUILTIN_FIND_FILES.H_CURSES_WSYNCUP= ${BUILTIN_FIND_FILES.H_CURSES} | |||
31 | BUILTIN_FIND_GREP.H_CURSES_WSYNCUP= wsyncup | |||
32 | ||||
33 | BUILTIN_FIND_FILES_VAR+= H_CURSES_MVWCHGAT | |||
34 | BUILTIN_FIND_FILES.H_CURSES_MVWCHGAT= ${BUILTIN_FIND_FILES.H_CURSES} | |||
35 | BUILTIN_FIND_GREP.H_CURSES_MVWCHGAT= mvwchgat | |||
36 | ||||
9 | .include "buildlink3/bsd.builtin.mk" | 37 | .include "buildlink3/bsd.builtin.mk" | |
10 | 38 | |||
11 | ### | 39 | ### | |
12 | ### Determine if there is a built-in implementation of the package and | 40 | ### Determine if there is a built-in implementation of the package and | |
13 | ### set IS_BUILTIN.<pkg> appropriately ("yes" or "no"). | 41 | ### set IS_BUILTIN.<pkg> appropriately ("yes" or "no"). | |
14 | ### | 42 | ### | |
15 | .if !defined(IS_BUILTIN.curses) | 43 | .if !defined(IS_BUILTIN.curses) | |
16 | IS_BUILTIN.curses= no | 44 | IS_BUILTIN.curses= no | |
17 | . if empty(H_CURSES:M${LOCALBASE}/*) && exists(${H_CURSES}) | 45 | . if empty(H_CURSES:M${LOCALBASE}/*) && exists(${H_CURSES}) | |
18 | IS_BUILTIN.curses= yes | 46 | IS_BUILTIN.curses= yes | |
19 | . endif | 47 | . endif | |
20 | .endif | 48 | .endif | |
21 | MAKEVARS+= IS_BUILTIN.curses | 49 | MAKEVARS+= IS_BUILTIN.curses | |
@@ -34,35 +62,99 @@ USE_BUILTIN.curses= yes | @@ -34,35 +62,99 @@ USE_BUILTIN.curses= yes | |||
34 | . for _dep_ in ${BUILDLINK_API_DEPENDS.curses} | 62 | . for _dep_ in ${BUILDLINK_API_DEPENDS.curses} | |
35 | . if !empty(USE_BUILTIN.curses:M[yY][eE][sS]) | 63 | . if !empty(USE_BUILTIN.curses:M[yY][eE][sS]) | |
36 | USE_BUILTIN.curses!= \ | 64 | USE_BUILTIN.curses!= \ | |
37 | if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.curses:Q}; then \ | 65 | if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.curses:Q}; then \ | |
38 | ${ECHO} yes; \ | 66 | ${ECHO} yes; \ | |
39 | else \ | 67 | else \ | |
40 | ${ECHO} no; \ | 68 | ${ECHO} no; \ | |
41 | fi | 69 | fi | |
42 | . endif | 70 | . endif | |
43 | . endfor | 71 | . endfor | |
44 | . endif | 72 | . endif | |
45 | . endif # PREFER.curses | 73 | . endif # PREFER.curses | |
46 | .endif | 74 | .endif | |
75 | ||||
76 | # If it is set to chgat, a curses implementation with chgat(3) support | |||
77 | # is considered good enough. | |||
78 | .if defined(USE_CURSES) && empty(USE_CURSES:M[yY][eE][sS]) | |||
79 | . if !empty(USE_CURSES:Mchgat) && !empty(H_CURSES_MVWCHGAT:M__nonexistent__) | |||
80 | USE_BUILTIN.curses= no | |||
81 | . endif | |||
82 | # same for halfdelay(3) | |||
83 | . if !empty(USE_CURSES:Mhalfdelay) | |||
84 | . if !empty(H_CURSES_HALFDELAY:M__nonexistent__) | |||
85 | USE_BUILTIN.curses= no | |||
86 | . endif | |||
87 | . endif | |||
88 | ## same for putwin(3) | |||
89 | . if !empty(USE_CURSES:Mputwin) && !empty(H_CURSES_PUTWIN:M__nonexistent__) | |||
90 | USE_BUILTIN.curses= no | |||
91 | . endif | |||
92 | # same for resizeterm(3) | |||
93 | . if !empty(USE_CURSES:Mresizeterm) | |||
94 | . if !empty(H_CURSES_RESIZETERM:M__nonexistent__) | |||
95 | USE_BUILTIN.curses= no | |||
96 | . endif | |||
97 | . endif | |||
98 | ## same for WA_NORMAL | |||
99 | . if !empty(USE_CURSES:MWA_NORMAL) | |||
100 | . if !empty(H_CURSES_WA_NORMAL:M__nonexistent__) | |||
101 | USE_BUILTIN.curses= no | |||
102 | . endif | |||
103 | . endif | |||
104 | ## same for wgetnstr(3) | |||
105 | . if !empty(USE_CURSES:Mwgetnstr) && !empty(H_CURSES_WGETNSTR:M__nonexistent__) | |||
106 | USE_BUILTIN.curses= no | |||
107 | . endif | |||
108 | # same for wsyncup(3) | |||
109 | . if !empty(USE_CURSES:Mwsyncup) && !empty(H_CURSES_WSYNCUP:M__nonexistent__) | |||
110 | USE_BUILTIN.curses= no | |||
111 | . endif | |||
112 | # AFAIK there is no way of working out if a system curses library has wide | |||
113 | # character support. So be safe and say no unless we know for sure. | |||
114 | . if !empty(USE_CURSES:Mwide) | |||
115 | . if ${OPSYS} == "NetBSD" | |||
116 | . if !empty(MACHINE_PLATFORM:MNetBSD-[0-4].*-*) | |||
117 | USE_BUILTIN.curses= no | |||
118 | . endif | |||
119 | . else | |||
120 | USE_BUILTIN.curses= no | |||
121 | . endif | |||
122 | . endif | |||
123 | .endif | |||
124 | ||||
125 | # Even if the package requested tests above pass, | |||
126 | # some system curses just are not good enough. | |||
127 | # If your system is one, add it here so a suitable | |||
128 | # curses from pkgsrc can be installed. | |||
129 | _INCOMPAT_CURSES?= NetBSD-0.*-* NetBSD-1.[0123]*-* \ | |||
130 | NetBSD-1.4.*-* NetBSD-1.4[A-X]-* | |||
131 | .for _pattern_ in ${_INCOMPAT_CURSES} ${INCOMPAT_CURSES} | |||
132 | . if !empty(MACHINE_PLATFORM:M${_pattern_}) | |||
133 | USE_BUILTIN.curses= no | |||
134 | . endif | |||
135 | .endfor | |||
136 | ||||
47 | MAKEVARS+= USE_BUILTIN.curses | 137 | MAKEVARS+= USE_BUILTIN.curses | |
48 | 138 | |||
49 | # Define BUILTIN_LIBNAME.curses to be the base name of the built-in | 139 | # Define BUILTIN_LIBNAME.curses to be the base name of the built-in | |
50 | # curses library. | 140 | # curses library. | |
51 | # | 141 | # | |
52 | .if !empty(BUILTIN_LIB_FOUND.curses:M[yY][eE][sS]) | 142 | .if !empty(BUILTIN_LIB_FOUND.curses:M[yY][eE][sS]) | |
53 | BUILTIN_LIBNAME.curses= curses | 143 | BUILTIN_LIBNAME.curses= curses | |
54 | .endif | 144 | .endif | |
55 | 145 | |||
146 | BUILTIN_LIBNAME.curses= curses | |||
147 | ||||
56 | ### | 148 | ### | |
57 | ### The section below only applies if we are not including this file | 149 | ### The section below only applies if we are not including this file | |
58 | ### solely to determine whether a built-in implementation exists. | 150 | ### solely to determine whether a built-in implementation exists. | |
59 | ### | 151 | ### | |
60 | CHECK_BUILTIN.curses?= no | 152 | CHECK_BUILTIN.curses?= no | |
61 | .if !empty(CHECK_BUILTIN.curses:M[nN][oO]) | 153 | .if !empty(CHECK_BUILTIN.curses:M[nN][oO]) | |
62 | 154 | |||
63 | . if !empty(USE_BUILTIN.curses:M[yY][eE][sS]) | 155 | . if !empty(USE_BUILTIN.curses:M[yY][eE][sS]) | |
64 | . if exists(${H_CURSES}) | 156 | . if exists(${H_CURSES}) | |
65 | BUILDLINK_INCDIRS.curses?= ${H_CURSES:H:S/^${BUILDLINK_PREFIX.curses}\///} | 157 | BUILDLINK_INCDIRS.curses?= ${H_CURSES:H:S/^${BUILDLINK_PREFIX.curses}\///} | |
66 | . endif | 158 | . endif | |
67 | BUILDLINK_LIBNAME.curses= ${BUILTIN_LIBNAME.curses} | 159 | BUILDLINK_LIBNAME.curses= ${BUILTIN_LIBNAME.curses} | |
68 | . endif | 160 | . endif |
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | # $NetBSD: terminfo.buildlink3.mk,v 1.4 2013/11/19 11:43:19 obache Exp $ | 1 | # $NetBSD: terminfo.buildlink3.mk,v 1.5 2014/03/09 10:15:32 roy 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 terminfo implementation instead of one particular one. The available | 4 | # any terminfo implementation instead of one particular one. The available | |
5 | # terminfo implementations are "terminfo" if built-in, "ncurses", and | 5 | # terminfo implementations are "terminfo" 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 | # TERMINFO_DEFAULT | 14 | # TERMINFO_DEFAULT | |
@@ -23,27 +23,27 @@ | @@ -23,27 +23,27 @@ | |||
23 | # | 23 | # | |
24 | # TERMINFO_TYPE | 24 | # TERMINFO_TYPE | |
25 | # The name of the selected terminfo implementation. | 25 | # The name of the selected terminfo implementation. | |
26 | 26 | |||
27 | TERMINFO_BUILDLINK3_MK:= ${TERMINFO_BUILDLINK3_MK}+ | 27 | TERMINFO_BUILDLINK3_MK:= ${TERMINFO_BUILDLINK3_MK}+ | |
28 | .include "bsd.fast.prefs.mk" | 28 | .include "bsd.fast.prefs.mk" | |
29 | 29 | |||
30 | .if !empty(TERMINFO_BUILDLINK3_MK:M+) | 30 | .if !empty(TERMINFO_BUILDLINK3_MK:M+) | |
31 | 31 | |||
32 | # _TERMINFO_PKGS is an exhaustive list of all of the terminfo implementations | 32 | # _TERMINFO_PKGS is an exhaustive list of all of the terminfo implementations | |
33 | # that may be used with terminfo.buildlink3.mk. | 33 | # that may be used with terminfo.buildlink3.mk. | |
34 | # | 34 | # | |
35 | _TERMINFO_PKGS?= terminfo ncurses pdcurses | 35 | _TERMINFO_PKGS?= terminfo ncurses pdcurses | |
36 | _TERMINFO_TYPES?= terminfo tinfo | 36 | _TERMINFO_TYPES?= terminfo tinfo curses ncurses | |
37 | 37 | |||
38 | CHECK_BUILTIN.terminfo:= yes | 38 | CHECK_BUILTIN.terminfo:= yes | |
39 | . include "terminfo.builtin.mk" | 39 | . include "terminfo.builtin.mk" | |
40 | CHECK_BUILTIN.terminfo:= no | 40 | CHECK_BUILTIN.terminfo:= no | |
41 | 41 | |||
42 | # Set the value of TERMINFO_DEFAULT depending on the platform and what's | 42 | # Set the value of TERMINFO_DEFAULT depending on the platform and what's | |
43 | # available in the base system. | 43 | # available in the base system. | |
44 | # | 44 | # | |
45 | .if defined(USE_BUILTIN.terminfo) && !empty(USE_BUILTIN.terminfo:M[yY][eE][sS]) | 45 | .if defined(USE_BUILTIN.terminfo) && !empty(USE_BUILTIN.terminfo:M[yY][eE][sS]) | |
46 | TERMINFO_DEFAULT?= terminfo | 46 | TERMINFO_DEFAULT?= terminfo | |
47 | .else | 47 | .else | |
48 | TERMINFO_DEFAULT?= ncurses | 48 | TERMINFO_DEFAULT?= ncurses | |
49 | .endif | 49 | .endif | |
@@ -63,27 +63,28 @@ TERMINFO_TYPE= none | @@ -63,27 +63,28 @@ TERMINFO_TYPE= none | |||
63 | . endif | 63 | . endif | |
64 | 64 | |||
65 | BUILD_DEFS+= TERMINFO_DEFAULT | 65 | BUILD_DEFS+= TERMINFO_DEFAULT | |
66 | BUILD_DEFS_EFFECTS+= TERMINFO_TYPE | 66 | BUILD_DEFS_EFFECTS+= TERMINFO_TYPE | |
67 | 67 | |||
68 | # Most GNU configure scripts will try finding every terminfo implementation, | 68 | # Most GNU configure scripts will try finding every terminfo implementation, | |
69 | # so prevent them from finding any except for the one we decide upon. | 69 | # so prevent them from finding any except for the one we decide upon. | |
70 | # | 70 | # | |
71 | # There is special handling for packages that can be provided by pkgsrc, | 71 | # There is special handling for packages that can be provided by pkgsrc, | |
72 | # e.g. curses -- see terminfo.builtin.mk for details. | 72 | # e.g. curses -- see terminfo.builtin.mk for details. | |
73 | # | 73 | # | |
74 | .if empty(TERMINFO_TYPE:Mnone) | 74 | .if empty(TERMINFO_TYPE:Mnone) | |
75 | . for _tcap_ in ${_TERMINFO_TYPES} | 75 | . for _tcap_ in ${_TERMINFO_TYPES} | |
76 | . if empty(TERMINFO_TYPE:M${_tcap_}) | 76 | . if empty(TERMINFO_TYPE:M${_tcap_}) \ | |
77 | && (!defined(CURSES_TYPE) || empty(CURSES_TYPE:M${_tcap_})) | |||
77 | BUILDLINK_TRANSFORM+= l:${_tcap_}:${BUILDLINK_LIBNAME.terminfo} | 78 | BUILDLINK_TRANSFORM+= l:${_tcap_}:${BUILDLINK_LIBNAME.terminfo} | |
78 | . endif | 79 | . endif | |
79 | . endfor | 80 | . endfor | |
80 | .endif | 81 | .endif | |
81 | 82 | |||
82 | .endif # TERMINFO_BUILDLINK3_MK | 83 | .endif # TERMINFO_BUILDLINK3_MK | |
83 | 84 | |||
84 | .if ${TERMINFO_TYPE} == "none" | 85 | .if ${TERMINFO_TYPE} == "none" | |
85 | PKG_FAIL_REASON= \ | 86 | PKG_FAIL_REASON= \ | |
86 | "${_TERMINFO_TYPE} is not an acceptable terminfo type for ${PKGNAME}." | 87 | "${_TERMINFO_TYPE} is not an acceptable terminfo type for ${PKGNAME}." | |
87 | .elif ${TERMINFO_TYPE} == "terminfo" | 88 | .elif ${TERMINFO_TYPE} == "terminfo" | |
88 | BUILDLINK_TREE+= terminfo -terminfo | 89 | BUILDLINK_TREE+= terminfo -terminfo | |
89 | BUILDLINK_LIBNAME.terminfo?= ${BUILTIN_LIBNAME.terminfo} | 90 | BUILDLINK_LIBNAME.terminfo?= ${BUILTIN_LIBNAME.terminfo} |