summaryrefslogtreecommitdiff
path: root/x11
diff options
context:
space:
mode:
authortron <tron>2008-01-05 15:27:08 +0000
committertron <tron>2008-01-05 15:27:08 +0000
commit4c68438d662a72441daed6f584daf559907025dc (patch)
tree6cf6111355a55368cf1d02aff36126ecc2aa63c5 /x11
parent2ae800c959aba3276ea9500f3a9e556d57e6e105 (diff)
downloadpkgsrc-4c68438d662a72441daed6f584daf559907025dc.tar.gz
Detect builtin "inputproto" e.g. under Mac OS X Leopard.
Diffstat (limited to 'x11')
-rw-r--r--x11/inputproto/builtin.mk49
1 files changed, 49 insertions, 0 deletions
diff --git a/x11/inputproto/builtin.mk b/x11/inputproto/builtin.mk
new file mode 100644
index 00000000000..4a372ab9829
--- /dev/null
+++ b/x11/inputproto/builtin.mk
@@ -0,0 +1,49 @@
+# $NetBSD: builtin.mk,v 1.1 2008/01/05 15:27:08 tron Exp $
+
+BUILTIN_PKG:= inputproto
+
+BUILTIN_FIND_FILES_VAR:= H_XI
+BUILTIN_FIND_FILES.H_XI= ${X11BASE}/include/X11/extensions/XI.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 ${X11BASE} == ${LOCALBASE}
+IS_BUILTIN.inputproto= no
+.elif !defined(IS_BUILTIN.inputproto)
+IS_BUILTIN.inputproto= no
+. if empty(H_XI:M__nonexistent__)
+IS_BUILTIN.inputproto= yes
+. endif
+.endif
+MAKEVARS+= IS_BUILTIN.inputproto
+
+###
+### 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.inputproto)
+. if ${PREFER.inputproto} == "pkgsrc"
+USE_BUILTIN.inputproto= no
+. else
+USE_BUILTIN.inputproto= ${IS_BUILTIN.inputproto}
+. if defined(BUILTIN_PKG.inputproto) && \
+ !empty(IS_BUILTIN.inputproto:M[yY][eE][sS])
+USE_BUILTIN.inputproto= yes
+. for _dep_ in ${BUILDLINK_API_DEPENDS.inputproto}
+. if !empty(USE_BUILTIN.inputproto:M[yY][eE][sS])
+USE_BUILTIN.inputproto!= \
+ if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.inputproto:Q}; then \
+ ${ECHO} yes; \
+ else \
+ ${ECHO} no; \
+ fi
+. endif
+. endfor
+. endif
+. endif # PREFER.inputproto
+.endif
+MAKEVARS+= USE_BUILTIN.inputproto