1 # $NetBSD: builtin.mk,v 1.4 2007/02/22 19:27:27 wiz Exp $
3 # TODO: builtin.mk failed to use native on XFree86
4 # the two headers are identical with native XFree86
6 BUILTIN_PKG
:= randrproto
8 BUILTIN_FIND_FILES_VAR
:= H_RANDR
9 BUILTIN_FIND_FILES.H_RANDR
= ${X11BASE}/include/X11
/extensions
/randr.h
11 .
include "../../mk/buildlink3/bsd.builtin.mk"
14 ### Determine if there is a built-in implementation of the package and
15 ### set IS_BUILTIN.<pkg> appropriately ("yes" or "no").
17 .if
${X11BASE} == ${LOCALBASE}
18 IS_BUILTIN.randrproto
= no
19 .elif
!defined
(IS_BUILTIN.randrproto
)
20 IS_BUILTIN.randrproto
= no
22 # Here, we skip checking whether the files are under ${LOCALBASE} since
23 # we'll consider this X11 package to be built-in even if it's a part
24 # of one of the pkgsrc-installed X11 distributions.
26 . if empty
(H_RANDR
:M__nonexistent__
)
27 IS_BUILTIN.randrproto
= yes
30 MAKEVARS
+= IS_BUILTIN.randrproto
33 ### If there is a built-in implementation, then set BUILTIN_PKG.<pkg> to
34 ### a package name to represent the built-in package.
36 .if
!defined
(BUILTIN_PKG.randrproto
) && \
37 !empty
(IS_BUILTIN.randrproto
:M
[yY
][eE
][sS
]) && \
38 empty
(H_RANDR
:M__nonexistent__
)
39 BUILTIN_VERSION.randrproto
!= \
40 ${AWK} '/\#define[ ]*RANDR_MAJOR/ { M = $$3 } \
41 /\#define[ ]*RANDR_MINOR/ { m = "."$$3 } \
42 END { printf "%s%s\n", M, m }' \
44 BUILTIN_PKG.randrproto
= randrproto-
${BUILTIN_VERSION.randrproto
}
46 MAKEVARS
+= BUILTIN_PKG.randrproto
49 ### Determine whether we should use the built-in implementation if it
50 ### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no").
52 .if
!defined
(USE_BUILTIN.randrproto
)
53 . if
${PREFER.randrproto
} == "pkgsrc"
54 USE_BUILTIN.randrproto
= no
56 USE_BUILTIN.randrproto
= ${IS_BUILTIN.randrproto
}
57 . if defined
(BUILTIN_PKG.randrproto
) && \
58 !empty
(IS_BUILTIN.randrproto
:M
[yY
][eE
][sS
])
59 USE_BUILTIN.randrproto
= yes
60 . for _dep_ in
${BUILDLINK_API_DEPENDS.randrproto
}
61 . if
!empty
(USE_BUILTIN.randrproto
:M
[yY
][eE
][sS
])
62 USE_BUILTIN.randrproto
!= \
63 if
${PKG_ADMIN} pmatch
${_dep_
:Q
} ${BUILTIN_PKG.randrproto
:Q
}; then \
71 .
endif # PREFER.randrproto
73 MAKEVARS
+= USE_BUILTIN.randrproto
76 ### The section below only applies if we are not including this file
77 ### solely to determine whether a built-in implementation exists.
80 .
include "../../mk/x11.builtin.mk"
82 CHECK_BUILTIN.randrproto?
= no
83 .if
!empty
(CHECK_BUILTIN.randrproto
:M
[nN
][oO
])
85 . if
!empty
(USE_BUILTIN.randrproto
:M
[nN
][oO
])
86 BUILDLINK_API_DEPENDS.randrproto
+= randrproto
>=1.0
89 .
endif # CHECK_BUILTIN.randrproto