summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjlam <jlam>2004-02-12 01:59:37 +0000
committerjlam <jlam>2004-02-12 01:59:37 +0000
commitd1197e2dbd26577a4d276890bc662b2a7f93e572 (patch)
treef36bdf155011b2521ad9dfd8a23373398462d265
parent2645f9642e2b6553e699f80dbfe9905e21c03d99 (diff)
downloadpkgsrc-d1197e2dbd26577a4d276890bc662b2a7f93e572.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.
-rw-r--r--archivers/bzip2/buildlink2.mk33
-rw-r--r--archivers/bzip2/buildlink3.mk27
-rw-r--r--converters/libiconv/buildlink2.mk39
-rw-r--r--converters/libiconv/buildlink3.mk27
-rw-r--r--devel/binutils/buildlink2.mk28
-rw-r--r--devel/binutils/buildlink3.mk27
-rw-r--r--devel/cdk/buildlink2.mk20
-rw-r--r--devel/gettext-lib/buildlink2.mk51
-rw-r--r--devel/gettext-lib/buildlink3.mk57
-rw-r--r--devel/libevent/buildlink2.mk8
-rw-r--r--devel/ncurses/buildlink2.mk76
-rw-r--r--devel/ncurses/buildlink3.mk80
-rw-r--r--devel/readline/buildlink2.mk37
-rw-r--r--devel/readline/buildlink3.mk27
-rw-r--r--devel/zlib/buildlink2.mk39
-rw-r--r--devel/zlib/buildlink3.mk70
-rw-r--r--graphics/MesaLib/buildlink3.mk59
-rw-r--r--graphics/freetype2/buildlink2.mk37
-rw-r--r--graphics/freetype2/buildlink3.mk56
-rw-r--r--graphics/glu/buildlink3.mk58
-rw-r--r--mail/libmilter/buildlink2.mk12
-rw-r--r--net/hesiod/buildlink2.mk22
-rw-r--r--net/libpcap/buildlink2.mk12
-rw-r--r--net/libpcap/buildlink3.mk16
-rw-r--r--security/PAM/buildlink2.mk8
-rw-r--r--security/PAM/buildlink3.mk16
-rw-r--r--security/heimdal/buildlink3.mk71
-rw-r--r--security/openssl/buildlink2.mk42
-rw-r--r--security/openssl/buildlink3.mk54
-rw-r--r--x11/Xrender/buildlink2.mk42
-rw-r--r--x11/Xrender/buildlink3.mk57
31 files changed, 640 insertions, 568 deletions
diff --git a/archivers/bzip2/buildlink2.mk b/archivers/bzip2/buildlink2.mk
index 0dbc71604e9..28ed9e56b6c 100644
--- a/archivers/bzip2/buildlink2.mk
+++ b/archivers/bzip2/buildlink2.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink2.mk,v 1.9 2004/02/05 07:17:14 jlam Exp $
+# $NetBSD: buildlink2.mk,v 1.10 2004/02/12 01:59:37 jlam Exp $
.if !defined(BZIP2_BUILDLINK2_MK)
BZIP2_BUILDLINK2_MK= # defined
@@ -8,37 +8,32 @@ BZIP2_BUILDLINK2_MK= # defined
BUILDLINK_DEPENDS.bzip2?= bzip2>=1.0.1
BUILDLINK_PKGSRCDIR.bzip2?= ../../archivers/bzip2
-.if defined(USE_BZIP2)
-_NEED_BZIP2= YES
-.else
-. if exists(/usr/include/bzlib.h)
+.if exists(/usr/include/bzlib.h)
#
# Recent versions of the libbz2 API prefix all functions with "BZ2_".
#
_BUILTIN_BZIP2!= ${EGREP} -c "BZ2_" /usr/include/bzlib.h || ${TRUE}
-. else
+.else
_BUILTIN_BZIP2= 0
-. endif
-. if ${_BUILTIN_BZIP2} == "0"
-_NEED_BZIP2= YES
-. else
-_NEED_BZIP2= NO
-. endif
+.endif
#
# Solaris 9 has bzip2 1.0.1, build it on older versions.
# Darwin only has static libbz2.a, which can't be buildlinked
#
_INCOMPAT_BZIP2= SunOS-5.[678]-* Darwin-*
-INCOMPAT_BZIP2?= # empty
-. for _pattern_ in ${_INCOMPAT_BZIP2} ${INCOMPAT_BZIP2}
-. if !empty(MACHINE_PLATFORM:M${_pattern_})
+.for _pattern_ in ${_INCOMPAT_BZIP2} ${INCOMPAT_BZIP2}
+. if !empty(MACHINE_PLATFORM:M${_pattern_})
+_BUILTIN_BZIP2= 0
+. endif
+.endfor
+
+.if ${_BUILTIN_BZIP2} == "0"
_NEED_BZIP2= YES
-. endif
-. endfor
+.else
+_NEED_BZIP2= NO
.endif
-.if !empty(PREFER_PKGSRC:M[yY][eE][sS]) || \
- !empty(PREFER_PKGSRC:Mbzip2)
+.if defined(USE_BZIP2)
_NEED_BZIP2= YES
.endif
diff --git a/archivers/bzip2/buildlink3.mk b/archivers/bzip2/buildlink3.mk
index 08082f3f076..a8284bf9d32 100644
--- a/archivers/bzip2/buildlink3.mk
+++ b/archivers/bzip2/buildlink3.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.11 2004/02/11 11:30:49 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.12 2004/02/12 01:59:37 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
BZIP2_BUILDLINK3_MK:= ${BZIP2_BUILDLINK3_MK}+
@@ -23,19 +23,27 @@ BUILDLINK_IS_BUILTIN.bzip2!= \
${ECHO} "NO"; \
fi
. endif
+. if !empty(BUILDLINK_CHECK_BUILTIN.bzip2:M[nN][oO])
#
# Solaris 9 has bzip2 1.0.1, build it on older versions.
# Darwin only has static libbz2.a, which can't be buildlinked.
#
_INCOMPAT_BZIP2?= SunOS-5.[678]-* Darwin-*
-. for _pattern_ in ${_INCOMPAT_BZIP2} ${INCOMPAT_BZIP2}
-. if !empty(MACHINE_PLATFORM:M${_pattern_})
+. for _pattern_ in ${_INCOMPAT_BZIP2} ${INCOMPAT_BZIP2}
+. if !empty(MACHINE_PLATFORM:M${_pattern_})
BUILDLINK_IS_BUILTIN.bzip2= NO
-. endif
-. endfor
+. endif
+. endfor
+. endif
MAKEFLAGS+= BUILDLINK_IS_BUILTIN.bzip2=${BUILDLINK_IS_BUILTIN.bzip2}
.endif
+.if !empty(BUILDLINK_IS_BUILTIN.bzip2:M[yY][eE][sS])
+BUILDLINK_USE_BUILTIN.bzip2= YES
+.else
+BUILDLINK_USE_BUILTIN.bzip2= NO
+.endif
+
.if !empty(PREFER_PKGSRC:M[yY][eE][sS]) || \
!empty(PREFER_PKGSRC:Mbzip2)
BUILDLINK_USE_BUILTIN.bzip2= NO
@@ -49,15 +57,6 @@ BUILDLINK_USE_BUILTIN.bzip2= NO
BUILDLINK_USE_BUILTIN.bzip2= YES
.endif
-.if !defined(BUILDLINK_USE_BUILTIN.bzip2)
-. if !empty(BUILDLINK_IS_BUILTIN.bzip2:M[nN][oO])
-BUILDLINK_USE_BUILTIN.bzip2= NO
-. else
-BUILDLINK_USE_BUILTIN.bzip2= YES
-. endif
-MAKEFLAGS+= BUILDLINK_USE_BUILTIN.bzip2=${BUILDLINK_USE_BUILTIN.bzip2}
-.endif
-
.if !empty(BUILDLINK_USE_BUILTIN.bzip2:M[nN][oO])
. if !empty(BUILDLINK_DEPTH:M+)
BUILDLINK_DEPENDS+= bzip2
diff --git a/converters/libiconv/buildlink2.mk b/converters/libiconv/buildlink2.mk
index c44ccf280af..ccb964c9021 100644
--- a/converters/libiconv/buildlink2.mk
+++ b/converters/libiconv/buildlink2.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink2.mk,v 1.16 2004/02/11 12:17:58 jlam Exp $
+# $NetBSD: buildlink2.mk,v 1.17 2004/02/12 01:59:37 jlam Exp $
.if !defined(ICONV_BUILDLINK2_MK)
ICONV_BUILDLINK2_MK= # defined
@@ -8,29 +8,30 @@ ICONV_BUILDLINK2_MK= # defined
BUILDLINK_DEPENDS.iconv?= libiconv>=1.9.1
BUILDLINK_PKGSRCDIR.iconv?= ../../converters/libiconv
-.if defined(USE_GNU_ICONV)
-_NEED_ICONV= YES
-_BLNK_LIBICONV_FOUND= NO
-.else
-. if exists(/usr/include/iconv.h)
-_NEED_ICONV= NO
+.if exists(/usr/include/iconv.h)
+_BUILTIN_ICONV= YES
_BLNK_LIBICONV_LIST!= ${ECHO} /usr/lib/libiconv.*
-. if ${_BLNK_LIBICONV_LIST} != "/usr/lib/libiconv.*"
+. if ${_BLNK_LIBICONV_LIST} != "/usr/lib/libiconv.*"
_BLNK_LIBICONV_FOUND= YES
-. else
-_BLNK_LIBICONV_FOUND= NO
-. endif
. else
-_NEED_ICONV= YES
_BLNK_LIBICONV_FOUND= NO
. endif
+.else
+_BUILTIN_ICONV= NO
+_BLNK_LIBICONV_FOUND= NO
+.endif
_INCOMPAT_ICONV?= # should be set from defs.${OPSYS}.mk
-INCOMPAT_ICONV?= # empty
-. for _pattern_ in ${_INCOMPAT_ICONV} ${INCOMPAT_ICONV}
-. if !empty(MACHINE_PLATFORM:M${_pattern_})
+.for _pattern_ in ${_INCOMPAT_ICONV} ${INCOMPAT_ICONV}
+. if !empty(MACHINE_PLATFORM:M${_pattern_})
+_BUILTIN_ICONV= NO
+_BLNK_LIBICONV_FOUND= NO
+. endif
+.endfor
+
+.if ${_BUILTIN_ICONV} == "YES"
+_NEED_ICONV= NO
+.else
_NEED_ICONV= YES
-. endif
-. endfor
.endif
.if !empty(PREFER_PKGSRC:M[yY][eE][sS]) || \
@@ -38,6 +39,10 @@ _NEED_ICONV= YES
_NEED_ICONV= YES
.endif
+.if defined(USE_GNU_ICONV)
+_NEED_ICONV= YES
+.endif
+
.if ${_NEED_ICONV} == "YES"
# let other packages know that we're using the pkgsrc
# GNU libiconv
diff --git a/converters/libiconv/buildlink3.mk b/converters/libiconv/buildlink3.mk
index e9b3cf9f117..f72f13a3d36 100644
--- a/converters/libiconv/buildlink3.mk
+++ b/converters/libiconv/buildlink3.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.12 2004/02/11 12:17:58 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.13 2004/02/12 01:59:37 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
ICONV_BUILDLINK3_MK:= ${ICONV_BUILDLINK3_MK}+
@@ -20,12 +20,20 @@ BUILDLINK_IS_BUILTIN.iconv= NO
. if exists(${_ICONV_H})
BUILDLINK_IS_BUILTIN.iconv= YES
. endif
+. if !empty(BUILDLINK_CHECK_BUILTIN.iconv:M[nN][oO])
_INCOMPAT_ICONV?= # should be set from defs.${OPSYS}.mk
-. for _pattern_ in ${_INCOMPAT_ICONV} ${INCOMPAT_ICONV}
-. if !empty(MACHINE_PLATFORM:M${_pattern_})
+. for _pattern_ in ${_INCOMPAT_ICONV} ${INCOMPAT_ICONV}
+. if !empty(MACHINE_PLATFORM:M${_pattern_})
BUILDLINK_IS_BUILTIN.iconv= NO
-. endif
-. endfor
+. endif
+. endfor
+. endif
+.endif
+
+.if !empty(BUILDLINK_IS_BUILTIN.iconv:M[yY][eE][sS])
+BUILDLINK_USE_BUILTIN.iconv= YES
+.else
+BUILDLINK_USE_BUILTIN.iconv= NO
.endif
.if !empty(PREFER_PKGSRC:M[yY][eE][sS]) || \
@@ -41,15 +49,6 @@ BUILDLINK_USE_BUILTIN.iconv= NO
BUILDLINK_USE_BUILTIN.iconv= YES
.endif
-.if !defined(BUILDLINK_USE_BUILTIN.iconv)
-. if !empty(BUILDLINK_IS_BUILTIN.iconv:M[nN][oO])
-BUILDLINK_USE_BUILTIN.iconv= NO
-. else
-BUILDLINK_USE_BUILTIN.iconv= YES
-. endif
-MAKEFLAGS+= BUILDLINK_USE_BUILTIN.iconv=${BUILDLINK_USE_BUILTIN.iconv}
-.endif
-
.if !empty(BUILDLINK_USE_BUILTIN.iconv:M[nN][oO])
. if !empty(BUILDLINK_DEPTH:M+)
BUILDLINK_DEPENDS+= iconv
diff --git a/devel/binutils/buildlink2.mk b/devel/binutils/buildlink2.mk
index 557209477f9..a4e80734cc5 100644
--- a/devel/binutils/buildlink2.mk
+++ b/devel/binutils/buildlink2.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink2.mk,v 1.13 2004/02/05 07:17:14 jlam Exp $
+# $NetBSD: buildlink2.mk,v 1.14 2004/02/12 01:59:37 jlam Exp $
.if !defined(BINUTILS_BUILDLINK2_MK)
BINUTILS_BUILDLINK2_MK= # defined
@@ -9,11 +9,6 @@ BUILDLINK_DEPENDS.binutils?= binutils>=2.14.0
BUILDLINK_PKGSRCDIR.binutils?= ../../devel/binutils
BUILDLINK_DEPMETHOD.binutils?= build
-.if defined(USE_BINUTILS)
-_NEED_BINUTILS= YES
-.else
-_NEED_BINUTILS= NO
-#
# These versions of NetBSD didn't have a toolchain that could be used in
# place of modern binutils and will need this package
#
@@ -23,12 +18,17 @@ _INCOMPAT_BINUTILS+= NetBSD-1.5.*-* NetBSD-1.5[A-X]-*
# XXX: _INCOMPAT_BINUTILS settings for other operating systems possibly
# XXX: needed here
#
-INCOMPAT_BINUTILS?= # empty
-. for _pattern_ in ${_INCOMPAT_BINUTILS} ${INCOMPAT_BINUTILS}
-. if !empty(MACHINE_PLATFORM:M${_pattern_})
-_NEED_BINUTILS= YES
-. endif
-. endfor
+_BUILTIN_BINUTILS= YES
+.for _pattern_ in ${_INCOMPAT_BINUTILS} ${INCOMPAT_BINUTILS}
+. if !empty(MACHINE_PLATFORM:M${_pattern_})
+_BUILTIN_BINUTILS= NO
+. endif
+.endfor
+
+.if ${_BUILTIN_BINUTILS} == "YES"
+_NEED_BINUTILS= NO
+.else
+_NEED_BINUTILS= YES
.endif
.if !empty(PREFER_PKGSRC:M[yY][eE][sS]) || \
@@ -36,6 +36,10 @@ _NEED_BINUTILS= YES
_NEED_BINUTILS= YES
.endif
+.if defined(USE_BINUTILS)
+_NEED_BINUTILS= YES
+.endif
+
.if ${_NEED_BINUTILS} == "YES"
BUILDLINK_PACKAGES+= binutils
BUILDLINK_PREFIX.binutils= ${LOCALBASE}
diff --git a/devel/binutils/buildlink3.mk b/devel/binutils/buildlink3.mk
index f8e98e9fdbd..4dd4af7b804 100644
--- a/devel/binutils/buildlink3.mk
+++ b/devel/binutils/buildlink3.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.10 2004/02/11 11:30:49 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.11 2004/02/12 01:59:37 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
BINUTILS_BUILDLINK3_MK:= ${BINUTILS_BUILDLINK3_MK}+
@@ -16,6 +16,7 @@ BUILDLINK_CHECK_BUILTIN.binutils?= NO
.if !defined(BUILDLINK_IS_BUILTIN.binutils)
BUILDLINK_IS_BUILTIN.binutils= YES
+. if !empty(BUILDLINK_CHECK_BUILTIN.binutils:M[nN][oO])
#
# These versions of NetBSD didn't have a toolchain that was capable of
# replacing binutils.
@@ -27,14 +28,21 @@ _INCOMPAT_BINUTILS+= NetBSD-1.5.*-* NetBSD-1.5[A-X]-*
# XXX: needed here
#
INCOMPAT_BINUTILS?= # empty
-. for _pattern_ in ${_INCOMPAT_BINUTILS} ${INCOMPAT_BINUTILS}
-. if !empty(MACHINE_PLATFORM:M${_pattern_})
+. for _pattern_ in ${_INCOMPAT_BINUTILS} ${INCOMPAT_BINUTILS}
+. if !empty(MACHINE_PLATFORM:M${_pattern_})
BUILDLINK_IS_BUILTIN.binutils= NO
-. endif
-. endfor
+. endif
+. endfor
+. endif
MAKEFLAGS+= BUILDLINK_IS_BUILTIN.binutils=${BUILDLINK_IS_BUILTIN.binutils}
.endif
+.if !empty(BUILDLINK_IS_BUILTIN.binutils:M[yY][eE][sS])
+BUILDLINK_USE_BUILTIN.binutils= YES
+.else
+BUILDLINK_USE_BUILTIN.binutils= NO
+.endif
+
.if !empty(PREFER_PKGSRC:M[yY][eE][sS]) || \
!empty(PREFER_PKGSRC:Mbinutils)
BUILDLINK_USE_BUILTIN.binutils= NO
@@ -48,15 +56,6 @@ BUILDLINK_USE_BUILTIN.binutils= NO
BUILDLINK_USE_BUILTIN.binutils= YES
.endif
-.if !defined(BUILDLINK_USE_BUILTIN.binutils)
-. if !empty(BUILDLINK_IS_BUILTIN.binutils:M[nN][oO])
-BUILDLINK_USE_BUILTIN.binutils= NO
-. else
-BUILDLINK_USE_BUILTIN.binutils= YES
-. endif
-MAKEFLAGS+= BUILDLINK_USE_BUILTIN.binutils=${BUILDLINK_USE_BUILTIN.binutils}
-.endif
-
.if !empty(BUILDLINK_USE_BUILTIN.binutils:M[nN][oO])
. if !empty(BUILDLINK_DEPTH:M+)
BUILDLINK_DEPENDS+= binutils
diff --git a/devel/cdk/buildlink2.mk b/devel/cdk/buildlink2.mk
index 7277eee1aaf..458a25bc3f0 100644
--- a/devel/cdk/buildlink2.mk
+++ b/devel/cdk/buildlink2.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink2.mk,v 1.8 2004/02/05 07:17:15 jlam Exp $
+# $NetBSD: buildlink2.mk,v 1.9 2004/02/12 01:59:37 jlam Exp $
.if !defined(CDK_BUILDLINK2_MK)
CDK_BUILDLINK2_MK= # defined
@@ -8,12 +8,16 @@ CDK_BUILDLINK2_MK= # defined
BUILDLINK_DEPENDS.cdk?= cdk>=4.9.9nb1
BUILDLINK_PKGSRCDIR.cdk?= ../../devel/cdk
-.if defined(USE_CDK)
-_NEED_CDK= YES
-.elif exists(/usr/include/cdk/cdk.h)
-_NEED_CDK= NO
+.if exists(/usr/include/cdk/cdk.h)
+_BUILTIN_CDK= YES
.else
-_NEED_CDK= YES
+_BUILTIN_CDK= NO
+.endif
+
+.if ${_BUILTIN_CDK} == "YES"
+_NEED_CDK= NO
+.else
+_NEED_CDK= YES
.endif
.if !empty(PREFER_PKGSRC:M[yY][eE][sS]) || \
@@ -21,6 +25,10 @@ _NEED_CDK= YES
_NEED_CDK= YES
.endif
+.if defined(USE_CDK)
+_NEED_CDK= YES
+.endif
+
.if ${_NEED_CDK} == "YES"
BUILDLINK_PACKAGES+= cdk
EVAL_PREFIX+= BUILDLINK_PREFIX.cdk=cdk
diff --git a/devel/gettext-lib/buildlink2.mk b/devel/gettext-lib/buildlink2.mk
index 729953a4d93..07592619993 100644
--- a/devel/gettext-lib/buildlink2.mk
+++ b/devel/gettext-lib/buildlink2.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink2.mk,v 1.28 2004/02/05 07:17:14 jlam Exp $
+# $NetBSD: buildlink2.mk,v 1.29 2004/02/12 01:59:37 jlam Exp $
.if !defined(GETTEXT_BUILDLINK2_MK)
GETTEXT_BUILDLINK2_MK= # defined
@@ -8,42 +8,43 @@ GETTEXT_BUILDLINK2_MK= # defined
BUILDLINK_DEPENDS.gettext?= gettext-lib>=0.10.35nb1
BUILDLINK_PKGSRCDIR.gettext?= ../../devel/gettext-lib
-.if defined(USE_GNU_GETTEXT)
-_NEED_GNU_GETTEXT= YES
-_BLNK_LIBINTL_FOUND= NO
-.else
-_BLNK_LIBINTL_LIST!= ${ECHO} /usr/lib/libintl.*
-. if ${_BLNK_LIBINTL_LIST} != "/usr/lib/libintl.*"
-_BLNK_LIBINTL_FOUND= YES
-. else
-_BLNK_LIBINTL_FOUND= NO
-. endif
-. if exists(/usr/include/libintl.h)
+.if exists(/usr/include/libintl.h)
#
# Consider the base system libintl to be gettext-lib-0.10.35nb1.
#
_GETTEXT_PKG= gettext-lib-0.10.35nb1
_GETTEXT_DEPENDS= ${BUILDLINK_DEPENDS.gettext}
-_NEED_GNU_GETTEXT!= \
+_BUILTIN_GETTEXT!= \
if ${PKG_ADMIN} pmatch '${_GETTEXT_DEPENDS}' ${_GETTEXT_PKG}; then \
- ${ECHO} "NO"; \
- else \
${ECHO} "YES"; \
+ else \
+ ${ECHO} "NO"; \
fi
+_BLNK_LIBINTL_LIST!= ${ECHO} /usr/lib/libintl.*
+. if ${_BLNK_LIBINTL_LIST} != "/usr/lib/libintl.*"
+_BLNK_LIBINTL_FOUND= YES
. else
-_NEED_GNU_GETTEXT= YES
+_BLNK_LIBINTL_FOUND= NO
. endif
+.else
+_BUILTIN_GETTEXT= NO
+_BLNK_LIBINTL_FOUND= NO
+.endif
#
-# Solaris has broken (for the purposes of pkgsrc) version of zlib and
-# gettext.
+# Solaris has broken (for the purposes of pkgsrc) version of gettext.
#
_INCOMPAT_GETTEXT= SunOS-*-*
-INCOMPAT_GETTEXT?= # empty
-. for _pattern_ in ${_INCOMPAT_GETTEXT} ${INCOMPAT_GETTEXT}
-. if !empty(MACHINE_PLATFORM:M${_pattern_})
+.for _pattern_ in ${_INCOMPAT_GETTEXT} ${INCOMPAT_GETTEXT}
+. if !empty(MACHINE_PLATFORM:M${_pattern_})
+_BUILTIN_GETTEXT= NO
+_BLNK_LIBINTL_FOUND= NO
+. endif
+.endfor
+
+.if ${_BUILTIN_GETTEXT} == "YES"
+_NEED_GNU_GETTEXT= NO
+.else
_NEED_GNU_GETTEXT= YES
-. endif
-. endfor
.endif
.if !empty(PREFER_PKGSRC:M[yY][eE][sS]) || \
@@ -51,6 +52,10 @@ _NEED_GNU_GETTEXT= YES
_NEED_GNU_GETTEXT= YES
.endif
+.if defined(USE_GNU_GETTEXT)
+_NEED_GNU_GETTEXT= YES
+.endif
+
.if ${_NEED_GNU_GETTEXT} == "YES"
BUILDLINK_PACKAGES+= gettext
EVAL_PREFIX+= BUILDLINK_PREFIX.gettext=gettext-lib
diff --git a/devel/gettext-lib/buildlink3.mk b/devel/gettext-lib/buildlink3.mk
index df8e615caa9..9ed24b3d317 100644
--- a/devel/gettext-lib/buildlink3.mk
+++ b/devel/gettext-lib/buildlink3.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.13 2004/02/11 11:30:49 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.14 2004/02/12 01:59:37 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
GETTEXT_BUILDLINK3_MK:= ${GETTEXT_BUILDLINK3_MK}+
@@ -17,21 +17,45 @@ BUILDLINK_CHECK_BUILTIN.gettext?= NO
BUILDLINK_IS_BUILTIN.gettext= NO
. if exists(/usr/include/libintl.h)
BUILDLINK_IS_BUILTIN.gettext= YES
+. if !empty(BUILDLINK_CHECK_BUILTIN.gettext:M[nN][oO])
+#
+# Consider the base system libintl to be gettext-lib-0.10.35nb1.
+#
+_GETTEXT_PKG= gettext-lib-0.10.35nb1
+. for _depend_ in ${BUILDLINK_DEPENDS.gettext}
+. if !empty(BUILDLINK_IS_BUILTIN.gettext:M[yY][eE][sS])
+BUILDLINK_IS_BUILTIN.gettext!= \
+ if ${PKG_ADMIN} pmatch '${_depend_}' ${_GETTEXT_PKG}; then \
+ ${ECHO} "YES"; \
+ else \
+ ${ECHO} "NO"; \
+ fi
+. endif
+. endfor
+. endif
. endif
+. if !empty(BUILDLINK_CHECK_BUILTIN.gettext:M[nN][oO])
#
# The listed platforms have a broken (for the purposes of pkgsrc) version
# of gettext-lib.
#
_INCOMPAT_GETTEXT= SunOS-*-*
INCOMPAT_GETTEXT?= # empty
-. for _pattern_ in ${_INCOMPAT_GETTEXT} ${INCOMPAT_GETTEXT}
-. if !empty(MACHINE_PLATFORM:M${_pattern_})
+. for _pattern_ in ${_INCOMPAT_GETTEXT} ${INCOMPAT_GETTEXT}
+. if !empty(MACHINE_PLATFORM:M${_pattern_})
BUILDLINK_IS_BUILTIN.gettext= NO
-. endif
-. endfor
+. endif
+. endfor
+. endif
MAKEFLAGS+= BUILDLINK_IS_BUILTIN.gettext=${BUILDLINK_IS_BUILTIN.gettext}
.endif
+.if !empty(BUILDLINK_IS_BUILTIN.gettext:M[yY][eE][sS])
+BUILDLINK_USE_BUILTIN.gettext= YES
+.else
+BUILDLINK_USE_BUILTIN.gettext= NO
+.endif
+
.if !empty(PREFER_PKGSRC:M[yY][eE][sS]) || \
!empty(PREFER_PKGSRC:Mgettext)
BUILDLINK_USE_BUILTIN.gettext= NO
@@ -45,29 +69,6 @@ BUILDLINK_USE_BUILTIN.gettext= NO
BUILDLINK_USE_BUILTIN.gettext= YES
.endif
-.if !defined(BUILDLINK_USE_BUILTIN.gettext)
-. if !empty(BUILDLINK_IS_BUILTIN.gettext:M[nN][oO])
-BUILDLINK_USE_BUILTIN.gettext= NO
-. else
-#
-# Consider the base system libintl to be gettext-lib-0.10.35nb1.
-#
-_GETTEXT_PKG= gettext-lib-0.10.35nb1
-BUILDLINK_USE_BUILTIN.gettext?= YES
-. for _depend_ in ${BUILDLINK_DEPENDS.gettext}
-. if !empty(BUILDLINK_USE_BUILTIN.gettext:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.gettext!= \
- if ${PKG_ADMIN} pmatch '${_depend_}' ${_GETTEXT_PKG}; then \
- ${ECHO} "YES"; \
- else \
- ${ECHO} "NO"; \
- fi
-. endif
-. endfor
-. endif
-MAKEFLAGS+= BUILDLINK_USE_BUILTIN.gettext=${BUILDLINK_USE_BUILTIN.gettext}
-.endif
-
.if !empty(BUILDLINK_USE_BUILTIN.gettext:M[nN][oO])
. if !empty(BUILDLINK_DEPTH:M+)
BUILDLINK_DEPENDS+= gettext
diff --git a/devel/libevent/buildlink2.mk b/devel/libevent/buildlink2.mk
index fdb72dc7477..78634ad0da9 100644
--- a/devel/libevent/buildlink2.mk
+++ b/devel/libevent/buildlink2.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink2.mk,v 1.5 2004/02/05 07:17:15 jlam Exp $
+# $NetBSD: buildlink2.mk,v 1.6 2004/02/12 01:59:37 jlam Exp $
#
# This Makefile fragment is included by packages that use libevent.
#
@@ -11,6 +11,12 @@ LIBEVENT_BUILDLINK2_MK= # defined
.include "../../mk/bsd.prefs.mk"
.if exists(/usr/include/event.h)
+_BUILTIN_LIBEVENT= YES
+.else
+_BUILTIN_LIBEVENT= NO
+.endif
+
+.if ${_BUILTIN_LIBEVENT} == "YES"
_NEED_LIBEVENT= NO
.else
_NEED_LIBEVENT= YES
diff --git a/devel/ncurses/buildlink2.mk b/devel/ncurses/buildlink2.mk
index 3f634b65a69..1455fcc4305 100644
--- a/devel/ncurses/buildlink2.mk
+++ b/devel/ncurses/buildlink2.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink2.mk,v 1.18 2004/02/05 07:17:14 jlam Exp $
+# $NetBSD: buildlink2.mk,v 1.19 2004/02/12 01:59:37 jlam Exp $
#
# Optionally define:
#
@@ -14,45 +14,62 @@ NCURSES_BUILDLINK2_MK= # defined
BUILDLINK_DEPENDS.ncurses?= ncurses>=5.3nb1
BUILDLINK_PKGSRCDIR.ncurses?= ../../devel/ncurses
-.if defined(USE_NCURSES)
-_NEED_NCURSES= YES
-.else
-_NEED_NCURSES= NO
+.if !defined(_BLNK_LIBNCURSES_FOUND)
+_BLNK_LIBNCURSES_FOUND!= \
+ if [ "`${ECHO} /usr/lib/libncurses.*`" = "/usr/lib/libncurses.*" ]; then \
+ ${ECHO} "NO"; \
+ else \
+ ${ECHO} "YES"; \
+ fi
+MAKEFLAGS+= _BLNK_LIBNCURSES_FOUND=${_BLNK_LIBNCURSES_FOUND}
+.endif
-#
-# Handle the base system not having (n)curses.
-#
-. if !(exists(/usr/include/curses.h) || exists(/usr/include/ncurses.h))
-_NEED_NCURSES= YES
+.if !defined(BUILDLINK_IS_BUILTIN.ncurses)
+BUILDLINK_IS_BUILTIN.ncurses= NO
+. if ${_BLNK_LIBNCURSES_FOUND} == "YES"
+BUILDLINK_IS_BUILTIN.ncurses= YES
+. elif exists(${_NCURSES_H})
+BUILDLINK_IS_BUILTIN.ncurses!= \
+ if ${GREP} -q "\#define[ ]*NCURSES_VERSION" ${_NCURSES_H}; then \
+ ${ECHO} "YES"; \
+ else \
+ ${ECHO} "NO"; \
+ fi
. endif
#
-# These versions of NetBSD didn't have a curses library that was capable of
-# replacing ncurses.
-#
-_INCOMPAT_CURSES= NetBSD-0.*-* NetBSD-1.[0123]*-*
-_INCOMPAT_CURSES+= NetBSD-1.4.*-* NetBSD-1.4[A-X]-*
+# XXX By default, assume that the builtin curses on NetBSD systems
+# XXX supports ncurses.
#
-# This catch-all for SunOS is probably too broad, but better to err on
-# the safe side. We can narrow down the match when we have better
-# information.
+. if ${OPSYS} == "NetBSD"
+BUILDLINK_IS_BUILTIN.ncurses= YES
#
-_INCOMPAT_CURSES+= SunOS-*-*
+# These versions of NetBSD didn't have a curses library that was
+# capable of replacing ncurses.
#
-# Similarly for IRIX and Darwin
+# XXX In reality, no version of NetBSD has a curses library that can
+# XXX completely replace ncurses; however, some version implement
+# XXX enough of ncurses that some packages are happy.
#
-_INCOMPAT_CURSES+= IRIX-*-*
-_INCOMPAT_CURSES+= Darwin-*-*
-INCOMPAT_CURSES?= # empty
-. for _pattern_ in ${_INCOMPAT_CURSES} ${INCOMPAT_CURSES}
-. if !empty(MACHINE_PLATFORM:M${_pattern_})
+_INCOMPAT_CURSES= NetBSD-0.*-* NetBSD-1.[0123]*-*
+_INCOMPAT_CURSES+= NetBSD-1.4.*-* NetBSD-1.4[A-X]-*
+. for _pattern_ in ${_INCOMPAT_CURSES} ${INCOMPAT_CURSES}
+. if !empty(MACHINE_PLATFORM:M${_pattern_})
+BUILDLINK_IS_BUILTIN.ncurses= NO
+. endif
+. endfor
+. endif
+MAKEFLAGS+= BUILDLINK_IS_BUILTIN.ncurses=${BUILDLINK_IS_BUILTIN.ncurses}
+.endif
+
+.if !empty(BUILDLINK_IS_BUILTIN.ncurses:M[yY][eE][sS])
+_NEED_NCURSES= NO
+.else
_NEED_NCURSES= YES
-. endif
-. endfor
.endif
.if !empty(PREFER_PKGSRC:M[yY][eE][sS]) || \
!empty(PREFER_PKGSRC:Mncurses)
-_NEED_NCURSES= YES
+_NEED_NCURSES= YES
.endif
.if ${_NEED_NCURSES} == "YES"
@@ -87,8 +104,7 @@ BUILDLINK_FILES.ncurses+= lib/libncurses.*
BUILDLINK_FILES.ncurses+= lib/libpanel.*
.if ${_NEED_NCURSES} == "NO"
-_BLNK_LIBNCURSES_LIST!= ${ECHO} /usr/lib/libncurses.*
-. if ${_BLNK_LIBNCURSES_LIST} == "/usr/lib/libncurses.*"
+. if !empty(_BLNK_LIBNCURSES_FOUND:M[yY][eE][sS])
BUILDLINK_FILES.ncurses+= lib/libcurses.*
BUILDLINK_TRANSFORM.ncurses+= -e "s|/curses.h|/ncurses.h|g"
BUILDLINK_TRANSFORM+= l:ncurses:curses
diff --git a/devel/ncurses/buildlink3.mk b/devel/ncurses/buildlink3.mk
index a50c9b6b663..d3f3df47188 100644
--- a/devel/ncurses/buildlink3.mk
+++ b/devel/ncurses/buildlink3.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.16 2004/02/11 11:30:50 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.17 2004/02/12 01:59:37 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
NCURSES_BUILDLINK3_MK:= ${NCURSES_BUILDLINK3_MK}+
@@ -30,25 +30,54 @@ BUILDLINK_IS_BUILTIN.ncurses= NO
. if ${_BLNK_LIBNCURSES_FOUND} == "YES"
BUILDLINK_IS_BUILTIN.ncurses= YES
. elif exists(${_NCURSES_H})
-BUILDLINK_IS_BUILTIN.ncurses!= \
+_IS_BUILTIN.ncurses!= \
if ${GREP} -q "\#define[ ]*NCURSES_VERSION" ${_NCURSES_H}; then \
${ECHO} "YES"; \
else \
${ECHO} "NO"; \
fi
+BUILDLINK_IS_BUILTIN.ncurses= ${_IS_BUILTIN.ncurses}
+. if !empty(BUILDLINK_CHECK_BUILTIN.ncurses:M[nN][oO]) && \
+ !empty(_IS_BUILTIN.ncurses:M[yY][eE][sS])
+#
+# Create an appropriate name for the built-in package 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.
+#
+_NCURSES_VERSION!= \
+ ${AWK} '/\#define[ ]*NCURSES_VERSION[ ]/ { \
+ vers = $$3; \
+ gsub("\"", "", vers); \
+ print vers; \
+ } \
+ ' ${_NCURSES_H}
+_NCURSES_PKG= ncurses-${_NCURSES_VERSION}
+BUILDLINK_IS_BUILTIN.ncurses= YES
+. for _depend_ in ${BUILDLINK_DEPENDS.ncurses}
+. if !empty(BUILDLINK_IS_BUILTIN.ncurses:M[yY][eE][sS])
+BUILDLINK_IS_BUILTIN.ncurses!= \
+ if ${PKG_ADMIN} pmatch '${_depend_}' ${_NCURSES_PKG}; then \
+ ${ECHO} "YES"; \
+ else \
+ ${ECHO} "NO"; \
+ fi
+. endif
+. endfor
+. endif
. endif
#
-# XXX By default, assume that the builtin curses on NetBSD systems
+# XXX By default, assume that the native curses on NetBSD systems
# XXX supports ncurses.
#
. if ${OPSYS} == "NetBSD"
-BUILDLINK_USE_BUILTIN.ncurses= YES
+BUILDLINK_IS_BUILTIN.ncurses= YES
#
# These versions of NetBSD didn't have a curses library that was
# capable of replacing ncurses.
#
# XXX In reality, no version of NetBSD has a curses library that can
-# XXX completely replace ncurses; however, some version implement
+# XXX completely replace ncurses; however, some versions implement
# XXX enough of ncurses that some packages are happy.
#
_INCOMPAT_CURSES= NetBSD-0.*-* NetBSD-1.[0123]*-*
@@ -62,6 +91,12 @@ BUILDLINK_IS_BUILTIN.ncurses= NO
MAKEFLAGS+= BUILDLINK_IS_BUILTIN.ncurses=${BUILDLINK_IS_BUILTIN.ncurses}
.endif
+.if !empty(BUILDLINK_IS_BUILTIN.ncurses:M[yY][eE][sS])
+BUILDLINK_USE_BUILTIN.ncurses= YES
+.else
+BUILDLINK_USE_BUILTIN.ncurses= NO
+.endif
+
.if !empty(PREFER_PKGSRC:M[yY][eE][sS]) || \
!empty(PREFER_PKGSRC:Mncurses)
BUILDLINK_USE_BUILTIN.ncurses= NO
@@ -75,41 +110,6 @@ BUILDLINK_USE_BUILTIN.ncurses= NO
BUILDLINK_USE_BUILTIN.ncurses= YES
.endif
-.if !defined(BUILDLINK_USE_BUILTIN.ncurses)
-. if !empty(BUILDLINK_IS_BUILTIN.ncurses:M[nN][oO])
-BUILDLINK_USE_BUILTIN.ncurses= NO
-. else
-BUILDLINK_USE_BUILTIN.ncurses= YES
-#
-# Create an appropriate name for the built-in package 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.
-#
-_NCURSES_VERSION!= \
- ${AWK} '/\#define[ ]*NCURSES_VERSION[ ]/ { \
- vers = $$3; \
- gsub("\"", "", vers); \
- print vers; \
- } \
- ' ${_NCURSES_H}
-_NCURSES_PKG= ncurses-${_NCURSES_VERSION}
-BUILDLINK_USE_BUILTIN.ncurses?= YES
-. for _depend_ in ${BUILDLINK_DEPENDS.ncurses}
-. if !empty(BUILDLINK_USE_BUILTIN.ncurses:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.ncurses!= \
- if ${PKG_ADMIN} pmatch '${_depend_}' ${_NCURSES_PKG}; then \
- ${ECHO} "YES"; \
- else \
- ${ECHO} "NO"; \
- fi
-. endif
-. endfor
-. endif
-MAKEFLAGS+= \
- BUILDLINK_USE_BUILTIN.ncurses=${BUILDLINK_USE_BUILTIN.ncurses}
-.endif
-
.if !empty(BUILDLINK_USE_BUILTIN.ncurses:M[nN][oO])
. if !empty(BUILDLINK_DEPTH:M+)
BUILDLINK_DEPENDS+= ncurses
diff --git a/devel/readline/buildlink2.mk b/devel/readline/buildlink2.mk
index b1b01d8dc5f..f395cbe82c7 100644
--- a/devel/readline/buildlink2.mk
+++ b/devel/readline/buildlink2.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink2.mk,v 1.6 2004/02/05 07:17:14 jlam Exp $
+# $NetBSD: buildlink2.mk,v 1.7 2004/02/12 01:59:38 jlam Exp $
#
# Optionally define USE_GNU_READLINE to force use of GNU readline.
#
@@ -13,27 +13,28 @@ READLINE_BUILDLINK2_MK= # defined
BUILDLINK_DEPENDS.readline?= readline>=2.2
BUILDLINK_PKGSRCDIR.readline?= ../../devel/readline
-.if defined(USE_GNU_READLINE)
-_NEED_GNU_READLINE= YES
+.if exists(/usr/include/readline.h) || \
+ exists(/usr/include/readline/readline.h)
+_BUILTIN_READLINE= YES
.else
-. if exists(/usr/include/readline.h) || \
- exists(/usr/include/readline/readline.h)
-_NEED_GNU_READLINE= NO
-. else
-_NEED_GNU_READLINE= YES
-. endif
+_BUILTIN_READLINE= NO
+.endif
#
# This catch-all for SunOS is probably too broad, but better to err on
# the safe side. We can narrow down the match when we have better
# information.
#
_INCOMPAT_READLINE= SunOS-*-*
-INCOMPAT_READLINE?= # empty
-. for _pattern_ in ${_INCOMPAT_READLINE} ${INCOMPAT_READLINE}
-. if !empty(MACHINE_PLATFORM:M${_pattern_})
+.for _pattern_ in ${_INCOMPAT_READLINE} ${INCOMPAT_READLINE}
+. if !empty(MACHINE_PLATFORM:M${_pattern_})
+_BUILTIN_READLINE= NO
+. endif
+.endfor
+
+.if ${_BUILTIN_READLINE} == "YES"
+_NEED_GNU_READLINE= NO
+.else
_NEED_GNU_READLINE= YES
-. endif
-. endfor
.endif
.if !empty(PREFER_PKGSRC:M[yY][eE][sS]) || \
@@ -41,14 +42,18 @@ _NEED_GNU_READLINE= YES
_NEED_GNU_READLINE= YES
.endif
+.if defined(USE_GNU_READLINE)
+_NEED_GNU_READLINE= YES
+.endif
+
.if ${_NEED_GNU_READLINE} == "YES"
BUILDLINK_PACKAGES+= readline
EVAL_PREFIX+= BUILDLINK_PREFIX.readline=readline
BUILDLINK_PREFIX.readline_DEFAULT= ${LOCALBASE}
.else
-BUILDLINK_PREFIX.readline= /usr
+BUILDLINK_PREFIX.readline= /usr
.endif
-BUILDLINK_PREFIX.history= ${BUILDLINK_PREFIX.readline}
+BUILDLINK_PREFIX.history= ${BUILDLINK_PREFIX.readline}
BUILDLINK_FILES.readline= include/readline.h
BUILDLINK_FILES.readline+= include/readline/*
diff --git a/devel/readline/buildlink3.mk b/devel/readline/buildlink3.mk
index d65025a8a43..f64d39b6e48 100644
--- a/devel/readline/buildlink3.mk
+++ b/devel/readline/buildlink3.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.11 2004/02/11 11:30:50 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.12 2004/02/12 01:59:38 jlam Exp $
#
# Optionally define USE_GNU_READLINE to force use of GNU readline.
#
@@ -24,19 +24,27 @@ BUILDLINK_IS_BUILTIN.readline= NO
exists(/usr/include/readline/readline.h)
BUILDLINK_IS_BUILTIN.readline= YES
. endif
+. if !empty(BUILDLINK_CHECK_BUILTIN.readline:M[nN][oO])
#
# These catch-alls are probably too broad, but better to err on the safe
# side. We can narrow down the match when we have better information.
#
_INCOMPAT_READLINE?= SunOS-*-*
-. for _pattern_ in ${_INCOMPAT_READLINE} ${INCOMPAT_READLINE}
-. if !empty(MACHINE_PLATFORM:M${_pattern_})
+. for _pattern_ in ${_INCOMPAT_READLINE} ${INCOMPAT_READLINE}
+. if !empty(MACHINE_PLATFORM:M${_pattern_})
BUILDLINK_IS_BUILTIN.readline= NO
-. endif
-. endfor
+. endif
+. endfor
+. endif
MAKEFLAGS+= BUILDLINK_IS_BUILTIN.readline=${BUILDLINK_IS_BUILTIN.readline}
.endif
+.if !empty(BUILDLINK_IS_BUILTIN.readline:M[yY][eE][sS])
+BUILDLINK_USE_BUILTIN.readline= YES
+.else
+BUILDLINK_USE_BUILTIN.readline= NO
+.endif
+
.if !empty(PREFER_PKGSRC:M[yY][eE][sS]) || \
!empty(PREFER_PKGSRC:Mreadline)
BUILDLINK_USE_BUILTIN.readline= NO
@@ -50,15 +58,6 @@ BUILDLINK_USE_BUILTIN.readline= NO
BUILDLINK_USE_BUILTIN.readline= YES
.endif
-.if !defined(BUILDLINK_USE_BUILTIN.readline)
-. if !empty(BUILDLINK_IS_BUILTIN.readline:M[nN][oO])
-BUILDLINK_USE_BUILTIN.readline= NO
-. else
-BUILDLINK_USE_BUILTIN.readline= YES
-. endif
-MAKEFLAGS+= BUILDLINK_USE_BUILTIN.readline=${BUILDLINK_USE_BUILTIN.readline}
-.endif
-
.if !empty(BUILDLINK_USE_BUILTIN.readline:M[nN][oO])
. if !empty(BUILDLINK_DEPTH:M+)
BUILDLINK_DEPENDS+= readline
diff --git a/devel/zlib/buildlink2.mk b/devel/zlib/buildlink2.mk
index 90cbd93d28c..90bb8cc6efd 100644
--- a/devel/zlib/buildlink2.mk
+++ b/devel/zlib/buildlink2.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink2.mk,v 1.12 2004/02/06 19:04:24 jlam Exp $
+# $NetBSD: buildlink2.mk,v 1.13 2004/02/12 01:59:38 jlam Exp $
.if !defined(ZLIB_BUILDLINK2_MK)
ZLIB_BUILDLINK2_MK= # defined
@@ -13,24 +13,6 @@ _ZLIB_H= /usr/include/zlib.h
.if !defined(BUILDLINK_IS_BUILTIN.zlib)
BUILDLINK_IS_BUILTIN.zlib= NO
. if exists(${_ZLIB_H})
-BUILDLINK_IS_BUILTIN.zlib= YES
-. endif
-.endif
-
-.if !empty(PREFER_PKGSRC:M[yY][eE][sS]) || \
- !empty(PREFER_PKGSRC:Mzlib)
-BUILDLINK_USE_BUILTIN.zlib= NO
-.endif
-
-.if defined(USE_ZLIB)
-BUILDLINK_USE_BUILTIN.zlib= NO
-.endif
-
-.if !defined(BUILDLINK_USE_BUILTIN.zlib)
-. if !empty(BUILDLINK_IS_BUILTIN.zlib:M[nN][oO])
-BUILDLINK_USE_BUILTIN.zlib= NO
-. else
-BUILDLINK_USE_BUILTIN.zlib= YES
#
# Create an appropriate name for the built-in package distributed
# with the system. This package name can be used to check against
@@ -67,14 +49,29 @@ _ZLIB_PKG= zlib-1.1.4nb1
. endif
_ZLIB_DEPENDS= ${BUILDLINK_DEPENDS.zlib}
-BUILDLINK_USE_BUILTIN.zlib!= \
+BUILDLINK_IS_BUILTIN.zlib!= \
if ${PKG_ADMIN} pmatch '${_ZLIB_DEPENDS}' ${_ZLIB_PKG}; then \
${ECHO} "YES"; \
else \
${ECHO} "NO"; \
fi
. endif
-MAKEFLAGS+= BUILDLINK_USE_BUILTIN.zlib=${BUILDLINK_USE_BUILTIN.zlib}
+MAKEFLAGS+= BUILDLINK_IS_BUILTIN.zlib=${BUILDLINK_IS_BUILTIN.zlib}
+.endif
+
+.if !empty(BUILDLINK_IS_BUILTIN.zlib:M[yY][eE][sS])
+BUILDLINK_USE_BUILTIN.zlib= YES
+.else
+BUILDLINK_USE_BUILTIN.zlib= NO
+.endif
+
+.if !empty(PREFER_PKGSRC:M[yY][eE][sS]) || \
+ !empty(PREFER_PKGSRC:Mzlib)
+BUILDLINK_USE_BUILTIN.zlib= NO
+.endif
+
+.if defined(USE_ZLIB)
+BUILDLINK_USE_BUILTIN.zlib= NO
.endif
.if !empty(BUILDLINK_USE_BUILTIN.zlib:M[nN][oO])
diff --git a/devel/zlib/buildlink3.mk b/devel/zlib/buildlink3.mk
index a8a54e96104..7b6653a13ff 100644
--- a/devel/zlib/buildlink3.mk
+++ b/devel/zlib/buildlink3.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.12 2004/02/06 19:04:24 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.13 2004/02/12 01:59:38 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
ZLIB_BUILDLINK3_MK:= ${ZLIB_BUILDLINK3_MK}+
@@ -19,27 +19,7 @@ _ZLIB_H= /usr/include/zlib.h
BUILDLINK_IS_BUILTIN.zlib= NO
. if exists(${_ZLIB_H})
BUILDLINK_IS_BUILTIN.zlib= YES
-. endif
-.endif
-
-.if !empty(PREFER_PKGSRC:M[yY][eE][sS]) || \
- !empty(PREFER_PKGSRC:Mzlib)
-BUILDLINK_USE_BUILTIN.zlib= NO
-.endif
-
-.if defined(USE_ZLIB)
-BUILDLINK_USE_BUILTIN.zlib= NO
-.endif
-
-.if !empty(BUILDLINK_CHECK_BUILTIN.zlib:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.zlib= YES
-.endif
-
-.if !defined(BUILDLINK_USE_BUILTIN.zlib)
-. if !empty(BUILDLINK_IS_BUILTIN.zlib:M[nN][oO])
-BUILDLINK_USE_BUILTIN.zlib= NO
-. else
-BUILDLINK_USE_BUILTIN.zlib= YES
+. if !empty(BUILDLINK_CHECK_BUILTIN.zlib:M[nN][oO])
#
# Create an appropriate name for the built-in package distributed
# with the system. This package name can be used to check against
@@ -67,27 +47,45 @@ _HAVE_CAN_2003_0107_FIX+= NetBSD-[2-9]*-* NetBSD-1[0-9]*-*
# XXX zlib-1.1.4.
#
_HAVE_CAN_2003_0107_FIX+= FreeBSD-*-* OpenBSD-*-*
-. if ${_ZLIB_VERSION} == "1.1.4"
-. for _pattern_ in ${_HAVE_CAN_2003_0107_FIX}
-. if !empty(MACHINE_PLATFORM:M${_pattern_})
+. if ${_ZLIB_VERSION} == "1.1.4"
+. for _pattern_ in ${_HAVE_CAN_2003_0107_FIX}
+. if !empty(MACHINE_PLATFORM:M${_pattern_})
_ZLIB_PKG= zlib-1.1.4nb1
-. endif
-. endfor
-. endif
-
-BUILDLINK_USE_BUILTIN.zlib?= YES
-. for _depend_ in ${BUILDLINK_DEPENDS.zlib}
-. if !empty(BUILDLINK_USE_BUILTIN.zlib:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.zlib!= \
+. endif
+. endfor
+. endif
+. for _depend_ in ${BUILDLINK_DEPENDS.zlib}
+. if !empty(BUILDLINK_IS_BUILTIN.zlib:M[yY][eE][sS])
+BUILDLINK_IS_BUILTIN.zlib!= \
if ${PKG_ADMIN} pmatch '${_depend_}' ${_ZLIB_PKG}; then \
${ECHO} "YES"; \
else \
${ECHO} "NO"; \
fi
-. endif
-. endfor
+. endif
+. endfor
+. endif
. endif
-MAKEFLAGS+= BUILDLINK_USE_BUILTIN.zlib=${BUILDLINK_USE_BUILTIN.zlib}
+MAKEFLAGS+= BUILDLINK_IS_BUILTIN.zlib=${BUILDLINK_IS_BUILTIN.zlib}
+.endif
+
+.if !empty(BUILDLINK_IS_BUILTIN.zlib:M[yY][eE][sS])
+BUILDLINK_USE_BUILTIN.zlib= YES
+.else
+BUILDLINK_USE_BUILTIN.zlib= NO
+.endif
+
+.if !empty(PREFER_PKGSRC:M[yY][eE][sS]) || \
+ !empty(PREFER_PKGSRC:Mzlib)
+BUILDLINK_USE_BUILTIN.zlib= NO
+.endif
+
+.if defined(USE_ZLIB)
+BUILDLINK_USE_BUILTIN.zlib= NO
+.endif
+
+.if !empty(BUILDLINK_CHECK_BUILTIN.zlib:M[yY][eE][sS])
+BUILDLINK_USE_BUILTIN.zlib= YES
.endif
.if !empty(BUILDLINK_USE_BUILTIN.zlib:M[nN][oO])
diff --git a/graphics/MesaLib/buildlink3.mk b/graphics/MesaLib/buildlink3.mk
index d4bceb7fbb7..58ae99ab19e 100644
--- a/graphics/MesaLib/buildlink3.mk
+++ b/graphics/MesaLib/buildlink3.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.22 2004/02/11 02:03:41 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.23 2004/02/12 01:59:38 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
MESALIB_BUILDLINK3_MK:= ${MESALIB_BUILDLINK3_MK}+
@@ -47,52 +47,53 @@ _X11_TMPL= ${X11BASE}/lib/X11/config/X11.tmpl
.if !defined(BUILDLINK_IS_BUILTIN.MesaLib)
BUILDLINK_IS_BUILTIN.MesaLib= NO
. if exists(${_GL_GLX_H}) && exists(${_X11_TMPL})
-BUILDLINK_IS_BUILTIN.MesaLib!= \
+_IS_BUILTIN.MesaLib!= \
if ${GREP} -q BuildGLXLibrary ${_X11_TMPL}; then \
${ECHO} "YES"; \
else \
${ECHO} "NO"; \
fi
-. endif
-MAKEFLAGS+= BUILDLINK_IS_BUILTIN.MesaLib=${BUILDLINK_IS_BUILTIN.MesaLib}
-.endif
-
-.if !empty(PREFER_PKGSRC:M[yY][eE][sS]) || \
- !empty(PREFER_PKGSRC:MMesaLib)
-BUILDLINK_USE_BUILTIN.MesaLib= NO
-.endif
-
-.if !empty(BUILDLINK_CHECK_BUILTIN.MesaLib:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.MesaLib= YES
-.endif
-
-.if !defined(BUILDLINK_USE_BUILTIN.MesaLib)
-. if !empty(BUILDLINK_IS_BUILTIN.MesaLib:M[nN][oO])
-BUILDLINK_USE_BUILTIN.MesaLib= NO
-. else
+BUILDLINK_IS_BUILTIN.MesaLib= ${_IS_BUILTIN.MesaLib}
+. if !empty(BUILDLINK_CHECK_BUILTIN.MesaLib:M[nN][oO]) && \
+ !empty(_IS_BUILTIN.MesaLib:M[yY][eE][sS])
#
# Create an appropriate package name for the built-in Mesa/GLX 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.
#
-. include "../../graphics/Mesa/version.mk"
+. include "../../graphics/Mesa/version.mk"
_MESALIB_PKG= MesaLib-${_MESA_VERSION}
-BUILDLINK_USE_BUILTIN.MesaLib?= YES
-. for _depend_ in ${BUILDLINK_DEPENDS.MesaLib}
-. if !empty(BUILDLINK_USE_BUILTIN.MesaLib:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.MesaLib!= \
+BUILDLINK_IS_BUILTIN.MesaLib?= YES
+. for _depend_ in ${BUILDLINK_DEPENDS.MesaLib}
+. if !empty(BUILDLINK_IS_BUILTIN.MesaLib:M[yY][eE][sS])
+BUILDLINK_IS_BUILTIN.MesaLib!= \
if ${PKG_ADMIN} pmatch '${_depend_}' ${_MESALIB_PKG}; then \
${ECHO} "YES"; \
else \
${ECHO} "NO"; \
fi
-. endif
-. endfor
+. endif
+. endfor
+. endif
. endif
-MAKEFLAGS+= \
- BUILDLINK_USE_BUILTIN.MesaLib=${BUILDLINK_USE_BUILTIN.MesaLib}
-.endif # BUILDLINK_USE_BUILTIN.MesaLib
+MAKEFLAGS+= BUILDLINK_IS_BUILTIN.MesaLib=${BUILDLINK_IS_BUILTIN.MesaLib}
+.endif
+
+.if !empty(BUILDLINK_IS_BUILTIN.MesaLib:M[yY][eE][sS])
+BUILDLINK_USE_BUILTIN.MesaLib= YES
+.else
+BUILDLINK_USE_BUILTIN.MesaLib= NO
+.endif
+
+.if !empty(PREFER_PKGSRC:M[yY][eE][sS]) || \
+ !empty(PREFER_PKGSRC:MMesaLib)
+BUILDLINK_USE_BUILTIN.MesaLib= NO
+.endif
+
+.if !empty(BUILDLINK_CHECK_BUILTIN.MesaLib:M[yY][eE][sS])
+BUILDLINK_USE_BUILTIN.MesaLib= YES
+.endif
.if !empty(BUILDLINK_USE_BUILTIN.MesaLib:M[nN][oO])
#
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])
diff --git a/graphics/glu/buildlink3.mk b/graphics/glu/buildlink3.mk
index 451c36a0dc7..290e9b871c1 100644
--- a/graphics/glu/buildlink3.mk
+++ b/graphics/glu/buildlink3.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.19 2004/02/11 02:03:41 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.20 2004/02/12 01:59:38 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
GLU_BUILDLINK3_MK:= ${GLU_BUILDLINK3_MK}+
@@ -21,51 +21,53 @@ _X11_TMPL= ${X11BASE}/lib/X11/config/X11.tmpl
.if !defined(BUILDLINK_IS_BUILTIN.glu)
BUILDLINK_IS_BUILTIN.glu= NO
. if exists(${_GL_GLU_H}) && exists(${_X11_TMPL})
-BUILDLINK_IS_BUILTIN.glu!= \
+_IS_BUILTIN.glu!= \
if ${GREP} -q BuildGLULibrary ${_X11_TMPL}; then \
${ECHO} "YES"; \
else \
${ECHO} "NO"; \
fi
-. endif
-MAKEFLAGS+= BUILDLINK_IS_BUILTIN.glu=${BUILDLINK_IS_BUILTIN.glu}
-.endif
-
-.if !empty(PREFER_PKGSRC:M[yY][eE][sS]) || \
- !empty(PREFER_PKGSRC:Mglu)
-BUILDLINK_USE_BUILTIN.glu= NO
-.endif
-
-.if !empty(BUILDLINK_CHECK_BUILTIN.glu:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.glu= YES
-.endif
-
-.if !defined(BUILDLINK_USE_BUILTIN.glu)
-. if !empty(BUILDLINK_IS_BUILTIN.glu:M[nN][oO])
-BUILDLINK_USE_BUILTIN.glu= NO
-. else
+BUILDLINK_IS_BUILTIN.glu= ${_IS_BUILTIN.glu}
+. if !empty(BUILDLINK_CHECK_BUILTIN.glu:M[nN][oO]) && \
+ !empty(_IS_BUILTIN.glu:M[yY][eE][sS])
#
# Create an appropriate package name for the built-in Mesa/GLU 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.
#
-. include "../../graphics/Mesa/version.mk"
+. include "../../graphics/Mesa/version.mk"
_GLU_PKG= glu-${_MESA_VERSION}
-BUILDLINK_USE_BUILTIN.glu?= YES
-. for _depend_ in ${BUILDLINK_DEPENDS.glu}
-. if !empty(BUILDLINK_USE_BUILTIN.glu:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.glu!= \
+BUILDLINK_IS_BUILTIN.glu?= YES
+. for _depend_ in ${BUILDLINK_DEPENDS.glu}
+. if !empty(BUILDLINK_IS_BUILTIN.glu:M[yY][eE][sS])
+BUILDLINK_IS_BUILTIN.glu!= \
if ${PKG_ADMIN} pmatch '${_depend_}' ${_GLU_PKG}; then \
${ECHO} "YES"; \
else \
${ECHO} "NO"; \
fi
-. endif
-. endfor
+. endif
+. endfor
+. endif
. endif
-MAKEFLAGS+= BUILDLINK_USE_BUILTIN.glu=${BUILDLINK_USE_BUILTIN.glu}
-.endif # BUILDLINK_USE_BUILTIN.glu
+MAKEFLAGS+= BUILDLINK_IS_BUILTIN.glu=${BUILDLINK_IS_BUILTIN.glu}
+.endif
+
+.if !empty(BUILDLINK_IS_BUILTIN.glu:M[yY][eE][sS])
+BUILDLINK_USE_BUILTIN.glu= YES
+.else
+BUILDLINK_USE_BUILTIN.glu= NO
+.endif
+
+.if !empty(PREFER_PKGSRC:M[yY][eE][sS]) || \
+ !empty(PREFER_PKGSRC:Mglu)
+BUILDLINK_USE_BUILTIN.glu= NO
+.endif
+
+.if !empty(BUILDLINK_CHECK_BUILTIN.glu:M[yY][eE][sS])
+BUILDLINK_USE_BUILTIN.glu= YES
+.endif
.if !empty(BUILDLINK_USE_BUILTIN.glu:M[nN][oO])
#
diff --git a/mail/libmilter/buildlink2.mk b/mail/libmilter/buildlink2.mk
index 2ddb9b951b6..c1d5790f352 100644
--- a/mail/libmilter/buildlink2.mk
+++ b/mail/libmilter/buildlink2.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink2.mk,v 1.6 2004/02/05 07:17:15 jlam Exp $
+# $NetBSD: buildlink2.mk,v 1.7 2004/02/12 01:59:38 jlam Exp $
#
# This Makefile fragment is included by packages that use libmilter.
#
@@ -14,11 +14,17 @@ BUILDLINK_PKGSRCDIR.libmilter?= ../../mail/libmilter
.if exists(/usr/lib/libmilter.a)
_MILTER_FILELIST!= ar t /usr/lib/libmilter.a
. if empty(_MILTER_FILELIST:Merrstring.o)
-_NEED_LIBMILTER= YES
+_BUILTIN_LIBMILTER= NO
. else
-_NEED_LIBMILTER= NO
+_BUILTIN_LIBMILTER= YES
. endif
.else
+_BUILTIN_LIBMILTER= NO
+.endif
+
+.if ${_BUILTIN_LIBMILTER} == "YES"
+_NEED_LIBMILTER= NO
+.else
_NEED_LIBMILTER= YES
.endif
diff --git a/net/hesiod/buildlink2.mk b/net/hesiod/buildlink2.mk
index 3216bad2688..5e89f709db8 100644
--- a/net/hesiod/buildlink2.mk
+++ b/net/hesiod/buildlink2.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink2.mk,v 1.5 2004/02/05 07:17:15 jlam Exp $
+# $NetBSD: buildlink2.mk,v 1.6 2004/02/12 01:59:38 jlam Exp $
.if !defined(HESIOD_BUILDLINK2_MK)
HESIOD_BUILDLINK2_MK= # defined
@@ -8,14 +8,16 @@ HESIOD_BUILDLINK2_MK= # defined
BUILDLINK_DEPENDS.hesiod?= hesiod>=3.0.2
BUILDLINK_PKGSRCDIR.hesiod?= ../../net/hesiod
-.if defined(USE_HESIOD)
-_NEED_HESIOD= YES
+.if exists(/usr/include/hesiod.h)
+_BUILTIN_HESIOD= YES
.else
-. if exists(/usr/include/hesiod.h)
-_NEED_HESIOD= NO
-. else
-_NEED_HESIOD= YES
-. endif
+_BUILTIN_HESIOD= NO
+.endif
+
+.if ${_BUILTIN_HESIOD} == "YES"
+_NEED_HESIOD= NO
+.else
+_NEED_HESIOD= YES
.endif
.if !empty(PREFER_PKGSRC:M[yY][eE][sS]) || \
@@ -23,6 +25,10 @@ _NEED_HESIOD= YES
_NEED_HESIOD= YES
.endif
+.if defined(USE_HESIOD)
+_NEED_HESIOD= YES
+.endif
+
.if ${_NEED_HESIOD} == "YES"
BUILDLINK_PACKAGES+= hesiod
EVAL_PREFIX+= BUILDLINK_PREFIX.hesiod=hesiod
diff --git a/net/libpcap/buildlink2.mk b/net/libpcap/buildlink2.mk
index cda6b050da1..2d72563273f 100644
--- a/net/libpcap/buildlink2.mk
+++ b/net/libpcap/buildlink2.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink2.mk,v 1.6 2004/02/05 07:17:14 jlam Exp $
+# $NetBSD: buildlink2.mk,v 1.7 2004/02/12 01:59:38 jlam Exp $
.if !defined(LIBPCAP_BUILDLINK2_MK)
LIBPCAP_BUILDLINK2_MK= # defined
@@ -9,9 +9,15 @@ BUILDLINK_DEPENDS.libpcap?= libpcap>=0.7.2
BUILDLINK_PKGSRCDIR.libpcap?= ../../net/libpcap
.if exists(/usr/include/pcap.h)
-_NEED_LIBPCAP= NO
+_BUILTIN_LIBPCAP= YES
.else
-_NEED_LIBPCAP= YES
+_BUILTIN_LIBPCAP= NO
+.endif
+
+.if ${_BUILTIN_LIBPCAP} == "YES"
+_NEED_LIBPCAP= NO
+.else
+_NEED_LIBPCAP= YES
.endif
.if !empty(PREFER_PKGSRC:M[yY][eE][sS]) || \
diff --git a/net/libpcap/buildlink3.mk b/net/libpcap/buildlink3.mk
index d45215ff886..3a00ea7ece8 100644
--- a/net/libpcap/buildlink3.mk
+++ b/net/libpcap/buildlink3.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.8 2004/02/05 07:17:14 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.9 2004/02/12 01:59:38 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
LIBPCAP_BUILDLINK3_MK:= ${LIBPCAP_BUILDLINK3_MK}+
@@ -20,6 +20,12 @@ BUILDLINK_IS_BUILTIN.libpcap= YES
. endif
.endif
+.if !empty(BUILDLINK_IS_BUILTIN.libpcap:M[yY][eE][sS])
+BUILDLINK_USE_BUILTIN.libpcap= YES
+.else
+BUILDLINK_USE_BUILTIN.libpcap= NO
+.endif
+
.if !empty(PREFER_PKGSRC:M[yY][eE][sS]) || \
!empty(PREFER_PKGSRC:Mlibpcap)
BUILDLINK_USE_BUILTIN.libpcap= NO
@@ -29,14 +35,6 @@ BUILDLINK_USE_BUILTIN.libpcap= NO
BUILDLINK_USE_BUILTIN.libpcap= YES
.endif
-.if !defined(BUILDLINK_USE_BUILTIN.libpcap)
-. if !empty(BUILDLINK_IS_BUILTIN.libpcap:M[nN][oO])
-BUILDLINK_USE_BUILTIN.libpcap= NO
-. else
-BUILDLINK_USE_BUILTIN.libpcap= YES
-. endif
-.endif
-
.if !empty(BUILDLINK_USE_BUILTIN.libpcap:M[nN][oO])
. if !empty(BUILDLINK_DEPTH:M+)
BUILDLINK_DEPENDS+= libpcap
diff --git a/security/PAM/buildlink2.mk b/security/PAM/buildlink2.mk
index 39e44bf1d7d..f2348d0f858 100644
--- a/security/PAM/buildlink2.mk
+++ b/security/PAM/buildlink2.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink2.mk,v 1.5 2004/02/05 07:17:14 jlam Exp $
+# $NetBSD: buildlink2.mk,v 1.6 2004/02/12 01:59:38 jlam Exp $
.if !defined(PAM_BUILDLINK2_MK)
PAM_BUILDLINK2_MK= # defined
@@ -9,6 +9,12 @@ BUILDLINK_DEPENDS.pam?= PAM>=0.75
BUILDLINK_PKGSRCDIR.pam?= ../../security/PAM
.if exists(/usr/include/security/pam_appl.h)
+_BUILTIN_PAM= YES
+.else
+_BUILTIN_PAM= NO
+.endif
+
+.if ${_BUILTIN_PAM} == "YES"
_NEED_PAM= NO
.else
_NEED_PAM= YES
diff --git a/security/PAM/buildlink3.mk b/security/PAM/buildlink3.mk
index ca1f2d334af..b80345cf8ab 100644
--- a/security/PAM/buildlink3.mk
+++ b/security/PAM/buildlink3.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.8 2004/02/05 07:17:14 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.9 2004/02/12 01:59:38 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
PAM_BUILDLINK3_MK:= ${PAM_BUILDLINK3_MK}+
@@ -20,6 +20,12 @@ BUILDLINK_IS_BUILTIN.pam= YES
. endif
.endif
+.if !empty(BUILDLINK_IS_BUILTIN.pam:M[yY][eE][sS])
+BUILDLINK_USE_BUILTIN.pam= YES
+.else
+BUILDLINK_USE_BUILTIN.pam= NO
+.endif
+
.if !empty(PREFER_PKGSRC:M[yY][eE][sS]) || \
!empty(PREFER_PKGSRC:Mpam)
BUILDLINK_USE_BUILTIN.pam= NO
@@ -29,14 +35,6 @@ BUILDLINK_USE_BUILTIN.pam= NO
BUILDLINK_USE_BUILTIN.pam= YES
.endif
-.if !defined(BUILDLINK_USE_BUILTIN.pam)
-. if !empty(BUILDLINK_IS_BUILTIN.pam:M[nN][oO])
-BUILDLINK_USE_BUILTIN.pam= NO
-. else
-BUILDLINK_USE_BUILTIN.pam= YES
-. endif
-.endif
-
.if !empty(BUILDLINK_USE_BUILTIN.pam:M[nN][oO])
. if !empty(BUILDLINK_DEPTH:M+)
BUILDLINK_DEPENDS+= pam
diff --git a/security/heimdal/buildlink3.mk b/security/heimdal/buildlink3.mk
index 6e131e0a674..a69fee08e9a 100644
--- a/security/heimdal/buildlink3.mk
+++ b/security/heimdal/buildlink3.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.10 2004/02/06 19:04:25 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.11 2004/02/12 01:59:38 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
HEIMDAL_BUILDLINK3_MK:= ${HEIMDAL_BUILDLINK3_MK}+
@@ -19,29 +19,15 @@ _KRB5_KRB5_H= /usr/include/krb5/krb5.h
.if !defined(BUILDLINK_IS_BUILTIN.heimdal)
BUILDLINK_IS_BUILTIN.heimdal= NO
. if exists(${_KRB5_KRB5_H})
-BUILDLINK_IS_BUILTIN.heimdal!= \
+_IS_BUILTIN.heimdal!= \
if ${GREP} -q heimdal_version ${_KRB5_KRB5_H}; then \
${ECHO} "YES"; \
else \
${ECHO} "NO"; \
fi
-. endif
-MAKEFLAGS+= BUILDLINK_IS_BUILTIN.heimdal=${BUILDLINK_IS_BUILTIN.heimdal}
-.endif
-
-.if !empty(PREFER_PKGSRC:M[yY][eE][sS]) || \
- !empty(PREFER_PKGSRC:Mheimdal)
-BUILDLINK_USE_BUILTIN.heimdal= NO
-.endif
-
-.if !empty(BUILDLINK_CHECK_BUILTIN.heimdal:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.heimdal= YES
-.endif
-
-.if !defined(BUILDLINK_USE_BUILTIN.heimdal)
-. if !empty(BUILDLINK_IS_BUILTIN.heimdal:M[nN][oO])
-BUILDLINK_USE_BUILTIN.heimdal= NO
-. else
+BUILDLINK_IS_BUILTIN.heimdal= ${_IS_BUILTIN.heimdal}
+. if !empty(BUILDLINK_CHECK_BUILTIN.heimdal:M[nN][oO]) && \
+ !empty(_IS_BUILTIN.heimdal:M[yY][eE][sS])
#
# Create an appropriate name for the built-in package distributed
# with the system. This package name can be used to check against
@@ -52,7 +38,7 @@ BUILDLINK_USE_BUILTIN.heimdal= NO
# the version number of the software. Match up heimdal versions with
# OS versions for an approximate determination of the heimdal version.
#
-. if !defined(_HEIMDAL_VERSION)
+. if !defined(_HEIMDAL_VERSION)
_HEIMDAL_VERSIONS= 0.6 0.5 0.4e 0.3f 0.3e
_HEIMDAL_0.6= NetBSD-1.6[U-Z]-* NetBSD-1.6Z*-* NetBSD-[2-9]*-*
_HEIMDAL_0.5= NetBSD-1.6[I-T]-*
@@ -62,32 +48,45 @@ _HEIMDAL_0.4e= NetBSD-1.6[A-H]-* \
_HEIMDAL_0.3f= NetBSD-1.5X-*
_HEIMDAL_0.3e= NetBSD-1.5[UVW]-* \
NetBSD-1.5.*-*
-. for _heimdal_version_ in ${_HEIMDAL_VERSIONS}
-. for _pattern_ in ${_HEIMDAL_${_heimdal_version_}}
-. if !empty(MACHINE_PLATFORM:M${_pattern_})
+. for _heimdal_version_ in ${_HEIMDAL_VERSIONS}
+. for _pattern_ in ${_HEIMDAL_${_heimdal_version_}}
+. if !empty(MACHINE_PLATFORM:M${_pattern_})
_HEIMDAL_VERSION?= ${_heimdal_version_}
-. endif
+. endif
+. endfor
. endfor
-. endfor
_HEIMDAL_VERSION?= 0.2t
-MAKEFLAGS+= _HEIMDAL_VERSION=${_HEIMDAL_VERSION}
-. endif
-
+. endif
_HEIMDAL_PKG= heimdal-${_HEIMDAL_VERSION}
-BUILDLINK_USE_BUILTIN.heimdal?= YES
-. for _depend_ in ${BUILDLINK_DEPENDS.heimdal}
-. if !empty(BUILDLINK_USE_BUILTIN.heimdal:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.heimdal!= \
+BUILDLINK_IS_BUILTIN.heimdal?= YES
+. for _depend_ in ${BUILDLINK_DEPENDS.heimdal}
+. if !empty(BUILDLINK_IS_BUILTIN.heimdal:M[yY][eE][sS])
+BUILDLINK_IS_BUILTIN.heimdal!= \
if ${PKG_ADMIN} pmatch '${_depend_}' ${_HEIMDAL_PKG}; then \
${ECHO} "YES"; \
else \
${ECHO} "NO"; \
fi
-. endif
-. endfor
+. endif
+. endfor
+. endif
. endif
-MAKEFLAGS+= \
- BUILDLINK_USE_BUILTIN.heimdal=${BUILDLINK_USE_BUILTIN.heimdal}
+MAKEFLAGS+= BUILDLINK_IS_BUILTIN.heimdal=${BUILDLINK_IS_BUILTIN.heimdal}
+.endif
+
+.if !empty(BUILDLINK_IS_BUILTIN.heimdal:M[yY][eE][sS])
+BUILDLINK_USE_BUILTIN.heimdal= YES
+.else
+BUILDLINK_USE_BUILTIN.heimdal= NO
+.endif
+
+.if !empty(PREFER_PKGSRC:M[yY][eE][sS]) || \
+ !empty(PREFER_PKGSRC:Mheimdal)
+BUILDLINK_USE_BUILTIN.heimdal= NO
+.endif
+
+.if !empty(BUILDLINK_CHECK_BUILTIN.heimdal:M[yY][eE][sS])
+BUILDLINK_USE_BUILTIN.heimdal= YES
.endif
.if !empty(BUILDLINK_USE_BUILTIN.heimdal:M[nN][oO])
diff --git a/security/openssl/buildlink2.mk b/security/openssl/buildlink2.mk
index 1e1cf1cbfdb..7d6e0412657 100644
--- a/security/openssl/buildlink2.mk
+++ b/security/openssl/buildlink2.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink2.mk,v 1.19 2004/02/06 19:04:25 jlam Exp $
+# $NetBSD: buildlink2.mk,v 1.20 2004/02/12 01:59:38 jlam Exp $
.if !defined(OPENSSL_BUILDLINK2_MK)
OPENSSL_BUILDLINK2_MK= # defined
@@ -20,21 +20,6 @@ _OPENSSL_OPENSSLV_H= /usr/include/openssl/opensslv.h
.if !defined(BUILDLINK_IS_BUILTIN.openssl)
BUILDLINK_IS_BUILTIN.openssl= NO
. if exists(${_OPENSSL_OPENSSLV_H})
-BUILDLINK_IS_BUILTIN.openssl= YES
-. endif
-.endif
-
-.if !empty(PREFER_PKGSRC:M[yY][eE][sS]) || \
- !empty(PREFER_PKGSRC:Mopenssl)
-_NEED_OPENSSL= YES
-.endif
-
-.if !empty(BUILDLINK_CHECK_BUILTIN.openssl:M[yY][eE][sS])
-_NEED_OPENSSL= NO
-.else
-. if !empty(BUILDLINK_IS_BUILTIN.openssl:M[nN][oO])
-_NEED_OPENSSL= YES
-. elif !defined(_NEED_OPENSSL)
#
# Create an appropriate name for the built-in package distributed
# with the system. This package name can be used to check against
@@ -104,14 +89,29 @@ _OPENSSL_PKG= openssl-0.9.6l
. endif
_OPENSSL_DEPENDS= ${BUILDLINK_DEPENDS.openssl}
-_NEED_OPENSSL!= \
+BUILDLINK_IS_BUILTIN.openssl!= \
if ${PKG_ADMIN} pmatch '${_OPENSSL_DEPENDS}' ${_OPENSSL_PKG}; then \
- ${ECHO} "NO"; \
- else \
${ECHO} "YES"; \
+ else \
+ ${ECHO} "NO"; \
fi
-MAKEFLAGS+= _NEED_OPENSSL=${_NEED_OPENSSL}
-. endif # !defined(_NEED_OPENSSL)
+. endif
+MAKEFLAGS+= BUILDLINK_IS_BUILTIN.openssl=${BUILDLINK_IS_BUILTIN.openssl}
+.endif
+
+.if !empty(BUILDLINK_IS_BUILTIN.openssl:M[yY][eE][sS])
+_NEED_OPENSSL= NO
+.else
+_NEED_OPENSSL= YES
+.endif
+
+.if !empty(PREFER_PKGSRC:M[yY][eE][sS]) || \
+ !empty(PREFER_PKGSRC:Mopenssl)
+_NEED_OPENSSL= YES
+.endif
+
+.if !empty(BUILDLINK_CHECK_BUILTIN.openssl:M[yY][eE][sS])
+_NEED_OPENSSL= NO
.endif
.if !defined(_NEED_NEWER_OPENSSL)
diff --git a/security/openssl/buildlink3.mk b/security/openssl/buildlink3.mk
index 111b6655c69..a559c5a66f8 100644
--- a/security/openssl/buildlink3.mk
+++ b/security/openssl/buildlink3.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.12 2004/02/06 19:04:25 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.13 2004/02/12 01:59:38 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
OPENSSL_BUILDLINK3_MK:= ${OPENSSL_BUILDLINK3_MK}+
@@ -25,22 +25,7 @@ _OPENSSL_OPENSSLV_H= /usr/include/openssl/opensslv.h
BUILDLINK_IS_BUILTIN.openssl= NO
. if exists(${_OPENSSL_OPENSSLV_H})
BUILDLINK_IS_BUILTIN.openssl= YES
-. endif
-.endif
-
-.if !empty(PREFER_PKGSRC:M[yY][eE][sS]) || \
- !empty(PREFER_PKGSRC:Mopenssl)
-BUILDLINK_USE_BUILTIN.openssl= NO
-.endif
-
-.if !empty(BUILDLINK_CHECK_BUILTIN.openssl:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.openssl= YES
-.endif
-
-.if !defined(BUILDLINK_USE_BUILTIN.openssl)
-. if !empty(BUILDLINK_IS_BUILTIN.openssl:M[nN][oO])
-BUILDLINK_USE_BUILTIN.openssl= NO
-. else
+. if !empty(BUILDLINK_CHECK_BUILTIN.openssl:M[nN][oO])
#
# Create an appropriate name for the built-in package distributed
# with the system. This package name can be used to check against
@@ -105,24 +90,39 @@ _OPENSSL_HAS_FIX!= \
/OPENSSL_HAS_20031107_FIX/ { ans = "YES" } \
END { print ans; exit 0 } \
' ${_OPENSSL_OPENSSLV_H}
-. if !empty(_OPENSSL_VERSION:M0\.9\.6g) && (${_OPENSSL_HAS_FIX} == "YES")
+. if !empty(_OPENSSL_VERSION:M0\.9\.6g) && (${_OPENSSL_HAS_FIX} == "YES")
_OPENSSL_PKG= openssl-0.9.6l
-. endif
+. endif
-BUILDLINK_USE_BUILTIN.openssl?= YES
-. for _depend_ in ${BUILDLINK_DEPENDS.openssl}
-. if !empty(BUILDLINK_USE_BUILTIN.openssl:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.openssl!= \
+BUILDLINK_IS_BUILTIN.openssl?= YES
+. for _depend_ in ${BUILDLINK_DEPENDS.openssl}
+. if !empty(BUILDLINK_IS_BUILTIN.openssl:M[yY][eE][sS])
+BUILDLINK_IS_BUILTIN.openssl!= \
if ${PKG_ADMIN} pmatch '${_depend_}' ${_OPENSSL_PKG}; then \
${ECHO} "YES"; \
else \
${ECHO} "NO"; \
fi
-. endif
-. endfor
+. endif
+. endfor
+. endif
. endif
-MAKEFLAGS+= \
- BUILDLINK_USE_BUILTIN.openssl=${BUILDLINK_USE_BUILTIN.openssl}
+MAKEFLAGS+= BUILDLINK_IS_BUILTIN.openssl=${BUILDLINK_IS_BUILTIN.openssl}
+.endif
+
+.if !empty(BUILDLINK_IS_BUILTIN.openssl:M[yY][eE][sS])
+BUILDLINK_USE_BUILTIN.openssl= YES
+.else
+BUILDLINK_USE_BUILTIN.openssl= NO
+.endif
+
+.if !empty(PREFER_PKGSRC:M[yY][eE][sS]) || \
+ !empty(PREFER_PKGSRC:Mopenssl)
+BUILDLINK_USE_BUILTIN.openssl= NO
+.endif
+
+.if !empty(BUILDLINK_CHECK_BUILTIN.openssl:M[yY][eE][sS])
+BUILDLINK_USE_BUILTIN.openssl= YES
.endif
.if !defined(_NEED_NEWER_OPENSSL)
diff --git a/x11/Xrender/buildlink2.mk b/x11/Xrender/buildlink2.mk
index 33a26e85e16..d20401f7c15 100644
--- a/x11/Xrender/buildlink2.mk
+++ b/x11/Xrender/buildlink2.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink2.mk,v 1.8 2004/02/05 07:17:14 jlam Exp $
+# $NetBSD: buildlink2.mk,v 1.9 2004/02/12 01:59:38 jlam Exp $
.if !defined(XRENDER_BUILDLINK2_MK)
XRENDER_BUILDLINK2_MK= # defined
@@ -15,19 +15,10 @@ _REQUIRE_BUILTIN_XRENDER?= NO
_RENDER_H= ${X11BASE}/include/X11/extensions/render.h
_X11_TMPL= ${X11BASE}/lib/X11/config/X11.tmpl
-.if exists(${_RENDER_H}) && exists(${_X11_TMPL})
-_IS_BUILTIN_XRENDER!= ${GREP} -c BuildRenderLibrary ${_X11_TMPL} || ${TRUE}
-.else
-_IS_BUILTIN_XRENDER= 0
-.endif
-.if !empty(_REQUIRE_BUILTIN_XRENDER:M[yY][eE][sS])
-_NEED_XRENDER= NO
-.else
-. if ${_IS_BUILTIN_XRENDER} == "0"
-_NEED_XRENDER= YES
-. else
-#
+.if !defined(_BUILTIN_XRENDER)
+_BUILTIN_XRENDER= NO
+. if exists(${_RENDER_H}) && exists(${_X11_TMPL})
# Create an appropriate Xrender package name for the built-in Xrender
# distributed with XFree86 4.x. This package name can be used to check
# against BUILDLINK_DEPENDS.Xrender to see if we need to install the
@@ -40,23 +31,38 @@ _XRENDER_MINOR!= \
_XRENDER_VERSION= ${_XRENDER_MAJOR}${_XRENDER_MINOR}
_XRENDER_PKG= Xrender-${_XRENDER_VERSION}
_XRENDER_DEPENDS= ${BUILDLINK_DEPENDS.Xrender}
-_NEED_XRENDER!= \
+_BUILTIN_XRENDER!= \
if ${PKG_ADMIN} pmatch '${_XRENDER_DEPENDS}' ${_XRENDER_PKG}; then \
- ${ECHO} "NO"; \
+ if ${GREP} -q BuildRenderLibrary ${_X11_TMPL}; then \
+ ${ECHO} "YES"; \
+ else \
+ ${ECHO} "NO"; \
+ fi; \
else \
- ${ECHO} "YES"; \
+ ${ECHO} "NO"; \
fi
. endif
+MAKEFLAGS+= _BUILTIN_XRENDER=${_BUILTIN_XRENDER}
.endif
-BUILDLINK_FILES.Xrender= include/X11/extensions/Xrender.h
-BUILDLINK_FILES.Xrender+= lib/libXrender.*
+.if !empty(_BUILTIN_XRENDER:M[yY][eE][sS])
+_NEED_XRENDER= NO
+.else
+_NEED_XRENDER= YES
+.endif
.if !empty(PREFER_PKGSRC:M[yY][eE][sS]) || \
!empty(PREFER_PKGSRC:MXrender)
_NEED_XRENDER= YES
.endif
+.if !empty(_REQUIRE_BUILTIN_XRENDER:M[yY][eE][sS])
+_NEED_XRENDER= NO
+.endif
+
+BUILDLINK_FILES.Xrender= include/X11/extensions/Xrender.h
+BUILDLINK_FILES.Xrender+= lib/libXrender.*
+
.if ${_NEED_XRENDER} == "YES"
BUILDLINK_PACKAGES+= Xrender
EVAL_PREFIX+= BUILDLINK_PREFIX.Xrender=Xrender
diff --git a/x11/Xrender/buildlink3.mk b/x11/Xrender/buildlink3.mk
index e0408eb1281..14249369e16 100644
--- a/x11/Xrender/buildlink3.mk
+++ b/x11/Xrender/buildlink3.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.17 2004/02/06 19:04:25 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.18 2004/02/12 01:59:38 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
XRENDER_BUILDLINK3_MK:= ${XRENDER_BUILDLINK3_MK}+
@@ -19,29 +19,15 @@ _X11_TMPL= ${X11BASE}/lib/X11/config/X11.tmpl
.if !defined(BUILDLINK_IS_BUILTIN.Xrender)
BUILDLINK_IS_BUILTIN.Xrender= NO
. if exists(${_X11_EXTENSIONS_RENDER_H}) && exists(${_X11_TMPL})
-BUILDLINK_IS_BUILTIN.Xrender!= \
+_IS_BUILTIN.Xrender!= \
if ${GREP} -q BuildRenderLibrary ${_X11_TMPL}; then \
${ECHO} "YES"; \
else \
${ECHO} "NO"; \
fi
-. endif
-MAKEFLAGS+= BUILDLINK_IS_BUILTIN.Xrender=${BUILDLINK_IS_BUILTIN.Xrender}
-.endif
-
-.if !empty(PREFER_PKGSRC:M[yY][eE][sS]) || \
- !empty(PREFER_PKGSRC:MXrender)
-BUILDLINK_USE_BUILTIN.Xrender= NO
-.endif
-
-.if !empty(BUILDLINK_CHECK_BUILTIN.Xrender:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.Xrender= YES
-.endif
-
-.if !defined(BUILDLINK_USE_BUILTIN.Xrender)
-. if !empty(BUILDLINK_IS_BUILTIN.Xrender:M[nN][oO])
-BUILDLINK_USE_BUILTIN.Xrender= NO
-. else
+BUILDLINK_IS_BUILTIN.Xrender= ${_IS_BUILTIN.Xrender}
+. if !empty(BUILDLINK_CHECK_BUILTIN.Xrender:M[nN][oO]) && \
+ !empty(_IS_BUILTIN.Xrender:M[yY][eE][sS])
#
# Create an appropriate package name for the built-in Xrender distributed
# with the system. This package name can be used to check against
@@ -54,21 +40,36 @@ _XRENDER_MINOR!= \
${AWK} '/\#define[ ]*RENDER_MINOR/ { print "."$$3 }' ${_X11_EXTENSIONS_RENDER_H}
_XRENDER_VERSION= ${_XRENDER_MAJOR}${_XRENDER_MINOR}
_XRENDER_PKG= Xrender-${_XRENDER_VERSION}
-BUILDLINK_USE_BUILTIN.Xrender?= YES
-. for _depend_ in ${BUILDLINK_DEPENDS.Xrender}
-. if !empty(BUILDLINK_USE_BUILTIN.Xrender:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.Xrender!= \
+BUILDLINK_IS_BUILTIN.Xrender?= YES
+. for _depend_ in ${BUILDLINK_DEPENDS.Xrender}
+. if !empty(BUILDLINK_IS_BUILTIN.Xrender:M[yY][eE][sS])
+BUILDLINK_IS_BUILTIN.Xrender!= \
if ${PKG_ADMIN} pmatch '${_depend_}' ${_XRENDER_PKG}; then \
${ECHO} "YES"; \
else \
${ECHO} "NO"; \
fi
-. endif
-. endfor
+. endif
+. endfor
+. endif
. endif
-MAKEFLAGS+= \
- BUILDLINK_USE_BUILTIN.Xrender=${BUILDLINK_USE_BUILTIN.Xrender}
-.endif # BUILDLINK_USE_BUILTIN.Xrender
+MAKEFLAGS+= BUILDLINK_IS_BUILTIN.Xrender=${BUILDLINK_IS_BUILTIN.Xrender}
+.endif
+
+.if !empty(BUILDLINK_IS_BUILTIN.Xrender:M[yY][eE][sS])
+BUILDLINK_USE_BUILTIN.Xrender= YES
+.else
+BUILDLINK_USE_BUILTIN.Xrender= NO
+.endif
+
+.if !empty(PREFER_PKGSRC:M[yY][eE][sS]) || \
+ !empty(PREFER_PKGSRC:MXrender)
+BUILDLINK_USE_BUILTIN.Xrender= NO
+.endif
+
+.if !empty(BUILDLINK_CHECK_BUILTIN.Xrender:M[yY][eE][sS])
+BUILDLINK_USE_BUILTIN.Xrender= YES
+.endif
.if !empty(BUILDLINK_USE_BUILTIN.Xrender:M[nN][oO])
#