1 # $NetBSD: builtin.mk,v 1.12 2005/06/03 19:12:49 jlam Exp $
5 BUILTIN_FIND_FILES_VAR:= H_XRANDR
6 BUILTIN_FIND_FILES.H_XRANDR= ${X11BASE}/include/X11/extensions/Xrandr.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.Xrandr)
16 . if exists(${H_XRANDR})
17 BUILTIN_IMAKE_CHECK:= Xrandr:BuildRandRLibrary
18 . include "../../mk/buildlink3/imake-check.mk"
19 IS_BUILTIN.Xrandr= ${BUILTIN_IMAKE_CHECK.Xrandr}
22 MAKEVARS+= IS_BUILTIN.Xrandr
25 ### If there is a built-in implementation, then set BUILTIN_PKG.<pkg> to
26 ### a package name to represent the built-in package.
28 .if !defined(BUILTIN_PKG.Xrandr) && \
29 !empty(IS_BUILTIN.Xrandr:M[yY][eE][sS]) && \
32 # Xrandr doesn't provide a method of discovering the version number of
33 # the software. Match up Xrandr versions with X11 versions for an
34 # approximate determination of the Xrandr version.
36 _BLTN_XRANDR_VERSIONS= 1.0.2 1.0.1 1.0 0.99
37 _BLTN_XRANDR_0.99.XFree86= 4.2 4.2.*
38 _BLTN_XRANDR_1.0.XFree86= 4.3 4.3.[0-9] 4.3.[0-9].* \
39 4.3.[1-8][0-9]* 4.3.9[0-8]* \
40 4.3.99.* 4.[4-9]* 4.[1-9][0-9]*
41 _BLTN_XRANDR_1.0.xorg= 6.[7-9]* 6.[1-9][0-9]*
42 . for _version_ in ${_BLTN_XRANDR_VERSIONS}
43 . for _pattern_ in ${_BLTN_XRANDR_${_version_}.${BUILTIN_X11_TYPE.${X11_TYPE}}}
44 . if defined(BUILTIN_X11_VERSION.${X11_TYPE}) && \
45 !empty(BUILTIN_X11_VERSION.${X11_TYPE}:M${_pattern_})
46 BUILTIN_VERSION.Xrandr?= ${_version_}
50 . if defined(BUILTIN_VERSION.Xrandr)
51 BUILTIN_PKG.Xrandr= Xrandr-${BUILTIN_VERSION.Xrandr}
54 MAKEVARS+= BUILTIN_PKG.Xrandr
57 ### Determine whether we should use the built-in implementation if it
58 ### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no").
61 # These are dependencies of Xrandr. If we need to use the pkgsrc
62 # versions of any of these, then also use the pkgsrc version of
65 .if defined(USE_BUILTIN.Xrender) && !empty(USE_BUILTIN.Xrender:M[nN][oO])
66 USE_BUILTIN.Xrender= no
68 .if defined(USE_BUILTIN.randrext) && !empty(USE_BUILTIN.randrext:M[nN][oO])
69 USE_BUILTIN.randrext= no
72 .if !defined(USE_BUILTIN.Xrandr)
73 . if ${PREFER.Xrandr} == "pkgsrc"
74 USE_BUILTIN.Xrandr= no
76 USE_BUILTIN.Xrandr= ${IS_BUILTIN.Xrandr}
77 . if defined(BUILTIN_PKG.Xrandr) && \
78 !empty(IS_BUILTIN.Xrandr:M[yY][eE][sS])
79 USE_BUILTIN.Xrandr= yes
80 . for _dep_ in ${BUILDLINK_DEPENDS.Xrandr}
81 . if !empty(USE_BUILTIN.Xrandr:M[yY][eE][sS])
82 USE_BUILTIN.Xrandr!= \
83 if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.Xrandr:Q}; then \
91 . endif # PREFER.Xrandr
93 MAKEVARS+= USE_BUILTIN.Xrandr
96 ### The section below only applies if we are not including this file
97 ### solely to determine whether a built-in implementation exists.
99 CHECK_BUILTIN.Xrandr?= no
100 .if !empty(CHECK_BUILTIN.Xrandr:M[nN][oO])
102 . if !empty(USE_BUILTIN.Xrandr:M[nN][oO])
103 BUILDLINK_DEPENDS.Xrandr+= Xrandr>=1.0.1
104 BUILDLINK_DEPENDS.Xrender+= Xrender>=0.8
107 . if !empty(USE_BUILTIN.Xrandr:M[yY][eE][sS])
108 BUILDLINK_PREFIX.Xrandr= ${X11BASE}
109 USE_BUILTIN.Xrender= yes
110 USE_BUILTIN.randrext= yes
113 .endif # CHECK_BUILTIN.Xrandr