summaryrefslogtreecommitdiff
path: root/x11
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2004-03-10 17:57:14 +0000
committerjlam <jlam@pkgsrc.org>2004-03-10 17:57:14 +0000
commitd0b4c54eb698e718080690cf98ab5b8bbb4001e0 (patch)
tree1226d07b8f66083168895189decc88848b70903f /x11
parent9d61fef8537aed11013bf556e319b2d8e398a11b (diff)
downloadpkgsrc-d0b4c54eb698e718080690cf98ab5b8bbb4001e0.tar.gz
Split out the code that deals with checking whether the software is
built-in or not into a separate builtin.mk file. The code to deal checking for built-in software is much simpler to deal with in pkgsrc. The buildlink3.mk file for a package will be of the usual format regardless of the package, which makes it simpler for packagers to update a package. The builtin.mk file for a package must define a single yes/no variable USE_BUILTIN.<pkg> that is used by bsd.buildlink3.mk to decide whether to use the built-in software or to use the pkgsrc software.
Diffstat (limited to 'x11')
-rw-r--r--x11/Xrandr-mixedcase/buildlink3.mk140
-rw-r--r--x11/Xrandr-mixedcase/builtin.mk99
-rw-r--r--x11/Xrender/buildlink3.mk141
-rw-r--r--x11/Xrender/builtin.mk100
-rw-r--r--x11/randrext/buildlink3.mk91
-rw-r--r--x11/randrext/builtin.mk58
-rw-r--r--x11/render/buildlink3.mk89
-rw-r--r--x11/render/builtin.mk58
-rw-r--r--x11/xcursor/buildlink3.mk106
-rw-r--r--x11/xcursor/builtin.mk68
10 files changed, 431 insertions, 519 deletions
diff --git a/x11/Xrandr-mixedcase/buildlink3.mk b/x11/Xrandr-mixedcase/buildlink3.mk
index 2e43737119c..571c9671547 100644
--- a/x11/Xrandr-mixedcase/buildlink3.mk
+++ b/x11/Xrandr-mixedcase/buildlink3.mk
@@ -1,144 +1,24 @@
-# $NetBSD: buildlink3.mk,v 1.12 2004/02/19 19:12:26 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.13 2004/03/10 17:57:15 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
XRANDR_BUILDLINK3_MK:= ${XRANDR_BUILDLINK3_MK}+
-.include "../../mk/bsd.prefs.mk"
+.if !empty(BUILDLINK_DEPTH:M+)
+BUILDLINK_DEPENDS+= Xrandr
+.endif
+
+BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:NXrandr}
+BUILDLINK_PACKAGES+= Xrandr
.if !empty(XRANDR_BUILDLINK3_MK:M+)
-BUILDLINK_PACKAGES+= Xrandr
BUILDLINK_DEPENDS.Xrandr+= Xrandr>=1.0
BUILDLINK_PKGSRCDIR.Xrandr?= ../../x11/Xrandr
-.endif # XRANDR_BUILDLINK3_MK
-
-BUILDLINK_CHECK_BUILTIN.Xrandr?= NO
-
-_X11_TMPL= ${X11BASE}/lib/X11/config/X11.tmpl
-
-.if !defined(BUILDLINK_IS_BUILTIN.Xrandr)
-BUILDLINK_IS_BUILTIN.Xrandr= NO
-. if exists(${_X11_TMPL})
-_IS_BUILTIN.Xrandr!= \
- if ${GREP} -q BuildRandRLibrary ${_X11_TMPL}; then \
- ${ECHO} "YES"; \
- else \
- ${ECHO} "NO"; \
- fi
-BUILDLINK_IS_BUILTIN.Xrandr= ${_IS_BUILTIN.Xrandr}
-. if !empty(BUILDLINK_CHECK_BUILTIN.Xrandr:M[nN][oO]) && \
- !empty(_IS_BUILTIN.Xrandr:M[yY][eE][sS])
-#
-# Create an appropriate package name for the built-in Xrandr distributed
-# with the system. This package name can be used to check against
-# BUILDLINK_DEPENDS.<pkg> to see if we need to install the pkgsrc version
-# or if the built-in one is sufficient.
-#
-# Xrandr doesn't provide a method of discovering the version number of
-# the software. Match up Xrandr versions with XFree86 versions for an
-# approximate determination of the Xrandr version.
-#
-_XRANDR_VERSIONS= 1.0.2 1.0.1 1.0
-_XRANDR_1.0= 4.2 4.2.* 4.3 4.3.[0-9] 4.3.[0-9].* 4.3.[1-8][0-9]* 4.3.9[0-8]*
-. if !defined(_XF86_VERSION)
-_X11_CONFIG_VERSION_DEF= ${X11BASE}/lib/X11/config/version.def
-. if !exists(${_X11_CONFIG_VERSION_DEF})
-_XF86_VERSION= 3.3
-. else
-_XF86_MAJOR!= \
- ${AWK} '/\#define[ ]*XF86_VERSION_MAJOR/ { print $$3 }' \
- ${_X11_CONFIG_VERSION_DEF}
-_XF86_MINOR!= \
- ${AWK} '/\#define[ ]*XF86_VERSION_MINOR/ { print $$3 }' \
- ${_X11_CONFIG_VERSION_DEF}
-_XF86_PATCH!= \
- ${AWK} '/\#define[ ]*XF86_VERSION_PATCH/ { print $$3 }' \
- ${_X11_CONFIG_VERSION_DEF}
-_XF86_SNAP!= \
- ${AWK} '/\#define[ ]*XF86_VERSION_SNAP/ { print $$3 }' \
- ${_X11_CONFIG_VERSION_DEF}
-_XF86_TEENY= ${_XF86_PATCH}.${_XF86_SNAP}
-. if !empty(_XF86_TEENY:M0.0)
-_XF86_VERSION= ${_XF86_MAJOR}.${_XF86_MINOR}
-. else
-_XF86_VERSION= ${_XF86_MAJOR}.${_XF86_MINOR}.${_XF86_TEENY}
-. endif
-. endif
-. endif
-. for _xrender_version_ in ${_XRANDR_VERSIONS}
-. for _pattern_ in ${_XRANDR_${_xrender_version_}}
-. if !empty(_XF86_VERSION:M${_pattern_})
-_XRANDR_VERSION?= ${_xrender_version_}
-. endif
-. endfor
-. endfor
-_XRANDR_VERSION?= 1.0
-_XRANDR_PKG= Xrandr-${_XRANDR_VERSION}
-
-BUILDLINK_IS_BUILTIN.Xrandr?= YES
-. for _depend_ in ${BUILDLINK_DEPENDS.Xrandr}
-. if !empty(BUILDLINK_IS_BUILTIN.Xrandr:M[yY][eE][sS])
-BUILDLINK_IS_BUILTIN.Xrandr!= \
- if ${PKG_ADMIN} pmatch '${_depend_}' ${_XRANDR_PKG}; then \
- ${ECHO} "YES"; \
- else \
- ${ECHO} "NO"; \
- fi
-. endif
-. endfor
-. endif
-. endif
-MAKEFLAGS+= BUILDLINK_IS_BUILTIN.Xrandr=${BUILDLINK_IS_BUILTIN.Xrandr}
-.endif
-
-.if !empty(BUILDLINK_CHECK_BUILTIN.Xrandr:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.Xrandr= YES
-.endif
-
-.if !defined(BUILDLINK_USE_BUILTIN.Xrandr)
-. if !empty(BUILDLINK_IS_BUILTIN.Xrandr:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.Xrandr= YES
-. else
-BUILDLINK_USE_BUILTIN.Xrandr= NO
-. endif
-. if !empty(PREFER_NATIVE:M[yY][eE][sS]) && \
- !empty(BUILDLINK_IS_BUILTIN.Xrandr:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.Xrandr= YES
-. endif
-. if !empty(PREFER_PKGSRC:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.Xrandr= NO
-. endif
-. if !empty(PREFER_NATIVE:MXrandr) && \
- !empty(BUILDLINK_IS_BUILTIN.Xrandr:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.Xrandr= YES
-. endif
-. if !empty(PREFER_PKGSRC:MXrandr)
-BUILDLINK_USE_BUILTIN.Xrandr= NO
-. endif
-.endif
-
-.if !empty(BUILDLINK_USE_BUILTIN.Xrandr:M[nN][oO])
-BUILDLINK_DEPENDS.Xrandr+= Xrandr>=1.0.1
-BUILDLINK_DEPENDS.Xrender+= Xrender>=0.8
-. if !empty(BUILDLINK_DEPTH:M+)
-BUILDLINK_DEPENDS+= Xrandr
-. endif
-.endif
+USE_X11= yes
-.if !empty(BUILDLINK_USE_BUILTIN.Xrandr:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.randrext= yes
-BUILDLINK_USE_BUILTIN.Xrender= yes
-.endif
+.include "../../x11/randrext/buildlink3.mk"
+.include "../../x11/Xrender/buildlink3.mk"
-.if !empty(XRANDR_BUILDLINK3_MK:M+)
-. if !empty(BUILDLINK_USE_BUILTIN.Xrandr:M[yY][eE][sS])
-BUILDLINK_PREFIX.Xrandr= ${X11BASE}
-. endif
-USE_X11= yes
-. if !empty(BUILDLINK_CHECK_BUILTIN.Xrandr:M[nN][oO])
-. include "../../x11/randrext/buildlink3.mk"
-. include "../../x11/Xrender/buildlink3.mk"
-. endif
.endif # XRANDR_BUILDLINK3_MK
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
diff --git a/x11/Xrandr-mixedcase/builtin.mk b/x11/Xrandr-mixedcase/builtin.mk
new file mode 100644
index 00000000000..26eeb68d4d2
--- /dev/null
+++ b/x11/Xrandr-mixedcase/builtin.mk
@@ -0,0 +1,99 @@
+# $NetBSD: builtin.mk,v 1.1 2004/03/10 17:57:15 jlam Exp $
+
+_X11_TMPL= ${X11BASE}/lib/X11/config/X11.tmpl
+
+.if !defined(IS_BUILTIN.Xrandr)
+IS_BUILTIN.Xrandr= no
+. if exists(${_X11_TMPL})
+IS_BUILTIN.Xrandr!= \
+ if ${GREP} -q BuildRandRLibrary ${_X11_TMPL}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. if !empty(IS_BUILTIN.Xrandr:M[yY][eE][sS])
+#
+# Create an appropriate package name for the built-in Xrandr distributed
+# with the system. This package name can be used to check against
+# BUILDLINK_DEPENDS.<pkg> to see if we need to install the pkgsrc version
+# or if the built-in one is sufficient.
+#
+# Xrandr doesn't provide a method of discovering the version number of
+# the software. Match up Xrandr versions with XFree86 versions for an
+# approximate determination of the Xrandr version.
+#
+_XRANDR_VERSIONS= 1.0.2 1.0.1 1.0
+_XRANDR_1.0= 4.2 4.2.* 4.3 4.3.[0-9] 4.3.[0-9].* 4.3.[1-8][0-9]* 4.3.9[0-8]*
+. if !defined(_XF86_VERSION)
+_X11_CONFIG_VERSION_DEF= ${X11BASE}/lib/X11/config/version.def
+_XF86_VERSION= 3.3
+. if exists(${_X11_CONFIG_VERSION_DEF})
+_XF86_MAJOR!= \
+ ${AWK} '/\#define[ ]*XF86_VERSION_MAJOR/ { print $$3 }' \
+ ${_X11_CONFIG_VERSION_DEF}
+_XF86_MINOR!= \
+ ${AWK} '/\#define[ ]*XF86_VERSION_MINOR/ { print $$3 }' \
+ ${_X11_CONFIG_VERSION_DEF}
+_XF86_PATCH!= \
+ ${AWK} '/\#define[ ]*XF86_VERSION_PATCH/ { print $$3 }' \
+ ${_X11_CONFIG_VERSION_DEF}
+_XF86_SNAP!= \
+ ${AWK} '/\#define[ ]*XF86_VERSION_SNAP/ { print $$3 }' \
+ ${_X11_CONFIG_VERSION_DEF}
+_XF86_TEENY= ${_XF86_PATCH}.${_XF86_SNAP}
+. if !empty(_XF86_TEENY:M0.0)
+_XF86_VERSION= ${_XF86_MAJOR}.${_XF86_MINOR}
+. else
+_XF86_VERSION= ${_XF86_MAJOR}.${_XF86_MINOR}.${_XF86_TEENY}
+. endif
+. endif
+MAKEFLAGS+= _XF86_VERSION=${_XF86_VERSION}
+. endif
+. for _xrandr_version_ in ${_XRANDR_VERSIONS}
+. for _pattern_ in ${_XRANDR_${_xrandr_version_}}
+. if !empty(_XF86_VERSION:M${_pattern_})
+_XRANDR_VERSION?= ${_xrandr_version_}
+. endif
+. endfor
+. endfor
+_XRANDR_VERSION?= 1.0
+BUILTIN_PKG.Xrandr= Xrandr-${_XRANDR_VERSION}
+MAKEFLAGS+= BUILTIN_PKG.Xrandr=${BUILTIN_PKG.Xrandr}
+. endif
+. endif
+MAKEFLAGS+= IS_BUILTIN.Xrandr=${IS_BUILTIN.Xrandr}
+.endif
+
+CHECK_BUILTIN.Xrandr?= no
+.if !empty(CHECK_BUILTIN.Xrandr:M[yY][eE][sS])
+USE_BUILTIN.Xrandr= yes
+.endif
+
+.if !defined(USE_BUILTIN.Xrandr)
+USE_BUILTIN.Xrandr?= ${IS_BUILTIN.Xrandr}
+
+. if defined(BUILTIN_PKG.Xrandr)
+USE_BUILTIN.Xrandr= yes
+. for _depend_ in ${BUILDLINK_DEPENDS.Xrandr}
+. if !empty(USE_BUILTIN.Xrandr:M[yY][eE][sS])
+USE_BUILTIN.Xrandr!= \
+ if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.Xrandr}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. endif
+. endfor
+. endif
+.endif # USE_BUILTIN.Xrandr
+
+.if !empty(USE_BUILTIN.Xrandr:M[nN][oO])
+BUILDLINK_DEPENDS.Xrandr+= Xrandr>=1.0.1
+BUILDLINK_DEPENDS.Xrender+= Xrender>=0.8
+.endif
+
+.if !empty(USE_BUILTIN.Xrandr:M[yY][eE][sS])
+BUILDLINK_PREFIX.Xrandr= ${X11BASE}
+USE_BUILTIN.randrext= yes
+USE_BUILTIN.Xrender= yes
+.endif
diff --git a/x11/Xrender/buildlink3.mk b/x11/Xrender/buildlink3.mk
index bbe7137be11..80e93c5e097 100644
--- a/x11/Xrender/buildlink3.mk
+++ b/x11/Xrender/buildlink3.mk
@@ -1,144 +1,23 @@
-# $NetBSD: buildlink3.mk,v 1.29 2004/02/29 00:22:43 recht Exp $
+# $NetBSD: buildlink3.mk,v 1.30 2004/03/10 17:57:15 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
XRENDER_BUILDLINK3_MK:= ${XRENDER_BUILDLINK3_MK}+
-.include "../../mk/bsd.prefs.mk"
+.if !empty(BUILDLINK_DEPTH:M+)
+BUILDLINK_DEPENDS+= Xrender
+.endif
+
+BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:NXrender}
+BUILDLINK_PACKAGES+= Xrender
.if !empty(XRENDER_BUILDLINK3_MK:M+)
-BUILDLINK_PACKAGES+= Xrender
BUILDLINK_DEPENDS.Xrender+= Xrender>=0.2
BUILDLINK_PKGSRCDIR.Xrender?= ../../x11/Xrender
-.endif # XRENDER_BUILDLINK3_MK
-
-BUILDLINK_CHECK_BUILTIN.Xrender?= NO
-
-_X11_TMPL= ${X11BASE}/lib/X11/config/X11.tmpl
-
-.if !defined(BUILDLINK_IS_BUILTIN.Xrender)
-BUILDLINK_IS_BUILTIN.Xrender= NO
-. if exists(${_X11_TMPL})
-_IS_BUILTIN.Xrender!= \
- if ${GREP} -q BuildRenderLibrary ${_X11_TMPL}; then \
- ${ECHO} "YES"; \
- else \
- ${ECHO} "NO"; \
- fi
-BUILDLINK_IS_BUILTIN.Xrender= ${_IS_BUILTIN.Xrender}
-. if !empty(BUILDLINK_CHECK_BUILTIN.Xrender:M[nN][oO]) && \
- !empty(_IS_BUILTIN.Xrender:M[yY][eE][sS])
-#
-# Create an appropriate package name for the built-in Xrender distributed
-# with the system. This package name can be used to check against
-# BUILDLINK_DEPENDS.<pkg> to see if we need to install the pkgsrc version
-# or if the built-in one is sufficient.
-#
-# Xrender doesn't provide a method of discovering the version number of
-# the software. Match up Xrender versions with XFree86 versions for an
-# approximate determination of the Xrender version.
-#
-_XRENDER_VERSIONS= 0.8.3 0.8.2 0.8.1 0.8 0.2 0.1
-_XRENDER_0.1= 4.0 4.0.* 4.1 4.1.[0-9] 4.1.[0-9].* 4.1.[1-8][0-9]* 4.1.9[0-8]*
-_XRENDER_0.2= 4.1.99.* 4.2 4.2.[0-9] 4.2.[0-9].* 4.2.[1-8][0-9]* 4.2.9[0-8]*
-_XRENDER_0.8= 4.2.99.* 4.3 4.3.[0-9] 4.3.[0-9].* 4.3.[1-8][0-9]* 4.3.9[0-8]*
-. if !defined(_XF86_VERSION)
-_X11_CONFIG_VERSION_DEF= ${X11BASE}/lib/X11/config/version.def
-. if !exists(${_X11_CONFIG_VERSION_DEF})
-_XF86_VERSION= 3.3
-. else
-_XF86_MAJOR!= \
- ${AWK} '/\#define[ ]*XF86_VERSION_MAJOR/ { print $$3 }' \
- ${_X11_CONFIG_VERSION_DEF}
-_XF86_MINOR!= \
- ${AWK} '/\#define[ ]*XF86_VERSION_MINOR/ { print $$3 }' \
- ${_X11_CONFIG_VERSION_DEF}
-_XF86_PATCH!= \
- ${AWK} '/\#define[ ]*XF86_VERSION_PATCH/ { print $$3 }' \
- ${_X11_CONFIG_VERSION_DEF}
-_XF86_SNAP!= \
- ${AWK} '/\#define[ ]*XF86_VERSION_SNAP/ { print $$3 }' \
- ${_X11_CONFIG_VERSION_DEF}
-_XF86_TEENY= ${_XF86_PATCH}.${_XF86_SNAP}
-. if !empty(_XF86_TEENY:M0.0)
-_XF86_VERSION= ${_XF86_MAJOR}.${_XF86_MINOR}
-. else
-_XF86_VERSION= ${_XF86_MAJOR}.${_XF86_MINOR}.${_XF86_TEENY}
-. endif
-. endif
-. endif
-. for _xrender_version_ in ${_XRENDER_VERSIONS}
-. for _pattern_ in ${_XRENDER_${_xrender_version_}}
-. if !empty(_XF86_VERSION:M${_pattern_})
-_XRENDER_VERSION?= ${_xrender_version_}
-. endif
-. endfor
-. endfor
-_XRENDER_VERSION?= 0.1
-_XRENDER_PKG= Xrender-${_XRENDER_VERSION}
-
-BUILDLINK_IS_BUILTIN.Xrender?= YES
-. for _depend_ in ${BUILDLINK_DEPENDS.Xrender}
-. if !empty(BUILDLINK_IS_BUILTIN.Xrender:M[yY][eE][sS])
-BUILDLINK_IS_BUILTIN.Xrender!= \
- if ${PKG_ADMIN} pmatch '${_depend_}' ${_XRENDER_PKG}; then \
- ${ECHO} "YES"; \
- else \
- ${ECHO} "NO"; \
- fi
-. endif
-. endfor
-. endif
-. endif
-MAKEFLAGS+= BUILDLINK_IS_BUILTIN.Xrender=${BUILDLINK_IS_BUILTIN.Xrender}
-.endif
-
-.if !empty(BUILDLINK_CHECK_BUILTIN.Xrender:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.Xrender= YES
-.endif
-
-.if !defined(BUILDLINK_USE_BUILTIN.Xrender)
-. if !empty(BUILDLINK_IS_BUILTIN.Xrender:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.Xrender= YES
-. else
-BUILDLINK_USE_BUILTIN.Xrender= NO
-. endif
-. if !empty(PREFER_NATIVE:M[yY][eE][sS]) && \
- !empty(BUILDLINK_IS_BUILTIN.Xrender:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.Xrender= YES
-. endif
-. if !empty(PREFER_PKGSRC:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.Xrender= NO
-. endif
-. if !empty(PREFER_NATIVE:MXrender) && \
- !empty(BUILDLINK_IS_BUILTIN.Xrender:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.Xrender= YES
-. endif
-. if !empty(PREFER_PKGSRC:MXrender)
-BUILDLINK_USE_BUILTIN.Xrender= NO
-. endif
-.endif
-
-.if !empty(BUILDLINK_USE_BUILTIN.Xrender:M[nN][oO])
-BUILDLINK_DEPENDS.Xrender+= Xrender>=0.8.2
-BUILDLINK_DEPENDS.render+= render>=0.8
-. if !empty(BUILDLINK_DEPTH:M+)
-BUILDLINK_DEPENDS+= Xrender
-. endif
-.endif
+USE_X11= yes
-.if !empty(BUILDLINK_USE_BUILTIN.Xrender:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.render= yes
-.endif
+.include "../../x11/render/buildlink3.mk"
-.if !empty(XRENDER_BUILDLINK3_MK:M+)
-. if !empty(BUILDLINK_USE_BUILTIN.Xrender:M[yY][eE][sS])
-BUILDLINK_PREFIX.Xrender= ${X11BASE}
-. endif
-USE_X11= yes
-. if !empty(BUILDLINK_CHECK_BUILTIN.Xrender:M[nN][oO])
-. include "../../x11/render/buildlink3.mk"
-. endif
.endif # XRENDER_BUILDLINK3_MK
-BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
+BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
diff --git a/x11/Xrender/builtin.mk b/x11/Xrender/builtin.mk
new file mode 100644
index 00000000000..b7a1940bc8c
--- /dev/null
+++ b/x11/Xrender/builtin.mk
@@ -0,0 +1,100 @@
+# $NetBSD: builtin.mk,v 1.1 2004/03/10 17:57:15 jlam Exp $
+
+_X11_TMPL= ${X11BASE}/lib/X11/config/X11.tmpl
+
+.if !defined(IS_BUILTIN.Xrender)
+IS_BUILTIN.Xrender= no
+. if exists(${_X11_TMPL})
+IS_BUILTIN.Xrender!= \
+ if ${GREP} -q BuildRenderLibrary ${_X11_TMPL}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. if !empty(IS_BUILTIN.Xrender:M[yY][eE][sS])
+#
+# Create an appropriate package name for the built-in Xrender distributed
+# with the system. This package name can be used to check against
+# BUILDLINK_DEPENDS.<pkg> to see if we need to install the pkgsrc version
+# or if the built-in one is sufficient.
+#
+# Xrender doesn't provide a method of discovering the version number of
+# the software. Match up Xrender versions with XFree86 versions for an
+# approximate determination of the Xrender version.
+#
+_XRENDER_VERSIONS= 0.8.3 0.8.2 0.8.1 0.8 0.2 0.1
+_XRENDER_0.1= 4.0 4.0.* 4.1 4.1.[0-9] 4.1.[0-9].* 4.1.[1-8][0-9]* 4.1.9[0-8]*
+_XRENDER_0.2= 4.1.99.* 4.2 4.2.[0-9] 4.2.[0-9].* 4.2.[1-8][0-9]* 4.2.9[0-8]*
+_XRENDER_0.8= 4.2.99.* 4.3 4.3.[0-9] 4.3.[0-9].* 4.3.[1-8][0-9]* 4.3.9[0-8]*
+. if !defined(_XF86_VERSION)
+_X11_CONFIG_VERSION_DEF= ${X11BASE}/lib/X11/config/version.def
+_XF86_VERSION= 3.3
+. if exists(${_X11_CONFIG_VERSION_DEF})
+_XF86_MAJOR!= \
+ ${AWK} '/\#define[ ]*XF86_VERSION_MAJOR/ { print $$3 }' \
+ ${_X11_CONFIG_VERSION_DEF}
+_XF86_MINOR!= \
+ ${AWK} '/\#define[ ]*XF86_VERSION_MINOR/ { print $$3 }' \
+ ${_X11_CONFIG_VERSION_DEF}
+_XF86_PATCH!= \
+ ${AWK} '/\#define[ ]*XF86_VERSION_PATCH/ { print $$3 }' \
+ ${_X11_CONFIG_VERSION_DEF}
+_XF86_SNAP!= \
+ ${AWK} '/\#define[ ]*XF86_VERSION_SNAP/ { print $$3 }' \
+ ${_X11_CONFIG_VERSION_DEF}
+_XF86_TEENY= ${_XF86_PATCH}.${_XF86_SNAP}
+. if !empty(_XF86_TEENY:M0.0)
+_XF86_VERSION= ${_XF86_MAJOR}.${_XF86_MINOR}
+. else
+_XF86_VERSION= ${_XF86_MAJOR}.${_XF86_MINOR}.${_XF86_TEENY}
+. endif
+. endif
+MAKEFLAGS+= _XF86_VERSION=${_XF86_VERSION}
+. endif
+. for _xrender_version_ in ${_XRENDER_VERSIONS}
+. for _pattern_ in ${_XRENDER_${_xrender_version_}}
+. if !empty(_XF86_VERSION:M${_pattern_})
+_XRENDER_VERSION?= ${_xrender_version_}
+. endif
+. endfor
+. endfor
+_XRENDER_VERSION?= 0.1
+BUILTIN_PKG.Xrender= Xrender-${_XRENDER_VERSION}
+MAKEFLAGS+= BUILTIN_PKG.Xrender=${BUILTIN_PKG.Xrender}
+. endif
+. endif
+MAKEFLAGS+= IS_BUILTIN.Xrender=${IS_BUILTIN.Xrender}
+.endif
+
+CHECK_BUILTIN.Xrender?= no
+.if !empty(CHECK_BUILTIN.Xrender:M[yY][eE][sS])
+USE_BUILTIN.Xrender= yes
+.endif
+
+.if !defined(USE_BUILTIN.Xrender)
+USE_BUILTIN.Xrender?= ${IS_BUILTIN.Xrender}
+
+. if defined(BUILTIN_PKG.Xrender)
+USE_BUILTIN.Xrender= yes
+. for _depend_ in ${BUILDLINK_DEPENDS.Xrender}
+. if !empty(USE_BUILTIN.Xrender:M[yY][eE][sS])
+USE_BUILTIN.Xrender!= \
+ if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.Xrender}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. endif
+. endfor
+. endif
+.endif # USE_BUILTIN.Xrender
+
+.if !empty(USE_BUILTIN.Xrender:M[nN][oO])
+BUILDLINK_DEPENDS.Xrender+= Xrender>=0.8.2
+BUILDLINK_DEPENDS.render+= render>=0.8
+.endif
+
+.if !empty(USE_BUILTIN.Xrender:M[yY][eE][sS])
+BUILDLINK_PREFIX.Xrender= ${X11BASE}
+USE_BUILTIN.render= yes
+.endif
diff --git a/x11/randrext/buildlink3.mk b/x11/randrext/buildlink3.mk
index 3e4c7ecc2f0..c5c01ef3591 100644
--- a/x11/randrext/buildlink3.mk
+++ b/x11/randrext/buildlink3.mk
@@ -1,95 +1,22 @@
-# $NetBSD: buildlink3.mk,v 1.2 2004/02/18 16:35:27 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.3 2004/03/10 17:57:15 jlam Exp $
-BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
+BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
RANDREXT_BUILDLINK3_MK:= ${RANDREXT_BUILDLINK3_MK}+
-.include "../../mk/bsd.prefs.mk"
+.if !empty(BUILDLINK_DEPTH:M+)
+BUILDLINK_DEPENDS+= randrext
+.endif
+
+BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Nrandrext}
+BUILDLINK_PACKAGES+= randrext
.if !empty(RANDREXT_BUILDLINK3_MK:M+)
-BUILDLINK_PACKAGES+= randrext
BUILDLINK_DEPENDS.randrext+= randrext>=1.0
BUILDLINK_PKGSRCDIR.randrext?= ../../x11/randrext
BUILDLINK_DEPMETHOD.randrext?= build
-.endif # RANDREXT_BUILDLINK3_MK
-
-BUILDLINK_CHECK_BUILTIN.randrext?= NO
-
-_X11_EXTENSIONS_RANDR_H= ${X11BASE}/include/X11/extensions/randr.h
-
-.if !defined(BUILDLINK_IS_BUILTIN.randrext)
-BUILDLINK_IS_BUILTIN.randrext= NO
-. if exists(${_X11_EXTENSIONS_RANDR_H})
-BUILDLINK_IS_BUILTIN.randrext= YES
-. if !empty(BUILDLINK_CHECK_BUILTIN.randrext:M[nN][oO])
-#
-# Create an appropriate package name for the built-in randr distributed
-# with the system. This package name can be used to check against
-# BUILDLINK_DEPENDS.<pkg> to see if we need to install the pkgsrc version
-# or if the built-in one is sufficient.
-#
-_RANDR_MAJOR!= \
- ${AWK} '/\#define[ ]*RANDR_MAJOR/ { print $$3 }' \
- ${_X11_EXTENSIONS_RANDR_H}
-_RANDR_MINOR!= \
- ${AWK} '/\#define[ ]*RANDR_MINOR/ { print "."$$3 }' \
- ${_X11_EXTENSIONS_RANDR_H}
-_RANDR_VERSION= ${_RANDR_MAJOR}${_RANDR_MINOR}
-_RANDR_PKG= randr-${_RANDR_VERSION}
-BUILDLINK_IS_BUILTIN.randrext?= YES
-. for _depend_ in ${BUILDLINK_DEPENDS.randrext}
-. if !empty(BUILDLINK_IS_BUILTIN.randrext:M[yY][eE][sS])
-BUILDLINK_IS_BUILTIN.randrext!= \
- if ${PKG_ADMIN} pmatch '${_depend_}' ${_RANDR_PKG}; then \
- ${ECHO} "YES"; \
- else \
- ${ECHO} "NO"; \
- fi
-. endif
-. endfor
-. endif
-. endif
-MAKEFLAGS+= BUILDLINK_IS_BUILTIN.randrext=${BUILDLINK_IS_BUILTIN.randrext}
-.endif
-
-.if !empty(BUILDLINK_CHECK_BUILTIN.randrext:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.randrext= YES
-.endif
-.if !defined(BUILDLINK_USE_BUILTIN.randrext)
-. if !empty(BUILDLINK_IS_BUILTIN.randrext:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.randrext= YES
-. else
-BUILDLINK_USE_BUILTIN.randrext= NO
-. endif
-
-. if !empty(PREFER_NATIVE:M[yY][eE][sS]) && \
- !empty(BUILDLINK_IS_BUILTIN.randrext:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.randrext= YES
-. endif
-. if !empty(PREFER_PKGSRC:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.randrext= NO
-. endif
-. if !empty(PREFER_NATIVE:Mrandr) && \
- !empty(BUILDLINK_IS_BUILTIN.randrext:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.randrext= YES
-. endif
-. if !empty(PREFER_PKGSRC:Mrandr)
-BUILDLINK_USE_BUILTIN.randrext= NO
-. endif
-.endif
-
-.if !empty(BUILDLINK_USE_BUILTIN.randrext:M[nN][oO])
-. if !empty(BUILDLINK_DEPTH:M+)
-BUILDLINK_DEPENDS+= randrext
-. endif
-.endif
-
-.if !empty(RANDREXT_BUILDLINK3_MK:M+)
-BUILDLINK_DEPENDS.randrext+= randrext>=1.0
-. if !empty(BUILDLINK_USE_BUILTIN.randrext:M[yY][eE][sS])
-BUILDLINK_PREFIX.randrext= ${X11BASE}
-. endif
USE_X11= yes
+
.endif # RANDREXT_BUILDLINK3_MK
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
diff --git a/x11/randrext/builtin.mk b/x11/randrext/builtin.mk
new file mode 100644
index 00000000000..af142fe125d
--- /dev/null
+++ b/x11/randrext/builtin.mk
@@ -0,0 +1,58 @@
+# $NetBSD: builtin.mk,v 1.1 2004/03/10 17:57:15 jlam Exp $
+
+_X11_EXTENSIONS_RANDR_H= ${X11BASE}/include/X11/extensions/randr.h
+
+.if !defined(IS_BUILTIN.randrext)
+IS_BUILTIN.randrext= no
+. if exists(${_X11_EXTENSIONS_RANDR_H})
+IS_BUILTIN.randrext= yes
+#
+# Create an appropriate package name for the built-in randr distributed
+# with the system. This package name can be used to check against
+# BUILDLINK_DEPENDS.<pkg> to see if we need to install the pkgsrc version
+# or if the built-in one is sufficient.
+#
+_RANDR_MAJOR!= \
+ ${AWK} '/\#define[ ]*RANDR_MAJOR/ { print $$3 }' \
+ ${_X11_EXTENSIONS_RANDR_H}
+_RANDR_MINOR!= \
+ ${AWK} '/\#define[ ]*RANDR_MINOR/ { print "."$$3 }' \
+ ${_X11_EXTENSIONS_RANDR_H}
+_RANDR_VERSION= ${_RANDR_MAJOR}${_RANDR_MINOR}
+BUILTIN_PKG.randrext= randrext-${_RANDR_VERSION}
+MAKEFLAGS+= BUILTIN_PKG.randrext=${BUILTIN_PKG.randrext}
+. endif
+MAKEFLAGS+= IS_BUILTIN.randrext=${IS_BUILTIN.randrext}
+.endif
+
+CHECK_BUILTIN.randrext?= no
+.if !empty(CHECK_BUILTIN.randrext:M[yY][eE][sS])
+USE_BUILTIN.randrext= yes
+.endif
+
+.if !defined(USE_BUILTIN.randrext)
+USE_BUILTIN.randrext?= ${IS_BUILTIN.randrext}
+
+. if defined(BUILTIN_PKG.randrext)
+USE_BUILTIN.randrext= yes
+. for _depend_ in ${BUILDLINK_DEPENDS.randrext}
+. if !empty(USE_BUILTIN.randrext:M[yY][eE][sS])
+USE_BUILTIN.randrext!= \
+ if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.randrext}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. endif
+. endfor
+. endif
+.endif # USE_BUILTIN.randrext
+
+.if !empty(USE_BUILTIN.randrext:M[nN][oO])
+BUILDLINK_DEPENDS.randrext+= randrext>=1.0
+.endif
+
+.if !empty(USE_BUILTIN.randrext:M[yY][eE][sS])
+BUILDLINK_PREFIX.randrext= ${X11BASE}
+USE_X11= yes
+.endif
diff --git a/x11/render/buildlink3.mk b/x11/render/buildlink3.mk
index 5ea88adf8ff..4698900316e 100644
--- a/x11/render/buildlink3.mk
+++ b/x11/render/buildlink3.mk
@@ -1,95 +1,22 @@
-# $NetBSD: buildlink3.mk,v 1.5 2004/02/18 16:35:27 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.6 2004/03/10 17:57:15 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
RENDER_BUILDLINK3_MK:= ${RENDER_BUILDLINK3_MK}+
-.include "../../mk/bsd.prefs.mk"
+.if !empty(BUILDLINK_DEPTH:M+)
+BUILDLINK_DEPENDS+= render
+.endif
+
+BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Nrender}
+BUILDLINK_PACKAGES+= render
.if !empty(RENDER_BUILDLINK3_MK:M+)
-BUILDLINK_PACKAGES+= render
BUILDLINK_DEPENDS.render+= render>=0.2
BUILDLINK_PKGSRCDIR.render?= ../../x11/render
BUILDLINK_DEPMETHOD.render?= build
-.endif # RENDER_BUILDLINK3_MK
-
-BUILDLINK_CHECK_BUILTIN.render?= NO
-
-_X11_EXTENSIONS_RENDER_H= ${X11BASE}/include/X11/extensions/render.h
-
-.if !defined(BUILDLINK_IS_BUILTIN.render)
-BUILDLINK_IS_BUILTIN.render= NO
-. if exists(${_X11_EXTENSIONS_RENDER_H})
-BUILDLINK_IS_BUILTIN.render= YES
-. if !empty(BUILDLINK_CHECK_BUILTIN.render:M[nN][oO])
-#
-# Create an appropriate package name for the built-in render distributed
-# with the system. This package name can be used to check against
-# BUILDLINK_DEPENDS.<pkg> to see if we need to install the pkgsrc version
-# or if the built-in one is sufficient.
-#
-_RENDER_MAJOR!= \
- ${AWK} '/\#define[ ]*RENDER_MAJOR/ { print $$3 }' \
- ${_X11_EXTENSIONS_RENDER_H}
-_RENDER_MINOR!= \
- ${AWK} '/\#define[ ]*RENDER_MINOR/ { print "."$$3 }' \
- ${_X11_EXTENSIONS_RENDER_H}
-_RENDER_VERSION= ${_RENDER_MAJOR}${_RENDER_MINOR}
-_RENDER_PKG= render-${_RENDER_VERSION}
-BUILDLINK_IS_BUILTIN.render?= YES
-. for _depend_ in ${BUILDLINK_DEPENDS.render}
-. if !empty(BUILDLINK_IS_BUILTIN.render:M[yY][eE][sS])
-BUILDLINK_IS_BUILTIN.render!= \
- if ${PKG_ADMIN} pmatch '${_depend_}' ${_RENDER_PKG}; then \
- ${ECHO} "YES"; \
- else \
- ${ECHO} "NO"; \
- fi
-. endif
-. endfor
-. endif
-. endif
-MAKEFLAGS+= BUILDLINK_IS_BUILTIN.render=${BUILDLINK_IS_BUILTIN.render}
-.endif
-
-.if !empty(BUILDLINK_CHECK_BUILTIN.render:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.render= YES
-.endif
-
-.if !defined(BUILDLINK_USE_BUILTIN.render)
-. if !empty(BUILDLINK_IS_BUILTIN.render:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.render= YES
-. else
-BUILDLINK_USE_BUILTIN.render= NO
-. endif
-
-. if !empty(PREFER_NATIVE:M[yY][eE][sS]) && \
- !empty(BUILDLINK_IS_BUILTIN.render:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.render= YES
-. endif
-. if !empty(PREFER_PKGSRC:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.render= NO
-. endif
-. if !empty(PREFER_NATIVE:Mrender) && \
- !empty(BUILDLINK_IS_BUILTIN.render:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.render= YES
-. endif
-. if !empty(PREFER_PKGSRC:Mrender)
-BUILDLINK_USE_BUILTIN.render= NO
-. endif
-.endif
-.if !empty(BUILDLINK_USE_BUILTIN.render:M[nN][oO])
-. if !empty(BUILDLINK_DEPTH:M+)
-BUILDLINK_DEPENDS+= render
-. endif
-.endif
-
-.if !empty(RENDER_BUILDLINK3_MK:M+)
-BUILDLINK_DEPENDS.render+= render>=0.8
-. if !empty(BUILDLINK_USE_BUILTIN.render:M[yY][eE][sS])
-BUILDLINK_PREFIX.render= ${X11BASE}
-. endif
USE_X11= yes
+
.endif # RENDER_BUILDLINK3_MK
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
diff --git a/x11/render/builtin.mk b/x11/render/builtin.mk
new file mode 100644
index 00000000000..61bf829dc13
--- /dev/null
+++ b/x11/render/builtin.mk
@@ -0,0 +1,58 @@
+# $NetBSD: builtin.mk,v 1.1 2004/03/10 17:57:15 jlam Exp $
+
+_X11_EXTENSIONS_RENDER_H= ${X11BASE}/include/X11/extensions/render.h
+
+.if !defined(IS_BUILTIN.render)
+IS_BUILTIN.render= no
+. if exists(${_X11_EXTENSIONS_RENDER_H})
+IS_BUILTIN.render= yes
+#
+# Create an appropriate package name for the built-in render distributed
+# with the system. This package name can be used to check against
+# BUILDLINK_DEPENDS.<pkg> to see if we need to install the pkgsrc version
+# or if the built-in one is sufficient.
+#
+_RENDER_MAJOR!= \
+ ${AWK} '/\#define[ ]*RENDER_MAJOR/ { print $$3 }' \
+ ${_X11_EXTENSIONS_RENDER_H}
+_RENDER_MINOR!= \
+ ${AWK} '/\#define[ ]*RENDER_MINOR/ { print "."$$3 }' \
+ ${_X11_EXTENSIONS_RENDER_H}
+_RENDER_VERSION= ${_RENDER_MAJOR}${_RENDER_MINOR}
+BUILTIN_PKG.render= render-${_RENDER_VERSION}
+MAKEFLAGS+= BUILTIN_PKG.render=${BUILTIN_PKG.render}
+. endif
+MAKEFLAGS+= IS_BUILTIN.render=${IS_BUILTIN.render}
+.endif
+
+CHECK_BUILTIN.render?= no
+.if !empty(CHECK_BUILTIN.render:M[yY][eE][sS])
+USE_BUILTIN.render= yes
+.endif
+
+.if !defined(USE_BUILTIN.render)
+USE_BUILTIN.render?= ${IS_BUILTIN.render}
+
+. if defined(BUILTIN_PKG.render)
+USE_BUILTIN.render= yes
+. for _depend_ in ${BUILDLINK_DEPENDS.render}
+. if !empty(USE_BUILTIN.render:M[yY][eE][sS])
+USE_BUILTIN.render!= \
+ if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.render}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. endif
+. endfor
+. endif
+.endif # USE_BUILTIN.render
+
+.if !empty(USE_BUILTIN.render:M[nN][oO])
+BUILDLINK_DEPENDS.render+= render>=0.8
+.endif
+
+.if !empty(USE_BUILTIN.render:M[yY][eE][sS])
+BUILDLINK_PREFIX.render= ${X11BASE}
+USE_X11= yes
+.endif
diff --git a/x11/xcursor/buildlink3.mk b/x11/xcursor/buildlink3.mk
index 308b3a7c7ba..aa7d3027cfd 100644
--- a/x11/xcursor/buildlink3.mk
+++ b/x11/xcursor/buildlink3.mk
@@ -1,110 +1,26 @@
-# $NetBSD: buildlink3.mk,v 1.11 2004/02/19 19:12:26 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.12 2004/03/10 17:57:15 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
XCURSOR_BUILDLINK3_MK:= ${XCURSOR_BUILDLINK3_MK}+
-.include "../../mk/bsd.prefs.mk"
+.if !empty(BUILDLINK_DEPTH:M+)
+BUILDLINK_DEPENDS+= xcursor
+.endif
+
+BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Nxcursor}
+BUILDLINK_PACKAGES+= xcursor
.if !empty(XCURSOR_BUILDLINK3_MK:M+)
-BUILDLINK_PACKAGES+= xcursor
BUILDLINK_DEPENDS.xcursor+= xcursor>=1.0
BUILDLINK_PKGSRCDIR.xcursor?= ../../x11/xcursor
-.endif # XCURSOR_BUILDLINK3_MK
-
-BUILDLINK_CHECK_BUILTIN.xcursor?= NO
-_X11_XCURSOR_XCURSOR_H= ${X11BASE}/include/X11/Xcursor/Xcursor.h
-
-.if !defined(BUILDLINK_IS_BUILTIN.xcursor)
-BUILDLINK_IS_BUILTIN.xcursor= NO
-. if exists(${_X11_XCURSOR_XCURSOR_H})
-BUILDLINK_IS_BUILTIN.xcursor= YES
-. if !empty(BUILDLINK_CHECK_BUILTIN.xcursor:M[nN][oO])
-#
-# Create an appropriate package name for the built-in Xcursor distributed
-# with the system. This package name can be used to check against
-# BUILDLINK_DEPENDS.<pkg> to see if we need to install the pkgsrc version
-# or if the built-in one is sufficient.
-#
-_XCURSOR_MAJOR!= \
- ${AWK} '/\#define[ ]*XCURSOR_MAJOR/ { print $$3 }' \
- ${_X11_XCURSOR_XCURSOR_H}
-_XCURSOR_MINOR!= \
- ${AWK} '/\#define[ ]*XCURSOR_MINOR/ { print "."$$3 }' \
- ${_X11_XCURSOR_XCURSOR_H}
-_XCURSOR_REVISION!= \
- ${AWK} '/\#define[ ]*XCURSOR_MINOR/ { print "."$$3 }' \
- ${_X11_XCURSOR_XCURSOR_H}
-_XCURSOR_VERSION= ${_XCURSOR_MAJOR}${_XCURSOR_MINOR}${_XCURSOR_REVISION}
-_XCURSOR_PKG= xcursor-${_XCURSOR_VERSION}
-
-BUILDLINK_IS_BUILTIN.xcursor?= YES
-. for _depend_ in ${BUILDLINK_DEPENDS.xcursor}
-. if !empty(BUILDLINK_IS_BUILTIN.xcursor:M[yY][eE][sS])
-BUILDLINK_IS_BUILTIN.xcursor!= \
- if ${PKG_ADMIN} pmatch '${_depend_}' ${_XCURSOR_PKG}; then \
- ${ECHO} "YES"; \
- else \
- ${ECHO} "NO"; \
- fi
-. endif
-. endfor
-. endif
-. endif
-MAKEFLAGS+= BUILDLINK_IS_BUILTIN.xcursor=${BUILDLINK_IS_BUILTIN.xcursor}
-.endif
-
-.if !empty(BUILDLINK_CHECK_BUILTIN.xcursor:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.xcursor= YES
-.endif
-
-.if !defined(BUILDLINK_USE_BUILTIN.xcursor)
-. if !empty(BUILDLINK_IS_BUILTIN.xcursor:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.xcursor= YES
-. else
-BUILDLINK_USE_BUILTIN.xcursor= NO
-. endif
+USE_X11= yes
-. if !empty(PREFER_NATIVE:M[yY][eE][sS]) && \
- !empty(BUILDLINK_IS_BUILTIN.xcursor:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.xcursor= YES
-. endif
-. if !empty(PREFER_PKGSRC:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.xcursor= NO
-. endif
-. if !empty(PREFER_NATIVE:Mxcursor) && \
- !empty(BUILDLINK_IS_BUILTIN.xcursor:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.xcursor= YES
-. endif
-. if !empty(PREFER_PKGSRC:Mxcursor)
-BUILDLINK_USE_BUILTIN.xcursor= NO
-. endif
-.endif
+# Xfixes/buildlink3.mk is included by xcursor/builtin.mk
+#.include "../../x11/Xfixes/buildlink3.mk"
-.if !empty(BUILDLINK_USE_BUILTIN.xcursor:M[nN][oO])
-BUILDLINK_DEPENDS.xcursor+= xcursor>=1.1.1
-BUILDLINK_DEPENDS.Xrender+= Xrender>=0.8
-. if !empty(BUILDLINK_DEPTH:M+)
-BUILDLINK_DEPENDS+= xcursor
-. endif
-.endif
+.include "../../x11/Xrender/buildlink3.mk"
-.if !empty(BUILDLINK_USE_BUILTIN.xcursor:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.Xrender= yes
-.endif
-
-.if !empty(XCURSOR_BUILDLINK3_MK:M+)
-. if !empty(BUILDLINK_USE_BUILTIN.xcursor:M[yY][eE][sS])
-BUILDLINK_PREFIX.xcursor= ${X11BASE}
-BUILDLINK_FILES.xcursor+= lib/pkgconfig/xcursor.pc
-. endif
-USE_X11= yes
-. if !empty(BUILDLINK_CHECK_BUILTIN.xcursor:M[nN][oO])
-. if !empty(BUILDLINK_USE_BUILTIN.xcursor:M[nN][oO])
-. include "../../x11/Xfixes/buildlink3.mk"
-. endif
-. include "../../x11/Xrender/buildlink3.mk"
-. endif
.endif # XCURSOR_BUILDLINK3_MK
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
diff --git a/x11/xcursor/builtin.mk b/x11/xcursor/builtin.mk
new file mode 100644
index 00000000000..817c2d7c25b
--- /dev/null
+++ b/x11/xcursor/builtin.mk
@@ -0,0 +1,68 @@
+# $NetBSD: builtin.mk,v 1.1 2004/03/10 17:57:15 jlam Exp $
+
+_X11_XCURSOR_XCURSOR_H= ${X11BASE}/include/X11/Xcursor/Xcursor.h
+
+.if !defined(IS_BUILTIN.xcursor)
+IS_BUILTIN.xcursor= no
+. if exists(${_X11_XCURSOR_XCURSOR_H})
+IS_BUILTIN.xcursor= yes
+#
+# Create an appropriate package name for the built-in Xcursor distributed
+# with the system. This package name can be used to check against
+# BUILDLINK_DEPENDS.<pkg> to see if we need to install the pkgsrc version
+# or if the built-in one is sufficient.
+#
+_XCURSOR_MAJOR!= \
+ ${AWK} '/\#define[ ]*XCURSOR_MAJOR/ { print $$3 }' \
+ ${_X11_XCURSOR_XCURSOR_H}
+_XCURSOR_MINOR!= \
+ ${AWK} '/\#define[ ]*XCURSOR_MINOR/ { print "."$$3 }' \
+ ${_X11_XCURSOR_XCURSOR_H}
+_XCURSOR_REVISION!= \
+ ${AWK} '/\#define[ ]*XCURSOR_MINOR/ { print "."$$3 }' \
+ ${_X11_XCURSOR_XCURSOR_H}
+_XCURSOR_VERSION= ${_XCURSOR_MAJOR}${_XCURSOR_MINOR}${_XCURSOR_REVISION}
+BUILTIN_PKG.xcursor= xcursor-${_XCURSOR_VERSION}
+MAKEFLAGS+= BUILTIN_PKG.xcursor=${BUILTIN_PKG.xcursor}
+. endif
+MAKEFLAGS+= IS_BUILTIN.xcursor=${IS_BUILTIN.xcursor}
+.endif
+
+CHECK_BUILTIN.xcursor?= no
+.if !empty(CHECK_BUILTIN.xcursor:M[yY][eE][sS])
+USE_BUILTIN.xcursor= yes
+.endif
+
+.if !defined(USE_BUILTIN.xcursor)
+USE_BUILTIN.xcursor?= ${IS_BUILTIN.xcursor}
+
+. if defined(BUILTIN_PKG.xcursor)
+USE_BUILTIN.xcursor= yes
+. for _depend_ in ${BUILDLINK_DEPENDS.xcursor}
+. if !empty(USE_BUILTIN.xcursor:M[yY][eE][sS])
+USE_BUILTIN.xcursor!= \
+ if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.xcursor}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. endif
+. endfor
+. endif
+.endif # USE_BUILTIN.xcursor
+
+.if !empty(USE_BUILTIN.xcursor:M[nN][oO])
+BUILDLINK_DEPENDS.xcursor+= xcursor>=1.1.1
+BUILDLINK_DEPENDS.Xrender+= Xrender>=0.8
+. for _mkfile_ in buildlink3.mk builtin.mk
+. if exists(../../x11/Xfixes/${_mkfile_})
+. include "../../x11/Xfixes/${_mkfile_}"
+. endif
+. endfor
+.endif
+
+.if !empty(USE_BUILTIN.xcursor:M[yY][eE][sS])
+BUILDLINK_PREFIX.xcursor= ${X11BASE}
+BUILDLINK_FILES.xcursor+= lib/pkgconfig/xcursor.pc
+USE_BUILTIN.Xrender= yes
+.endif