summaryrefslogtreecommitdiff
path: root/x11/xextensions/builtin.mk
diff options
context:
space:
mode:
Diffstat (limited to 'x11/xextensions/builtin.mk')
-rw-r--r--x11/xextensions/builtin.mk79
1 files changed, 50 insertions, 29 deletions
diff --git a/x11/xextensions/builtin.mk b/x11/xextensions/builtin.mk
index a6032c4747e..b4fbc38c006 100644
--- a/x11/xextensions/builtin.mk
+++ b/x11/xextensions/builtin.mk
@@ -1,47 +1,68 @@
-# $NetBSD: builtin.mk,v 1.2 2005/03/22 15:52:35 jmmv Exp $
+# $NetBSD: builtin.mk,v 1.3 2005/06/01 18:03:32 jlam Exp $
-_X11_EXTENSIONS_EXTUTIL_H= ${X11BASE}/include/X11/extensions/extutil.h
-_X11_EXTENSIONS_PC= ${X11BASE}/lib/pkgconfig/xextensions.pc
+BUILTIN_PKG:= xextensions
+BUILTIN_FIND_FILES_VAR:= H_XEXTENSIONS
+BUILTIN_FIND_FILES.H_XEXTENSIONS= \
+ ${X11BASE}/include/X11/extensions/extutil.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.xextensions)
IS_BUILTIN.xextensions= no
-. if exists(${_X11_EXTENSIONS_EXTUTIL_H}) && exists(${_X11_EXTENSIONS_PC})
+#
+# Here, we skip checking whether the files are under ${LOCALBASE} since
+# we'll consider this X11 package to be built-in even if it's a part
+# of one of the pkgsrc-installed X11 distributions.
+#
+. if exists(${H_XEXTENSIONS})
IS_BUILTIN.xextensions= yes
-# hardcode version for now, since there currently is only one, really
-BUILTIN_PKG.xextensions= xextensions-1.0.1
-BUILDLINK_VARS+= BUILTIN_PKG.xextensions
. endif
-BUILDLINK_VARS+= IS_BUILTIN.xextensions
-.endif # IS_BUILTIN.xextensions
+.endif
+MAKEVARS+= IS_BUILTIN.xextensions
+###
+### 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.xextensions)
-USE_BUILTIN.xextensions?= ${IS_BUILTIN.xextensions}
-
-. if defined(BUILTIN_PKG.xextensions)
+. if ${PREFER.xextensions} == "pkgsrc"
+USE_BUILTIN.xextensions= no
+. else
+USE_BUILTIN.xextensions= ${IS_BUILTIN.xextensions}
+. if defined(BUILTIN_PKG.xextensions) && \
+ !empty(IS_BUILTIN.xextensions:M[yY][eE][sS])
USE_BUILTIN.xextensions= yes
-. for _depend_ in ${BUILDLINK_DEPENDS.xextensions}
-. if !empty(USE_BUILTIN.xextensions:M[yY][eE][sS])
-USE_BUILTIN.xextensions!= \
- if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.xextensions}; then \
- ${ECHO} "yes"; \
+. for _dep_ in ${BUILDLINK_DEPENDS.xextensions}
+. if !empty(USE_BUILTIN.xextensions:M[yY][eE][sS])
+USE_BUILTIN.xextensions!= \
+ if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.xextensions:Q}; then \
+ ${ECHO} yes; \
else \
- ${ECHO} "no"; \
+ ${ECHO} no; \
fi
-. endif
-. endfor
-. endif
-.endif # USE_BUILTIN.xextensions
+. endif
+. endfor
+. endif
+. endif # PREFER.xextensions
+.endif
+MAKEVARS+= USE_BUILTIN.xextensions
+###
+### The section below only applies if we are not including this file
+### solely to determine whether a built-in implementation exists.
+###
CHECK_BUILTIN.xextensions?= no
.if !empty(CHECK_BUILTIN.xextensions:M[nN][oO])
-.if !empty(USE_BUILTIN.xextensions:M[nN][oO])
-BUILDLINK_DEPENDS.xextensions+= xextensions>=1.0
-.endif
-
-.if !empty(USE_BUILTIN.xextensions:M[yY][eE][sS])
+. if !empty(USE_BUILTIN.xextensions:M[yY][eE][sS])
BUILDLINK_PREFIX.xextensions= ${X11BASE}
-USE_X11= yes
-.endif
+. include "../../mk/x11.buildlink3.mk"
+. include "../../mk/x11.builtin.mk"
+. endif
.endif # CHECK_BUILTIN.xextensions