| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | # $NetBSD: builtin.mk,v 1.21 2008/02/29 16:04:55 tron Exp $ | | 1 | # $NetBSD: builtin.mk,v 1.22 2008/02/29 16:14:09 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"). |
| @@ -93,50 +93,51 @@ MAKEVARS+= USE_BUILTIN.ncurses | | | @@ -93,50 +93,51 @@ 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 base name of the built-in | | 103 | # Define BUILTIN_LIBNAME.ncurses to be the base name of the built-in |
104 | # ncurses library. | | 104 | # ncurses library. |
105 | # | | 105 | # |
| | | 106 | BUILTIN_LIBNAME.ncurses= ncurses |
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]) |
108 | BUILTIN_LIBNAME.ncurses= curses | | 109 | BUILTIN_LIBNAME.ncurses= curses |
109 | .endif | | 110 | .endif |
110 | # | | 111 | # |
111 | # On Interix, there is a libncurses.a and a libcurses.so but strangely, | | 112 | # On Interix, there is a libncurses.a and a libcurses.so but strangely, |
112 | # no libncurses.so. We want to link against the shared library, so | | 113 | # no libncurses.so. We want to link against the shared library, so |
113 | # turn "-lncurses" into "-lcurses". | | 114 | # turn "-lncurses" into "-lcurses". |
114 | # | | 115 | # |
115 | .if (${OPSYS} == "Interix") && \ | | 116 | .if (${OPSYS} == "Interix") && \ |
116 | !empty(BUILTIN_LIB_FOUND.curses:M[yY][eE][sS]) | | 117 | !empty(BUILTIN_LIB_FOUND.curses:M[yY][eE][sS]) |
117 | BUILTIN_LIBNAME.ncurses= curses | | 118 | BUILTIN_LIBNAME.ncurses= curses |
118 | .endif | | 119 | .endif |
119 | | | 120 | |
120 | ### | | 121 | ### |
121 | ### The section below only applies if we are not including this file | | 122 | ### The section below only applies if we are not including this file |
122 | ### solely to determine whether a built-in implementation exists. | | 123 | ### solely to determine whether a built-in implementation exists. |
123 | ### | | 124 | ### |
124 | CHECK_BUILTIN.ncurses?= no | | 125 | CHECK_BUILTIN.ncurses?= no |
125 | .if !empty(CHECK_BUILTIN.ncurses:M[nN][oO]) | | 126 | .if !empty(CHECK_BUILTIN.ncurses:M[nN][oO]) |
126 | | | 127 | |
127 | BUILDLINK_TRANSFORM+= l:ncurses:${BUILDLINK_LIBNAME.ncurses} | | | |
128 | . 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} | | 129 | BUILDLINK_LIBNAME.ncurses= ${BUILTIN_LIBNAME.ncurses} |
| | | 130 | BUILDLINK_TRANSFORM+= l:ncurses:${BUILTIN_LIBNAME.ncurses} |
130 | BUILDLINK_TARGETS+= buildlink-curses-ncurses-h | | 131 | BUILDLINK_TARGETS+= buildlink-curses-ncurses-h |
131 | BUILDLINK_TARGETS+= buildlink-ncurses-extra-includes | | 132 | BUILDLINK_TARGETS+= buildlink-ncurses-extra-includes |
132 | . endif | | 133 | . endif |
133 | | | 134 | |
134 | # A full ncurses implementation provides more headers than some curses | | 135 | # A full ncurses implementation provides more headers than some curses |
135 | # implementations. Touch empty replacements for those headers so that | | 136 | # implementations. Touch empty replacements for those headers so that |
136 | # packages can continue to use the familiar ncurses header names. | | 137 | # packages can continue to use the familiar ncurses header names. |
137 | # | | 138 | # |
138 | . if !target(buildlink-ncurses-extra-includes) | | 139 | . if !target(buildlink-ncurses-extra-includes) |
139 | .PHONY: buildlink-ncurses-extra-includes | | 140 | .PHONY: buildlink-ncurses-extra-includes |
140 | buildlink-ncurses-extra-includes: | | 141 | buildlink-ncurses-extra-includes: |
141 | ${RUN} \ | | 142 | ${RUN} \ |
142 | extra_includes="include/term.h"; \ | | 143 | extra_includes="include/term.h"; \ |