| @@ -1,52 +1,55 @@ | | | @@ -1,52 +1,55 @@ |
1 | # $NetBSD: termlib.builtin.mk,v 1.2 2008/02/27 15:26:34 jlam Exp $ | | 1 | # $NetBSD: termlib.builtin.mk,v 1.3 2008/02/27 17:36:34 jlam Exp $ |
2 | | | 2 | |
3 | BUILTIN_PKG:= termlib | | 3 | BUILTIN_PKG:= termlib |
4 | | | 4 | |
5 | BUILTIN_FIND_LIBS:= termcap curses | | 5 | BUILTIN_FIND_LIBS:= termcap tinfo curses |
6 | | | 6 | |
7 | .include "buildlink3/bsd.builtin.mk" | | 7 | .include "buildlink3/bsd.builtin.mk" |
8 | | | 8 | |
9 | ### | | 9 | ### |
10 | ### 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 |
11 | ### set IS_BUILTIN.<pkg> appropriately ("yes" or "no"). | | 11 | ### set IS_BUILTIN.<pkg> appropriately ("yes" or "no"). |
12 | ### | | 12 | ### |
13 | .if !defined(IS_BUILTIN.termlib) | | 13 | .if !defined(IS_BUILTIN.termlib) |
14 | IS_BUILTIN.termlib= no | | 14 | IS_BUILTIN.termlib= no |
15 | . if !empty(BUILTIN_LIB_FOUND.termcap:M[yY][eE][sS]) || \ | | 15 | . if !empty(BUILTIN_LIB_FOUND.termcap:M[yY][eE][sS]) || \ |
| | | 16 | !empty(BUILTIN_LIB_FOUND.tinfo:M[yY][eE][sS]) || \ |
16 | !empty(BUILTIN_LIB_FOUND.curses:M[yY][eE][sS]) | | 17 | !empty(BUILTIN_LIB_FOUND.curses:M[yY][eE][sS]) |
17 | IS_BUILTIN.termlib= yes | | 18 | IS_BUILTIN.termlib= yes |
18 | . endif | | 19 | . endif |
19 | .endif | | 20 | .endif |
20 | MAKEVARS+= IS_BUILTIN.termlib | | 21 | MAKEVARS+= IS_BUILTIN.termlib |
21 | | | 22 | |
22 | ### | | 23 | ### |
23 | ### Determine whether we should use the built-in implementation if it | | 24 | ### Determine whether we should use the built-in implementation if it |
24 | ### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no"). | | 25 | ### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no"). |
25 | ### | | 26 | ### |
26 | .if !defined(USE_BUILTIN.termlib) | | 27 | .if !defined(USE_BUILTIN.termlib) |
27 | . if ${PREFER.termlib} == "pkgsrc" | | 28 | . if ${PREFER.termlib} == "pkgsrc" |
28 | USE_BUILTIN.termlib= no | | 29 | USE_BUILTIN.termlib= no |
29 | . else | | 30 | . else |
30 | USE_BUILTIN.termlib= ${IS_BUILTIN.termlib} | | 31 | USE_BUILTIN.termlib= ${IS_BUILTIN.termlib} |
31 | . endif # PREFER.termlib | | 32 | . endif # PREFER.termlib |
32 | .endif | | 33 | .endif |
33 | MAKEVARS+= USE_BUILTIN.termlib | | 34 | MAKEVARS+= USE_BUILTIN.termlib |
34 | | | 35 | |
35 | # Define BUILTIN_LIBNAME.termlib to be the base name of the built-in | | 36 | # Define BUILTIN_LIBNAME.termlib to be the base name of the built-in |
36 | # terminal library. | | 37 | # terminal library. |
37 | # | | 38 | # |
38 | .if !empty(BUILTIN_LIB_FOUND.termcap:M[yY][eE][sS]) | | 39 | .if !empty(BUILTIN_LIB_FOUND.termcap:M[yY][eE][sS]) |
39 | BUILTIN_LIBNAME.termlib= termcap | | 40 | BUILTIN_LIBNAME.termlib= termcap |
| | | 41 | .elif !empty(BUILTIN_LIB_FOUND.tinfo:M[yY][eE][sS]) |
| | | 42 | BUILTIN_LIBNAME.termlib= tinfo |
40 | .elif !empty(BUILTIN_LIB_FOUND.curses:M[yY][eE][sS]) | | 43 | .elif !empty(BUILTIN_LIB_FOUND.curses:M[yY][eE][sS]) |
41 | BUILTIN_LIBNAME.termlib= curses | | 44 | BUILTIN_LIBNAME.termlib= curses |
42 | .endif | | 45 | .endif |
43 | | | 46 | |
44 | ### | | 47 | ### |
45 | ### The section below only applies if we are not including this file | | 48 | ### The section below only applies if we are not including this file |
46 | ### solely to determine whether a built-in implementation exists. | | 49 | ### solely to determine whether a built-in implementation exists. |
47 | ### | | 50 | ### |
48 | CHECK_BUILTIN.termlib?= no | | 51 | CHECK_BUILTIN.termlib?= no |
49 | .if !empty(CHECK_BUILTIN.termlib:M[nN][oO]) | | 52 | .if !empty(CHECK_BUILTIN.termlib:M[nN][oO]) |
50 | | | 53 | |
51 | . if !empty(USE_BUILTIN.termlib:M[yY][eE][sS]) | | 54 | . if !empty(USE_BUILTIN.termlib:M[yY][eE][sS]) |
52 | BUILDLINK_LIBNAME.termlib= ${BUILTIN_LIBNAME.termlib} | | 55 | BUILDLINK_LIBNAME.termlib= ${BUILTIN_LIBNAME.termlib} |