summaryrefslogtreecommitdiff
path: root/graphics/freetype2
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2004-02-12 01:59:37 +0000
committerjlam <jlam@pkgsrc.org>2004-02-12 01:59:37 +0000
commit1edfa505eddb87dd79db0d2897323b39e05e4a03 (patch)
treef36bdf155011b2521ad9dfd8a23373398462d265 /graphics/freetype2
parent3574066d66f5570c39b086cbf1ccc1116cb66c7b (diff)
downloadpkgsrc-1edfa505eddb87dd79db0d2897323b39e05e4a03.tar.gz
Reorganize code so that any dependencies are checked as part of deciding
whether the software is built-in or not. This facilitates implementing the forthcoming PKGSRC_NATIVE variable.
Diffstat (limited to 'graphics/freetype2')
-rw-r--r--graphics/freetype2/buildlink2.mk37
-rw-r--r--graphics/freetype2/buildlink3.mk56
2 files changed, 50 insertions, 43 deletions
diff --git a/graphics/freetype2/buildlink2.mk b/graphics/freetype2/buildlink2.mk
index 37d2b99ba8b..0f442ad7bfa 100644
--- a/graphics/freetype2/buildlink2.mk
+++ b/graphics/freetype2/buildlink2.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink2.mk,v 1.15 2004/02/09 20:20:43 reed Exp $
+# $NetBSD: buildlink2.mk,v 1.16 2004/02/12 01:59:38 jlam Exp $
.if !defined(FREETYPE2_BUILDLINK2_MK)
FREETYPE2_BUILDLINK2_MK= # defined
@@ -15,18 +15,10 @@ _REQUIRE_BUILTIN_FREETYPE2?= NO
_FREETYPE_H= ${X11BASE}/include/freetype2/freetype/freetype.h
_X11_TMPL= ${X11BASE}/lib/X11/config/X11.tmpl
-.if exists(${_FREETYPE_H}) && exists(${_X11_TMPL})
-_IS_BUILTIN_FREETYPE2!= ${GREP} -c BuildFreetype2Library ${_X11_TMPL} || ${TRUE}
-.else
-_IS_BUILTIN_FREETYPE2= 0
-.endif
-.if !empty(_REQUIRE_BUILTIN_FREETYPE2:M[yY][eE][sS])
-_NEED_FREETYPE2= NO
-.else
-. if ${_IS_BUILTIN_FREETYPE2} == "0"
-_NEED_FREETYPE2= YES
-. else
+.if !defined(_BUILTIN_FREETYPE2)
+_BUILTIN_FREETYPE2= NO
+. if exists(${_FREETYPE_H}) && exists(${_X11_TMPL})
#
# Create an appropriate freetype2 package name for the built-in freetype2
# distributed with XFree86 4.x. This package name can be used to check
@@ -42,13 +34,24 @@ _FREETYPE_PATCH!= \
_FREETYPE_VERSION= ${_FREETYPE_MAJOR}${_FREETYPE_MINOR}${_FREETYPE_PATCH}
_FREETYPE_PKG= freetype2-${_FREETYPE_VERSION}
_FREETYPE_DEPENDS= ${BUILDLINK_DEPENDS.freetype2}
-_NEED_FREETYPE2!= \
+_BUILTIN_FREETYPE2!= \
if ${PKG_ADMIN} pmatch '${_FREETYPE_DEPENDS}' ${_FREETYPE_PKG}; then \
- ${ECHO} "NO"; \
+ if ${GREP} -q BuildFreetype2Library ${_X11_TMPL}; then \
+ ${ECHO} "YES"; \
+ else \
+ ${ECHO} "NO"; \
+ fi; \
else \
- ${ECHO} "YES"; \
+ ${ECHO} "NO"; \
fi
. endif
+MAKEFLAGS+= _BUILTIN_FREETYPE=${_BUILTIN_FREETYPE}
+.endif
+
+.if !empty(_BUILTIN_FREETYPE2:M[yY][eE][sS])
+_NEED_FREETYPE2= NO
+.else
+_NEED_FREETYPE2= YES
.endif
.if !empty(PREFER_PKGSRC:M[yY][eE][sS]) || \
@@ -56,6 +59,10 @@ _NEED_FREETYPE2!= \
_NEED_FREETYPE2= YES
.endif
+.if !empty(_REQUIRE_BUILTIN_FREETYPE2:M[yY][eE][sS])
+_NEED_FREETYPE2= NO
+.endif
+
.if ${_NEED_FREETYPE2} == "YES"
BUILDLINK_PACKAGES+= freetype2
EVAL_PREFIX+= BUILDLINK_PREFIX.freetype2=freetype2
diff --git a/graphics/freetype2/buildlink3.mk b/graphics/freetype2/buildlink3.mk
index 0b3a486ec6a..7ddaad003c6 100644
--- a/graphics/freetype2/buildlink3.mk
+++ b/graphics/freetype2/buildlink3.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.16 2004/02/09 20:20:43 reed Exp $
+# $NetBSD: buildlink3.mk,v 1.17 2004/02/12 01:59:38 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
FREETYPE2_BUILDLINK3_MK:= ${FREETYPE2_BUILDLINK3_MK}+
@@ -20,30 +20,15 @@ _X11_TMPL= ${X11BASE}/lib/X11/config/X11.tmpl
.if !defined(BUILDLINK_IS_BUILTIN.freetype2)
BUILDLINK_IS_BUILTIN.freetype2= NO
. if exists(${_FREETYPE2_FREETYPE_H}) && exists(${_X11_TMPL})
-BUILDLINK_IS_BUILTIN.freetype2!= \
+_IS_BUILTIN.freetype2!= \
if ${GREP} -q BuildFreetype2Library ${_X11_TMPL}; then \
${ECHO} "YES"; \
else \
${ECHO} "NO"; \
fi
-. endif
-MAKEFLAGS+= \
- BUILDLINK_IS_BUILTIN.freetype2=${BUILDLINK_IS_BUILTIN.freetype2}
-.endif
-
-.if !empty(PREFER_PKGSRC:M[yY][eE][sS]) || \
- !empty(PREFER_PKGSRC:Mfreetype2)
-BUILDLINK_USE_BUILTIN.freetype2= NO
-.endif
-
-.if !empty(BUILDLINK_CHECK_BUILTIN.freetype2:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.freetype2= YES
-.endif
-
-.if !defined(BUILDLINK_USE_BUILTIN.freetype2)
-. if !empty(BUILDLINK_IS_BUILTIN.freetype2:M[nN][oO])
-BUILDLINK_USE_BUILTIN.freetype2= NO
-. else
+BUILDLINK_IS_BUILTIN.freetype2= ${_IS_BUILTIN.freetype2}
+. if !empty(BUILDLINK_CHECK_BUILTIN.freetype2:M[nN][oO]) && \
+ !empty(_IS_BUILTIN.freetype2:M[yY][eE][sS])
#
# Create an appropriate package name for the built-in freetype2 distributed
# with the system. This package name can be used to check against
@@ -58,20 +43,35 @@ _FREETYPE2_PATCH!= \
${AWK} 'BEGIN { patch=0; } /\#define[ ]*FREETYPE_PATCH/ { patch=$$3; } END { print "."patch; }' ${_FREETYPE2_FREETYPE_H}
_FREETYPE2_VERSION= ${_FREETYPE2_MAJOR}${_FREETYPE2_MINOR}${_FREETYPE2_PATCH}
_FREETYPE2_PKG= freetype2-${_FREETYPE2_VERSION}
-BUILDLINK_USE_BUILTIN.freetype2?= YES
-. for _depend_ in ${BUILDLINK_DEPENDS.freetype2}
-. if !empty(BUILDLINK_USE_BUILTIN.freetype2:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.freetype2!= \
+BUILDLINK_IS_BUILTIN.freetype2?= YES
+. for _depend_ in ${BUILDLINK_DEPENDS.freetype2}
+. if !empty(BUILDLINK_IS_BUILTIN.freetype2:M[yY][eE][sS])
+BUILDLINK_IS_BUILTIN.freetype2!= \
if ${PKG_ADMIN} pmatch '${_depend_}' ${_FREETYPE2_PKG}; then \
${ECHO} "YES"; \
else \
${ECHO} "NO"; \
fi
-. endif
-. endfor
+. endif
+. endfor
+. endif
. endif
-MAKEFLAGS+= \
- BUILDLINK_USE_BUILTIN.freetype2=${BUILDLINK_USE_BUILTIN.freetype2}
+MAKEFLAGS+= BUILDLINK_IS_BUILTIN.freetype2=${BUILDLINK_IS_BUILTIN.freetype2}
+.endif
+
+.if !empty(BUILDLINK_IS_BUILTIN.freetype2:M[yY][eE][sS]I)
+BUILDLINK_USE_BUILTIN.freetype2= YES
+.else
+BUILDLINK_USE_BUILTIN.freetype2= NO
+.endif
+
+.if !empty(PREFER_PKGSRC:M[yY][eE][sS]) || \
+ !empty(PREFER_PKGSRC:Mfreetype2)
+BUILDLINK_USE_BUILTIN.freetype2= NO
+.endif
+
+.if !empty(BUILDLINK_CHECK_BUILTIN.freetype2:M[yY][eE][sS])
+BUILDLINK_USE_BUILTIN.freetype2= YES
.endif
.if !empty(BUILDLINK_USE_BUILTIN.freetype2:M[nN][oO])