| @@ -1,23 +1,18 @@ | | | @@ -1,23 +1,18 @@ |
1 | # $NetBSD: termcap.builtin.mk,v 1.3 2008/03/05 07:10:26 jlam Exp $ | | 1 | # $NetBSD: termcap.builtin.mk,v 1.4 2008/03/05 16:23:52 jlam Exp $ |
2 | | | 2 | |
3 | BUILTIN_PKG:= termcap | | 3 | BUILTIN_PKG:= termcap |
4 | | | 4 | |
5 | # _TERMCAP_TYPES is an exhaustive list of all of the termcap implementations | | 5 | BUILTIN_FIND_LIBS:= curses termcap termlib tinfo |
6 | # that may be found. | | | |
7 | # | | | |
8 | _TERMCAP_TYPES?= curses termcap termlib tinfo | | | |
9 | | | | |
10 | BUILTIN_FIND_LIBS:= ${_TERMCAP_TYPES} | | | |
11 | | | 6 | |
12 | .include "buildlink3/bsd.builtin.mk" | | 7 | .include "buildlink3/bsd.builtin.mk" |
13 | | | 8 | |
14 | ### | | 9 | ### |
15 | ### 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 |
16 | ### set IS_BUILTIN.<pkg> appropriately ("yes" or "no"). | | 11 | ### set IS_BUILTIN.<pkg> appropriately ("yes" or "no"). |
17 | ### | | 12 | ### |
18 | .if !defined(IS_BUILTIN.termcap) | | 13 | .if !defined(IS_BUILTIN.termcap) |
19 | IS_BUILTIN.termcap= no | | 14 | IS_BUILTIN.termcap= no |
20 | . if !empty(BUILTIN_LIB_FOUND.curses:M[yY][eE][sS]) || \ | | 15 | . if !empty(BUILTIN_LIB_FOUND.curses:M[yY][eE][sS]) || \ |
21 | !empty(BUILTIN_LIB_FOUND.termcap:M[yY][eE][sS]) || \ | | 16 | !empty(BUILTIN_LIB_FOUND.termcap:M[yY][eE][sS]) || \ |
22 | !empty(BUILTIN_LIB_FOUND.termlib:M[yY][eE][sS]) || \ | | 17 | !empty(BUILTIN_LIB_FOUND.termlib:M[yY][eE][sS]) || \ |
23 | !empty(BUILTIN_LIB_FOUND.tinfo:M[yY][eE][sS]) | | 18 | !empty(BUILTIN_LIB_FOUND.tinfo:M[yY][eE][sS]) |
| @@ -48,55 +43,35 @@ MAKEVARS+= USE_BUILTIN.termcap | | | @@ -48,55 +43,35 @@ MAKEVARS+= USE_BUILTIN.termcap |
48 | # XXX symbols in libraries, we'll need to be clever with looking at | | 43 | # XXX symbols in libraries, we'll need to be clever with looking at |
49 | # XXX headers. | | 44 | # XXX headers. |
50 | # | | 45 | # |
51 | .if !empty(BUILTIN_LIB_FOUND.termcap:M[yY][eE][sS]) | | 46 | .if !empty(BUILTIN_LIB_FOUND.termcap:M[yY][eE][sS]) |
52 | BUILTIN_LIBNAME.termcap= termcap | | 47 | BUILTIN_LIBNAME.termcap= termcap |
53 | .elif !empty(BUILTIN_LIB_FOUND.tinfo:M[yY][eE][sS]) | | 48 | .elif !empty(BUILTIN_LIB_FOUND.tinfo:M[yY][eE][sS]) |
54 | BUILTIN_LIBNAME.termcap= tinfo | | 49 | BUILTIN_LIBNAME.termcap= tinfo |
55 | .elif !empty(BUILTIN_LIB_FOUND.curses:M[yY][eE][sS]) | | 50 | .elif !empty(BUILTIN_LIB_FOUND.curses:M[yY][eE][sS]) |
56 | BUILTIN_LIBNAME.termcap= curses | | 51 | BUILTIN_LIBNAME.termcap= curses |
57 | .elif !empty(BUILTIN_LIB_FOUND.termlib:M[yY][eE][sS]) | | 52 | .elif !empty(BUILTIN_LIB_FOUND.termlib:M[yY][eE][sS]) |
58 | BUILTIN_LIBNAME.termcap= termlib | | 53 | BUILTIN_LIBNAME.termcap= termlib |
59 | .endif | | 54 | .endif |
60 | | | 55 | |
61 | .if !empty(USE_BUILTIN.termcap:M[yY][eE][sS]) | | | |
62 | . if defined(BUILTIN_LIBNAME.termcap) | | | |
63 | TERMCAP_TYPE= ${BUILTIN_LIBNAME.termcap} | | | |
64 | . else | | | |
65 | TERMCAP_TYPE= none | | | |
66 | . endif | | | |
67 | .else | | | |
68 | TERMCAP_TYPE= curses # pkgsrc termcap is curses | | | |
69 | .endif | | | |
70 | BUILD_DEFS+= TERMCAP_TYPE | | | |
71 | | | | |
72 | ### | | 56 | ### |
73 | ### 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 |
74 | ### solely to determine whether a built-in implementation exists. | | 58 | ### solely to determine whether a built-in implementation exists. |
75 | ### | | 59 | ### |
76 | CHECK_BUILTIN.termcap?= no | | 60 | CHECK_BUILTIN.termcap?= no |
77 | .if !empty(CHECK_BUILTIN.termcap:M[nN][oO]) | | 61 | .if !empty(CHECK_BUILTIN.termcap:M[nN][oO]) |
78 | | | 62 | |
79 | . if !empty(USE_BUILTIN.termcap:M[yY][eE][sS]) | | 63 | . if !empty(USE_BUILTIN.termcap:M[yY][eE][sS]) |
80 | BUILDLINK_LIBNAME.termcap= ${BUILTIN_LIBNAME.termcap} | | 64 | BUILDLINK_LIBNAME.termcap= ${BUILTIN_LIBNAME.termcap} |
81 | . endif | | 65 | . endif |
82 | | | 66 | |
83 | # Most GNU configure scripts will try finding every termcap implementation, | | 67 | # If the package wants both "termcap" and "curses", then we must not |
84 | # so prevent them from finding any except for the one we decide upon. | | 68 | # remove the -l options for the curses libraries; otherwise, we should |
85 | # | | 69 | # remove them as GNU configure scripts commonly check for one or both |
86 | # There is special handling here for packages that can be provided by | | 70 | # of those library options. |
87 | # pkgsrc, e.g. curses. In case we need both that package as well as | | | |
88 | # termcap, we must not remove the -l options for that package's libraries. | | | |
89 | # | | 71 | # |
90 | . for _tcap_ in ${_TERMCAP_TYPES:Ntermcap:Ncurses} | | 72 | . if empty(BUILDLINK_PACKAGES:Mcurses) && empty(BUILDLINK_PACKAGES:Mncurses) |
91 | . if empty(TERMCAP_TYPE:M${_tcap_}) | | | |
92 | BUILDLINK_TRANSFORM+= rm:-l${_tcap_} | | | |
93 | . endif | | | |
94 | . endfor | | | |
95 | . if empty(TERMCAP_TYPE:Mcurses) && \ | | | |
96 | empty(BUILDLINK_PACKAGES:Mcurses) && empty(BUILDLINK_PACKAGES:Mncurses) | | | |
97 | BUILDLINK_TRANSFORM+= rm:-lcurses | | 73 | BUILDLINK_TRANSFORM+= rm:-lcurses |
98 | BUILDLINK_TRANSFORM+= rm:-lncurses | | 74 | BUILDLINK_TRANSFORM+= rm:-lncurses |
99 | . endif | | 75 | . endif |
100 | BUILDLINK_TRANSFORM+= l:termcap:${BUILDLINK_LIBNAME.termcap} | | | |
101 | | | 76 | |
102 | .endif # CHECK_BUILTIN.termcap | | 77 | .endif # CHECK_BUILTIN.termcap |