summaryrefslogtreecommitdiff
path: root/x11/Xfixes
diff options
context:
space:
mode:
Diffstat (limited to 'x11/Xfixes')
-rw-r--r--x11/Xfixes/Makefile4
-rw-r--r--x11/Xfixes/buildlink3.mk3
-rw-r--r--x11/Xfixes/builtin-imake.mk12
-rw-r--r--x11/Xfixes/builtin.mk58
4 files changed, 66 insertions, 11 deletions
diff --git a/x11/Xfixes/Makefile b/x11/Xfixes/Makefile
index 8d6e17862b3..8c3f38735ce 100644
--- a/x11/Xfixes/Makefile
+++ b/x11/Xfixes/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.12 2005/04/11 21:48:04 tv Exp $
+# $NetBSD: Makefile,v 1.13 2005/06/01 18:03:27 jlam Exp $
#
DISTNAME= libXfixes-2.0.1
@@ -14,7 +14,6 @@ COMMENT= X Fixes extension of X RandR
PKG_INSTALLATION_TYPES= overwrite pkgviews
-USE_X11= yes
USE_LIBTOOL= yes
GNU_CONFIGURE= yes
@@ -22,4 +21,5 @@ PKGCONFIG_OVERRIDE+= xfixes.pc.in
.include "../../devel/pkgconfig/buildlink3.mk"
.include "../../x11/fixesext/buildlink3.mk"
+.include "../../mk/x11.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
diff --git a/x11/Xfixes/buildlink3.mk b/x11/Xfixes/buildlink3.mk
index b295f9d0fbc..b4244804c45 100644
--- a/x11/Xfixes/buildlink3.mk
+++ b/x11/Xfixes/buildlink3.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.4 2004/10/03 00:18:28 tv Exp $
+# $NetBSD: buildlink3.mk,v 1.5 2005/06/01 18:03:27 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
XFIXES_BUILDLINK3_MK:= ${XFIXES_BUILDLINK3_MK}+
@@ -16,6 +16,7 @@ BUILDLINK_RECOMMENDED.Xfixes+= Xfixes>=2.0.1nb1
BUILDLINK_PKGSRCDIR.Xfixes?= ../../x11/Xfixes
.endif # XFIXES_BUILDLINK3_MK
+.include "../../mk/x11.buildlink3.mk"
.include "../../x11/fixesext/buildlink3.mk"
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
diff --git a/x11/Xfixes/builtin-imake.mk b/x11/Xfixes/builtin-imake.mk
new file mode 100644
index 00000000000..7963f807be3
--- /dev/null
+++ b/x11/Xfixes/builtin-imake.mk
@@ -0,0 +1,12 @@
+XCOMM $NetBSD: builtin-imake.mk,v 1.1 2005/06/01 18:03:27 jlam Exp $
+
+/*
+ * Check the value of BuildXfixesLibrary for the presence of
+ * Xfixes in the X11 distribution.
+ */
+builtin-test:
+#if BuildXfixesLibrary
+ @echo yes
+#else
+ @echo no
+#endif
diff --git a/x11/Xfixes/builtin.mk b/x11/Xfixes/builtin.mk
index 5ca24d4e319..c038a583c23 100644
--- a/x11/Xfixes/builtin.mk
+++ b/x11/Xfixes/builtin.mk
@@ -1,13 +1,55 @@
-# $NetBSD: builtin.mk,v 1.3 2004/10/09 06:40:48 xtraeme Exp $
+# $NetBSD: builtin.mk,v 1.4 2005/06/01 18:03:27 jlam Exp $
-_H_XFIXES= ${X11BASE}/include/X11/extensions/Xfixes.h
-_FIXESEXT_PC= ${X11BASE}/lib/pkgconfig/xfixes.pc
+BUILTIN_PKG:= Xfixes
+BUILTIN_FIND_FILES_VAR:= H_XFIXES
+BUILTIN_FIND_FILES.H_XFIXES= ${X11BASE}/include/X11/extensions/Xfixes.h
+
+.include "../../mk/buildlink3/bsd.builtin.mk"
+
+###
+### Determine if there is a built-in implementation of the package and
+### set IS_BUILTIN.<pkg> appropriately ("yes" or "no").
+###
.if !defined(IS_BUILTIN.Xfixes)
-IS_BUILTIN.Xfixes= no
-. if exists(${_H_XFIXES}) && exists(${_FIXESEXT_PC})
-IS_BUILTIN.Xfixes= yes
+IS_BUILTIN.Xfixes= no
+. if exists(${H_XFIXES})
+PKGSRC_USE_TOOLS+= imake # XXX
+IMAKE?= ${X11BASE}/bin/imake # XXX
+. if defined(IMAKE) && exists(${IMAKE})
+IS_BUILTIN.Xfixes!= \
+ ${IMAKE} -DUseInstalled -I${X11BASE}/lib/X11/config \
+ -f ${BUILDLINK_PKGSRCDIR.Xfixes}/builtin-imake.mk \
+ -s - | \
+ ${MAKE} -f - builtin-test
+. endif
. endif
-.endif # IS_BUILTIN.Xfixes
+.endif
+MAKEVARS+= IS_BUILTIN.Xfixes
-USE_BUILTIN.Xfixes?= ${IS_BUILTIN.Xfixes}
+###
+### Determine whether we should use the built-in implementation if it
+### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no").
+###
+.if !defined(USE_BUILTIN.Xfixes)
+. if ${PREFER.Xfixes} == "pkgsrc"
+USE_BUILTIN.Xfixes= no
+. else
+USE_BUILTIN.Xfixes= ${IS_BUILTIN.Xfixes}
+. if defined(BUILTIN_PKG.Xfixes) && \
+ !empty(IS_BUILTIN.Xfixes:M[yY][eE][sS])
+USE_BUILTIN.Xfixes= yes
+. for _dep_ in ${BUILDLINK_DEPENDS.Xfixes}
+. if !empty(USE_BUILTIN.Xfixes:M[yY][eE][sS])
+USE_BUILTIN.Xfixes!= \
+ if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.Xfixes:Q}; then \
+ ${ECHO} yes; \
+ else \
+ ${ECHO} no; \
+ fi
+. endif
+. endfor
+. endif
+. endif # PREFER.Xfixes
+.endif
+MAKEVARS+= USE_BUILTIN.Xfixes