1 # $NetBSD: curses.builtin.mk,v 1.5 2008/02/27 15:26:34 jlam Exp $
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"
13 ### Determine if there is a built-in implementation of the package and
14 ### set IS_BUILTIN.<pkg> appropriately ("yes" or "no").
16 .if
!defined
(IS_BUILTIN.curses
)
18 . if empty
(H_CURSES
:M
${LOCALBASE}/*) && exists
(${H_CURSES})
19 IS_BUILTIN.curses
= yes
22 MAKEVARS
+= IS_BUILTIN.curses
25 ### Determine whether we should use the built-in implementation if it
26 ### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no").
28 .if
!defined
(USE_BUILTIN.curses
)
29 . if
${PREFER.curses
} == "pkgsrc"
30 USE_BUILTIN.curses
= no
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 \
46 .
endif # PREFER.curses
48 MAKEVARS
+= USE_BUILTIN.curses
50 # Define BUILTIN_LIBNAME.curses to be the base name of the built-in
53 .if
!empty
(BUILTIN_LIB_FOUND.curses
:M
[yY
][eE
][sS
])
54 BUILTIN_LIBNAME.curses
= curses
58 ### The section below only applies if we are not including this file
59 ### solely to determine whether a built-in implementation exists.
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
}\
///}
68 BUILDLINK_LIBNAME.curses
= ${BUILTIN_LIBNAME.curses
}
71 .
endif # CHECK_BUILTIN.curses