Fixup fromcvs/togit conversion
[minix-pkgsrc.git] / mk / curses.builtin.mk
blob38470d64744ee9ab72d14f49c880697b11c0ae7e
1 # $NetBSD: curses.builtin.mk,v 1.5 2008/02/27 15:26:34 jlam Exp $
3 BUILTIN_PKG:= curses
5 BUILTIN_FIND_LIBS:= curses
6 BUILTIN_FIND_FILES_VAR:= H_CURSES
7 BUILTIN_FIND_FILES.H_CURSES= /usr/include/curses.h
8 BUILTIN_FIND_FILES.H_CURSES+= /boot/develop/headers/3rdparty/curses.h
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.curses)
17 IS_BUILTIN.curses= no
18 . if empty(H_CURSES:M${LOCALBASE}/*) && exists(${H_CURSES})
19 IS_BUILTIN.curses= yes
20 . endif
21 .endif
22 MAKEVARS+= IS_BUILTIN.curses
24 ###
25 ### Determine whether we should use the built-in implementation if it
26 ### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no").
27 ###
28 .if !defined(USE_BUILTIN.curses)
29 . if ${PREFER.curses} == "pkgsrc"
30 USE_BUILTIN.curses= no
31 . else
32 USE_BUILTIN.curses= ${IS_BUILTIN.curses}
33 . if defined(BUILTIN_PKG.curses) && !empty(IS_BUILTIN.curses:M[yY][eE][sS])
34 USE_BUILTIN.curses= yes
35 . for _dep_ in ${BUILDLINK_API_DEPENDS.curses}
36 . if !empty(USE_BUILTIN.curses:M[yY][eE][sS])
37 USE_BUILTIN.curses!= \
38 if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.curses:Q}; then \
39 ${ECHO} yes; \
40 else \
41 ${ECHO} no; \
43 . endif
44 . endfor
45 . endif
46 . endif # PREFER.curses
47 .endif
48 MAKEVARS+= USE_BUILTIN.curses
50 # Define BUILTIN_LIBNAME.curses to be the base name of the built-in
51 # curses library.
53 .if !empty(BUILTIN_LIB_FOUND.curses:M[yY][eE][sS])
54 BUILTIN_LIBNAME.curses= curses
55 .endif
57 ###
58 ### The section below only applies if we are not including this file
59 ### solely to determine whether a built-in implementation exists.
60 ###
61 CHECK_BUILTIN.curses?= no
62 .if !empty(CHECK_BUILTIN.curses:M[nN][oO])
64 . if !empty(USE_BUILTIN.curses:M[yY][eE][sS])
65 . if exists(${H_CURSES})
66 BUILDLINK_INCDIRS.curses?= ${H_CURSES:H:S/^${BUILDLINK_PREFIX.curses}\///}
67 . endif
68 BUILDLINK_LIBNAME.curses= ${BUILTIN_LIBNAME.curses}
69 . endif
71 .endif # CHECK_BUILTIN.curses