Fixup fromcvs/togit conversion
[minix-pkgsrc.git] / mk / terminfo.buildlink3.mk
blob34ed5ff62f323cb63d1224682e9c4b87fac8909e
1 # $NetBSD: terminfo.buildlink3.mk,v 1.1 2010/02/08 22:11:43 roy Exp $
3 # This Makefile fragment is meant to be included by packages that require
4 # any terminfo implementation instead of one particular one. The available
5 # terminfo implementations are "terminfo" if built-in, "ncurses", and
6 # "pdcurses".
8 # If a package genuinely requires ncurses or pdcurses, then it should
9 # directly include the appropriate buildlink3.mk instead of this file in
10 # the package Makefile.
12 # === User-settable variables ===
14 # TERMINFO_DEFAULT
15 # This value represents the type of curses we wish to use on the
16 # system. Setting this to "curses" means that the system curses
17 # implementation is fine.
19 # Possible: terminfo, ncurses, pdcurses
20 # Default: (depends)
22 # === Variables set by this file ===
24 # TERMINFO_TYPE
25 # The name of the selected curses implementation.
27 TERMINFO_BUILDLINK3_MK:= ${TERMINFO_BUILDLINK3_MK}+
28 .include "bsd.fast.prefs.mk"
30 .if !empty(TERMINFO_BUILDLINK3_MK:M+)
32 # _TERMINFO_PKGS is an exhaustive list of all of the curses implementations
33 # that may be used with curses.buildlink3.mk.
35 _TERMINFO_PKGS?= terminfo ncurses pdcurses
37 CHECK_BUILTIN.terminfo:= yes
38 . include "terminfo.builtin.mk"
39 CHECK_BUILTIN.terminfo:= no
41 # Set the value of TERMINFO_DEFAULT depending on the platform and what's
42 # available in the base system.
44 .if defined(USE_BUILTIN.terminfo) && !empty(USE_BUILTIN.terminfo:M[yY][eE][sS])
45 TERMINFO_DEFAULT?= terminfo
46 .else
47 TERMINFO_DEFAULT?= ncurses
48 .endif
50 _TERMINFO_ACCEPTED= # empty
51 .if defined(USE_BUILTIN.terminfo) && !empty(USE_BUILTIN.terminfo:M[yY][eE][sS])
52 _TERMINFO_ACCEPTED+= terminfo # system curses exists
53 .endif
54 _TERMINFO_ACCEPTED+= ncurses # pkgsrc ncurses
55 _TERMINFO_ACCEPTED+= pdcurses # pkgsrc pdcurses
57 _TERMINFO_TYPE= ${TERMINFO_DEFAULT}
58 . if !empty(_TERMINFO_ACCEPTED:M${_TERMINFO_TYPE})
59 TERMINFO_TYPE= ${_TERMINFO_TYPE}
60 . else
61 TERMINFO_TYPE= none
62 . endif
64 BUILD_DEFS+= TERMINFO_DEFAULT
65 BUILD_DEFS_EFFECTS+= TERMINFO_TYPE
67 .endif # TERMINFO_BUILDLINK3_MK
69 .if ${TERMINFO_TYPE} == "none"
70 PKG_FAIL_REASON= \
71 "${_TERMINFO_TYPE} is not an acceptable terminfo type for ${PKGNAME}."
72 .elif ${TERMINFO_TYPE} == "terminfo"
73 .elif ${TERMINFO_TYPE} == "ncurses"
74 USE_NCURSES= yes
75 . include "../../devel/ncurses/buildlink3.mk"
76 BUILDLINK_PREFIX.terminfo?= ${BUILDLINK_PREFIX.ncurses}
77 BUILDLINK_LIBNAME.terminfo?= ${BUILDLINK_LIBNAME.ncurses}
78 BUILDLINK_LDADD.terminfo?= ${BUILDLINK_LDADD.ncurses}
79 .elif ${TERMINFO_TYPE} == "pdcurses"
80 . include "../../devel/pdcurses/buildlink3.mk"
81 BUILDLINK_PREFIX.terminfo?= ${BUILDLINK_PREFIX.pdcurses}
82 BUILDLINK_LIBNAME.terminfo?= ${BUILDLINK_LIBNAME.pdcurses}
83 BUILDLINK_LDADD.terminfo?= ${BUILDLINK_LDADD.pdcurses}
84 .endif