Teach termlib files about another possible native terminal library, tinfo.diff -r1.2 -r1.3 pkgsrc/mk/termlib.buildlink3.mk
(jlam)
@@ -1,48 +1,49 @@ | @@ -1,48 +1,49 @@ | |||
1 | # $NetBSD: termlib.buildlink3.mk,v 1.2 2008/02/27 06:10:25 jlam Exp $ | 1 | # $NetBSD: termlib.buildlink3.mk,v 1.3 2008/02/27 17:36:34 jlam Exp $ | |
2 | # | 2 | # | |
3 | # This Makefile fragment is meant to be included by packages that require | 3 | # This Makefile fragment is meant to be included by packages that require | |
4 | # a basic termlib implementation. | 4 | # a basic termlib implementation. | |
5 | # | 5 | # | |
6 | # === Variables set by this file === | 6 | # === Variables set by this file === | |
7 | # | 7 | # | |
8 | # TERMLIB_TYPE | 8 | # TERMLIB_TYPE | |
9 | # The name of the selected termlib implementation. | 9 | # The name of the selected termlib implementation. | |
10 | 10 | |||
11 | TERMLIB_BUILDLINK3_MK:= ${TERMLIB_BUILDLINK3_MK}+ | 11 | TERMLIB_BUILDLINK3_MK:= ${TERMLIB_BUILDLINK3_MK}+ | |
12 | 12 | |||
13 | .include "bsd.fast.prefs.mk" | 13 | .include "bsd.fast.prefs.mk" | |
14 | 14 | |||
15 | .if !empty(TERMLIB_BUILDLINK3_MK:M+) | 15 | .if !empty(TERMLIB_BUILDLINK3_MK:M+) | |
16 | 16 | |||
17 | CHECK_BUILTIN.termlib:= yes | 17 | CHECK_BUILTIN.termlib:= yes | |
18 | . include "termlib.builtin.mk" | 18 | . include "termlib.builtin.mk" | |
19 | CHECK_BUILTIN.termlib:= no | 19 | CHECK_BUILTIN.termlib:= no | |
20 | 20 | |||
21 | . if !empty(USE_BUILTIN.termlib:M[yY][eE][sS]) | 21 | . if !empty(USE_BUILTIN.termlib:M[yY][eE][sS]) | |
22 | . if defined(BUILTIN_LIBNAME.termlib) | 22 | . if defined(BUILTIN_LIBNAME.termlib) | |
23 | TERMLIB_TYPE= ${BUILTIN_LIBNAME.termlib} | 23 | TERMLIB_TYPE= ${BUILTIN_LIBNAME.termlib} | |
24 | . else | 24 | . else | |
25 | TERMLIB_TYPE= none | 25 | TERMLIB_TYPE= none | |
26 | . endif | 26 | . endif | |
27 | . else | 27 | . else | |
28 | TERMLIB_TYPE= curses | 28 | TERMLIB_TYPE= curses | |
29 | . endif | 29 | . endif | |
30 | 30 | |||
31 | BUILD_DEFS+= TERMLIB_TYPE | 31 | BUILD_DEFS+= TERMLIB_TYPE | |
32 | 32 | |||
33 | .endif # TERMLIB_BUILDLINK3_MK | 33 | .endif # TERMLIB_BUILDLINK3_MK | |
34 | 34 | |||
35 | .if ${TERMLIB_TYPE} == "none" | 35 | .if ${TERMLIB_TYPE} == "none" | |
36 | PKG_FAIL_REASON= "No usable terminal library found on the system." | 36 | PKG_FAIL_REASON= "No usable terminal library found on the system." | |
37 | .elif (${TERMLIB_TYPE} == "termcap") | 37 | .elif (${TERMLIB_TYPE} == "termcap") || \ | |
38 | (${TERMLIB_TYPE} == "tinfo") | |||
38 | BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Ntermlib} | 39 | BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Ntermlib} | |
39 | BUILDLINK_PACKAGES+= termlib | 40 | BUILDLINK_PACKAGES+= termlib | |
40 | BUILDLINK_ORDER:= ${BUILDLINK_ORDER} ${BUILDLINK_DEPTH}termlib | 41 | BUILDLINK_ORDER:= ${BUILDLINK_ORDER} ${BUILDLINK_DEPTH}termlib | |
41 | BUILDLINK_LIBNAME.termlib?= termcap | 42 | BUILDLINK_LIBNAME.termlib?= ${BUILTIN_LIBNAME.termlib} | |
42 | BUILDLINK_LDADD.termlib?= ${BUILDLINK_LIBNAME.termlib:S/^/-l/} | 43 | BUILDLINK_LDADD.termlib?= ${BUILDLINK_LIBNAME.termlib:S/^/-l/} | |
43 | BUILDLINK_BUILTIN_MK.termlib= ../../mk/termlib.builtin.mk | 44 | BUILDLINK_BUILTIN_MK.termlib= ../../mk/termlib.builtin.mk | |
44 | .elif ${TERMLIB_TYPE} == "curses" | 45 | .elif ${TERMLIB_TYPE} == "curses" | |
45 | . include "../../mk/curses.buildlink3.mk" | 46 | . include "../../mk/curses.buildlink3.mk" | |
46 | BUILDLINK_LIBNAME.termlib?= ${BUILDLINK_LIBNAME.curses} | 47 | BUILDLINK_LIBNAME.termlib?= ${BUILDLINK_LIBNAME.curses} | |
47 | BUILDLINK_LDADD.termlib?= ${BUILDLINK_LDADD.curses} | 48 | BUILDLINK_LDADD.termlib?= ${BUILDLINK_LDADD.curses} | |
48 | .endif | 49 | .endif |
@@ -1,55 +1,58 @@ | @@ -1,55 +1,58 @@ | |||
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} | |
53 | . endif | 56 | . endif | |
54 | 57 | |||
55 | .endif # CHECK_BUILTIN.termlib | 58 | .endif # CHECK_BUILTIN.termlib |