| @@ -1,23 +1,23 @@ | | | @@ -1,23 +1,23 @@ |
1 | # $NetBSD: builtin.mk,v 1.6 2008/02/22 13:48:21 tron Exp $ | | 1 | # $NetBSD: builtin.mk,v 1.7 2008/02/29 19:23:07 jlam Exp $ |
2 | | | 2 | |
3 | BUILTIN_PKG:= ncursesw | | 3 | BUILTIN_PKG:= ncursesw |
4 | | | 4 | |
5 | # H_NB_CURSESW searches for NetBSD's <curses.h> that uses HAVE_WCHAR to | | 5 | # H_NB_CURSESW searches for NetBSD's <curses.h> that uses HAVE_WCHAR to |
6 | # build with wide curses support. | | 6 | # build with wide curses support. |
7 | # | | 7 | # |
8 | # XXX Need to deal with Solaris <curses.h> | | 8 | # XXX Need to deal with Solaris <curses.h> |
9 | # | | 9 | # |
10 | BUILTIN_FIND_LIBS:= ncursesw | | 10 | BUILTIN_FIND_LIBS:= ncursesw curses |
11 | BUILTIN_FIND_FILES_VAR:= H_NB_CURSESW H_NCURSESW | | 11 | BUILTIN_FIND_FILES_VAR:= H_NB_CURSESW H_NCURSESW |
12 | BUILTIN_FIND_FILES.H_NB_CURSESW= /usr/include/curses.h | | 12 | BUILTIN_FIND_FILES.H_NB_CURSESW= /usr/include/curses.h |
13 | BUILTIN_FIND_GREP.H_NB_CURSESW= \#ifdef[ ]*HAVE_WCHAR | | 13 | BUILTIN_FIND_GREP.H_NB_CURSESW= \#ifdef[ ]*HAVE_WCHAR |
14 | BUILTIN_FIND_FILES.H_NCURSESW= /usr/include/ncursesw/curses.h \ | | 14 | BUILTIN_FIND_FILES.H_NCURSESW= /usr/include/ncursesw/curses.h \ |
15 | /usr/include/curses.h | | 15 | /usr/include/curses.h |
16 | BUILTIN_FIND_GREP.H_NCURSESW= \Id: curses.wide,v | | 16 | BUILTIN_FIND_GREP.H_NCURSESW= \Id: curses.wide,v |
17 | | | 17 | |
18 | .include "../../mk/buildlink3/bsd.builtin.mk" | | 18 | .include "../../mk/buildlink3/bsd.builtin.mk" |
19 | | | 19 | |
20 | ### | | 20 | ### |
21 | ### Determine if there is a built-in implementation of the package and | | 21 | ### Determine if there is a built-in implementation of the package and |
22 | ### set IS_BUILTIN.<pkg> appropriately ("yes" or "no"). | | 22 | ### set IS_BUILTIN.<pkg> appropriately ("yes" or "no"). |
23 | ### | | 23 | ### |
| @@ -84,37 +84,45 @@ USE_BUILTIN.ncursesw!= \ | | | @@ -84,37 +84,45 @@ USE_BUILTIN.ncursesw!= \ |
84 | USE_BUILTIN.ncursesw= yes | | 84 | USE_BUILTIN.ncursesw= yes |
85 | . endif | | 85 | . endif |
86 | . endif # PREFER.ncursesw | | 86 | . endif # PREFER.ncursesw |
87 | .endif | | 87 | .endif |
88 | MAKEVARS+= USE_BUILTIN.ncursesw | | 88 | MAKEVARS+= USE_BUILTIN.ncursesw |
89 | | | 89 | |
90 | # If USE_NCURSES is defined, then only use the built-in "ncursesw" | | 90 | # If USE_NCURSES is defined, then only use the built-in "ncursesw" |
91 | # if it's *actually* ncursesw. | | 91 | # if it's *actually* ncursesw. |
92 | # | | 92 | # |
93 | .if defined(USE_NCURSES) && !empty(IS_BUILTIN.ncursesw:M[nN][oO]) | | 93 | .if defined(USE_NCURSES) && !empty(IS_BUILTIN.ncursesw:M[nN][oO]) |
94 | USE_BUILTIN.ncursesw= no | | 94 | USE_BUILTIN.ncursesw= no |
95 | .endif | | 95 | .endif |
96 | | | 96 | |
| | | 97 | # Define BUILTIN_LIBNAME.ncursesw to be the base name of the built-in |
| | | 98 | # ncursesw library. |
| | | 99 | # |
| | | 100 | .if !empty(BUILTIN_LIB_FOUND.ncursesw:M[yY][eE][sS]) |
| | | 101 | BUILTIN_LIBNAME.ncursesw= ncursesw |
| | | 102 | .elif !empty(BUILTIN_LIB_FOUND.curses:M[yY][eE][sS]) |
| | | 103 | BUILTIN_LIBNAME.ncursesw= curses |
| | | 104 | .endif |
| | | 105 | |
97 | ### | | 106 | ### |
98 | ### The section below only applies if we are not including this file | | 107 | ### The section below only applies if we are not including this file |
99 | ### solely to determine whether a built-in implementation exists. | | 108 | ### solely to determine whether a built-in implementation exists. |
100 | ### | | 109 | ### |
101 | CHECK_BUILTIN.ncursesw?= no | | 110 | CHECK_BUILTIN.ncursesw?= no |
102 | .if !empty(CHECK_BUILTIN.ncursesw:M[nN][oO]) | | 111 | .if !empty(CHECK_BUILTIN.ncursesw:M[nN][oO]) |
103 | | | 112 | |
104 | . if !empty(USE_BUILTIN.ncursesw:M[yY][eE][sS]) | | 113 | . if !empty(USE_BUILTIN.ncursesw:M[yY][eE][sS]) |
105 | . if !empty(BUILTIN_LIB_FOUND.ncursesw:M[nN][oO]) | | 114 | BUILDLINK_LIBNAME.ncursesw= ${BUILTIN_LIBNAME.ncursesw} |
106 | BUILDLINK_TRANSFORM+= l:ncursesw:curses | | 115 | BUILDLINK_TRANSFORM+= l:ncursesw:${BUILTIN_LIBNAME.ncursesw} |
107 | . endif | | | |
108 | . if empty(H_NB_CURSESW:M__nonexistent__) && \ | | 116 | . if empty(H_NB_CURSESW:M__nonexistent__) && \ |
109 | empty(H_NB_CURSESW:M${LOCALBASE}/*) | | 117 | empty(H_NB_CURSESW:M${LOCALBASE}/*) |
110 | BUILDLINK_CPPFLAGS.ncursesw+= -DHAVE_WCHAR=1 | | 118 | BUILDLINK_CPPFLAGS.ncursesw+= -DHAVE_WCHAR=1 |
111 | . endif | | 119 | . endif |
112 | . endif | | 120 | . endif |
113 | | | 121 | |
114 | # According to the ncurses(3) manual page, applications that want to use | | 122 | # According to the ncurses(3) manual page, applications that want to use |
115 | # the wide curses definitions need to define _XOPEN_SOURCE_EXTENDED. | | 123 | # the wide curses definitions need to define _XOPEN_SOURCE_EXTENDED. |
116 | # | | 124 | # |
117 | . if !empty(USE_BUILTIN.ncursesw:M[nN][oO]) || \ | | 125 | . if !empty(USE_BUILTIN.ncursesw:M[nN][oO]) || \ |
118 | (!empty(USE_BUILTIN.ncursesw:M[yY][eE][sS]) && \ | | 126 | (!empty(USE_BUILTIN.ncursesw:M[yY][eE][sS]) && \ |
119 | !empty(IS_BUILTIN.ncursesw:M[yY][eE][sS])) | | 127 | !empty(IS_BUILTIN.ncursesw:M[yY][eE][sS])) |
120 | USE_NCURSES= yes | | 128 | USE_NCURSES= yes |