summaryrefslogtreecommitdiff
path: root/graphics/xpm/buildlink3.mk
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2003-09-02 07:12:16 +0000
committerjlam <jlam@pkgsrc.org>2003-09-02 07:12:16 +0000
commit54f69b4eda336afb63334453e9d1966f0d823d3c (patch)
treef42bdfb851a85ba9f8fea9806d0ab808804a0ec9 /graphics/xpm/buildlink3.mk
parent5b399ffa4729d0c29732547d73107ad0f1620637 (diff)
downloadpkgsrc-54f69b4eda336afb63334453e9d1966f0d823d3c.tar.gz
Add some buildlink3.mk files needed by x11-links>=0.13.
Diffstat (limited to 'graphics/xpm/buildlink3.mk')
-rw-r--r--graphics/xpm/buildlink3.mk84
1 files changed, 84 insertions, 0 deletions
diff --git a/graphics/xpm/buildlink3.mk b/graphics/xpm/buildlink3.mk
new file mode 100644
index 00000000000..26b6b97fb51
--- /dev/null
+++ b/graphics/xpm/buildlink3.mk
@@ -0,0 +1,84 @@
+# $NetBSD: buildlink3.mk,v 1.1 2003/09/02 07:12:18 jlam Exp $
+
+.if !defined(XPM_BUILDLINK3_MK)
+XPM_BUILDLINK3_MK= # defined
+BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
+
+.include "../../mk/bsd.prefs.mk"
+
+BUILDLINK_DEPENDS.xpm?= xpm>=3.4k
+BUILDLINK_PKGSRCDIR.xpm?= ../../graphics/xpm
+
+# If BUILDLINK_CHECK_BUILTIN.<pkg> is "YES", then _only_ run the check
+# to see whether this is builtin to the system. The result can be found
+# by checking the value of BUILDLINK_IS_BUILTIN.<pkg> (either "YES" or
+# "NO").
+#
+BUILDLINK_CHECK_BUILTIN.xpm?= NO
+
+_X11_XPM_H= ${X11BASE}/include/X11/xpm.h
+_X11_TMPL= ${X11BASE}/lib/X11/config/X11.tmpl
+
+.if !defined(BUILDLINK_IS_BUILTIN.xpm)
+BUILDLINK_IS_BUILTIN.xpm= NO
+. if exists(${_X11_XPM_H})
+. if !empty(X11BASE:M*openwin)
+BUILDLINK_IS_BUILTIN.xpm!= \
+ if /usr/sbin/pkgchk -l SUNWxwinc | ${GREP} -q xpm.h; then \
+ ${ECHO} YES; \
+ else \
+ ${ECHO} NO; \
+ fi
+. elif exists(${_X11_TMPL})
+BUILDLINK_IS_BUILTIN.xpm!= \
+ if ${GREP} -q NormalLibXpm ${_X11_TMPL}; then \
+ ${ECHO} YES; \
+ else \
+ ${ECHO} NO; \
+ fi
+. else
+BUILDLINK_IS_BUILTIN.xpm= NO
+. endif
+. endif
+MAKEFLAGS+= BUILDLINK_IS_BUILTIN.xpm=${BUILDLINK_IS_BUILTIN.xpm}
+.endif
+
+.if !empty(BUILDLINK_CHECK_BUILTIN.xpm:M[yY][eE][sS])
+_NEED_XPM= NO
+.else
+. if !empty(BUILDLINK_IS_BUILTIN.xpm:M[nN][oO])
+_NEED_XPM= YES
+. else
+#
+# Create an appropriate package name for the built-in xpm 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.
+#
+_XPM_MAJOR!= \
+ ${AWK} '/\#define[ ]*XpmFormat/ { print $$3 }' ${_X11_XPM_H}
+_XPM_MINOR!= \
+ ${AWK} '/\#define[ ]*XpmVersion/ { print "."$$3 }' ${_X11_XPM_H}
+_XPM_PATCH!= \
+ ${AWK} 'BEGIN { split("abcdefghijklmnopqrstuvwxyz", alpha, "") } /\#define[ ]*XpmRevision/ { print alpha[$$3] }' ${_X11_XPM_H}
+_XPM_VERSION= ${_XPM_MAJOR}${_XPM_MINOR}${_XPM_PATCH}
+_XPM_PKG= xpm-${_XPM_VERSION}
+_XPM_DEPENDS= ${BUILDLINK_DEPENDS.xpm}
+_NEED_XPM!= \
+ if ${PKG_ADMIN} pmatch '${_XPM_DEPENDS}' ${_XPM_PKG}; then \
+ ${ECHO} "NO"; \
+ else \
+ ${ECHO} "YES"; \
+ fi
+. endif
+.endif
+
+.if ${_NEED_XPM} == "YES"
+. if !empty(BUILDLINK_DEPTH:M\+)
+BUILDLINK_DEPENDS+= xpm
+. endif
+BUILDLINK_PACKAGES+= xpm
+.endif
+
+BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/\+$//}
+.endif # XPM_BUILDLINK3_MK