1 # $NetBSD: builtin.mk,v 1.17 2008/10/05 21:36:35 cube Exp $
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"
11 ### Determine if there is a built-in implementation of the package and
12 ### set IS_BUILTIN.<pkg> appropriately ("yes" or "no").
14 .if
!defined
(IS_BUILTIN.Xft2
)
15 . if empty
(H_XFT2
:M__nonexistent__
)
21 MAKEVARS
+= IS_BUILTIN.Xft2
24 ### If there is a built-in implementation, then set BUILTIN_PKG.<pkg> to
25 ### a package name to represent the built-in package.
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 }' \
41 BUILTIN_PKG.Xft2
= Xft2-
${BUILTIN_VERSION.Xft2
}
43 MAKEVARS
+= BUILTIN_PKG.Xft2
46 ### Determine whether we should use the built-in implementation if it
47 ### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no").
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
54 .if defined
(USE_BUILTIN.Xrender
) && !empty
(USE_BUILTIN.Xrender
:M
[nN
][oO
])
57 .if defined
(USE_BUILTIN.fontconfig
) && !empty
(USE_BUILTIN.fontconfig
:M
[nN
][oO
])
61 .if
!defined
(USE_BUILTIN.Xft2
)
62 . if
${PREFER.Xft2
} == "pkgsrc"
65 USE_BUILTIN.Xft2
= ${IS_BUILTIN.Xft2
}
66 . if defined
(BUILTIN_PKG.Xft2
) && \
67 !empty
(IS_BUILTIN.Xft2
:M
[yY
][eE
][sS
])
69 . for _dep_ in
${BUILDLINK_API_DEPENDS.Xft2
}
70 . if
!empty
(USE_BUILTIN.Xft2
:M
[yY
][eE
][sS
])
72 if
${PKG_ADMIN} pmatch
${_dep_
:Q
} ${BUILTIN_PKG.Xft2
:Q
}; then \
82 MAKEVARS
+= USE_BUILTIN.Xft2
85 ### The section below only applies if we are not including this file
86 ### solely to determine whether a built-in implementation exists.
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
98 .
endif # CHECK_BUILTIN.Xft2