Fixup fromcvs/togit conversion
[minix-pkgsrc.git] / x11 / randrproto / builtin.mk
blob5fbdcf013e8ae0fbc1b6f3314e8a38fbea8d7cf5
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"
13 ###
14 ### Determine if there is a built-in implementation of the package and
15 ### set IS_BUILTIN.<pkg> appropriately ("yes" or "no").
16 ###
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
28 . endif
29 .endif
30 MAKEVARS+= IS_BUILTIN.randrproto
32 ###
33 ### If there is a built-in implementation, then set BUILTIN_PKG.<pkg> to
34 ### a package name to represent the built-in package.
35 ###
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 }' \
43 ${H_RANDR}
44 BUILTIN_PKG.randrproto= randrproto-${BUILTIN_VERSION.randrproto}
45 .endif
46 MAKEVARS+= BUILTIN_PKG.randrproto
48 ###
49 ### Determine whether we should use the built-in implementation if it
50 ### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no").
51 ###
52 .if !defined(USE_BUILTIN.randrproto)
53 . if ${PREFER.randrproto} == "pkgsrc"
54 USE_BUILTIN.randrproto= no
55 . else
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 \
64 ${ECHO} yes; \
65 else \
66 ${ECHO} no; \
68 . endif
69 . endfor
70 . endif
71 . endif # PREFER.randrproto
72 .endif
73 MAKEVARS+= USE_BUILTIN.randrproto
75 ###
76 ### The section below only applies if we are not including this file
77 ### solely to determine whether a built-in implementation exists.
78 ###
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
87 . endif
89 .endif # CHECK_BUILTIN.randrproto