Fixup fromcvs/togit conversion
[minix-pkgsrc.git] / mk / terminfo.builtin.mk
blob83caa0499a571b6f43a323c0dbc59ed1b3260ca0
1 # $NetBSD: terminfo.builtin.mk,v 1.1 2010/02/07 09:46:14 roy Exp $
3 BUILTIN_PKG:= terminfo
5 BUILTIN_FIND_LIBS:= terminfo curses tinfo
6 BUILTIN_FIND_FILES_VAR:= H_TERM
7 BUILTIN_FIND_FILES.H_TERM:= /usr/include/term.h
8 BUILTIN_FIND_GREP.H_TERM:= tigetstr
10 .include "buildlink3/bsd.builtin.mk"
12 ###
13 ### Determine if there is a built-in implementation of the package and
14 ### set IS_BUILTIN.<pkg> appropriately ("yes" or "no").
15 ###
16 .if !defined(IS_BUILTIN.terminfo)
17 IS_BUILTIN.terminfo= no
18 . if empty(H_TERM:M__nonexistent__) && empty(H_TERM:M${LOCALBASE}/*)
19 . if !empty(BUILTIN_LIB_FOUND.terminfo:M[yY[eE][sS]) || \
20 !empty(BUILTIN_LIB_FOUND.curses:M[yY][eE][sS]) || \
21 !empty(BUILTIN_LIB_FOUND.tinfo:M[yY][eE][sS])
22 IS_BUILTIN.terminfo= yes
23 . endif
24 . endif
25 .endif
26 MAKEVARS+= IS_BUILTIN.terminfo
28 ###
29 ### Determine whether we should use the built-in implementation if it
30 ### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no").
31 ###
32 .if !defined(USE_BUILTIN.terminfo)
33 . if ${PREFER.terminfo} == "pkgsrc"
34 USE_BUILTIN.terminfo= no
35 . else
36 USE_BUILTIN.terminfo= ${IS_BUILTIN.terminfo}
37 . endif # PREFER.terminfo
38 .endif
39 MAKEVARS+= USE_BUILTIN.terminfo
41 # Define BUILTIN_LIBNAME.termcap to be the base name of the built-in
42 # termcap library.
44 # The way this is determined is:
46 # (1) If <term.h> exists and libterminfo exists, then it's "terminfo".
47 # (1) If <term.h> exists and libtinfo exists, then it's "tinfo".
48 # (2) If <term.h> exists and libcurses exists, then it's "curses".
49 # (3) If <term.h> exists and lib{curses,terminfo,tinfo} don't, then it's "c".
51 .if empty(H_TERM:M__nonexistent__) && empty(H_TERM:M${LOCALBASE}/*)
52 . if !empty(BUILTIN_LIB_FOUND.terminfo:M[yY][eE][sS])
53 BUILTIN_LIBNAME.terminfo= terminfo
54 . elif !empty(BUILTIN_LIB_FOUND.tinfo:M[yY][eE][sS])
55 BUILTIN_LIBNAME.terminfo= tinfo
56 . elif !empty(BUILTIN_LIB_FOUND.curses:M[yY][eE][sS])
57 BUILTIN_LIBNAME.terminfo= curses
58 . else
59 BUILTIN_LIBNAME.terminfo= c
60 . endif
61 .endif
63 ###
64 ### The section below only applies if we are not including this file
65 ### solely to determine whether a built-in implementation exists.
66 ###
67 CHECK_BUILTIN.terminfo?= no
68 .if !empty(CHECK_BUILTIN.terminfo:M[nN][oO])
70 . if !empty(USE_BUILTIN.terminfo:M[yY][eE][sS])
71 BUILDLINK_LIBNAME.terminfo= ${BUILTIN_LIBNAME.terminfo}
72 . endif
74 # If the package wants both "terminfo" and "curses", then we must not
75 # remove the -l options for the curses libraries; otherwise, we should
76 # remove them as GNU configure scripts commonly check for one or both
77 # of those library options.
79 . if empty(BUILDLINK_TREE:Mcurses) && empty(BUILDLINK_TREE:Mncurses)
80 BUILDLINK_TRANSFORM+= rm:-lcurses
81 BUILDLINK_TRANSFORM+= rm:-lncurses
82 . endif
84 .endif # CHECK_BUILTIN.terminfo