1 # $NetBSD: builtin.mk,v 1.6 2008/10/05 21:36:34 cube Exp $
3 BUILTIN_PKG:= xextproto
5 BUILTIN_FIND_FILES_VAR:= H_XEXTPROTO
6 BUILTIN_FIND_FILES.H_XEXTPROTO= \
7 ${X11BASE}/include/X11/extensions/extutil.h
9 .include "../../mk/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 ${X11BASE} == ${LOCALBASE}
16 IS_BUILTIN.xextproto= no
17 .elif !defined(IS_BUILTIN.xextproto)
18 IS_BUILTIN.xextproto= no
20 # Here, we skip checking whether the files are under ${LOCALBASE} since
21 # we'll consider this X11 package to be built-in even if it's a part
22 # of one of the pkgsrc-installed X11 distributions.
24 . if empty(H_XEXTPROTO:M__nonexistent__)
25 IS_BUILTIN.xextproto= yes
28 MAKEVARS+= IS_BUILTIN.xextproto
31 ### Determine whether we should use the built-in implementation if it
32 ### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no").
34 .if !defined(USE_BUILTIN.xextproto)
35 . if ${PREFER.xextproto} == "pkgsrc"
36 USE_BUILTIN.xextproto= no
38 USE_BUILTIN.xextproto= ${IS_BUILTIN.xextproto}
39 . if defined(BUILTIN_PKG.xextproto) && \
40 !empty(IS_BUILTIN.xextproto:M[yY][eE][sS])
41 USE_BUILTIN.xextproto= yes
42 . for _dep_ in ${BUILDLINK_API_DEPENDS.xextproto}
43 . if !empty(USE_BUILTIN.xextproto:M[yY][eE][sS])
44 USE_BUILTIN.xextproto!= \
45 if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.xextproto:Q}; then \
53 . endif # PREFER.xextproto
55 MAKEVARS+= USE_BUILTIN.xextproto
58 ### The section below only applies if we are not including this file
59 ### solely to determine whether a built-in implementation exists.
62 .include "../../mk/x11.builtin.mk"
64 CHECK_BUILTIN.xextproto?= no
65 .if !empty(CHECK_BUILTIN.xextproto:M[nN][oO])
67 # If we are using the builtin version, check whether it has a xextproto.pc
68 # file or not. If the latter, generate a fake one.
69 . if !empty(USE_BUILTIN.xextproto:M[Yy][Ee][Ss])
70 BUILDLINK_TARGETS+= xextproto-fake-pc
74 src=${BUILDLINK_PREFIX.xextproto}/lib/pkgconfig/xextproto.pc; \
75 dst=${BUILDLINK_DIR}/lib/pkgconfig/xextproto.pc; \
76 ${MKDIR} ${BUILDLINK_DIR}/lib/pkgconfig; \
77 if ${TEST} -f $${src}; then \
78 ${LN} -sf $${src} $${dst}; \
80 { ${ECHO} "Name: XExtensions"; \
81 ${ECHO} "Description: Sundry X extension headers"; \
82 ${ECHO} "Version: 1.0.1"; \
83 ${ECHO} "Cflags: -I${BUILDLINK_PREFIX.xextproto}/include"; \
88 .endif # CHECK_BUILTIN.xextproto