Fixup fromcvs/togit conversion
[minix-pkgsrc.git] / fonts / Xft2 / builtin.mk
blobd6ecef03d76ef6784d00d83be0cedbc86c1f52d7
1 # $NetBSD: builtin.mk,v 1.17 2008/10/05 21:36:35 cube Exp $
3 BUILTIN_PKG:= Xft2
5 BUILTIN_FIND_FILES_VAR:= H_XFT2
6 BUILTIN_FIND_FILES.H_XFT2= ${X11BASE}/include/X11/Xft/Xft.h
8 .include "../../mk/buildlink3/bsd.builtin.mk"
10 ###
11 ### Determine if there is a built-in implementation of the package and
12 ### set IS_BUILTIN.<pkg> appropriately ("yes" or "no").
13 ###
14 .if !defined(IS_BUILTIN.Xft2)
15 . if empty(H_XFT2:M__nonexistent__)
16 IS_BUILTIN.Xft2= yes
17 . else
18 IS_BUILTIN.Xft2= no
19 . endif
20 .endif
21 MAKEVARS+= IS_BUILTIN.Xft2
23 ###
24 ### If there is a built-in implementation, then set BUILTIN_PKG.<pkg> to
25 ### a package name to represent the built-in package.
26 ###
27 .if !defined(BUILTIN_PKG.Xft2) && \
28 !empty(IS_BUILTIN.Xft2:M[yY][eE][sS]) && \
29 empty(H_XFT2:M__nonexistent__)
31 # Extract the version number from the header file, but if it's not
32 # there, then pretend it's from version 2.0.
34 BUILTIN_VERSION.Xft2!= \
35 ${AWK} 'BEGIN { M = 2; m = ".0"; r = "" } \
36 /\#define[ ]*XFT_MAJOR/ { M = $$3 } \
37 /\#define[ ]*XFT_MINOR/ { m = "."$$3 } \
38 /\#define[ ]*XFT_REVISION/ { r = "."$$3 } \
39 END { printf "%s%s%s\n", M, m, r }' \
40 ${H_XFT2}
41 BUILTIN_PKG.Xft2= Xft2-${BUILTIN_VERSION.Xft2}
42 .endif
43 MAKEVARS+= BUILTIN_PKG.Xft2
45 ###
46 ### Determine whether we should use the built-in implementation if it
47 ### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no").
48 ###
50 # These are dependencies of Xft2. If we need to use the pkgsrc
51 # versions of any of these, then also use the pkgsrc version of
52 # Xft2.
54 .if defined(USE_BUILTIN.Xrender) && !empty(USE_BUILTIN.Xrender:M[nN][oO])
55 USE_BUILTIN.Xft2= no
56 .endif
57 .if defined(USE_BUILTIN.fontconfig) && !empty(USE_BUILTIN.fontconfig:M[nN][oO])
58 USE_BUILTIN.Xft2= no
59 .endif
61 .if !defined(USE_BUILTIN.Xft2)
62 . if ${PREFER.Xft2} == "pkgsrc"
63 USE_BUILTIN.Xft2= no
64 . else
65 USE_BUILTIN.Xft2= ${IS_BUILTIN.Xft2}
66 . if defined(BUILTIN_PKG.Xft2) && \
67 !empty(IS_BUILTIN.Xft2:M[yY][eE][sS])
68 USE_BUILTIN.Xft2= yes
69 . for _dep_ in ${BUILDLINK_API_DEPENDS.Xft2}
70 . if !empty(USE_BUILTIN.Xft2:M[yY][eE][sS])
71 USE_BUILTIN.Xft2!= \
72 if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.Xft2:Q}; then \
73 ${ECHO} yes; \
74 else \
75 ${ECHO} no; \
77 . endif
78 . endfor
79 . endif
80 . endif # PREFER.Xft2
81 .endif
82 MAKEVARS+= USE_BUILTIN.Xft2
84 ###
85 ### The section below only applies if we are not including this file
86 ### solely to determine whether a built-in implementation exists.
87 ###
89 .include "../../mk/x11.builtin.mk"
91 CHECK_BUILTIN.Xft2?= no
92 .if !empty(CHECK_BUILTIN.Xft2:M[nN][oO])
94 . if !empty(USE_BUILTIN.Xft2:M[nN][oO])
95 BUILDLINK_API_DEPENDS.Xft2+= Xft2>=2.1nb2
96 . endif
98 .endif # CHECK_BUILTIN.Xft2