1 # $NetBSD: curses.builtin.mk,v 1.4 2008/02/27 06:14:23 jlam Exp $
5 BUILTIN_FIND_LIBS:= curses
6 BUILTIN_FIND_FILES_VAR:= H_CURSES
7 BUILTIN_FIND_FILES.H_CURSES= /usr/include/curses.h
9 .include "buildlink3/bsd.builtin.mk"
12 ### Determine if there is a built-in implementation of the package and
13 ### set IS_BUILTIN.<pkg> appropriately ("yes" or "no").
15 .if !defined(IS_BUILTIN.curses)
17 . if empty(H_CURSES:M${LOCALBASE}/*) && exists(${H_CURSES})
18 IS_BUILTIN.curses= yes
21 MAKEVARS+= IS_BUILTIN.curses
24 ### Determine whether we should use the built-in implementation if it
25 ### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no").
27 .if !defined(USE_BUILTIN.curses)
28 . if ${PREFER.curses} == "pkgsrc"
29 USE_BUILTIN.curses= no
31 USE_BUILTIN.curses= ${IS_BUILTIN.curses}
32 . if defined(BUILTIN_PKG.curses) && !empty(IS_BUILTIN.curses:M[yY][eE][sS])
33 USE_BUILTIN.curses= yes
34 . for _dep_ in ${BUILDLINK_API_DEPENDS.curses}
35 . if !empty(USE_BUILTIN.curses:M[yY][eE][sS])
36 USE_BUILTIN.curses!= \
37 if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.curses:Q}; then \
45 . endif # PREFER.curses
47 MAKEVARS+= USE_BUILTIN.curses
49 # Define BUILTIN_LIBNAME.curses to be the base name of the built-in
52 .if !empty(BUILTIN_LIB_FOUND.curses:M[yY][eE][sS])
53 BUILTIN_LIBNAME.curses= curses
57 ### The section below only applies if we are not including this file
58 ### solely to determine whether a built-in implementation exists.
60 CHECK_BUILTIN.curses?= no
61 .if !empty(CHECK_BUILTIN.curses:M[nN][oO])
63 . if !empty(USE_BUILTIN.curses:M[yY][eE][sS])
64 . if exists(${H_CURSES})
65 BUILDLINK_INCDIRS.curses?= ${H_CURSES:H:S/^${BUILDLINK_PREFIX.curses}\///}
67 BUILDLINK_LIBNAME.curses= ${BUILTIN_LIBNAME.curses}
70 .endif # CHECK_BUILTIN.curses