summaryrefslogtreecommitdiff
path: root/x11
diff options
context:
space:
mode:
authortron <tron>2007-12-16 19:04:28 +0000
committertron <tron>2007-12-16 19:04:28 +0000
commitcde2bf7593cc9bac19df8d6bfc7eca8d7ac0edd0 (patch)
treeb8f314c708a3e9f198d653ed77daa40142aece30 /x11
parent0ff538ab429cb2771598c2c44db84752060a7d15 (diff)
downloadpkgsrc-cde2bf7593cc9bac19df8d6bfc7eca8d7ac0edd0.tar.gz
Detect builtin "libXmu" e.g. under Mac OS X Leopard.
Diffstat (limited to 'x11')
-rw-r--r--x11/libXmu/buildlink3.mk4
-rw-r--r--x11/libXmu/builtin.mk49
2 files changed, 51 insertions, 2 deletions
diff --git a/x11/libXmu/buildlink3.mk b/x11/libXmu/buildlink3.mk
index 5733502b87d..db32c0eaf8f 100644
--- a/x11/libXmu/buildlink3.mk
+++ b/x11/libXmu/buildlink3.mk
@@ -1,8 +1,8 @@
-# $NetBSD: buildlink3.mk,v 1.2 2006/11/06 09:59:11 joerg Exp $
+# $NetBSD: buildlink3.mk,v 1.3 2007/12/16 19:04:28 tron Exp $
.include "../../mk/bsd.fast.prefs.mk"
-.if ${X11_TYPE} != "modular"
+.if ${X11_TYPE} != "modular" && !exists(${X11BASE}/lib/pkgconfig/xmu.pc)
.include "../../mk/x11.buildlink3.mk"
.else
diff --git a/x11/libXmu/builtin.mk b/x11/libXmu/builtin.mk
new file mode 100644
index 00000000000..b2429237d90
--- /dev/null
+++ b/x11/libXmu/builtin.mk
@@ -0,0 +1,49 @@
+# $NetBSD: builtin.mk,v 1.1 2007/12/16 19:04:28 tron Exp $
+
+BUILTIN_PKG:= libXmu
+
+BUILTIN_FIND_FILES_VAR:= H_XMU
+BUILTIN_FIND_FILES.H_XMU= ${X11BASE}/include/X11/Xmu/Xmu.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.libXmu= no
+.elif !defined(IS_BUILTIN.libXmu)
+IS_BUILTIN.libXmu= no
+. if empty(H_XMU:M__nonexistent__)
+IS_BUILTIN.libXmu= yes
+. endif
+.endif
+MAKEVARS+= IS_BUILTIN.libXmu
+
+###
+### 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.libXmu)
+. if ${PREFER.libXmu} == "pkgsrc"
+USE_BUILTIN.libXmu= no
+. else
+USE_BUILTIN.libXmu= ${IS_BUILTIN.libXmu}
+. if defined(BUILTIN_PKG.libXmu) && \
+ !empty(IS_BUILTIN.libXmu:M[yY][eE][sS])
+USE_BUILTIN.libXmu= yes
+. for _dep_ in ${BUILDLINK_API_DEPENDS.libXmu}
+. if !empty(USE_BUILTIN.libXmu:M[yY][eE][sS])
+USE_BUILTIN.libXmu!= \
+ if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.libXmu:Q}; then \
+ ${ECHO} yes; \
+ else \
+ ${ECHO} no; \
+ fi
+. endif
+. endfor
+. endif
+. endif # PREFER.libXmu
+.endif
+MAKEVARS+= USE_BUILTIN.libXmu