| @@ -1,134 +1,134 @@ | | | @@ -1,134 +1,134 @@ |
1 | # $NetBSD: curses.builtin.mk,v 1.20 2019/06/17 18:19:55 sjmulder Exp $ | | 1 | # $NetBSD: curses.builtin.mk,v 1.21 2022/06/06 01:24:11 gutteridge 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 | # Functions and defines to search for. | | 9 | # Functions and defines to search for. |
10 | # These are valid USE_CURSES options and will determine whether the | | 10 | # These are valid USE_CURSES options and will determine whether the |
11 | # package can use the builtin curses or not. | | 11 | # package can use the built-in curses or not. |
12 | # | | 12 | # |
13 | BUILTIN_TEST_CURSES_FUNCS= chgat getsyx halfdelay putwin | | 13 | BUILTIN_TEST_CURSES_FUNCS= chgat getsyx halfdelay putwin |
14 | BUILTIN_TEST_CURSES_FUNCS+= resize_term resizeterm ripoffline set_escdelay syncok | | 14 | BUILTIN_TEST_CURSES_FUNCS+= resize_term resizeterm ripoffline set_escdelay syncok |
15 | BUILTIN_TEST_CURSES_FUNCS+= wgetnstr wsyncup mvwchgat vw_printw | | 15 | BUILTIN_TEST_CURSES_FUNCS+= wgetnstr wsyncup mvwchgat vw_printw |
16 | BUILTIN_TEST_CURSES_FUNCS+= getmouse | | 16 | BUILTIN_TEST_CURSES_FUNCS+= getmouse |
17 | BUILTIN_TEST_CURSES_DEFINES= WA_NORMAL | | 17 | BUILTIN_TEST_CURSES_DEFINES= WA_NORMAL |
18 | | | 18 | |
19 | .for func in ${BUILTIN_TEST_CURSES_FUNCS} | | 19 | .for func in ${BUILTIN_TEST_CURSES_FUNCS} |
20 | BUILTIN_FIND_FILES_VAR+= H_CURSES_${func:tu} | | 20 | BUILTIN_FIND_FILES_VAR+= H_CURSES_${func:tu} |
21 | BUILTIN_FIND_FILES.H_CURSES_${func:tu}= ${H_CURSES} | | 21 | BUILTIN_FIND_FILES.H_CURSES_${func:tu}= ${H_CURSES} |
22 | BUILTIN_FIND_GREP.H_CURSES_${func:tu}= ${func} | | 22 | BUILTIN_FIND_GREP.H_CURSES_${func:tu}= ${func} |
23 | .endfor | | 23 | .endfor |
24 | | | 24 | |
25 | .for defn in ${BUILTIN_TEST_CURSES_DEFINES} | | 25 | .for defn in ${BUILTIN_TEST_CURSES_DEFINES} |
26 | BUILTIN_FIND_FILES_VAR+= H_CURSES_${defn} | | 26 | BUILTIN_FIND_FILES_VAR+= H_CURSES_${defn} |
27 | BUILTIN_FIND_FILES.H_CURSES_${defn}= ${H_CURSES} | | 27 | BUILTIN_FIND_FILES.H_CURSES_${defn}= ${H_CURSES} |
28 | BUILTIN_FIND_GREP.H_CURSES_${defn}= ${defn} | | 28 | BUILTIN_FIND_GREP.H_CURSES_${defn}= ${defn} |
29 | .endfor | | 29 | .endfor |
30 | | | 30 | |
31 | .include "buildlink3/bsd.builtin.mk" | | 31 | .include "buildlink3/bsd.builtin.mk" |
32 | | | 32 | |
33 | ### | | 33 | ### |
34 | ### Determine if there is a built-in implementation of the package and | | 34 | ### Determine if there is a built-in implementation of the package and |
35 | ### set IS_BUILTIN.<pkg> appropriately ("yes" or "no"). | | 35 | ### set IS_BUILTIN.<pkg> appropriately ("yes" or "no"). |
36 | ### | | 36 | ### |
37 | .if !defined(IS_BUILTIN.curses) | | 37 | .if !defined(IS_BUILTIN.curses) |
38 | IS_BUILTIN.curses= no | | 38 | IS_BUILTIN.curses= no |
39 | . if empty(H_CURSES:M${LOCALBASE}/*) && exists(${H_CURSES}) | | 39 | . if empty(H_CURSES:M${LOCALBASE}/*) && exists(${H_CURSES}) |
40 | IS_BUILTIN.curses= yes | | 40 | IS_BUILTIN.curses= yes |
41 | . endif | | 41 | . endif |
42 | .endif | | 42 | .endif |
43 | MAKEVARS+= IS_BUILTIN.curses | | 43 | MAKEVARS+= IS_BUILTIN.curses |
44 | | | 44 | |
45 | ### | | 45 | ### |
46 | ### Determine whether we should use the built-in implementation if it | | 46 | ### Determine whether we should use the built-in implementation if it |
47 | ### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no"). | | 47 | ### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no"). |
48 | ### | | 48 | ### |
49 | .if !defined(USE_BUILTIN.curses) | | 49 | .if !defined(USE_BUILTIN.curses) |
50 | . if ${PREFER.curses} == "pkgsrc" | | 50 | . if ${PREFER.curses} == "pkgsrc" |
51 | USE_BUILTIN.curses= no | | 51 | USE_BUILTIN.curses= no |
52 | . else | | 52 | . else |
53 | USE_BUILTIN.curses= ${IS_BUILTIN.curses} | | 53 | USE_BUILTIN.curses= ${IS_BUILTIN.curses} |
54 | . if defined(BUILTIN_PKG.curses) && !empty(IS_BUILTIN.curses:M[yY][eE][sS]) | | 54 | . if defined(BUILTIN_PKG.curses) && !empty(IS_BUILTIN.curses:M[yY][eE][sS]) |
55 | USE_BUILTIN.curses= yes | | 55 | USE_BUILTIN.curses= yes |
56 | . for _dep_ in ${BUILDLINK_API_DEPENDS.curses} | | 56 | . for _dep_ in ${BUILDLINK_API_DEPENDS.curses} |
57 | . if !empty(USE_BUILTIN.curses:M[yY][eE][sS]) | | 57 | . if !empty(USE_BUILTIN.curses:M[yY][eE][sS]) |
58 | USE_BUILTIN.curses!= \ | | 58 | USE_BUILTIN.curses!= \ |
59 | if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.curses:Q}; then \ | | 59 | if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.curses:Q}; then \ |
60 | ${ECHO} yes; \ | | 60 | ${ECHO} yes; \ |
61 | else \ | | 61 | else \ |
62 | ${ECHO} no; \ | | 62 | ${ECHO} no; \ |
63 | fi | | 63 | fi |
64 | . endif | | 64 | . endif |
65 | . endfor | | 65 | . endfor |
66 | . endif | | 66 | . endif |
67 | . endif # PREFER.curses | | 67 | . endif # PREFER.curses |
68 | .endif | | 68 | .endif |
69 | | | 69 | |
70 | # If it is set to chgat, a curses implementation with chgat(3) support | | 70 | # If it is set to chgat, a curses implementation with chgat(3) support |
71 | # is considered good enough. | | 71 | # is considered good enough. |
72 | .if defined(USE_CURSES) && empty(USE_CURSES:M[yY][eE][sS]) | | 72 | .if defined(USE_CURSES) && empty(USE_CURSES:M[yY][eE][sS]) |
73 | . for func in ${BUILTIN_TEST_CURSES_FUNCS} | | 73 | . for func in ${BUILTIN_TEST_CURSES_FUNCS} |
74 | . if !empty(USE_CURSES:M${func}) && \ | | 74 | . if !empty(USE_CURSES:M${func}) && \ |
75 | !empty(H_CURSES_${func:tu}:M__nonexistent__) | | 75 | !empty(H_CURSES_${func:tu}:M__nonexistent__) |
76 | USE_BUILTIN.curses= no | | 76 | USE_BUILTIN.curses= no |
77 | . endif | | 77 | . endif |
78 | . endfor | | 78 | . endfor |
79 | . for defn in ${BUILTIN_TEST_CURSES_DEFINES} | | 79 | . for defn in ${BUILTIN_TEST_CURSES_DEFINES} |
80 | . if !empty(USE_CURSES:M${defn}) && \ | | 80 | . if !empty(USE_CURSES:M${defn}) && \ |
81 | !empty(H_CURSES_${defn}:M__nonexistent__) | | 81 | !empty(H_CURSES_${defn}:M__nonexistent__) |
82 | USE_BUILTIN.curses= no | | 82 | USE_BUILTIN.curses= no |
83 | . endif | | 83 | . endif |
84 | . endfor | | 84 | . endfor |
85 | # AFAIK there is no way of working out if a system curses library has wide | | 85 | # AFAIK there is no way of working out if a system curses library has wide |
86 | # character support. So be safe and say no unless we know for sure. | | 86 | # character support. So be safe and say no unless we know for sure. |
87 | . if !empty(USE_CURSES:Mwide) | | 87 | . if !empty(USE_CURSES:Mwide) |
88 | . if ${OPSYS} == "NetBSD" | | 88 | . if ${OPSYS} == "NetBSD" |
89 | . if !empty(MACHINE_PLATFORM:MNetBSD-[0-4].*-*) | | 89 | . if !empty(MACHINE_PLATFORM:MNetBSD-[0-4].*-*) |
90 | USE_BUILTIN.curses= no | | 90 | USE_BUILTIN.curses= no |
91 | . endif | | 91 | . endif |
92 | . else | | 92 | . else |
93 | USE_BUILTIN.curses= no | | 93 | USE_BUILTIN.curses= no |
94 | . endif | | 94 | . endif |
95 | . endif | | 95 | . endif |
96 | .endif | | 96 | .endif |
97 | | | 97 | |
98 | # Even if the package requested tests above pass, | | 98 | # Even if the package requested tests above pass, |
99 | # some system curses just are not good enough. | | 99 | # some system curses just are not good enough. |
100 | # If your system is one, add it here so a suitable | | 100 | # If your system is one, add it here so a suitable |
101 | # curses from pkgsrc can be installed. | | 101 | # curses from pkgsrc can be installed. |
102 | _INCOMPAT_CURSES?= | | 102 | _INCOMPAT_CURSES?= |
103 | .for _pattern_ in ${_INCOMPAT_CURSES} ${INCOMPAT_CURSES} | | 103 | .for _pattern_ in ${_INCOMPAT_CURSES} ${INCOMPAT_CURSES} |
104 | . if !empty(MACHINE_PLATFORM:M${_pattern_}) | | 104 | . if !empty(MACHINE_PLATFORM:M${_pattern_}) |
105 | USE_BUILTIN.curses= no | | 105 | USE_BUILTIN.curses= no |
106 | . endif | | 106 | . endif |
107 | .endfor | | 107 | .endfor |
108 | | | 108 | |
109 | MAKEVARS+= USE_BUILTIN.curses | | 109 | MAKEVARS+= USE_BUILTIN.curses |
110 | | | 110 | |
111 | # Define BUILTIN_LIBNAME.curses to be the base name of the built-in | | 111 | # Define BUILTIN_LIBNAME.curses to be the base name of the built-in |
112 | # curses library. | | 112 | # curses library. |
113 | # | | 113 | # |
114 | .if !empty(BUILTIN_LIB_FOUND.curses:M[yY][eE][sS]) | | 114 | .if !empty(BUILTIN_LIB_FOUND.curses:M[yY][eE][sS]) |
115 | BUILTIN_LIBNAME.curses= curses | | 115 | BUILTIN_LIBNAME.curses= curses |
116 | .endif | | 116 | .endif |
117 | | | 117 | |
118 | BUILTIN_LIBNAME.curses= curses | | 118 | BUILTIN_LIBNAME.curses= curses |
119 | | | 119 | |
120 | ### | | 120 | ### |
121 | ### 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 |
122 | ### solely to determine whether a built-in implementation exists. | | 122 | ### solely to determine whether a built-in implementation exists. |
123 | ### | | 123 | ### |
124 | CHECK_BUILTIN.curses?= no | | 124 | CHECK_BUILTIN.curses?= no |
125 | .if !empty(CHECK_BUILTIN.curses:M[nN][oO]) | | 125 | .if !empty(CHECK_BUILTIN.curses:M[nN][oO]) |
126 | | | 126 | |
127 | . if !empty(USE_BUILTIN.curses:M[yY][eE][sS]) | | 127 | . if !empty(USE_BUILTIN.curses:M[yY][eE][sS]) |
128 | . if exists(${H_CURSES}) | | 128 | . if exists(${H_CURSES}) |
129 | BUILDLINK_INCDIRS.curses?= ${H_CURSES:H} | | 129 | BUILDLINK_INCDIRS.curses?= ${H_CURSES:H} |
130 | . endif | | 130 | . endif |
131 | BUILDLINK_LIBNAME.curses= ${BUILTIN_LIBNAME.curses} | | 131 | BUILDLINK_LIBNAME.curses= ${BUILTIN_LIBNAME.curses} |
132 | . endif | | 132 | . endif |
133 | | | 133 | |
134 | .endif # CHECK_BUILTIN.curses | | 134 | .endif # CHECK_BUILTIN.curses |