summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--archivers/bzip2/buildlink3.mk74
-rw-r--r--archivers/bzip2/builtin.mk41
-rw-r--r--converters/libiconv/buildlink3.mk111
-rw-r--r--converters/libiconv/builtin.mk78
-rw-r--r--devel/binutils/buildlink3.mk82
-rw-r--r--devel/binutils/builtin.mk44
-rw-r--r--devel/gettext-lib/buildlink3.mk155
-rw-r--r--devel/gettext-lib/builtin.mk146
-rw-r--r--devel/libgetopt/buildlink3.mk56
-rw-r--r--devel/libgetopt/builtin.mk26
-rw-r--r--devel/ncurses/buildlink3.mk168
-rw-r--r--devel/ncurses/builtin.mk133
-rw-r--r--devel/readline/buildlink3.mk153
-rw-r--r--devel/readline/builtin.mk116
-rw-r--r--devel/zlib/buildlink3.mk110
-rw-r--r--devel/zlib/builtin.mk81
-rw-r--r--fonts/Xft2/buildlink3.mk140
-rw-r--r--fonts/Xft2/builtin.mk100
-rw-r--r--fonts/fontconfig/buildlink3.mk120
-rw-r--r--fonts/fontconfig/builtin.mk75
-rw-r--r--graphics/MesaLib/buildlink3.mk126
-rw-r--r--graphics/MesaLib/builtin.mk87
-rw-r--r--graphics/freetype2/buildlink3.mk105
-rw-r--r--graphics/freetype2/builtin.mk66
-rw-r--r--graphics/glu/buildlink3.mk98
-rw-r--r--graphics/glu/builtin.mk61
-rw-r--r--graphics/xpm/buildlink3.mk92
-rw-r--r--graphics/xpm/builtin.mk72
-rw-r--r--net/libpcap/buildlink3.mk54
-rw-r--r--net/libpcap/builtin.mk15
-rw-r--r--security/PAM/buildlink3.mk52
-rw-r--r--security/PAM/builtin.mk15
-rw-r--r--security/heimdal/buildlink3.mk118
-rw-r--r--security/heimdal/builtin.mk80
-rw-r--r--security/openssl/buildlink3.mk186
-rw-r--r--security/openssl/builtin.mk135
-rw-r--r--security/tcp_wrappers/buildlink3.mk39
-rw-r--r--security/tcp_wrappers/builtin.mk15
-rw-r--r--textproc/expat/buildlink3.mk99
-rw-r--r--textproc/expat/builtin.mk69
-rw-r--r--x11/Xrandr-mixedcase/buildlink3.mk140
-rw-r--r--x11/Xrandr-mixedcase/builtin.mk99
-rw-r--r--x11/Xrender/buildlink3.mk141
-rw-r--r--x11/Xrender/builtin.mk100
-rw-r--r--x11/randrext/buildlink3.mk91
-rw-r--r--x11/randrext/builtin.mk58
-rw-r--r--x11/render/buildlink3.mk89
-rw-r--r--x11/render/builtin.mk58
-rw-r--r--x11/xcursor/buildlink3.mk106
-rw-r--r--x11/xcursor/builtin.mk68
50 files changed, 2053 insertions, 2490 deletions
diff --git a/archivers/bzip2/buildlink3.mk b/archivers/bzip2/buildlink3.mk
index 818bb26f489..a11040d0d99 100644
--- a/archivers/bzip2/buildlink3.mk
+++ b/archivers/bzip2/buildlink3.mk
@@ -1,78 +1,18 @@
-# $NetBSD: buildlink3.mk,v 1.14 2004/02/18 16:35:27 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.15 2004/03/10 17:57:14 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
BZIP2_BUILDLINK3_MK:= ${BZIP2_BUILDLINK3_MK}+
-.include "../../mk/bsd.prefs.mk"
+.if !empty(BUILDLINK_DEPTH:M+)
+BUILDLINK_DEPENDS+= bzip2
+.endif
+
+BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Nbzip2}
+BUILDLINK_PACKAGES+= bzip2
.if !empty(BZIP2_BUILDLINK3_MK:M+)
-BUILDLINK_PACKAGES+= bzip2
BUILDLINK_DEPENDS.bzip2+= bzip2>=1.0.1
BUILDLINK_PKGSRCDIR.bzip2?= ../../archivers/bzip2
.endif # BZIP2_BUILDLINK3_MK
-BUILDLINK_CHECK_BUILTIN.bzip2?= NO
-
-.if !defined(BUILDLINK_IS_BUILTIN.bzip2)
-BUILDLINK_IS_BUILTIN.bzip2= NO
-. if exists(/usr/include/bzlib.h)
-BUILDLINK_IS_BUILTIN.bzip2!= \
- if ${GREP} -q "BZ2_" /usr/include/bzlib.h; then \
- ${ECHO} "YES"; \
- else \
- ${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_})
-BUILDLINK_IS_BUILTIN.bzip2= NO
-. endif
-. endfor
-. endif
-MAKEFLAGS+= BUILDLINK_IS_BUILTIN.bzip2=${BUILDLINK_IS_BUILTIN.bzip2}
-.endif
-
-.if !empty(BUILDLINK_CHECK_BUILTIN.bzip2:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.bzip2= YES
-.endif
-
-.if !defined(BUILDLINK_USE_BUILTIN.bzip2)
-. 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_NATIVE:M[yY][eE][sS]) && \
- !empty(BUILDLINK_IS_BUILTIN.bzip2:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.bzip2= YES
-. endif
-. if !empty(PREFER_PKGSRC:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.bzip2= NO
-. endif
-. if !empty(PREFER_NATIVE:Mbzip2) && \
- !empty(BUILDLINK_IS_BUILTIN.bzip2:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.bzip2= YES
-. endif
-. if !empty(PREFER_PKGSRC:Mbzip2)
-BUILDLINK_USE_BUILTIN.bzip2= NO
-. endif
-
-. if defined(USE_BZIP2)
-BUILDLINK_USE_BUILTIN.bzip2= NO
-. endif
-.endif
-
-.if !empty(BUILDLINK_USE_BUILTIN.bzip2:M[nN][oO])
-. if !empty(BUILDLINK_DEPTH:M+)
-BUILDLINK_DEPENDS+= bzip2
-. endif
-.endif
-
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
diff --git a/archivers/bzip2/builtin.mk b/archivers/bzip2/builtin.mk
new file mode 100644
index 00000000000..408657f8b59
--- /dev/null
+++ b/archivers/bzip2/builtin.mk
@@ -0,0 +1,41 @@
+# $NetBSD: builtin.mk,v 1.1 2004/03/10 17:57:14 jlam Exp $
+
+.if !defined(IS_BUILTIN.bzip2)
+IS_BUILTIN.bzip2= no
+. if exists(/usr/include/bzlib.h)
+IS_BUILTIN.bzip2!= \
+ if ${GREP} -q "BZ2_" /usr/include/bzlib.h; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. endif
+MAKEFLAGS+= IS_BUILTIN.bzip2=${IS_BUILTIN.bzip2}
+.endif
+
+CHECK_BUILTIN.bzip2?= no
+.if !empty(CHECK_BUILTIN.bzip2:M[yY][eE][sS])
+USE_BUILTIN.bzip2= yes
+.endif
+
+.if !defined(USE_BUILTIN.bzip2)
+USE_BUILTIN.bzip2?= ${IS_BUILTIN.bzip2}
+PREFER.bzip2?= pkgsrc
+
+. if defined(USE_BZIP2)
+. if !empty(IS_BUILTIN.bzip2:M[nN][oO]) || \
+ (${PREFER.bzip2} == "pkgsrc")
+USE_BUILTIN.bzip2= no
+. endif
+. endif
+
+# Solaris 9 has bzip2 1.0.1, build it on older versions.
+# Darwin only has a static libbz2.a.
+#
+_INCOMPAT_BZIP2?= SunOS-5.[678]-* Darwin-*
+. for _pattern_ in ${_INCOMPAT_BZIP2} ${INCOMPAT_BZIP2}
+. if !empty(MACHINE_PLATFORM:M${_pattern_})
+USE_BUILTIN.bzip2= no
+. endif
+. endfor
+.endif # USE_BUILTIN.bzip2
diff --git a/converters/libiconv/buildlink3.mk b/converters/libiconv/buildlink3.mk
index 100ea810a8c..b08a3f314f3 100644
--- a/converters/libiconv/buildlink3.mk
+++ b/converters/libiconv/buildlink3.mk
@@ -1,115 +1,18 @@
-# $NetBSD: buildlink3.mk,v 1.15 2004/02/18 16:35:27 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.16 2004/03/10 17:57:14 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
ICONV_BUILDLINK3_MK:= ${ICONV_BUILDLINK3_MK}+
-.include "../../mk/bsd.prefs.mk"
-
-.if !empty(ICONV_BUILDLINK3_MK:M+)
-BUILDLINK_PACKAGES+= iconv
-BUILDLINK_DEPENDS.iconv+= libiconv>=1.9.1
-BUILDLINK_PKGSRCDIR.iconv?= ../../converters/libiconv
-.endif # ICONV_BUILDLINK3_MK
-
-BUILDLINK_CHECK_BUILTIN.iconv?= NO
-
-_ICONV_H= /usr/include/iconv.h
-
-.if !defined(BUILDLINK_IS_BUILTIN.iconv)
-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_})
-BUILDLINK_IS_BUILTIN.iconv= NO
-. endif
-. endfor
-. endif
-.endif
-
-.if !empty(BUILDLINK_CHECK_BUILTIN.iconv:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.iconv= YES
-.endif
-
-.if !defined(BUILDLINK_USE_BUILTIN.iconv)
-. 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_NATIVE:M[yY][eE][sS]) && \
- !empty(BUILDLINK_IS_BUILTIN.iconv:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.iconv= YES
-. endif
-. if !empty(PREFER_PKGSRC:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.iconv= NO
-. endif
-. if !empty(PREFER_NATIVE:Miconv) && \
- !empty(BUILDLINK_IS_BUILTIN.iconv:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.iconv= YES
-. endif
-. if !empty(PREFER_PKGSRC:Miconv)
-BUILDLINK_USE_BUILTIN.iconv= NO
-. endif
-
-. if defined(USE_GNU_ICONV)
-BUILDLINK_USE_BUILTIN.iconv= NO
-. endif
-.endif
-
-.if !empty(BUILDLINK_USE_BUILTIN.iconv:M[nN][oO])
-. if !empty(BUILDLINK_DEPTH:M+)
+.if !empty(BUILDLINK_DEPTH:M+)
BUILDLINK_DEPENDS+= iconv
-. endif
.endif
-.if !empty(ICONV_BUILDLINK3_MK:M+)
-. if !empty(BUILDLINK_USE_BUILTIN.iconv:M[nN][oO])
-_BLNK_LIBICONV= -liconv
-. else
-. if !defined(_BLNK_LIBICONV_FOUND)
-_BLNK_LIBICONV_FOUND!= \
- if [ "`${ECHO} /usr/lib/libiconv.*`" = "/usr/lib/libiconv.*" ]; then \
- ${ECHO} NO; \
- else \
- ${ECHO} YES; \
- fi
-MAKEFLAGS+= _BLNK_LIBICONV_FOUND=${_BLNK_LIBICONV_FOUND}
-. endif
-. if ${_BLNK_LIBICONV_FOUND} == "YES"
-_BLNK_LIBICONV= -liconv
-. else
-_BLNK_LIBICONV= # empty
-BUILDLINK_TRANSFORM+= l:iconv:
-. endif
-BUILDLINK_LDADD.iconv?= ${_BLNK_LIBICONV}
-. endif
+BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Niconv}
+BUILDLINK_PACKAGES+= iconv
-.if !defined(ICONV_TYPE)
-ICONV_TYPE?= gnu
-. if !empty(BUILDLINK_USE_BUILTIN.iconv:M[yY][eE][sS]) && \
- exists(${_ICONV_H})
-ICONV_TYPE!= \
- if ${GREP} -q "GNU LIBICONV Library" ${_ICONV_H}; then \
- ${ECHO} "gnu"; \
- else \
- ${ECHO} "native"; \
- fi
-. endif
-MAKEFLAGS+= ICONV_TYPE=${ICONV_TYPE}
-.endif
-
-. if defined(GNU_CONFIGURE)
-. if !empty(BUILDLINK_USE_BUILTIN.iconv:M[nN][oO])
-CONFIGURE_ARGS+= --with-libiconv-prefix=${BUILDLINK_PREFIX.iconv}
-. else
-CONFIGURE_ARGS+= --without-libiconv-prefix
-. endif
-. endif
+.if !empty(ICONV_BUILDLINK3_MK:M+)
+BUILDLINK_DEPENDS.iconv+= libiconv>=1.9.1
+BUILDLINK_PKGSRCDIR.iconv?= ../../converters/libiconv
.endif # ICONV_BUILDLINK3_MK
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
diff --git a/converters/libiconv/builtin.mk b/converters/libiconv/builtin.mk
new file mode 100644
index 00000000000..65eceadae3c
--- /dev/null
+++ b/converters/libiconv/builtin.mk
@@ -0,0 +1,78 @@
+# $NetBSD: builtin.mk,v 1.1 2004/03/10 17:57:14 jlam Exp $
+
+.if !defined(_LIBICONV_FOUND)
+_LIBICONV_FOUND!= \
+ if [ "`${ECHO} /usr/lib/libiconv.*`" = "/usr/lib/libiconv.*" ]; then \
+ ${ECHO} "no"; \
+ else \
+ ${ECHO} "yes"; \
+ fi
+MAKEFLAGS+= _LIBICONV_FOUND=${_LIBICONV_FOUND}
+.endif
+
+_ICONV_H= /usr/include/iconv.h
+
+.if !defined(IS_BUILTIN.iconv)
+IS_BUILTIN.iconv= no
+. if exists(${_ICONV_H})
+IS_BUILTIN.iconv= yes
+. endif
+.endif
+
+CHECK_BUILTIN.iconv?= no
+.if !empty(CHECK_BUILTIN.iconv:M[yY][eE][sS])
+USE_BUILTIN.iconv= yes
+.endif
+
+.if !defined(USE_BUILTIN.iconv)
+USE_BUILTIN.iconv?= ${IS_BUILTIN.iconv}
+PREFER.iconv?= pkgsrc
+
+_INCOMPAT_ICONV?= # should be set from defs.${OPSYS}.mk
+. for _pattern_ in ${_INCOMPAT_ICONV} ${INCOMPAT_ICONV}
+. if !empty(MACHINE_PLATFORM:M${_pattern_})
+USE_BUILTIN.iconv= no
+. endif
+. endfor
+
+. if defined(USE_GNU_ICONV)
+. if !empty(IS_BUILTIN.iconv:M[nN][oO]) || \
+ (${PREFER.iconv} == "pkgsrc")
+USE_BUILTIN.iconv= no
+. endif
+. endif
+.endif # USE_BUILTIN.iconv
+
+.if !empty(USE_BUILTIN.iconv:M[nN][oO])
+_LIBICONV= -liconv
+.else
+. if !empty(_LIBICONV_FOUND:M[yY][eE][sS])
+_LIBICONV= -liconv
+. else
+_LIBICONV= # empty
+BUILDLINK_TRANSFORM+= l:iconv:
+. endif
+.endif
+
+BUILDLINK_LDADD.iconv?= ${_LIBICONV}
+
+.if !defined(ICONV_TYPE)
+ICONV_TYPE?= gnu
+. if !empty(USE_BUILTIN.iconv:M[yY][eE][sS]) && exists(${_ICONV_H})
+ICONV_TYPE!= \
+ if ${GREP} -q "GNU LIBICONV Library" ${_ICONV_H}; then \
+ ${ECHO} "gnu"; \
+ else \
+ ${ECHO} "native"; \
+ fi
+. endif
+MAKEFLAGS+= ICONV_TYPE=${ICONV_TYPE}
+.endif
+
+.if defined(GNU_CONFIGURE)
+. if !empty(USE_BUILTIN.iconv:M[nN][oO])
+CONFIGURE_ARGS+= --with-libiconv-prefix=${BUILDLINK_PREFIX.iconv}
+. else
+CONFIGURE_ARGS+= --without-libiconv-prefix
+. endif
+.endif
diff --git a/devel/binutils/buildlink3.mk b/devel/binutils/buildlink3.mk
index e240ae1c192..ab6ed1cfa74 100644
--- a/devel/binutils/buildlink3.mk
+++ b/devel/binutils/buildlink3.mk
@@ -1,87 +1,19 @@
-# $NetBSD: buildlink3.mk,v 1.13 2004/02/18 16:35:27 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.14 2004/03/10 17:57:14 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
BINUTILS_BUILDLINK3_MK:= ${BINUTILS_BUILDLINK3_MK}+
-.include "../../mk/bsd.prefs.mk"
+.if !empty(BUILDLINK_DEPTH:M+)
+BUILDLINK_DEPENDS+= binutils
+.endif
+
+BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Nbinutils}
+BUILDLINK_PACKAGES+= binutils
.if !empty(BINUTILS_BUILDLINK3_MK:M+)
-BUILDLINK_PACKAGES+= binutils
BUILDLINK_DEPENDS.binutils+= binutils>=2.14.0
BUILDLINK_PKGSRCDIR.binutils?= ../../devel/binutils
BUILDLINK_DEPMETHOD.binutils?= build
.endif # BINUTILS_BUILDLINK3_MK
-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.
-#
-_INCOMPAT_BINUTILS= NetBSD-0.*-* NetBSD-1.[01234]*-*
-_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_})
-BUILDLINK_IS_BUILTIN.binutils= NO
-. endif
-. endfor
-. endif
-MAKEFLAGS+= BUILDLINK_IS_BUILTIN.binutils=${BUILDLINK_IS_BUILTIN.binutils}
-.endif
-
-.if !empty(BUILDLINK_CHECK_BUILTIN.binutils:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.binutils= YES
-.endif
-
-.if !defined(BUILDLINK_USE_BUILTIN.binutils)
-. 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_NATIVE:M[yY][eE][sS]) && \
- !empty(BUILDLINK_IS_BUILTIN.binutils:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.binutils= YES
-. endif
-. if !empty(PREFER_PKGSRC:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.binutils= NO
-. endif
-. if !empty(PREFER_NATIVE:Mbinutils) && \
- !empty(BUILDLINK_IS_BUILTIN.binutils:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.binutils= YES
-. endif
-. if !empty(PREFER_PKGSRC:Mbinutils)
-BUILDLINK_USE_BUILTIN.binutils= NO
-. endif
-
-. if defined(USE_BINUTILS)
-BUILDLINK_USE_BUILTIN.binutils= NO
-. endif
-.endif
-
-.if !empty(BUILDLINK_USE_BUILTIN.binutils:M[nN][oO])
-. if !empty(BUILDLINK_DEPTH:M+)
-BUILDLINK_DEPENDS+= binutils
-. endif
-.endif
-
-.if !empty(BINUTILS_BUILDLINK3_MK:M+)
-. if !empty(BUILDLINK_USE_BUILTIN.binutils:M[nN][oO])
-AR= ${BUILDLINK_PREFIX.binutils}/bin/ar
-AS= ${BUILDLINK_PREFIX.binutils}/bin/as
-LD= ${BUILDLINK_PREFIX.binutils}/bin/ld
-NM= ${BUILDLINK_PREFIX.binutils}/bin/nm
-RANLIB= ${BUILDLINK_PREFIX.binutils}/bin/ranlib
-. endif
-.endif # BINUTILS_BUILDLINK3_MK
-
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
diff --git a/devel/binutils/builtin.mk b/devel/binutils/builtin.mk
new file mode 100644
index 00000000000..e3869b1fe13
--- /dev/null
+++ b/devel/binutils/builtin.mk
@@ -0,0 +1,44 @@
+# $NetBSD: builtin.mk,v 1.1 2004/03/10 17:57:14 jlam Exp $
+
+# XXX Assume that the base OS provides a built-in binutils.
+IS_BUILTIN.binutils?= yes
+
+CHECK_BUILTIN.binutils?= no
+.if !empty(CHECK_BUILTIN.binutils:M[yY][eE][sS])
+USE_BUILTIN.binutils= yes
+.endif
+
+.if !defined(USE_BUILTIN.binutils)
+USE_BUILTIN.binutils?= ${IS_BUILTIN.binutils}
+PREFER.binutils?= pkgsrc
+
+. if defined(USE_BINUTILS)
+. if !empty(IS_BUILTIN.binutils:M[nN][oO]) || \
+ (${PREFER.binutils} == "pkgsrc")
+USE_BUILTIN.binutils= no
+. endif
+. endif
+
+# These versions of NetBSD didn't have a toolchain that was capable of
+# replacing binutils.
+#
+_INCOMPAT_BINUTILS= NetBSD-0.*-* NetBSD-1.[01234]*-*
+_INCOMPAT_BINUTILS+= NetBSD-1.5.*-* NetBSD-1.5[A-X]-*
+#
+# XXX _INCOMPAT_BINUTILS settings for other operating systems possibly
+# XXX needed here
+#
+. for _pattern_ in ${_INCOMPAT_BINUTILS} ${INCOMPAT_BINUTILS}
+. if !empty(MACHINE_PLATFORM:M${_pattern_})
+USE_BUILTIN.binutils= no
+. endif
+. endfor
+.endif # USE_BUILTIN.binutils
+
+.if !empty(USE_BUILTIN.binutils:M[nN][oO])
+AR= ${BUILDLINK_PREFIX.binutils}/bin/ar
+AS= ${BUILDLINK_PREFIX.binutils}/bin/as
+LD= ${BUILDLINK_PREFIX.binutils}/bin/ld
+NM= ${BUILDLINK_PREFIX.binutils}/bin/nm
+RANLIB= ${BUILDLINK_PREFIX.binutils}/bin/ranlib
+.endif
diff --git a/devel/gettext-lib/buildlink3.mk b/devel/gettext-lib/buildlink3.mk
index 9855b406820..96bf0bf2bdf 100644
--- a/devel/gettext-lib/buildlink3.mk
+++ b/devel/gettext-lib/buildlink3.mk
@@ -1,159 +1,22 @@
-# $NetBSD: buildlink3.mk,v 1.16 2004/02/18 16:35:27 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.17 2004/03/10 17:57:14 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
GETTEXT_BUILDLINK3_MK:= ${GETTEXT_BUILDLINK3_MK}+
-.include "../../mk/bsd.prefs.mk"
-
-.if !empty(GETTEXT_BUILDLINK3_MK:M+)
-BUILDLINK_PACKAGES+= gettext
-BUILDLINK_DEPENDS.gettext+= gettext-lib>=0.10.35nb1
-BUILDLINK_PKGSRCDIR.gettext?= ../../devel/gettext-lib
-.endif # GETTEXT_BUILDLINK3_MK
-
-BUILDLINK_CHECK_BUILTIN.gettext?= NO
-
-.if !defined(BUILDLINK_IS_BUILTIN.gettext)
-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_})
-BUILDLINK_IS_BUILTIN.gettext= NO
-. endif
-. endfor
-. endif
-MAKEFLAGS+= BUILDLINK_IS_BUILTIN.gettext=${BUILDLINK_IS_BUILTIN.gettext}
-.endif
-
-.if !empty(BUILDLINK_CHECK_BUILTIN.gettext:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.gettext= YES
-.endif
-
-.if !defined(BUILDLINK_USE_BUILTIN.gettext)
-. 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_NATIVE:M[yY][eE][sS]) && \
- !empty(BUILDLINK_IS_BUILTIN.gettext:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.gettext= YES
-. endif
-. if !empty(PREFER_PKGSRC:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.gettext= NO
-. endif
-. if !empty(PREFER_NATIVE:Mgettext) && \
- !empty(BUILDLINK_IS_BUILTIN.gettext:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.gettext= YES
-. endif
-. if !empty(PREFER_PKGSRC:Mgettext)
-BUILDLINK_USE_BUILTIN.gettext= NO
-. endif
-
-. if defined(USE_GNU_GETTEXT)
-BUILDLINK_USE_BUILTIN.gettext= NO
-. endif
-.endif
-
-.if !empty(BUILDLINK_USE_BUILTIN.gettext:M[nN][oO])
-. if !empty(BUILDLINK_DEPTH:M+)
+.if !empty(BUILDLINK_DEPTH:M+)
BUILDLINK_DEPENDS+= gettext
-. endif
.endif
+BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Ngettext}
+BUILDLINK_PACKAGES+= gettext
+
.if !empty(GETTEXT_BUILDLINK3_MK:M+)
-. if !empty(BUILDLINK_USE_BUILTIN.gettext:M[nN][oO])
-_BLNK_LIBINTL= -lintl
-_GETTEXT_ICONV_DEPENDS= gettext-lib>=0.11.5nb1
-. if !defined(_GETTEXT_NEEDS_ICONV)
-_GETTEXT_NEEDS_ICONV?= NO
-. for _depend_ in ${BUILDLINK_DEPENDS.gettext}
-. if !empty(_GETTEXT_NEEDS_ICONV:M[nN][oO])
-_GETTEXT_NEEDS_ICONV!= \
- if ${PKG_INFO} -qe '${_depend_}'; then \
- pkg=`cd ${_PKG_DBDIR}; ${PKG_ADMIN} -S lsbest '${_depend_}'`; \
- if ${PKG_INFO} -qN "$$pkg" | ${GREP} -q "libiconv-[0-9]"; then \
- ${ECHO} "YES"; \
- else \
- ${ECHO} "NO"; \
- fi; \
- else \
- ${ECHO} "YES"; \
- fi
-. endif
-. endfor
-MAKEFLAGS+= _GETTEXT_NEEDS_ICONV=${_GETTEXT_NEEDS_ICONV}
-. endif
-. if ${_GETTEXT_NEEDS_ICONV} == "YES"
-. include "../../converters/libiconv/buildlink3.mk"
-BUILDLINK_DEPENDS.gettext+= ${_GETTEXT_ICONV_DEPENDS}
-_BLNK_LIBINTL+= ${BUILDLINK_LDADD.iconv}
-. endif
-. else
-. if !defined(_BLNK_LIBINTL_FOUND)
-_BLNK_LIBINTL_FOUND!= \
- if [ "`${ECHO} /usr/lib/libintl.*`" = "/usr/lib/libintl.*" ]; then \
- ${ECHO} "NO"; \
- else \
- ${ECHO} "YES"; \
- fi
-MAKEFLAGS+= _BLNK_LIBINTL_FOUND=${_BLNK_LIBINTL_FOUND}
-. endif
-. if ${_BLNK_LIBINTL_FOUND} == "YES"
-_BLNK_LIBINTL= -lintl
-. else
-_BLNK_LIBINTL= # empty
-BUILDLINK_TRANSFORM+= l:intl:
-. endif
-. endif
+BUILDLINK_DEPENDS.gettext+= gettext-lib>=0.10.35nb1
+BUILDLINK_PKGSRCDIR.gettext?= ../../devel/gettext-lib
-BUILDLINK_LDADD.gettext?= ${_BLNK_LIBINTL}
+# libiconv/buildlink3.mk is included by gettext-lib/builtin.mk
+#.include "../../converters/libiconv/buildlink3.mk"
-# Add -lintl to LIBS in CONFIGURE_ENV to work around broken gettext.m4:
-# older gettext.m4 does not add -lintl where it should, and the resulting
-# configure script fails to detect if libintl.a is the genuine GNU gettext
-# or not.
-#
-. if defined(GNU_CONFIGURE)
-LIBS+= ${BUILDLINK_LDADD.gettext}
-CONFIGURE_ENV+= INTLLIBS="${BUILDLINK_LDADD.gettext}"
-. if !empty(BUILDLINK_USE_BUILTIN.gettext:M[yY][eE][sS])
-. if ${_BLNK_LIBINTL_FOUND} == "YES"
-CONFIGURE_ENV+= gt_cv_func_gnugettext1_libintl="yes"
-. endif
-. endif
-. if !empty(BUILDLINK_USE_BUILTIN.gettext:M[nN][oO])
-CONFIGURE_ARGS+= --with-libintl-prefix=${BUILDLINK_PREFIX.gettext}
-. else
-CONFIGURE_ARGS+= --without-libintl-prefix
-. endif
-. endif
.endif # GETTEXT_BUILDLINK3_MK
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
diff --git a/devel/gettext-lib/builtin.mk b/devel/gettext-lib/builtin.mk
new file mode 100644
index 00000000000..d073634700f
--- /dev/null
+++ b/devel/gettext-lib/builtin.mk
@@ -0,0 +1,146 @@
+# $NetBSD: builtin.mk,v 1.1 2004/03/10 17:57:14 jlam Exp $
+
+.if !defined(_BLNK_LIBINTL_FOUND)
+_BLNK_LIBINTL_FOUND!= \
+ if [ "`${ECHO} /usr/lib/libintl.*`" = "/usr/lib/libintl.*" ]; then \
+ ${ECHO} "no"; \
+ else \
+ ${ECHO} "yes"; \
+ fi
+MAKEFLAGS+= _BLNK_LIBINTL_FOUND=${_BLNK_LIBINTL_FOUND}
+.endif
+
+_LIBINTL_H= /usr/include/libintl.h
+
+.if !defined(IS_BUILTIN.gettext)
+IS_BUILTIN.gettext= no
+. if !empty(_BLNK_LIBINTL_FOUND:M[yY][eE][sS]) && exists(${_LIBINTL_H})
+IS_BUILTIN.gettext!= \
+ if ${GREP} -q "\#define[ ]*__USE_GNU_GETTEXT" ${_LIBINTL_H}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. if !empty(IS_BUILTIN.gettext:M[yY][eE][sS])
+#
+# XXX Consider the base system libintl to be gettext-lib-0.10.35nb1.
+#
+BUILTIN_PKG.gettext= gettext-lib-0.10.35nb1
+MAKEFLAGS+= BUILTIN_PKG.gettext=${BUILTIN_PKG.gettext}
+. endif
+. endif
+MAKEFLAGS+= IS_BUILTIN.gettext=${IS_BUILTIN.gettext}
+.endif
+
+CHECK_BUILTIN.gettext?= no
+.if !empty(CHECK_BUILTIN.gettext:M[yY][eE][sS])
+USE_BUILTIN.gettext= yes
+.endif
+
+.if !defined(USE_BUILTIN.gettext)
+USE_BUILTIN.gettext?= ${IS_BUILTIN.gettext}
+PREFER.getext?= pkgsrc
+
+. if defined(BUILTIN_PKG.gettext)
+USE_BUILTIN.gettext= yes
+. for _depend_ in ${BUILDLINK_DEPENDS.gettext}
+. if !empty(USE_BUILTIN.gettext:M[yY][eE][sS])
+USE_BUILTIN.gettext!= \
+ if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.gettext}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. endif
+. endfor
+. endif
+
+. if ${PREFER.gettext} == "native"
+# XXX
+# XXX By default, assume that the native libintl is good enough.
+# XXX
+. if !empty(_BLNK_LIBINTL_FOUND:M[yY][eE][sS]) && exists(${_LIBINTL_H})
+USE_BUILTIN.gettext= yes
+#
+# The listed platforms have an implementation of libintl that isn't
+# GNUish enough.
+#
+_INCOMPAT_GETTEXT= SunOS-*-*
+. for _pattern_ in ${_INCOMPAT_GETTEXT} ${INCOMPAT_GETTEXT}
+. if !empty(MACHINE_PLATFORM:M${_pattern_})
+USE_BUILTIN.gettext= no
+. endif
+. endfor
+. endif
+. endif
+
+. if defined(USE_GNU_GETTEXT)
+. if !empty(IS_BUILTIN.gettext:M[nN][oO]) || \
+ (${PREFER.gettext} == "pkgsrc")
+USE_BUILTIN.gettext= no
+. endif
+. endif
+.endif # USE_BUILTIN.gettext
+
+.if !empty(USE_BUILTIN.gettext:M[nN][oO])
+_BLNK_LIBINTL= -lintl
+_GETTEXT_ICONV_DEPENDS= gettext-lib>=0.11.5nb1
+. if !defined(_GETTEXT_NEEDS_ICONV)
+_GETTEXT_NEEDS_ICONV?= no
+. for _depend_ in ${BUILDLINK_DEPENDS.gettext}
+. if !empty(_GETTEXT_NEEDS_ICONV:M[nN][oO])
+_GETTEXT_NEEDS_ICONV!= \
+ if ${PKG_INFO} -qe '${_depend_}'; then \
+ pkg=`cd ${_PKG_DBDIR}; ${PKG_ADMIN} -S lsbest '${_depend_}'`; \
+ if ${PKG_INFO} -qN "$$pkg" | ${GREP} -q "libiconv-[0-9]"; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi; \
+ else \
+ ${ECHO} "yes"; \
+ fi
+. endif
+. endfor
+. endif
+. if ${_GETTEXT_NEEDS_ICONV} == "yes"
+. for _mkfile_ in buildlink3.mk builtin.mk
+. if exists(../../converters/libiconv/${_mkfile_})
+. include "../../converters/libiconv/${_mkfile_}"
+. endif
+. endfor
+BUILDLINK_DEPENDS.gettext+= ${_GETTEXT_ICONV_DEPENDS}
+_BLNK_LIBINTL+= ${BUILDLINK_LDADD.iconv}
+. endif
+.endif
+
+.if !empty(USE_BUILTIN.gettext:M[yY][eE][sS])
+. if ${_BLNK_LIBINTL_FOUND} == "yes"
+_BLNK_LIBINTL= -lintl
+. else
+_BLNK_LIBINTL= # empty
+BUILDLINK_TRANSFORM+= l:intl:
+. endif
+.endif
+
+BUILDLINK_LDADD.gettext?= ${_BLNK_LIBINTL}
+
+# Add -lintl to LIBS in CONFIGURE_ENV to work around broken gettext.m4:
+# older gettext.m4 does not add -lintl where it should, and the resulting
+# configure script fails to detect if libintl.a is the genuine GNU gettext
+# or not.
+#
+.if defined(GNU_CONFIGURE)
+LIBS+= ${BUILDLINK_LDADD.gettext}
+CONFIGURE_ENV+= INTLLIBS="${BUILDLINK_LDADD.gettext}"
+. if !empty(USE_BUILTIN.gettext:M[yY][eE][sS])
+. if ${_BLNK_LIBINTL_FOUND} == "yes"
+CONFIGURE_ENV+= gt_cv_func_gnugettext1_libintl="yes"
+. endif
+. endif
+. if !empty(USE_BUILTIN.gettext:M[nN][oO])
+CONFIGURE_ARGS+= --with-libintl-prefix=${BUILDLINK_PREFIX.gettext}
+. else
+CONFIGURE_ARGS+= --without-libintl-prefix
+. endif
+.endif
diff --git a/devel/libgetopt/buildlink3.mk b/devel/libgetopt/buildlink3.mk
index 3049327ab69..1d2ceb33792 100644
--- a/devel/libgetopt/buildlink3.mk
+++ b/devel/libgetopt/buildlink3.mk
@@ -1,52 +1,18 @@
-# $NetBSD: buildlink3.mk,v 1.5 2004/01/24 03:12:32 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.6 2004/03/10 17:57:14 jlam Exp $
-BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
-GETOPT_BUILDLINK3_MK:= ${GETOPT_BUILDLINK3_MK}+
+BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
+LIBGETOPT_BUILDLINK3_MK:= ${LIBGETOPT_BUILDLINK3_MK}+
-.if !empty(GETOPT_BUILDLINK3_MK:M+)
-BUILDLINK_PACKAGES+= getopt
-BUILDLINK_DEPENDS.getopt+= libgetopt>=1.3
-BUILDLINK_PKGSRCDIR.getopt?= ../../devel/libgetopt
-.endif # GETOPT_BUILDLINK3_MK
-
-BUILDLINK_CHECK_BUILTIN.getopt?= NO
-
-.if !defined(BUILDLINK_IS_BUILTIN.getopt)
-BUILDLINK_IS_BUILTIN.getopt= NO
-. if exists(/usr/include/getopt.h)
-BUILDLINK_IS_BUILTIN.getopt= YES
-. endif
-.endif
-
-.if !empty(BUILDLINK_CHECK_BUILTIN.getopt:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.getopt= YES
-.endif
-
-.if !defined(BUILDLINK_USE_BUILTIN.getopt)
-. if !empty(BUILDLINK_IS_BUILTIN.getopt:M[nN][oO])
-BUILDLINK_USE_BUILTIN.getopt= NO
-. else
-BUILDLINK_USE_BUILTIN.getopt= YES
-. endif
-.endif
-
-.if !empty(BUILDLINK_USE_BUILTIN.getopt:M[nN][oO])
-. if !empty(BUILDLINK_DEPTH:M+)
+.if !empty(BUILDLINK_DEPTH:M+)
BUILDLINK_DEPENDS+= getopt
-. endif
.endif
-.if !empty(GETOPT_BUILDLINK3_MK:M+)
-. if !empty(BUILDLINK_USE_BUILTIN.getopt:M[nN][oO])
-LIBGETOPT= -lgetopt
-. else
-LIBGETOPT= # empty
-. endif
+BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Ngetopt}
+BUILDLINK_PACKAGES+= getopt
-BUILDLINK_LDADD.getopt?= ${LIBGETOPT}
-
-CONFIGURE_ENV+= LIBGETOPT="${LIBGETOPT}"
-MAKE_ENV+= LIBGETOPT="${LIBGETOPT}"
-.endif # GETOPT_BUILDLINK3_MK
+.if !empty(LIBGETOPT_BUILDLINK3_MK:M+)
+BUILDLINK_DEPENDS.getopt+= libgetopt>=1.3
+BUILDLINK_PKGSRCDIR.getopt?= ../../devel/libgetopt
+.endif # LIBGETOPT_BUILDLINK3_MK
-BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
+BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
diff --git a/devel/libgetopt/builtin.mk b/devel/libgetopt/builtin.mk
new file mode 100644
index 00000000000..74615cdb8be
--- /dev/null
+++ b/devel/libgetopt/builtin.mk
@@ -0,0 +1,26 @@
+# $NetBSD: builtin.mk,v 1.1 2004/03/10 17:57:14 jlam Exp $
+
+.if !defined(IS_BUILTIN.getopt)
+IS_BUILTIN.getopt= no
+. if exists(/usr/include/getopt.h)
+IS_BUILTIN.getopt= yes
+. endif
+.endif
+
+CHECK_BUILTIN.getopt?= no
+.if !empty(CHECK_BUILTIN.getopt:M[yY][eE][sS])
+USE_BUILTIN.getopt= yes
+.endif
+
+USE_BUILTIN.getopt?= ${IS_BUILTIN.getopt}
+
+.if !empty(USE_BUILTIN.getopt:M[nN][oO])
+LIBGETOPT= -lgetopt
+.else
+LIBGETOPT= # empty
+.endif
+
+BUILDLINK_LDADD.getopt?= ${LIBGETOPT}
+
+CONFIGURE_ENV+= LIBGETOPT="${LIBGETOPT}"
+MAKE_ENV+= LIBGETOPT="${LIBGETOPT}"
diff --git a/devel/ncurses/buildlink3.mk b/devel/ncurses/buildlink3.mk
index 89c9f90fe2d..e9a45bf445f 100644
--- a/devel/ncurses/buildlink3.mk
+++ b/devel/ncurses/buildlink3.mk
@@ -1,172 +1,18 @@
-# $NetBSD: buildlink3.mk,v 1.22 2004/02/19 17:36:38 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.23 2004/03/10 17:57:14 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
NCURSES_BUILDLINK3_MK:= ${NCURSES_BUILDLINK3_MK}+
-.include "../../mk/bsd.prefs.mk"
-
-.if !empty(NCURSES_BUILDLINK3_MK:M+)
-BUILDLINK_PACKAGES+= ncurses
-BUILDLINK_DEPENDS.ncurses+= ncurses>=5.3nb1
-BUILDLINK_PKGSRCDIR.ncurses?= ../../devel/ncurses
-.endif # NCURSES_BUILDLINK3_MK
-
-BUILDLINK_CHECK_BUILTIN.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
-
-_NCURSES_H= /usr/include/curses.h
-
-.if !defined(BUILDLINK_IS_BUILTIN.ncurses)
-BUILDLINK_IS_BUILTIN.ncurses= NO
-. if !empty(_BLNK_LIBNCURSES_FOUND:M[yY][eE][sS])
-BUILDLINK_IS_BUILTIN.ncurses= YES
-. elif exists(${_NCURSES_H})
-_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 native curses on NetBSD systems
-# XXX supports ncurses.
-#
-. if ${OPSYS} == "NetBSD"
-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 versions implement
-# XXX enough of ncurses that some packages are happy.
-#
-_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_CHECK_BUILTIN.ncurses:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.ncurses= YES
-.endif
-
-.if !defined(BUILDLINK_USE_BUILTIN.ncurses)
-. 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_NATIVE:M[yY][eE][sS]) && \
- !empty(BUILDLINK_IS_BUILTIN.ncurses:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.ncurses= YES
-. endif
-. if !empty(PREFER_PKGSRC:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.ncurses= NO
-. endif
-. if !empty(PREFER_NATIVE:Mncurses) && \
- !empty(BUILDLINK_IS_BUILTIN.ncurses:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.ncurses= YES
-. endif
-. if !empty(PREFER_PKGSRC:Mncurses)
-BUILDLINK_USE_BUILTIN.ncurses= NO
-. endif
-
-. if defined(USE_NCURSES)
-. if !empty(BUILDLINK_IS_BUILTIN.ncurses:M[yY][eE][sS]) && \
- !empty(_BLNK_LIBNCURSES_FOUND:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.ncurses= YES
-. else
-BUILDLINK_USE_BUILTIN.ncurses= NO
-. endif
-. endif
-.endif
-
-.if !empty(BUILDLINK_USE_BUILTIN.ncurses:M[nN][oO])
-. if !empty(BUILDLINK_DEPTH:M+)
+.if !empty(BUILDLINK_DEPTH:M+)
BUILDLINK_DEPENDS+= ncurses
-. endif
.endif
-.if !empty(NCURSES_BUILDLINK3_MK:M+)
-. if !empty(BUILDLINK_USE_BUILTIN.ncurses:M[yY][eE][sS])
-. if !empty(_BLNK_LIBNCURSES_FOUND:M[nN][oO])
-BUILDLINK_TRANSFORM.ncurses+= -e "s|/curses\.h|/ncurses.h|g"
-BUILDLINK_TRANSFORM+= l:ncurses:curses
-. endif
-. endif
-
-BUILDLINK_FILES.ncurses= include/curses.h
-BUILDLINK_FILES.ncurses+= include/term.h
-
-BUILDLINK_TARGETS+= buildlink-ncurses-curses-h
-BUILDLINK_TARGETS+= buildlink-ncurses-extra-includes
-
-.PHONY: buildlink-ncurses-extra-includes
-buildlink-ncurses-extra-includes:
- ${_PKG_SILENT}${_PKG_DEBUG} \
- extra_includes="include/term.h"; \
- for f in $${extra_includes}; do \
- if [ ! -f ${BUILDLINK_DIR}/$${f} ]; then \
- ${ECHO_BUILDLINK_MSG} "Touching extra ncurses header ($${f}) in ${BUILDLINK_DIR}."; \
- ${TOUCH} ${TOUCH_FLAGS} ${BUILDLINK_DIR}/$${f}; \
- fi; \
- done
+BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Nncurses}
+BUILDLINK_PACKAGES+= ncurses
-.PHONY: buildlink-ncurses-curses-h
-buildlink-ncurses-curses-h:
- ${_PKG_SILENT}${_PKG_DEBUG} \
- if [ ! -f ${BUILDLINK_DIR}/include/curses.h -a \
- -f ${BUILDLINK_PREFIX.ncurses}/include/ncurses.h ]; then \
- ${ECHO_BUILDLINK_MSG} "Linking curses.h to ncurses.h."; \
- ${LN} -s ${BUILDLINK_PREFIX.ncurses}/include/ncurses.h \
- ${BUILDLINK_DIR}/include/curses.h; \
- fi
+.if !empty(NCURSES_BUILDLINK3_MK:M+)
+BUILDLINK_DEPENDS.ncurses+= ncurses>=5.3nb1
+BUILDLINK_PKGSRCDIR.ncurses?= ../../devel/ncurses
.endif # NCURSES_BUILDLINK3_MK
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
diff --git a/devel/ncurses/builtin.mk b/devel/ncurses/builtin.mk
new file mode 100644
index 00000000000..0303309a723
--- /dev/null
+++ b/devel/ncurses/builtin.mk
@@ -0,0 +1,133 @@
+# $NetBSD: builtin.mk,v 1.1 2004/03/10 17:57:14 jlam Exp $
+
+.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
+
+_NCURSES_H= /usr/include/curses.h
+
+.if !defined(IS_BUILTIN.ncurses)
+IS_BUILTIN.ncurses= no
+. if !empty(_BLNK_LIBNCURSES_FOUND:M[yY][eE][sS])
+IS_BUILTIN.ncurses= yes
+. elif exists(${_NCURSES_H})
+IS_BUILTIN.ncurses!= \
+ if ${GREP} -q "\#define[ ]*NCURSES_VERSION" ${_NCURSES_H}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. if !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}
+BUILTIN_PKG.ncurses= ncurses-${_NCURSES_VERSION}
+MAKEFLAGS+= BUILTIN_PKG.ncurses=${BUILTIN_PKG.ncurses}
+. endif
+. endif
+MAKEFLAGS+= IS_BUILTIN.ncurses=${IS_BUILTIN.ncurses}
+.endif
+
+CHECK_BUILTIN.ncurses?= no
+.if !empty(CHECK_BUILTIN.ncurses:M[yY][eE][sS])
+USE_BUILTIN.ncurses= yes
+.endif
+
+.if !defined(USE_BUILTIN.ncurses)
+USE_BUILTIN.ncurses?= ${IS_BUILTIN.ncurses}
+PREFER.ncurses?= pkgsrc
+
+. if defined(BUILTIN_PKG.ncurses)
+USE_BUILTIN.ncurses= yes
+. for _depend_ in ${BUILDLINK_DEPENDS.ncurses}
+. if !empty(IS_BUILTIN.ncurses:M[yY][eE][sS])
+USE_BUILTIN.ncurses!= \
+ if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.ncurses}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. endif
+. endfor
+. endif
+
+. if ${PREFER.ncurses} == "native"
+# XXX
+# XXX By default, assume that the native curses on NetBSD systems
+# XXX supports ncurses.
+# XXX
+. if ${OPSYS} == "NetBSD"
+USE_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 versions implement
+# XXX enough of ncurses that some packages are happy.
+#
+_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_})
+USE_BUILTIN.ncurses= no
+. endif
+. endfor
+. endif
+. endif
+
+. if defined(USE_NCURSES)
+. if !empty(IS_BUILTIN.ncurses:M[nN][oO]) || \
+ (${PREFER.ncurses} == "pkgsrc")
+USE_BUILTIN.ncurses= no
+. endif
+. endif
+.endif # USE_BUILTIN.ncurses
+
+.if !empty(USE_BUILTIN.ncurses:M[yY][eE][sS])
+. if !empty(_BLNK_LIBNCURSES_FOUND:M[nN][oO])
+BUILDLINK_TRANSFORM.ncurses+= -e "s|/curses\.h|/ncurses.h|g"
+BUILDLINK_TRANSFORM+= l:ncurses:curses
+. endif
+BUILDLINK_FILES.ncurses+= include/curses.h
+
+BUILDLINK_TARGETS+= buildlink-ncurses-curses-h
+BUILDLINK_TARGETS+= buildlink-ncurses-extra-includes
+
+.PHONY: buildlink-ncurses-extra-includes
+buildlink-ncurses-extra-includes:
+ ${_PKG_SILENT}${_PKG_DEBUG} \
+ extra_includes="include/term.h"; \
+ for f in $${extra_includes}; do \
+ if [ ! -f ${BUILDLINK_PREFIX.ncurses}/$$f ]; then \
+ ${ECHO_BUILDLINK_MSG} "Touching extra ncurses header ($$f) in ${BUILDLINK_DIR}."; \
+ ${TOUCH} ${TOUCH_FLAGS} ${BUILDLINK_DIR}/$$f; \
+ fi; \
+ done
+
+.PHONY: buildlink-ncurses-curses-h
+buildlink-ncurses-curses-h:
+ ${_PKG_SILENT}${_PKG_DEBUG} \
+ if [ ! -f ${BUILDLINK_DIR}/include/curses.h -a \
+ -f ${BUILDLINK_PREFIX.ncurses}/include/ncurses.h ]; then \
+ ${ECHO_BUILDLINK_MSG} "Linking curses.h -> ncurses.h."; \
+ ${LN} -s ${BUILDLINK_PREFIX.ncurses}/include/ncurses.h \
+ ${BUILDLINK_DIR}/include/curses.h; \
+ fi
+.endif
diff --git a/devel/readline/buildlink3.mk b/devel/readline/buildlink3.mk
index 830ea6b65b4..0b8a1030e99 100644
--- a/devel/readline/buildlink3.mk
+++ b/devel/readline/buildlink3.mk
@@ -1,159 +1,26 @@
-# $NetBSD: buildlink3.mk,v 1.16 2004/02/20 06:51:16 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.17 2004/03/10 17:57:14 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
READLINE_BUILDLINK3_MK:= ${READLINE_BUILDLINK3_MK}+
-.include "../../mk/bsd.prefs.mk"
-
-.if !empty(READLINE_BUILDLINK3_MK:M+)
-BUILDLINK_PACKAGES+= readline
-BUILDLINK_DEPENDS.readline+= readline>=2.2
-BUILDLINK_PKGSRCDIR.readline?= ../../devel/readline
-.endif # READLINE_BUILDLINK3_MK
-
-BUILDLINK_CHECK_BUILTIN.readline?= NO
-
-.if !defined(_BLNK_LIBREADLINE_FOUND)
-_BLNK_LIBREADLINE_FOUND!= \
- if [ "`${ECHO} /usr/lib/libreadline.*`" = "/usr/lib/libreadline.*" ]; then \
- ${ECHO} "NO"; \
- else \
- ${ECHO} "YES"; \
- fi
-MAKEFLAGS+= _BLNK_LIBREADLINE_FOUND=${_BLNK_LIBREADLINE_FOUND}
-.endif
-
-.if !defined(_BLNK_LIBEDIT_FOUND)
-_BLNK_LIBEDIT_FOUND!= \
- if [ "`${ECHO} /usr/lib/libedit.*`" = "/usr/lib/libedit.*" ]; then \
- ${ECHO} "NO"; \
- else \
- ${ECHO} "YES"; \
- fi
-MAKEFLAGS+= _BLNK_LIBEDIT_FOUND=${_BLNK_LIBEDIT_FOUND}
-.endif
-
-_READLINE_H= /usr/include/readline.h
-_READLINE_READLINE_H= /usr/include/readline/readline.h
-
-.if !defined(BUILDLINK_IS_BUILTIN.readline)
-BUILDLINK_IS_BUILTIN.readline= NO
-. if !empty(_BLNK_LIBREADLINE_FOUND:M[yY][eE][sS])
-BUILDLINK_IS_BUILTIN.readline= YES
-. elif exists(${_READLINE_H}) || exists(${_READLINE_READLINE_H})
-. if exists(${_READLINE_H})
-_READLINE_HEADER= ${_READLINE_H}
-. else
-_READLINE_HEADER= ${_READLINE_READLINE_H}
-. endif
-_IS_BUILTIN.readline!= \
- if ${GREP} -q "\#define[ ]*RL_VERSION_MAJOR" ${_READLINE_HEADER}; then \
- ${ECHO} "YES"; \
- else \
- ${ECHO} "NO"; \
- fi
-BUILDLINK_IS_BUILTIN.readline= ${_IS_BUILTIN.readline}
-. if !empty(BUILDLINK_CHECK_BUILTIN.readline:M[nN][oO]) && \
- !empty(_IS_BUILTIN.readline: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.
-#
-_READLINE_MAJOR!= \
- ${AWK} '/\#define[ ]*RL_VERSION_MAJOR/ { print $$3 }' \
- ${_READLINE_HEADER}
-_READLINE_MINOR!= \
- ${AWK} '/\#define[ ]*RL_VERSION_MINOR/ { print $$3 }' \
- ${_READLINE_HEADER}
-_READLINE_VERSION= ${_READLINE_MAJOR}.${_READLINE_MINOR}
-_READLINE_PKG= readline-${_READLINE_VERSION}
-BUILDLINK_IS_BUILTIN.readline= YES
-. for _depend_ in ${BUILDLINK_DEPENDS.readline}
-. if !empty(BUILDLINK_IS_BUILTIN.readline:M[yY][eE][sS])
-BUILDLINK_IS_BUILTIN.readline!= \
- if ${PKG_ADMIN} pmatch '${_depend_}' ${_READLINE_PKG}; then \
- ${ECHO} "YES"; \
- else \
- ${ECHO} "NO"; \
- fi
-. endif
-. endfor
-. endif
-. endif
-#
-# XXX By default, assume that the native editline library supports readline.
-#
-. if !empty(_BLNK_LIBREADLINE_FOUND:M[nN][oO]) && \
- !empty(_BLNK_LIBEDIT_FOUND:M[yY][eE][sS])
-BUILDLINK_IS_BUILTIN.readline= YES
-_INCOMPAT_READLINE?= SunOS-*-*
-. for _pattern_ in ${_INCOMPAT_READLINE} ${INCOMPAT_READLINE}
-. if !empty(MACHINE_PLATFORM:M${_pattern_})
-BUILDLINK_IS_BUILTIN.readline= NO
-. endif
-. endfor
-. endif
-MAKEFLAGS+= BUILDLINK_IS_BUILTIN.readline=${BUILDLINK_IS_BUILTIN.readline}
-.endif
-
-.if !empty(BUILDLINK_CHECK_BUILTIN.readline:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.readline= YES
-.endif
-
-.if !defined(BUILDLINK_USE_BUILTIN.readline)
-. 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_NATIVE:M[yY][eE][sS]) && \
- !empty(BUILDLINK_IS_BUILTIN.readline:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.readline= YES
-. endif
-. if !empty(PREFER_PKGSRC:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.readline= NO
-. endif
-. if !empty(PREFER_NATIVE:Mreadline) && \
- !empty(BUILDLINK_IS_BUILTIN.readline:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.readline= YES
-. endif
-. if !empty(PREFER_PKGSRC:Mreadline)
-BUILDLINK_USE_BUILTIN.readline= NO
-. endif
-
-. if defined(USE_GNU_READLINE)
-. if !empty(BUILDLINK_IS_BUILTIN.readline:M[yY][eE][sS]) && \
- !empty(_BLNK_LIBREADLINE_FOUND:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.readline= YES
-. else
-BUILDLINK_USE_BUILTIN.readline= NO
-. endif
-. endif
-.endif
-
-.if !empty(BUILDLINK_USE_BUILTIN.readline:M[nN][oO])
-. if !empty(BUILDLINK_DEPTH:M+)
+.if !empty(BUILDLINK_DEPTH:M+)
BUILDLINK_DEPENDS+= readline
-. endif
.endif
+BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Nreadline}
+BUILDLINK_PACKAGES+= readline
+
.if !empty(READLINE_BUILDLINK3_MK:M+)
-. if !empty(BUILDLINK_USE_BUILTIN.readline:M[yY][eE][sS])
-. if !empty(_BLNK_LIBREADLINE_FOUND:M[nN][oO]) && \
- !empty(_BLNK_LIBEDIT_FOUND:M[yY][eE][sS])
-BUILDLINK_TRANSFORM+= l:history:edit
-BUILDLINK_TRANSFORM+= l:readline:edit:termcap
-. endif
-. endif
+BUILDLINK_DEPENDS.readline+= readline>=2.2
+BUILDLINK_PKGSRCDIR.readline?= ../../devel/readline
-BUILDLINK_FILES.readline= include/history.h
+BUILDLINK_FILES.readline+= include/history.h
BUILDLINK_FILES.readline+= include/readline.h
+
BUILDLINK_TRANSFORM.readline= \
-e "s|include/history\.h|include/readline/history.h|g" \
-e "s|include/readline\.h|include/readline/readline.h|g"
+
.endif # READLINE_BUILDLINK3_MK
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
diff --git a/devel/readline/builtin.mk b/devel/readline/builtin.mk
new file mode 100644
index 00000000000..0c7594fcb24
--- /dev/null
+++ b/devel/readline/builtin.mk
@@ -0,0 +1,116 @@
+# $NetBSD: builtin.mk,v 1.1 2004/03/10 17:57:14 jlam Exp $
+
+.if !defined(_BLNK_LIBREADLINE_FOUND)
+_BLNK_LIBREADLINE_FOUND!= \
+ if [ "`${ECHO} /usr/lib/libreadline.*`" = "/usr/lib/libreadline.*" ]; then \
+ ${ECHO} "no"; \
+ else \
+ ${ECHO} "yes"; \
+ fi
+MAKEFLAGS+= _BLNK_LIBREADLINE_FOUND=${_BLNK_LIBREADLINE_FOUND}
+.endif
+
+.if !defined(_BLNK_LIBEDIT_FOUND)
+_BLNK_LIBEDIT_FOUND!= \
+ if [ "`${ECHO} /usr/lib/libedit.*`" = "/usr/lib/libedit.*" ]; then \
+ ${ECHO} "no"; \
+ else \
+ ${ECHO} "yes"; \
+ fi
+MAKEFLAGS+= _BLNK_LIBEDIT_FOUND=${_BLNK_LIBEDIT_FOUND}
+.endif
+
+_READLINE_H= /usr/include/readline.h
+_READLINE_READLINE_H= /usr/include/readline/readline.h
+
+.if !defined(IS_BUILTIN.readline)
+IS_BUILTIN.readline= no
+. if !empty(_BLNK_LIBREADLINE_FOUND:M[yY][eE][sS])
+IS_BUILTIN.readline= yes
+. elif exists(${_READLINE_H}) || exists(${_READLINE_READLINE_H})
+. if exists(${_READLINE_H})
+_READLINE_HEADER= ${_READLINE_H}
+. else
+_READLINE_HEADER= ${_READLINE_READLINE_H}
+. endif
+IS_BUILTIN.readline!= \
+ if ${GREP} -q "\#define[ ]*RL_VERSION_MAJOR" ${_READLINE_HEADER}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. if !empty(IS_BUILTIN.readline: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.
+#
+_READLINE_MAJOR!= \
+ ${AWK} '/\#define[ ]*RL_VERSION_MAJOR/ { print $$3 }' \
+ ${_READLINE_HEADER}
+_READLINE_MINOR!= \
+ ${AWK} '/\#define[ ]*RL_VERSION_MINOR/ { print $$3 }' \
+ ${_READLINE_HEADER}
+_READLINE_VERSION= ${_READLINE_MAJOR}.${_READLINE_MINOR}
+BUILTIN_PKG.readline= readline-${_READLINE_VERSION}
+MAKEFLAGS+= BUILTIN_PKG.readline=${BUILTIN_PKG.readline}
+. endif
+. endif
+MAKEFLAGS+= IS_BUILTIN.readline=${IS_BUILTIN.readline}
+.endif
+
+CHECK_BUILTIN.readline?= no
+.if !empty(CHECK_BUILTIN.readline:M[yY][eE][sS])
+USE_BUILTIN.readline= yes
+.endif
+
+.if !defined(USE_BUILTIN.readline)
+USE_BUILTIN.readline?= ${IS_BUILTIN.readline}
+PREFER.readline?= pkgsrc
+
+. if defined(BUILTIN_PKG.readline)
+USE_BUILTIN.readline= yes
+. for _depend_ in ${BUILDLINK_DEPENDS.readline}
+. if !empty(USE_BUILTIN.readline:M[yY][eE][sS])
+USE_BUILTIN.readline!= \
+ if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.readline}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. endif
+. endfor
+. endif
+
+. if ${PREFER.readline} == "native"
+# XXX
+# XXX By default, assume that the native editline library supports readline.
+# XXX
+. if !empty(_BLNK_LIBREADLINE_FOUND:M[nN][oO]) && \
+ !empty(_BLNK_LIBEDIT_FOUND:M[yY][eE][sS])
+USE_BUILTIN.readline= yes
+_INCOMPAT_READLINE?= SunOS-*-*
+. for _pattern_ in ${_INCOMPAT_READLINE} ${INCOMPAT_READLINE}
+. if !empty(MACHINE_PLATFORM:M${_pattern_})
+USE_BUILTIN.readline= no
+. endif
+. endfor
+. endif
+. endif
+
+. if defined(USE_GNU_READLINE)
+. if !empty(IS_BUILTIN.readline:M[nN][oO]) && \
+ (${PREFER.readline} == "pkgsrc")
+USE_BUILTIN.readline= no
+. endif
+. endif
+.endif # USE_BUILTIN.readline
+
+.if !empty(USE_BUILTIN.readline:M[yY][eE][sS])
+. if !empty(_BLNK_LIBREADLINE_FOUND:M[nN][oO]) && \
+ !empty(_BLNK_LIBEDIT_FOUND:M[yY][eE][sS])
+BUILDLINK_TRANSFORM+= l:history:edit
+BUILDLINK_TRANSFORM+= l:readline:edit:termcap
+. endif
+.endif
diff --git a/devel/zlib/buildlink3.mk b/devel/zlib/buildlink3.mk
index c9f47b1d6e7..05772b6bf27 100644
--- a/devel/zlib/buildlink3.mk
+++ b/devel/zlib/buildlink3.mk
@@ -1,114 +1,18 @@
-# $NetBSD: buildlink3.mk,v 1.15 2004/02/18 16:35:27 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.16 2004/03/10 17:57:14 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
ZLIB_BUILDLINK3_MK:= ${ZLIB_BUILDLINK3_MK}+
-.include "../../mk/bsd.prefs.mk"
+.if !empty(BUILDLINK_DEPTH:M+)
+BUILDLINK_DEPENDS+= zlib
+.endif
+
+BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Nzlib}
+BUILDLINK_PACKAGES+= zlib
.if !empty(ZLIB_BUILDLINK3_MK:M+)
-BUILDLINK_PACKAGES+= zlib
BUILDLINK_DEPENDS.zlib+= zlib>=1.1.4nb1
BUILDLINK_PKGSRCDIR.zlib?= ../../devel/zlib
.endif # ZLIB_BUILDLINK3_MK
-BUILDLINK_CHECK_BUILTIN.zlib?= NO
-
-_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
-. 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
-# BUILDLINK_DEPENDS.<pkg> to see if we need to install the pkgsrc
-# version or if the built-in one is sufficient.
-#
-_ZLIB_VERSION!= \
- ${AWK} '/\#define[ ]*ZLIB_VERSION/ { \
- vers = $$3; \
- gsub("\"", "", vers); \
- print vers; \
- } \
- ' ${_ZLIB_H}
-_ZLIB_PKG= zlib-${_ZLIB_VERSION}
-#
-# If the built-in zlib is 1.1.4, then check whether it has the security
-# fix for CAN-2003-0107, which was a buffer overflow in the gzprintf
-# function. If it does, then treat it as the equivalent of zlib-1.1.4nb1.
-#
-_HAVE_CAN_2003_0107_FIX= NetBSD-1.3[I-Z]*-* NetBSD-1.[456]*-*
-_HAVE_CAN_2003_0107_FIX+= NetBSD-[2-9]*-* NetBSD-1[0-9]*-*
-#
-# XXX These patterns for {Free,Open}BSD are too permissive, but I'm not
-# XXX sure which versions of those OSes provide secure versions of
-# 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_})
-_ZLIB_PKG= zlib-1.1.4nb1
-. 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
-. endif
-MAKEFLAGS+= BUILDLINK_IS_BUILTIN.zlib=${BUILDLINK_IS_BUILTIN.zlib}
-.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[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.zlib= YES
-. else
-BUILDLINK_USE_BUILTIN.zlib= NO
-. endif
-
-. if !empty(PREFER_NATIVE:M[yY][eE][sS]) && \
- !empty(BUILDLINK_IS_BUILTIN.zlib:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.zlib= YES
-. endif
-. if !empty(PREFER_PKGSRC:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.zlib= NO
-. endif
-. if !empty(PREFER_NATIVE:Mzlib) && \
- !empty(BUILDLINK_IS_BUILTIN.zlib:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.zlib= YES
-. endif
-. if !empty(PREFER_PKGSRC:Mzlib)
-BUILDLINK_USE_BUILTIN.zlib= NO
-. endif
-
-. if defined(USE_ZLIB)
-BUILDLINK_USE_BUILTIN.zlib= NO
-. endif
-.endif
-
-.if !empty(BUILDLINK_USE_BUILTIN.zlib:M[nN][oO])
-#
-# If we depend on the package, depend on the latest version with a library
-# major number bump.
-#
-BUILDLINK_DEPENDS.zlib+= zlib>=1.2.1
-. if !empty(BUILDLINK_DEPTH:M+)
-BUILDLINK_DEPENDS+= zlib
-. endif
-.endif
-
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
diff --git a/devel/zlib/builtin.mk b/devel/zlib/builtin.mk
new file mode 100644
index 00000000000..7df7fe471b4
--- /dev/null
+++ b/devel/zlib/builtin.mk
@@ -0,0 +1,81 @@
+# $NetBSD: builtin.mk,v 1.1 2004/03/10 17:57:14 jlam Exp $
+
+_ZLIB_H= /usr/include/zlib.h
+
+.if !defined(IS_BUILTIN.zlib)
+IS_BUILTIN.zlib= no
+. if exists(${_ZLIB_H})
+IS_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
+# BUILDLINK_DEPENDS.<pkg> to see if we need to install the pkgsrc
+# version or if the built-in one is sufficient.
+#
+_ZLIB_VERSION!= \
+ ${AWK} '/\#define[ ]*ZLIB_VERSION/ { \
+ vers = $$3; \
+ gsub("\"", "", vers); \
+ print vers; \
+ } \
+ ' ${_ZLIB_H}
+BUILTIN_PKG.zlib= zlib-${_ZLIB_VERSION}
+#
+# If the built-in zlib is 1.1.4, then check whether it has the security
+# fix for CAN-2003-0107, which was a buffer overflow in the gzprintf
+# function. If it does, then treat it as the equivalent of zlib-1.1.4nb1.
+#
+_HAVE_CAN_2003_0107_FIX= NetBSD-1.3[I-Z]*-* NetBSD-1.[456]*-*
+_HAVE_CAN_2003_0107_FIX+= NetBSD-[2-9]*-* NetBSD-1[0-9]*-*
+#
+# XXX These patterns for {Free,Open}BSD are too permissive, but I'm not
+# XXX sure which versions of those OSes provide secure versions of
+# 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_})
+BUILTIN_PKG.zlib= zlib-1.1.4nb1
+. endif
+. endfor
+. endif
+MAKEFLAGS+= BUILTIN_PKG.zlib=${BUILTIN_PKG.zlib}
+. endif
+MAKEFLAGS+= IS_BUILTIN.zlib=${IS_BUILTIN.zlib}
+.endif
+
+CHECK_BUILTIN.zlib?= no
+.if !empty(CHECK_BUILTIN.zlib:M[yY][eE][sS])
+USE_BUILTIN.zlib= yes
+.endif
+
+.if !defined(USE_BUILTIN.zlib)
+USE_BUILTIN.zlib?= ${IS_BUILTIN.zlib}
+PREFER.zlib?= pkgsrc
+
+. if defined(BUILTIN_PKG.zlib)
+USE_BUILTIN.zlib= yes
+. for _depend_ in ${BUILDLINK_DEPENDS.zlib}
+. if !empty(USE_BUILTIN.zlib:M[yY][eE][sS])
+USE_BUILTIN.zlib!= \
+ if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.zlib}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. endif
+. endfor
+. endif
+
+. if defined(USE_ZLIB)
+. if !empty(IS_BUILTIN.zlib:M[nN][oO]) && \
+ (${PREFER.zlib} == "pkgsrc")
+USE_BUILTIN.zlib= no
+. endif
+. endif
+.endif # USE_BUILTIN.zlib
+
+.if !empty(USE_BUILTIN.zlib:M[nN][oO])
+BUILDLINK_DEPENDS.zlib+= zlib>=1.2.1
+.endif
diff --git a/fonts/Xft2/buildlink3.mk b/fonts/Xft2/buildlink3.mk
index 0614e079f96..2d0efbbf216 100644
--- a/fonts/Xft2/buildlink3.mk
+++ b/fonts/Xft2/buildlink3.mk
@@ -1,144 +1,22 @@
-# $NetBSD: buildlink3.mk,v 1.10 2004/02/29 00:22:43 recht Exp $
+# $NetBSD: buildlink3.mk,v 1.11 2004/03/10 17:57:14 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
XFT2_BUILDLINK3_MK:= ${XFT2_BUILDLINK3_MK}+
-.include "../../mk/bsd.prefs.mk"
+.if !empty(BUILDLINK_DEPTH:M+)
+BUILDLINK_DEPENDS+= Xft2
+.endif
+
+BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:NXft2}
+BUILDLINK_PACKAGES+= Xft2
.if !empty(XFT2_BUILDLINK3_MK:M+)
-BUILDLINK_PACKAGES+= Xft2
BUILDLINK_DEPENDS.Xft2+= Xft2>=2.1
BUILDLINK_PKGSRCDIR.Xft2?= ../../fonts/Xft2
-.endif # XFT2_BUILDLINK3_MK
-
-BUILDLINK_CHECK_BUILTIN.Xft2?= NO
-_X11_TMPL= ${X11BASE}/lib/X11/config/X11.tmpl
-
-.if !defined(BUILDLINK_IS_BUILTIN.Xft2)
-BUILDLINK_IS_BUILTIN.Xft2= NO
-. if exists(${_X11_TMPL})
-_IS_BUILTIN.Xft2!= \
- if ${GREP} -q BuildXftLibrary ${_X11_TMPL}; then \
- ${ECHO} "YES"; \
- else \
- ${ECHO} "NO"; \
- fi
-BUILDLINK_IS_BUILTIN.Xft2= ${_IS_BUILTIN.Xft2}
-. if !empty(BUILDLINK_CHECK_BUILTIN.Xft2:M[nN][oO]) && \
- !empty(_IS_BUILTIN.Xft2:M[yY][eE][sS])
-#
-# Create an appropriate package name for the built-in Xft2 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.
-#
-# Xft2 doesn't provide a method of discovering the version number of
-# the software. Match up Xft2 versions with XFree86 versions for an
-# approximate determination of the Xft2 version.
-#
-_XFT2_VERSIONS= 2.1.2 2.1.1 2.1.0
-_XFT2_2.1.0= 4.2.99.* 4.3 4.3.[0-9] 4.3.[0-9].* 4.3.[1-8][0-9]* 4.3.9[0-8]*
-. if !defined(_XF86_VERSION)
-_X11_CONFIG_VERSION_DEF= ${X11BASE}/lib/X11/config/version.def
-. if !exists(${_X11_CONFIG_VERSION_DEF})
-_XF86_VERSION= 3.3
-. else
-_XF86_MAJOR!= \
- ${AWK} '/\#define[ ]*XF86_VERSION_MAJOR/ { print $$3 }' \
- ${_X11_CONFIG_VERSION_DEF}
-_XF86_MINOR!= \
- ${AWK} '/\#define[ ]*XF86_VERSION_MINOR/ { print $$3 }' \
- ${_X11_CONFIG_VERSION_DEF}
-_XF86_PATCH!= \
- ${AWK} '/\#define[ ]*XF86_VERSION_PATCH/ { print $$3 }' \
- ${_X11_CONFIG_VERSION_DEF}
-_XF86_SNAP!= \
- ${AWK} '/\#define[ ]*XF86_VERSION_SNAP/ { print $$3 }' \
- ${_X11_CONFIG_VERSION_DEF}
-_XF86_TEENY= ${_XF86_PATCH}.${_XF86_SNAP}
-. if !empty(_XF86_TEENY:M0.0)
-_XF86_VERSION= ${_XF86_MAJOR}.${_XF86_MINOR}
-. else
-_XF86_VERSION= ${_XF86_MAJOR}.${_XF86_MINOR}.${_XF86_TEENY}
-. endif
-. endif
-. endif
-. for _xrender_version_ in ${_XFT2_VERSIONS}
-. for _pattern_ in ${_XFT2_${_xrender_version_}}
-. if !empty(_XF86_VERSION:M${_pattern_})
-_XFT2_VERSION?= ${_xrender_version_}
-. endif
-. endfor
-. endfor
-_XFT2_VERSION?= 0.0
-_XFT2_PKG= Xft2-${_XFT2_VERSION}
-
-BUILDLINK_IS_BUILTIN.Xft2?= YES
-. for _depend_ in ${BUILDLINK_DEPENDS.Xft2}
-. if !empty(BUILDLINK_IS_BUILTIN.Xft2:M[yY][eE][sS])
-BUILDLINK_IS_BUILTIN.Xft2!= \
- if ${PKG_ADMIN} pmatch '${_depend_}' ${_XFT2_PKG}; then \
- ${ECHO} "YES"; \
- else \
- ${ECHO} "NO"; \
- fi
-. endif
-. endfor
-. endif
-. endif
-MAKEFLAGS+= BUILDLINK_IS_BUILTIN.Xft2=${BUILDLINK_IS_BUILTIN.Xft2}
-.endif
-
-.if !empty(BUILDLINK_CHECK_BUILTIN.Xft2:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.Xft2= YES
-.endif
+.include "../../fonts/fontconfig/buildlink3.mk"
+.include "../../x11/Xrender/buildlink3.mk"
-.if !defined(BUILDLINK_USE_BUILTIN.Xft2)
-. if !empty(BUILDLINK_IS_BUILTIN.Xft2:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.Xft2= YES
-. else
-BUILDLINK_USE_BUILTIN.Xft2= NO
-. endif
-
-. if !empty(PREFER_NATIVE:M[yY][eE][sS]) && \
- !empty(BUILDLINK_IS_BUILTIN.Xft2:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.Xft2= YES
-. endif
-. if !empty(PREFER_PKGSRC:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.Xft2= NO
-. endif
-. if !empty(PREFER_NATIVE:MXft2) && \
- !empty(BUILDLINK_IS_BUILTIN.Xft2:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.Xft2= YES
-. endif
-. if !empty(PREFER_PKGSRC:MXft2)
-BUILDLINK_USE_BUILTIN.Xft2= NO
-. endif
-.endif
-
-.if !empty(BUILDLINK_USE_BUILTIN.Xft2:M[nN][oO])
-BUILDLINK_DEPENDS.Xft2+= Xft2>=2.1nb1
-. if !empty(BUILDLINK_DEPTH:M+)
-BUILDLINK_DEPENDS+= Xft2
-. endif
-.endif
-
-.if !empty(BUILDLINK_USE_BUILTIN.Xft2:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.fontconfig= yes
-BUILDLINK_USE_BUILTIN.Xrender= yes
-.endif
-
-.if !empty(XFT2_BUILDLINK3_MK:M+)
-. if !empty(BUILDLINK_USE_BUILTIN.Xft2:M[yY][eE][sS])
-BUILDLINK_PREFIX.Xft2= ${X11BASE}
-BUILDLINK_FILES.Xft2+= lib/pkgconfig/xft.pc
-. endif
-USE_X11= yes
-. if !empty(BUILDLINK_CHECK_BUILTIN.Xft2:M[nN][oO])
-. include "../../fonts/fontconfig/buildlink3.mk"
-. include "../../x11/Xrender/buildlink3.mk"
-. endif
.endif # XFT2_BUILDLINK3_MK
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
diff --git a/fonts/Xft2/builtin.mk b/fonts/Xft2/builtin.mk
new file mode 100644
index 00000000000..cd06112318e
--- /dev/null
+++ b/fonts/Xft2/builtin.mk
@@ -0,0 +1,100 @@
+# $NetBSD: builtin.mk,v 1.1 2004/03/10 17:57:14 jlam Exp $
+
+_X11_TMPL= ${X11BASE}/lib/X11/config/X11.tmpl
+
+.if !defined(IS_BUILTIN.Xft2)
+IS_BUILTIN.Xft2= no
+. if exists(${_X11_TMPL})
+IS_BUILTIN.Xft2!= \
+ if ${GREP} -q BuildXftLibrary ${_X11_TMPL}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. if !empty(IS_BUILTIN.Xft2:M[yY][eE][sS])
+#
+# Create an appropriate package name for the built-in Xft2 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.
+#
+# Xft2 doesn't provide a method of discovering the version number of
+# the software. Match up Xft2 versions with XFree86 versions for an
+# approximate determination of the Xft2 version.
+#
+_XFT2_VERSIONS= 2.1.2 2.1.1 2.1.0
+_XFT2_2.1.0= 4.2.99.* 4.3 4.3.[0-9] 4.3.[0-9].* 4.3.[1-8][0-9]* 4.3.9[0-8]*
+. if !defined(_XF86_VERSION)
+_X11_CONFIG_VERSION_DEF= ${X11BASE}/lib/X11/config/version.def
+_XF86_VERSION= 3.3
+. if exists(${_X11_CONFIG_VERSION_DEF})
+_XF86_MAJOR!= \
+ ${AWK} '/\#define[ ]*XF86_VERSION_MAJOR/ { print $$3 }' \
+ ${_X11_CONFIG_VERSION_DEF}
+_XF86_MINOR!= \
+ ${AWK} '/\#define[ ]*XF86_VERSION_MINOR/ { print $$3 }' \
+ ${_X11_CONFIG_VERSION_DEF}
+_XF86_PATCH!= \
+ ${AWK} '/\#define[ ]*XF86_VERSION_PATCH/ { print $$3 }' \
+ ${_X11_CONFIG_VERSION_DEF}
+_XF86_SNAP!= \
+ ${AWK} '/\#define[ ]*XF86_VERSION_SNAP/ { print $$3 }' \
+ ${_X11_CONFIG_VERSION_DEF}
+_XF86_TEENY= ${_XF86_PATCH}.${_XF86_SNAP}
+. if !empty(_XF86_TEENY:M0.0)
+_XF86_VERSION= ${_XF86_MAJOR}.${_XF86_MINOR}
+. else
+_XF86_VERSION= ${_XF86_MAJOR}.${_XF86_MINOR}.${_XF86_TEENY}
+. endif
+. endif
+MAKEFLAGS+= _XF86_VERSION=${_XF86_VERSION}
+. endif
+. for _xrender_version_ in ${_XFT2_VERSIONS}
+. for _pattern_ in ${_XFT2_${_xrender_version_}}
+. if !empty(_XF86_VERSION:M${_pattern_})
+_XFT2_VERSION?= ${_xrender_version_}
+. endif
+. endfor
+. endfor
+_XFT2_VERSION?= 0.0
+BUILTIN_PKG.Xft2= Xft2-${_XFT2_VERSION}
+MAKEFLAGS+= BUILTIN_PKG.Xft2=${BUILTIN_PKG.Xft2}
+. endif
+. endif
+MAKEFLAGS+= IS_BUILTIN.Xft2=${IS_BUILTIN.Xft2}
+.endif
+
+CHECK_BUILTIN.Xft2?= no
+.if !empty(CHECK_BUILTIN.Xft2:M[yY][eE][sS])
+USE_BUILTIN.Xft2= yes
+.endif
+
+.if !defined(USE_BUILTIN.Xft2)
+USE_BUILTIN.Xft2?= ${IS_BUILTIN.Xft2}
+
+. if defined(BUILTIN_PKG.Xft2)
+USE_BUILTIN.Xft2= yes
+. for _depend_ in ${BUILDLINK_DEPENDS.Xft2}
+. if !empty(USE_BUILTIN.Xft2:M[yY][eE][sS])
+USE_BUILTIN.Xft2!= \
+ if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.Xft2}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. endif
+. endfor
+. endif
+.endif # USE_BUILTIN.Xft2
+
+.if !empty(USE_BUILTIN.Xft2:M[nN][oO])
+BUILDLINK_DEPENDS.Xft2+= Xft2>=2.1nb1
+.endif
+
+.if !empty(USE_BUILTIN.Xft2:M[yY][eE][sS])
+BUILDLINK_PREFIX.Xft2= ${X11BASE}
+BUILDLINK_FILES.Xft2+= lib/pkgconfig/xft.pc
+
+USE_BUILTIN.Xrender= yes
+USE_BUILTIN.fontconfig= yes
+.endif
diff --git a/fonts/fontconfig/buildlink3.mk b/fonts/fontconfig/buildlink3.mk
index f39cfb4e8c9..5ceb235e08f 100644
--- a/fonts/fontconfig/buildlink3.mk
+++ b/fonts/fontconfig/buildlink3.mk
@@ -1,121 +1,23 @@
-# $NetBSD: buildlink3.mk,v 1.14 2004/02/19 19:12:26 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.15 2004/03/10 17:57:14 jlam Exp $
-BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
+BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
FONTCONFIG_BUILDLINK3_MK:= ${FONTCONFIG_BUILDLINK3_MK}+
-.include "../../mk/bsd.prefs.mk"
+.if !empty(BUILDLINK_DEPTH:M+)
+BUILDLINK_DEPENDS+= fontconfig
+.endif
+
+BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Nfontconfig}
+BUILDLINK_PACKAGES+= fontconfig
.if !empty(FONTCONFIG_BUILDLINK3_MK:M+)
-BUILDLINK_PACKAGES+= fontconfig
BUILDLINK_DEPENDS.fontconfig+= fontconfig>=1.0.1
BUILDLINK_PKGSRCDIR.fontconfig?= ../../fonts/fontconfig
-.endif # FONTCONFIG_BUILDLINK3_MK
-
-BUILDLINK_CHECK_BUILTIN.fontconfig?= NO
-
-_FONTCONFIG_FONTCONFIG_H= ${X11BASE}/include/fontconfig/fontconfig.h
-_X11_TMPL= ${X11BASE}/lib/X11/config/X11.tmpl
-.if !defined(BUILDLINK_IS_BUILTIN.fontconfig)
-BUILDLINK_IS_BUILTIN.fontconfig= NO
-. if exists(${_FONTCONFIG_FONTCONFIG_H}) && exists(${_X11_TMPL})
-_IS_BUILTIN.fontconfig!= \
- if ${GREP} -q BuildFontconfigLibrary ${_X11_TMPL}; then \
- ${ECHO} "YES"; \
- else \
- ${ECHO} "NO"; \
- fi
-BUILDLINK_IS_BUILTIN.fontconfig= ${_IS_BUILTIN.fontconfig}
-. if !empty(BUILDLINK_CHECK_BUILTIN.fontconfig:M[nN][oO]) && \
- !empty(_IS_BUILTIN.fontconfig:M[yY][eE][sS])
-#
-# Create an appropriate package name for the built-in fontconfig 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.
-#
-_FONTCONFIG_MAJOR!= \
- ${AWK} '/\#define[ ]*FC_MAJOR/ { print $$3 }' \
- ${_FONTCONFIG_FONTCONFIG_H}
-_FONTCONFIG_MINOR!= \
- ${AWK} '/\#define[ ]*FC_MINOR/ { print $$3 }' \
- ${_FONTCONFIG_FONTCONFIG_H}
-_FONTCONFIG_REVISION!= \
- ${AWK} '/\#define[ ]*FC_REVISION/ { print $$3 }' \
- ${_FONTCONFIG_FONTCONFIG_H}
-_FONTCONFIG_VERSION= \
- ${_FONTCONFIG_MAJOR}.${_FONTCONFIG_MINOR}.${_FONTCONFIG_REVISION}
-_FONTCONFIG_PKG= fontconfig-${_FONTCONFIG_VERSION}
-
-BUILDLINK_IS_BUILTIN.fontconfig?= YES
-. for _depend_ in ${BUILDLINK_DEPENDS.fontconfig}
-. if !empty(BUILDLINK_IS_BUILTIN.fontconfig:M[yY][eE][sS])
-BUILDLINK_IS_BUILTIN.fontconfig!= \
- if ${PKG_ADMIN} pmatch '${_depend_}' ${_FONTCONFIG_PKG}; then \
- ${ECHO} "YES"; \
- else \
- ${ECHO} "NO"; \
- fi
-. endif
-. endfor
-. endif
-. endif
-MAKEFLAGS+= \
- BUILDLINK_IS_BUILTIN.fontconfig=${BUILDLINK_IS_BUILTIN.fontconfig}
-.endif
-
-.if !empty(BUILDLINK_CHECK_BUILTIN.fontconfig:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.fontconfig= YES
-.endif
+.include "../../devel/zlib/buildlink3.mk"
+.include "../../graphics/freetype2/buildlink3.mk"
+.include "../../textproc/expat/buildlink3.mk"
-.if !defined(BUILDLINK_USE_BUILTIN.fontconfig)
-. if !empty(BUILDLINK_IS_BUILTIN.fontconfig:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.fontconfig= YES
-. else
-BUILDLINK_USE_BUILTIN.fontconfig= NO
-. endif
-
-. if !empty(PREFER_NATIVE:M[yY][eE][sS]) && \
- !empty(BUILDLINK_IS_BUILTIN.fontconfig:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.fontconfig= YES
-. endif
-. if !empty(PREFER_PKGSRC:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.fontconfig= NO
-. endif
-. if !empty(PREFER_NATIVE:Mfontconfig) && \
- !empty(BUILDLINK_IS_BUILTIN.fontconfig:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.fontconfig= YES
-. endif
-. if !empty(PREFER_PKGSRC:Mfontconfig)
-BUILDLINK_USE_BUILTIN.fontconfig= NO
-. endif
-.endif
-
-.if !empty(BUILDLINK_USE_BUILTIN.fontconfig:M[nN][oO])
-BUILDLINK_DEPENDS.fontconfig+= fontconfig>=2.1nb2
-BUILDLINK_DEPENDS.freetype2+= freetype2>=2.1.3
-. if !empty(BUILDLINK_DEPTH:M+)
-BUILDLINK_DEPENDS+= fontconfig
-. endif
-.endif
-
-.if !empty(BUILDLINK_USE_BUILTIN.fontconfig:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.zlib= yes
-BUILDLINK_USE_BUILTIN.freetype2= yes
-BUILDLINK_USE_BUILTIN.expat= yes
-.endif
-
-.if !empty(FONTCONFIG_BUILDLINK3_MK:M+)
-. if !empty(BUILDLINK_USE_BUILTIN.fontconfig:M[yY][eE][sS])
-BUILDLINK_PREFIX.fontconfig= ${X11BASE}
-BUILDLINK_FILES.fontconfig+= lib/pkgconfig/fontconfig.pc
-. endif
-USE_X11= yes
-. if !empty(BUILDLINK_CHECK_BUILTIN.fontconfig:M[nN][oO])
-. include "../../devel/zlib/buildlink3.mk"
-. include "../../graphics/freetype2/buildlink3.mk"
-. include "../../textproc/expat/buildlink3.mk"
-. endif
.endif # FONTCONFIG_BUILDLINK3_MK
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
diff --git a/fonts/fontconfig/builtin.mk b/fonts/fontconfig/builtin.mk
new file mode 100644
index 00000000000..3a832e349bd
--- /dev/null
+++ b/fonts/fontconfig/builtin.mk
@@ -0,0 +1,75 @@
+# $NetBSD: builtin.mk,v 1.1 2004/03/10 17:57:14 jlam Exp $
+
+_FONTCONFIG_FONTCONFIG_H= ${X11BASE}/include/fontconfig/fontconfig.h
+_X11_TMPL= ${X11BASE}/lib/X11/config/X11.tmpl
+
+.if !defined(IS_BUILTIN.fontconfig)
+IS_BUILTIN.fontconfig= no
+. if exists(${_FONTCONFIG_FONTCONFIG_H}) && exists(${_X11_TMPL})
+IS_BUILTIN.fontconfig!= \
+ if ${GREP} -q BuildFontconfigLibrary ${_X11_TMPL}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. if !empty(IS_BUILTIN.fontconfig:M[yY][eE][sS])
+#
+# Create an appropriate package name for the built-in fontconfig 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.
+#
+_FONTCONFIG_MAJOR!= \
+ ${AWK} '/\#define[ ]*FC_MAJOR/ { print $$3 }' \
+ ${_FONTCONFIG_FONTCONFIG_H}
+_FONTCONFIG_MINOR!= \
+ ${AWK} '/\#define[ ]*FC_MINOR/ { print $$3 }' \
+ ${_FONTCONFIG_FONTCONFIG_H}
+_FONTCONFIG_REVISION!= \
+ ${AWK} '/\#define[ ]*FC_REVISION/ { print $$3 }' \
+ ${_FONTCONFIG_FONTCONFIG_H}
+_FONTCONFIG_VERSION= \
+ ${_FONTCONFIG_MAJOR}.${_FONTCONFIG_MINOR}.${_FONTCONFIG_REVISION}
+BUILTIN_PKG.fontconfig= fontconfig-${_FONTCONFIG_VERSION}
+MAKEFLAGS+= BUILTIN_PKG.fontconfig=${BUILTIN_PKG.fontconfig}
+. endif
+. endif
+MAKEFLAGS+= IS_BUILTIN.fontconfig=${IS_BUILTIN.fontconfig}
+.endif
+
+CHECK_BUILTIN.fontconfig?= no
+.if !empty(CHECK_BUILTIN.fontconfig:M[yY][eE][sS])
+USE_BUILTIN.fontconfig= yes
+.endif
+
+.if !defined(USE_BUILTIN.fontconfig)
+USE_BUILTIN.fontconfig?= ${IS_BUILTIN.fontconfig}
+
+. if defined(BUILTIN_PKG.fontconfig)
+USE_BUILTIN.fontconfig= yes
+. for _depend_ in ${BUILDLINK_DEPENDS.fontconfig}
+. if !empty(USE_BUILTIN.fontconfig:M[yY][eE][sS])
+USE_BUILTIN.fontconfig!= \
+ if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.fontconfig}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. endif
+. endfor
+. endif
+.endif # USE_BUILTIN.fontconfig
+
+.if !empty(USE_BUILTIN.fontconfig:M[nN][oO])
+BUILDLINK_DEPENDS.fontconfig+= fontconfig>=2.1nb2
+BUILDLINK_DEPENDS.freetype2+= freetype2>=2.1.3
+.endif
+
+.if !empty(USE_BUILTIN.fontconfig:M[yY][eE][sS])
+BUILDLINK_PREFIX.fontconfig= ${X11BASE}
+BUILDLINK_FILES.fontconfig+= lib/pkgconfig/fontconfig.pc
+
+USE_BUILTIN.expat= yes
+USE_BUILTIN.freetype2= yes
+USE_BUILTIN.zlib= yes
+.endif
diff --git a/graphics/MesaLib/buildlink3.mk b/graphics/MesaLib/buildlink3.mk
index d26c3e04bab..a6331c09a49 100644
--- a/graphics/MesaLib/buildlink3.mk
+++ b/graphics/MesaLib/buildlink3.mk
@@ -1,133 +1,25 @@
-# $NetBSD: buildlink3.mk,v 1.25 2004/02/18 16:35:27 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.26 2004/03/10 17:57:14 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
MESALIB_BUILDLINK3_MK:= ${MESALIB_BUILDLINK3_MK}+
-.include "../../mk/bsd.prefs.mk"
+.if !empty(BUILDLINK_DEPTH:M+)
+BUILDLINK_DEPENDS+= MesaLib
+.endif
+
+BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:NMesaLib}
+BUILDLINK_PACKAGES+= MesaLib
.if !empty(MESALIB_BUILDLINK3_MK:M+)
MESA_REQD+= 3.4.2
-# Distill the MESA_REQD list into a single _MESA_REQD value that is the
-# highest version of MESA required.
-#
-_MESA_STRICTEST_REQD?= none
-. for _version_ in ${MESA_REQD}
-. for _pkg_ in gcc-${_version_}
-. if ${_MESA_STRICTEST_REQD} == "none"
-_MESA_PKG_SATISFIES_DEP= YES
-. for _vers_ in ${MESA_REQD}
-. if !empty(_MESA_PKG_SATISFIES_DEP:M[yY][eE][sS])
-_MESA_PKG_SATISFIES_DEP!= \
- if ${PKG_ADMIN} pmatch 'gcc>=${_vers_}' ${_pkg_}; then \
- ${ECHO} "YES"; \
- else \
- ${ECHO} "NO"; \
- fi
-. endif
-. endfor
-. if !empty(_MESA_PKG_SATISFIES_DEP:M[yY][eE][sS])
-_MESA_STRICTEST_REQD= ${_version_}
-. endif
-. endif
-. endfor
-. endfor
-_MESA_REQD= ${_MESA_STRICTEST_REQD}
-
-BUILDLINK_PACKAGES+= MesaLib
BUILDLINK_DEPENDS.MesaLib+= MesaLib>=${_MESA_REQD}
BUILDLINK_PKGSRCDIR.MesaLib?= ../../graphics/MesaLib
-.endif # MESALIB_BUILDLINK3_MK
-
-BUILDLINK_CHECK_BUILTIN.MesaLib?= NO
-
-_GL_GLX_H= ${X11BASE}/include/GL/glx.h
-_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})
-_IS_BUILTIN.MesaLib!= \
- if ${GREP} -q BuildGLXLibrary ${_X11_TMPL}; then \
- ${ECHO} "YES"; \
- else \
- ${ECHO} "NO"; \
- fi
-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"
-_MESALIB_PKG= MesaLib-${_MESA_VERSION}
-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
-. endif
-MAKEFLAGS+= BUILDLINK_IS_BUILTIN.MesaLib=${BUILDLINK_IS_BUILTIN.MesaLib}
-.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[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.MesaLib= YES
-. else
-BUILDLINK_USE_BUILTIN.MesaLib= NO
-. endif
-
-. if !empty(PREFER_NATIVE:M[yY][eE][sS]) && \
- !empty(BUILDLINK_IS_BUILTIN.MesaLib:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.MesaLib= YES
-. endif
-. if !empty(PREFER_PKGSRC:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.MesaLib= NO
-. endif
-. if !empty(PREFER_NATIVE:MMesaLib) && \
- !empty(BUILDLINK_IS_BUILTIN.MesaLib:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.MesaLib= YES
-. endif
-. if !empty(PREFER_PKGSRC:MMesaLib)
-BUILDLINK_USE_BUILTIN.MesaLib= NO
-. endif
-.endif
-
-.if !empty(BUILDLINK_USE_BUILTIN.MesaLib:M[nN][oO])
-#
-# If we depend on the package, depend on the latest version with a library
-# major number bump.
-#
-BUILDLINK_DEPENDS.MesaLib+= MesaLib>=6.0
-. if !empty(BUILDLINK_DEPTH:M+)
-BUILDLINK_DEPENDS+= MesaLib
-. endif
+.if !defined(BUILDING_MESA)
+BUILDLINK_CPPFLAGS.MesaLib= -DGLX_GLXEXT_LEGACY
.endif
-.if !empty(MESALIB_BUILDLINK3_MK:M+)
-. if !empty(BUILDLINK_USE_BUILTIN.MesaLib:M[yY][eE][sS])
-BUILDLINK_PREFIX.MesaLib= ${X11BASE}
-USE_X11= yes
-_MESA_REQD= ${_MESA_VERSION}
-. else
-. if !defined(BUILDING_MESA)
-BUILDLINK_CPPFLAGS.MesaLib= -DGLX_GLXEXT_LEGACY
-. endif
-. endif
.endif # MESALIB_BUILDLINK3_MK
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
diff --git a/graphics/MesaLib/builtin.mk b/graphics/MesaLib/builtin.mk
new file mode 100644
index 00000000000..8be4d7ff5e4
--- /dev/null
+++ b/graphics/MesaLib/builtin.mk
@@ -0,0 +1,87 @@
+# $NetBSD: builtin.mk,v 1.1 2004/03/10 17:57:14 jlam Exp $
+
+_GL_GLX_H= ${X11BASE}/include/GL/glx.h
+_X11_TMPL= ${X11BASE}/lib/X11/config/X11.tmpl
+
+# Distill the MESA_REQD list into a single _MESA_REQD value that is the
+# highest version of MESA required.
+#
+_MESA_STRICTEST_REQD?= none
+. for _version_ in ${MESA_REQD}
+. for _pkg_ in gcc-${_version_}
+. if ${_MESA_STRICTEST_REQD} == "none"
+_MESA_PKG_SATISFIES_DEP= yes
+. for _vers_ in ${MESA_REQD}
+. if !empty(_MESA_PKG_SATISFIES_DEP:M[yY][eE][sS])
+_MESA_PKG_SATISFIES_DEP!= \
+ if ${PKG_ADMIN} pmatch 'gcc>=${_vers_}' ${_pkg_}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. endif
+. endfor
+. if !empty(_MESA_PKG_SATISFIES_DEP:M[yY][eE][sS])
+_MESA_STRICTEST_REQD= ${_version_}
+. endif
+. endif
+. endfor
+. endfor
+_MESA_REQD= ${_MESA_STRICTEST_REQD}
+
+.if !defined(IS_BUILTIN.MesaLib)
+IS_BUILTIN.MesaLib= no
+. if exists(${_GL_GLX_H}) && exists(${_X11_TMPL})
+IS_BUILTIN.MesaLib!= \
+ if ${GREP} -q BuildGLXLibrary ${_X11_TMPL}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. if !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"
+BUILTIN_PKG.MesaLib= MesaLib-${_MESA_VERSION}
+MAKEFLAGS+= BUILTIN_PKG.MesaLib=${BUILTIN_PKG.MesaLib}
+. endif
+. endif
+MAKEFLAGS+= IS_BUILTIN.MesaLib=${IS_BUILTIN.MesaLib}
+.endif
+
+CHECK_BUILTIN.MesaLib?= no
+.if !empty(CHECK_BUILTIN.MesaLib:M[yY][eE][sS])
+USE_BUILTIN.MesaLib= yes
+.endif
+
+.if !defined(USE_BUILTIN.MesaLib)
+USE_BUILTIN.MesaLib?= ${IS_BUILTIN.MesaLib}
+
+. if defined(BUILTIN_PKG.MesaLib)
+USE_BUILTIN.MesaLib= yes
+. for _depend_ in ${BUILDLINK_DEPENDS.MesaLib}
+. if !empty(USE_BUILTIN.MesaLib:M[yY][eE][sS])
+USE_BUILTIN.MesaLib!= \
+ if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.MesaLib}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. endif
+. endfor
+. endif
+.endif # USE_BUILTIN.MesaLib
+
+.if !empty(USE_BUILTIN.MesaLib:M[nN][oO])
+BUILDLINK_DEPENDS.MesaLib+= MesaLib>=6.0
+.endif
+
+.if !empty(USE_BUILTIN.MesaLib:M[yY][eE][sS])
+BUILDLINK_PREFIX.MesaLib= ${X11BASE}
+USE_X11= yes
+_MESA_REQD= ${_MESA_VERSION}
+.endif
diff --git a/graphics/freetype2/buildlink3.mk b/graphics/freetype2/buildlink3.mk
index 87a506b7c7a..9c2a3435a74 100644
--- a/graphics/freetype2/buildlink3.mk
+++ b/graphics/freetype2/buildlink3.mk
@@ -1,110 +1,23 @@
-# $NetBSD: buildlink3.mk,v 1.20 2004/02/29 00:22:43 recht Exp $
+# $NetBSD: buildlink3.mk,v 1.21 2004/03/10 17:57:14 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
FREETYPE2_BUILDLINK3_MK:= ${FREETYPE2_BUILDLINK3_MK}+
-.include "../../mk/bsd.prefs.mk"
-
-.if !empty(FREETYPE2_BUILDLINK3_MK:M+)
-BUILDLINK_PACKAGES+= freetype2
-BUILDLINK_DEPENDS.freetype2+= freetype2>=2.1.3
-BUILDLINK_PKGSRCDIR.freetype2?= ../../graphics/freetype2
-BUILDLINK_INCDIRS.freetype2?= include/freetype2
-.endif # FREETYPE2_BUILDLINK3_MK
-
-BUILDLINK_CHECK_BUILTIN.freetype2?= NO
-
-_FREETYPE2_FREETYPE_H= ${X11BASE}/include/freetype2/freetype/freetype.h
-_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})
-_IS_BUILTIN.freetype2!= \
- if ${GREP} -q BuildFreetype2Library ${_X11_TMPL}; then \
- ${ECHO} "YES"; \
- else \
- ${ECHO} "NO"; \
- fi
-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
-# BUILDLINK_DEPENDS.<pkg> to see if we need to install the pkgsrc version
-# or if the built-in one is sufficient.
-#
-_FREETYPE2_MAJOR!= \
- ${AWK} '/\#define[ ]*FREETYPE_MAJOR/ { print $$3 }' ${_FREETYPE2_FREETYPE_H}
-_FREETYPE2_MINOR!= \
- ${AWK} '/\#define[ ]*FREETYPE_MINOR/ { print "."$$3 }' ${_FREETYPE2_FREETYPE_H}
-_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_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
-. endif
-MAKEFLAGS+= BUILDLINK_IS_BUILTIN.freetype2=${BUILDLINK_IS_BUILTIN.freetype2}
+.if !empty(BUILDLINK_DEPTH:M+)
+BUILDLINK_DEPENDS+= freetype2
.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[yY][eE][sS]I)
-BUILDLINK_USE_BUILTIN.freetype2= YES
-. else
-BUILDLINK_USE_BUILTIN.freetype2= NO
-. endif
-
-. if !empty(PREFER_NATIVE:M[yY][eE][sS]) && \
- !empty(BUILDLINK_IS_BUILTIN.freetype2:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.freetype2= YES
-. endif
-. if !empty(PREFER_PKGSRC:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.freetype2= NO
-. endif
-. if !empty(PREFER_NATIVE:Mfreetype2) && \
- !empty(BUILDLINK_IS_BUILTIN.freetype2:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.freetype2= YES
-. endif
-. if !empty(PREFER_PKGSRC:Mfreetype2)
-BUILDLINK_USE_BUILTIN.freetype2= NO
-. endif
-.endif
-
-.if !empty(BUILDLINK_USE_BUILTIN.freetype2:M[nN][oO])
-#
-# If we depend on the package, depend on the latest version with a library
-# major number bump.
-#
-BUILDLINK_DEPENDS.freetype2+= freetype2>=2.1.3
-. if !empty(BUILDLINK_DEPTH:M+)
-BUILDLINK_DEPENDS+= freetype2
-. endif
-.endif
+BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Nfreetype2}
+BUILDLINK_PACKAGES+= freetype2
.if !empty(FREETYPE2_BUILDLINK3_MK:M+)
-. if !empty(BUILDLINK_USE_BUILTIN.freetype2:M[yY][eE][sS])
-BUILDLINK_PREFIX.freetype2= ${X11BASE}
-USE_X11= yes
-. endif
+BUILDLINK_DEPENDS.freetype2+= freetype2>=2.1.0
+BUILDLINK_PKGSRCDIR.freetype2?= ../../graphics/freetype2
+BUILDLINK_INCDIRS.freetype2?= include/freetype2
FREETYPE_CONFIG?= ${BUILDLINK_PREFIX.freetype2}/bin/freetype-config
CONFIGURE_ENV+= FREETYPE_CONFIG="${FREETYPE_CONFIG}"
+
.endif # FREETYPE2_BUILDLINK3_MK
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
diff --git a/graphics/freetype2/builtin.mk b/graphics/freetype2/builtin.mk
new file mode 100644
index 00000000000..10ab50c29ce
--- /dev/null
+++ b/graphics/freetype2/builtin.mk
@@ -0,0 +1,66 @@
+# $NetBSD: builtin.mk,v 1.1 2004/03/10 17:57:14 jlam Exp $
+
+_FREETYPE2_FREETYPE_H= ${X11BASE}/include/freetype2/freetype/freetype.h
+_X11_TMPL= ${X11BASE}/lib/X11/config/X11.tmpl
+
+.if !defined(IS_BUILTIN.freetype2)
+IS_BUILTIN.freetype2= no
+. if exists(${_FREETYPE2_FREETYPE_H}) && exists(${_X11_TMPL})
+IS_BUILTIN.freetype2!= \
+ if ${GREP} -q BuildFreetype2Library ${_X11_TMPL}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. if !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
+# BUILDLINK_DEPENDS.<pkg> to see if we need to install the pkgsrc version
+# or if the built-in one is sufficient.
+#
+_FREETYPE2_MAJOR!= \
+ ${AWK} '/\#define[ ]*FREETYPE_MAJOR/ { print $$3 }' ${_FREETYPE2_FREETYPE_H}
+_FREETYPE2_MINOR!= \
+ ${AWK} '/\#define[ ]*FREETYPE_MINOR/ { print "."$$3 }' ${_FREETYPE2_FREETYPE_H}
+_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}
+BUILTIN_PKG.freetype2= freetype2-${_FREETYPE2_VERSION}
+MAKEFLAGS+= BUILTIN_PKG.freetype2=${BUILTIN_PKG.freetype2}
+. endif
+. endif
+MAKEFLAGS+= IS_BUILTIN.freetype2=${IS_BUILTIN.freetype2}
+.endif
+
+CHECK_BUILTIN.freetype2?= no
+.if !empty(CHECK_BUILTIN.freetype2:M[yY][eE][sS])
+USE_BUILTIN.freetype2= yes
+.endif
+
+.if !defined(USE_BUILTIN.freetype2)
+USE_BUILTIN.freetype2?= ${IS_BUILTIN.freetype2}
+
+. if defined(BUILTIN_PKG.freetype2)
+USE_BUILTIN.freetype2= yes
+. for _depend_ in ${BUILDLINK_DEPENDS.freetype2}
+. if !empty(USE_BUILTIN.freetype2:M[yY][eE][sS])
+USE_BUILTIN.freetype2!= \
+ if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.freetype2}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. endif
+. endfor
+. endif
+.endif # USE_BUILTIN.freetype2
+
+.if !empty(USE_BUILTIN.freetype2:M[nN][oO])
+BUILDLINK_DEPENDS.freetype2+= freetype2>=2.1.3
+.endif
+
+.if !empty(USE_BUILTIN.freetype2:M[yY][eE][sS])
+BUILDLINK_PREFIX.freetype2= ${X11BASE}
+USE_X11= yes
+.endif
diff --git a/graphics/glu/buildlink3.mk b/graphics/glu/buildlink3.mk
index 90739f0c13a..68c38bb242d 100644
--- a/graphics/glu/buildlink3.mk
+++ b/graphics/glu/buildlink3.mk
@@ -1,103 +1,21 @@
-# $NetBSD: buildlink3.mk,v 1.22 2004/02/18 16:35:27 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.23 2004/03/10 17:57:14 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
GLU_BUILDLINK3_MK:= ${GLU_BUILDLINK3_MK}+
-.include "../../mk/bsd.prefs.mk"
+.if !empty(BUILDLINK_DEPTH:M+)
+BUILDLINK_DEPENDS+= glu
+.endif
-.if !empty(GLU_BUILDLINK3_MK:M+)
-. include "../../graphics/MesaLib/buildlink3.mk"
+BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Nglu}
+BUILDLINK_PACKAGES+= glu
-BUILDLINK_PACKAGES+= glu
+.if !empty(GLU_BUILDLINK3_MK:M+)
BUILDLINK_DEPENDS.glu+= glu>=${_MESA_REQD}
BUILDLINK_PKGSRCDIR.glu?= ../../graphics/glu
-.endif # GLU_BUILDLINK3_MK
-BUILDLINK_CHECK_BUILTIN.glu?= NO
+.include "../../graphics/MesaLib/buildlink3.mk"
-_GL_GLU_H= ${X11BASE}/include/GL/glu.h
-_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})
-_IS_BUILTIN.glu!= \
- if ${GREP} -q BuildGLULibrary ${_X11_TMPL}; then \
- ${ECHO} "YES"; \
- else \
- ${ECHO} "NO"; \
- fi
-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"
-_GLU_PKG= glu-${_MESA_VERSION}
-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
-. endif
-MAKEFLAGS+= BUILDLINK_IS_BUILTIN.glu=${BUILDLINK_IS_BUILTIN.glu}
-.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[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.glu= YES
-. else
-BUILDLINK_USE_BUILTIN.glu= NO
-. endif
-
-. if !empty(PREFER_NATIVE:M[yY][eE][sS]) && \
- !empty(BUILDLINK_IS_BUILTIN.glu:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.glu= YES
-. endif
-. if !empty(PREFER_PKGSRC:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.glu= NO
-. endif
-. if !empty(PREFER_NATIVE:Mglu) && \
- !empty(BUILDLINK_IS_BUILTIN.glu:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.glu= YES
-. endif
-. if !empty(PREFER_PKGSRC:Mglu)
-BUILDLINK_USE_BUILTIN.glu= NO
-. endif
-.endif
-
-.if !empty(BUILDLINK_USE_BUILTIN.glu:M[nN][oO])
-#
-# If we depend on the package, depend on the latest version with a library
-# major number bump.
-#
-BUILDLINK_DEPENDS.glu+= glu>=6.0
-. if !empty(BUILDLINK_DEPTH:M+)
-BUILDLINK_DEPENDS+= glu
-. endif
-.endif
-
-.if !empty(GLU_BUILDLINK3_MK:M+)
-. if !empty(BUILDLINK_USE_BUILTIN.glu:M[yY][eE][sS])
-BUILDLINK_PREFIX.glu= ${X11BASE}
-USE_X11= yes
-_MESA_REQD= ${_MESA_VERSION}
-. endif
.endif # GLU_BUILDLINK3_MK
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
diff --git a/graphics/glu/builtin.mk b/graphics/glu/builtin.mk
new file mode 100644
index 00000000000..160b4c41d95
--- /dev/null
+++ b/graphics/glu/builtin.mk
@@ -0,0 +1,61 @@
+# $NetBSD: builtin.mk,v 1.1 2004/03/10 17:57:14 jlam Exp $
+
+_GL_GLU_H= ${X11BASE}/include/GL/glu.h
+_X11_TMPL= ${X11BASE}/lib/X11/config/X11.tmpl
+
+.if !defined(IS_BUILTIN.glu)
+IS_BUILTIN.glu= no
+. if exists(${_GL_GLU_H}) && exists(${_X11_TMPL})
+IS_BUILTIN.glu!= \
+ if ${GREP} -q BuildGLULibrary ${_X11_TMPL}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. if !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"
+BUILTIN_PKG.glu= glu-${_MESA_VERSION}
+MAKEFLAGS+= BUILTIN_PKG.glu=${BUILTIN_PKG.glu}
+. endif
+. endif
+MAKEFLAGS+= IS_BUILTIN.glu=${IS_BUILTIN.glu}
+.endif
+
+CHECK_BUILTIN.glu?= no
+.if !empty(CHECK_BUILTIN.glu:M[yY][eE][sS])
+USE_BUILTIN.glu= yes
+.endif
+
+.if !defined(USE_BUILTIN.glu)
+USE_BUILTIN.glu?= ${IS_BUILTIN.glu}
+
+. if defined(BUILTIN_PKG.glu)
+USE_BUILTIN.glu= yes
+. for _depend_ in ${BUILDLINK_DEPENDS.glu}
+. if !empty(USE_BUILTIN.glu:M[yY][eE][sS])
+USE_BUILTIN.glu!= \
+ if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.glu}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. endif
+. endfor
+. endif
+.endif # USE_BUILTIN.glu
+
+.if !empty(USE_BUILTIN.glu:M[nN][oO])
+BUILDLINK_DEPENDS.glu+= glu>=6.0
+.endif
+
+.if !empty(USE_BUILTIN.glu:M[yY][eE][sS])
+BUILDLINK_PREFIX.glu= ${X11BASE}
+USE_X11= yes
+_MESA_REQD= ${_MESA_VERSION}
+.endif
diff --git a/graphics/xpm/buildlink3.mk b/graphics/xpm/buildlink3.mk
index e556f1fcd2c..9d4e6e41549 100644
--- a/graphics/xpm/buildlink3.mk
+++ b/graphics/xpm/buildlink3.mk
@@ -1,95 +1,21 @@
-# $NetBSD: buildlink3.mk,v 1.14 2004/02/06 19:04:25 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.15 2004/03/10 17:57:14 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
XPM_BUILDLINK3_MK:= ${XPM_BUILDLINK3_MK}+
-.include "../../mk/bsd.prefs.mk"
+.if !empty(BUILDLINK_DEPTH:M+)
+BUILDLINK_DEPENDS+= xpm
+.endif
+
+BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Nxpm}
+BUILDLINK_PACKAGES+= xpm
.if !empty(XPM_BUILDLINK3_MK:M+)
-BUILDLINK_PACKAGES+= xpm
BUILDLINK_DEPENDS.xpm+= xpm>=3.4k
BUILDLINK_PKGSRCDIR.xpm?= ../../graphics/xpm
-.endif # XPM_BUILDLINK3_MK
-
-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 ${OPSYS} == "IRIX"
-BUILDLINK_IS_BUILTIN.xpm= YES
-. 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])
-BUILDLINK_USE_BUILTIN.xpm= YES
-.endif
-.if !defined(BUILDLINK_USE_BUILTIN.xpm)
-. if !empty(BUILDLINK_IS_BUILTIN.xpm:M[nN][oO])
-BUILDLINK_USE_BUILTIN.xpm= NO
-. 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}
-BUILDLINK_USE_BUILTIN.xpm?= YES
-. for _depend_ in ${BUILDLINK_DEPENDS.xpm}
-. if !empty(BUILDLINK_USE_BUILTIN.xpm:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.xpm!= \
- if ${PKG_ADMIN} pmatch '${_depend_}' ${_XPM_PKG}; then \
- ${ECHO} "YES"; \
- else \
- ${ECHO} "NO"; \
- fi
-. endif
-. endfor
-. endif
-MAKEFLAGS+= BUILDLINK_USE_BUILTIN.xpm=${BUILDLINK_USE_BUILTIN.xpm}
-.endif # BUILDLINK_USE_BUILTIN.xpm
+USE_X11= yes
-.if !empty(BUILDLINK_USE_BUILTIN.xpm:M[nN][oO])
-. if !empty(BUILDLINK_DEPTH:M+)
-BUILDLINK_DEPENDS+= xpm
-. endif
-.endif
-
-.if !empty(XPM_BUILDLINK3_MK:M+)
-. if !empty(BUILDLINK_USE_BUILTIN.xpm:M[yY][eE][sS])
-BUILDLINK_PREFIX.xpm= ${X11BASE}
-. endif
-USE_X11= yes
.endif # XPM_BUILDLINK3_MK
-BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
+BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
diff --git a/graphics/xpm/builtin.mk b/graphics/xpm/builtin.mk
new file mode 100644
index 00000000000..1a2c59b7166
--- /dev/null
+++ b/graphics/xpm/builtin.mk
@@ -0,0 +1,72 @@
+# $NetBSD: builtin.mk,v 1.1 2004/03/10 17:57:14 jlam Exp $
+
+.include "../../mk/bsd.prefs.mk"
+
+_X11_XPM_H= ${X11BASE}/include/X11/xpm.h
+_X11_TMPL= ${X11BASE}/lib/X11/config/X11.tmpl
+
+.if !defined(IS_BUILTIN.xpm)
+IS_BUILTIN.xpm= no
+. if exists(${_X11_XPM_H})
+. if !empty(X11BASE:M*openwin)
+IS_BUILTIN.xpm!= \
+ if /usr/sbin/pkgchk -l SUNWxwinc | ${GREP} -q xpm.h; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. elif ${OPSYS} == "IRIX"
+IS_BUILTIN.xpm= yes
+. elif exists(${_X11_TMPL})
+IS_BUILTIN.xpm!= \
+ if ${GREP} -q NormalLibXpm ${_X11_TMPL}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. else
+IS_BUILTIN.xpm= no
+. endif
+. endif
+. if !empty(IS_BUILTIN.xpm:M[yY][eE][sS])
+#
+# 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}
+BUILTIN_PKG.xpm= xpm-${_XPM_VERSION}
+MAKEFLAGS+= BUILTIN_PKG.xpm=${BUILTIN_PKG.xpm}
+. endif
+MAKEFLAGS+= IS_BUILTIN.xpm=${IS_BUILTIN.xpm}
+.endif # USE_BUILTIN.xpm
+
+CHECK_BUILTIN.xpm?= no
+.if !empty(CHECK_BUILTIN.xpm:M[yY][eE][sS])
+USE_BUILTIN.xpm= yes
+.endif
+
+.if !defined(USE_BUILTIN.xpm)
+USE_BUILTIN.xpm?= ${IS_BUILTIN.xpm}
+
+. if defined(BUILTIN_PKG.xpm)
+USE_BUILTIN.xpm= yes
+. for _depend_ in ${BUILDLINK_DEPENDS.xpm}
+. if !empty(USE_BUILTIN.xpm:M[yY][eE][sS])
+USE_BUILTIN.xpm!= \
+ if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.xpm}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. endif
+. endfor
+. endif
+.endif # USE_BUILTIN.xpm
diff --git a/net/libpcap/buildlink3.mk b/net/libpcap/buildlink3.mk
index 8acb18903c7..266ab6c3527 100644
--- a/net/libpcap/buildlink3.mk
+++ b/net/libpcap/buildlink3.mk
@@ -1,56 +1,18 @@
-# $NetBSD: buildlink3.mk,v 1.11 2004/02/18 16:35:27 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.12 2004/03/10 17:57:14 jlam Exp $
-BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
+BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
LIBPCAP_BUILDLINK3_MK:= ${LIBPCAP_BUILDLINK3_MK}+
-.include "../../mk/bsd.prefs.mk"
+.if !empty(BUILDLINK_DEPTH:M+)
+BUILDLINK_DEPENDS+= libpcap
+.endif
+
+BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Nlibpcap}
+BUILDLINK_PACKAGES+= libpcap
.if !empty(LIBPCAP_BUILDLINK3_MK:M+)
-BUILDLINK_PACKAGES+= libpcap
BUILDLINK_DEPENDS.libpcap+= libpcap>=0.7.2
BUILDLINK_PKGSRCDIR.libpcap?= ../../net/libpcap
.endif # LIBPCAP_BUILDLINK3_MK
-BUILDLINK_CHECK_BUILTIN.libpcap?= NO
-
-.if !defined(BUILDLINK_IS_BUILTIN.libpcap)
-BUILDLINK_IS_BUILTIN.libpcap= NO
-. if exists(/usr/include/pcap.h)
-BUILDLINK_IS_BUILTIN.libpcap= YES
-. endif
-.endif
-
-.if !empty(BUILDLINK_CHECK_BUILTIN.libpcap:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.libpcap= YES
-.endif
-
-.if !defined(BUILDLINK_USE_BUILTIN.libpcap)
-. 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_NATIVE:M[yY][eE][sS]) && \
- !empty(BUILDLINK_IS_BUILTIN.libpcap:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.libpcap= YES
-. endif
-. if !empty(PREFER_PKGSRC:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.libpcap= NO
-. endif
-. if !empty(PREFER_NATIVE:Mlibpcap) && \
- !empty(BUILDLINK_IS_BUILTIN.libpcap:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.libpcap= YES
-. endif
-. if !empty(PREFER_PKGSRC:Mlibpcap)
-BUILDLINK_USE_BUILTIN.libpcap= NO
-. endif
-.endif
-
-.if !empty(BUILDLINK_USE_BUILTIN.libpcap:M[nN][oO])
-. if !empty(BUILDLINK_DEPTH:M+)
-BUILDLINK_DEPENDS+= libpcap
-. endif
-.endif
-
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
diff --git a/net/libpcap/builtin.mk b/net/libpcap/builtin.mk
new file mode 100644
index 00000000000..546a9dbaa00
--- /dev/null
+++ b/net/libpcap/builtin.mk
@@ -0,0 +1,15 @@
+# $NetBSD: builtin.mk,v 1.1 2004/03/10 17:57:14 jlam Exp $
+
+.if !defined(IS_BUILTIN.libpcap)
+IS_BUILTIN.libpcap= no
+. if exists(/usr/include/pcap.h)
+IS_BUILTIN.libpcap= yes
+. endif
+.endif
+
+CHECK_BUILTIN.libpcap?= no
+.if !empty(CHECK_BUILTIN.libpcap:M[yY][eE][sS])
+USE_BUILTIN.libpcap= yes
+.endif
+
+USE_BUILTIN.libpcap?= ${IS_BUILTIN.libpcap}
diff --git a/security/PAM/buildlink3.mk b/security/PAM/buildlink3.mk
index 8716a50b62d..658a2bc520f 100644
--- a/security/PAM/buildlink3.mk
+++ b/security/PAM/buildlink3.mk
@@ -1,56 +1,18 @@
-# $NetBSD: buildlink3.mk,v 1.11 2004/02/18 16:35:27 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.12 2004/03/10 17:57:14 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
PAM_BUILDLINK3_MK:= ${PAM_BUILDLINK3_MK}+
-.include "../../mk/bsd.prefs.mk"
+.if !empty(BUILDLINK_DEPTH:M+)
+BUILDLINK_DEPENDS+= pam
+.endif
+
+BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Npam}
+BUILDLINK_PACKAGES+= pam
.if !empty(PAM_BUILDLINK3_MK:M+)
-BUILDLINK_PACKAGES+= pam
BUILDLINK_DEPENDS.pam+= PAM>=0.75
BUILDLINK_PKGSRCDIR.pam?= ../../security/PAM
.endif # PAM_BUILDLINK3_MK
-BUILDLINK_CHECK_BUILTIN.pam?= NO
-
-.if !defined(BUILDLINK_IS_BUILTIN.pam)
-BUILDLINK_IS_BUILTIN.pam= NO
-. if exists(/usr/include/security/pam_appl.h)
-BUILDLINK_IS_BUILTIN.pam= YES
-. endif
-.endif
-
-.if !empty(BUILDLINK_CHECK_BUILTIN.pam:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.pam= YES
-.endif
-
-.if !defined(BUILDLINK_USE_BUILTIN.pam)
-. 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_NATIVE:M[yY][eE][sS]) && \
- !empty(BUILDLINK_IS_BUILTIN.pam:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.pam= YES
-. endif
-. if !empty(PREFER_PKGSRC:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.pam= NO
-. endif
-. if !empty(PREFER_NATIVE:Mpam) && \
- !empty(BUILDLINK_IS_BUILTIN.pam:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.pam= YES
-. endif
-. if !empty(PREFER_PKGSRC:Mpam)
-BUILDLINK_USE_BUILTIN.pam= NO
-. endif
-.endif
-
-.if !empty(BUILDLINK_USE_BUILTIN.pam:M[nN][oO])
-. if !empty(BUILDLINK_DEPTH:M+)
-BUILDLINK_DEPENDS+= pam
-. endif
-.endif
-
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
diff --git a/security/PAM/builtin.mk b/security/PAM/builtin.mk
new file mode 100644
index 00000000000..cd234981780
--- /dev/null
+++ b/security/PAM/builtin.mk
@@ -0,0 +1,15 @@
+# $NetBSD: builtin.mk,v 1.1 2004/03/10 17:57:14 jlam Exp $
+
+.if !defined(IS_BUILTIN.pam)
+IS_BUILTIN.pam= no
+. if exists(/usr/include/security/pam_appl.h)
+IS_BUILTIN.pam= yes
+. endif
+.endif
+
+CHECK_BUILTIN.pam?= no
+.if !empty(CHECK_BUILTIN.pam:M[yY][eE][sS])
+USE_BUILTIN.pam= yes
+.endif
+
+USE_BUILTIN.pam?= ${IS_BUILTIN.pam}
diff --git a/security/heimdal/buildlink3.mk b/security/heimdal/buildlink3.mk
index f7575d77e61..a9d0d9d22d3 100644
--- a/security/heimdal/buildlink3.mk
+++ b/security/heimdal/buildlink3.mk
@@ -1,123 +1,19 @@
-# $NetBSD: buildlink3.mk,v 1.13 2004/02/18 16:35:27 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.14 2004/03/10 17:57:14 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
HEIMDAL_BUILDLINK3_MK:= ${HEIMDAL_BUILDLINK3_MK}+
-.include "../../mk/bsd.prefs.mk"
+.if !empty(BUILDLINK_DEPTH:M+)
+BUILDLINK_DEPENDS+= heimdal
+.endif
+
+BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Nheimdal}
+BUILDLINK_PACKAGES+= heimdal
.if !empty(HEIMDAL_BUILDLINK3_MK:M+)
-BUILDLINK_PACKAGES+= heimdal
BUILDLINK_DEPENDS.heimdal+= heimdal>=0.4e
BUILDLINK_PKGSRCDIR.heimdal?= ../../security/heimdal
BUILDLINK_INCDIRS.heimdal?= include/krb5
.endif # HEIMDAL_BUILDLINK3_MK
-BUILDLINK_CHECK_BUILTIN.heimdal?= NO
-
-_KRB5_KRB5_H= /usr/include/krb5/krb5.h
-
-.if !defined(BUILDLINK_IS_BUILTIN.heimdal)
-BUILDLINK_IS_BUILTIN.heimdal= NO
-. if exists(${_KRB5_KRB5_H})
-_IS_BUILTIN.heimdal!= \
- if ${GREP} -q heimdal_version ${_KRB5_KRB5_H}; then \
- ${ECHO} "YES"; \
- else \
- ${ECHO} "NO"; \
- fi
-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
-# BUILDLINK_DEPENDS.<pkg> to see if we need to install the pkgsrc
-# version or if the built-in one is sufficient.
-#
-# heimdal<=0.6 doesn't have a method of checking the headers to discover
-# 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)
-_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]-*
-_HEIMDAL_0.4e= NetBSD-1.6[A-H]-* \
- NetBSD-1.6-* NetBSD-1.6_*-* NetBSD-1.6.*-* \
- NetBSD-1.5[YZ]-* NetBSD-1.5Z*-*
-_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_})
-_HEIMDAL_VERSION?= ${_heimdal_version_}
-. endif
-. endfor
-. endfor
-_HEIMDAL_VERSION?= 0.2t
-. endif
-_HEIMDAL_PKG= heimdal-${_HEIMDAL_VERSION}
-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
-. endif
-MAKEFLAGS+= BUILDLINK_IS_BUILTIN.heimdal=${BUILDLINK_IS_BUILTIN.heimdal}
-.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[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.heimdal= YES
-. else
-BUILDLINK_USE_BUILTIN.heimdal= NO
-. endif
-
-. if !empty(PREFER_NATIVE:M[yY][eE][sS]) && \
- !empty(BUILDLINK_IS_BUILTIN.heimdal:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.heimdal= YES
-. endif
-. if !empty(PREFER_PKGSRC:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.heimdal= NO
-. endif
-. if !empty(PREFER_NATIVE:Mheimdal) && \
- !empty(BUILDLINK_IS_BUILTIN.heimdal:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.heimdal= YES
-. endif
-. if !empty(PREFER_PKGSRC:Mheimdal)
-BUILDLINK_USE_BUILTIN.heimdal= NO
-. endif
-.endif
-
-.if !empty(BUILDLINK_USE_BUILTIN.heimdal:M[nN][oO])
-#
-# If we depend on the package, depend on the latest version with a library
-# major number bump.
-#
-BUILDLINK_DEPENDS.heimdal+= heimdal>=0.6
-. if !empty(BUILDLINK_DEPTH:M+)
-BUILDLINK_DEPENDS+= heimdal
-. endif
-.endif
-
-.if !empty(HEIMDAL_BUILDLINK3_MK:M+)
-. if !empty(BUILDLINK_USE_BUILTIN.heimdal:M[nN][oO])
-KRB5_CONFIG?= ${BUILDLINK_PREFIX.heimdal}/bin/krb5-config
-CONFIGURE_ENV+= KRB5_CONFIG="${KRB5_CONFIG}"
-MAKE_ENV+= KRB5_CONFIG="${KRB5_CONFIG}"
-. endif
-.endif # HEIMDAL_BUILDLINK3_MK
-
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
diff --git a/security/heimdal/builtin.mk b/security/heimdal/builtin.mk
new file mode 100644
index 00000000000..5267e9e0b75
--- /dev/null
+++ b/security/heimdal/builtin.mk
@@ -0,0 +1,80 @@
+# $NetBSD: builtin.mk,v 1.1 2004/03/10 17:57:14 jlam Exp $
+
+_KRB5_KRB5_H= /usr/include/krb5/krb5.h
+
+.if !defined(IS_BUILTIN.heimdal)
+IS_BUILTIN.heimdal= no
+. if exists(${_KRB5_KRB5_H})
+IS_BUILTIN.heimdal!= \
+ if ${GREP} -q heimdal_version ${_KRB5_KRB5_H}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. if !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
+# BUILDLINK_DEPENDS.<pkg> to see if we need to install the pkgsrc
+# version or if the built-in one is sufficient.
+#
+# heimdal<=0.6 doesn't have a method of checking the headers to discover
+# 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)
+_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]-*
+_HEIMDAL_0.4e= NetBSD-1.6[A-H]-* \
+ NetBSD-1.6-* NetBSD-1.6_*-* NetBSD-1.6.*-* \
+ NetBSD-1.5[YZ]-* NetBSD-1.5Z*-*
+_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_})
+_HEIMDAL_VERSION?= ${_heimdal_version_}
+. endif
+. endfor
+. endfor
+_HEIMDAL_VERSION?= 0.2t
+. endif
+BUILTIN_PKG.heimdal= heimdal-${_HEIMDAL_VERSION}
+MAKEFLAGS+= BUILTIN_PKG.heimdal=${BUILTIN_PKG.heimdal}
+. endif
+. endif
+MAKEFLAGS+= IS_BUILTIN.heimdal=${IS_BUILTIN.heimdal}
+.endif
+
+CHECK_BUILTIN.heimdal?= no
+.if !empty(CHECK_BUILTIN.heimdal:M[yY][eE][sS])
+USE_BUILTIN.heimdal= yes
+.endif
+
+.if !defined(USE_BUILTIN.heimdal)
+USE_BUILTIN.heimdal?= ${IS_BUILTIN.heimdal}
+
+. if defined(BUILTIN_PKG.heimdal)
+USE_BUILTIN.heimdal= yes
+. for _depend_ in ${BUILDLINK_DEPENDS.heimdal}
+. if !empty(USE_BUILTIN.heimdal:M[yY][eE][sS])
+USE_BUILTIN.heimdal!= \
+ if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.heimdal}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. endif
+. endfor
+. endif
+.endif # USE_BUILTIN.heimdal
+
+.if !empty(USE_BUILTIN.heimdal:M[nN][oO])
+BUILDLINK_DEPENDS.heimdal+= heimdal>=0.6
+
+KRB5_CONFIG?= ${BUILDLINK_PREFIX.heimdal}/bin/krb5-config
+CONFIGURE_ENV+= KRB5_CONFIG="${KRB5_CONFIG}"
+MAKE_ENV+= KRB5_CONFIG="${KRB5_CONFIG}"
+.endif # HEIMDAL_BUILDLINK3_MK
diff --git a/security/openssl/buildlink3.mk b/security/openssl/buildlink3.mk
index 163bd2ab162..5002ed30884 100644
--- a/security/openssl/buildlink3.mk
+++ b/security/openssl/buildlink3.mk
@@ -1,173 +1,21 @@
-# $NetBSD: buildlink3.mk,v 1.15 2004/02/18 16:35:27 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.16 2004/03/10 17:57:15 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
OPENSSL_BUILDLINK3_MK:= ${OPENSSL_BUILDLINK3_MK}+
.include "../../mk/bsd.prefs.mk"
-.if !empty(OPENSSL_BUILDLINK3_MK:M+)
-#
-# This is the ${PKGNAME} of the version of the OpenSSL package installed
-# by pkgsrc.
-#
-_OPENSSL_PKGSRC_PKGNAME= openssl-0.9.6l
-
-BUILDLINK_PACKAGES+= openssl
-BUILDLINK_DEPENDS.openssl+= openssl>=0.9.6l
-BUILDLINK_PKGSRCDIR.openssl?= ../../security/openssl
-.endif # OPENSSL_BUILDLINK3_MK
-
-BUILDLINK_CHECK_BUILTIN.openssl?= NO
-
-_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
-. 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
-# BUILDLINK_DEPENDS.<pkg> to see if we need to install the pkgsrc
-# version or if the built-in one is sufficient.
-#
-_OPENSSL_MAJOR!= \
- ${AWK} 'BEGIN { hex="0123456789abcdef" } \
- /\#define[ ]*OPENSSL_VERSION_NUMBER/ { \
- i = index(hex, substr($$3, 3, 1)) - 1; \
- print i; \
- exit 0; \
- } \
- ' ${_OPENSSL_OPENSSLV_H}
-_OPENSSL_MINOR!= \
- ${AWK} 'BEGIN { hex="0123456789abcdef" } \
- /\#define[ ]*OPENSSL_VERSION_NUMBER/ { \
- i = 16 * (index(hex, substr($$3, 4, 1)) - 1); \
- i += index(hex, substr($$3, 5, 1)) - 1; \
- print i; \
- exit 0; \
- } \
- ' ${_OPENSSL_OPENSSLV_H}
-_OPENSSL_TEENY!= \
- ${AWK} 'BEGIN { hex="0123456789abcdef" } \
- /\#define[ ]*OPENSSL_VERSION_NUMBER/ { \
- i = 16 * (index(hex, substr($$3, 6, 1)) - 1); \
- i += index(hex, substr($$3, 7, 1)) - 1; \
- print i; \
- exit 0; \
- } \
- ' ${_OPENSSL_OPENSSLV_H}
-_OPENSSL_PATCHLEVEL!= \
- ${AWK} 'BEGIN { hex="0123456789abcdef"; \
- split("abcdefghijklmnopqrstuvwxyz", alpha, ""); \
- } \
- /\#define[ ]*OPENSSL_VERSION_NUMBER/ { \
- i = 16 * (index(hex, substr($$3, 8, 1)) - 1); \
- i += index(hex, substr($$3, 9, 1)) - 1; \
- if (i == 0) { \
- print ""; \
- } else if (i > 26) { \
- print "a"; \
- } else { \
- print alpha[i]; \
- } \
- exit 0; \
- } \
- ' ${_OPENSSL_OPENSSLV_H}
-_OPENSSL_VERSION= ${_OPENSSL_MAJOR}.${_OPENSSL_MINOR}.${_OPENSSL_TEENY}${_OPENSSL_PATCHLEVEL}
-_OPENSSL_PKG= openssl-${_OPENSSL_VERSION}
-#
-# If the built-in OpenSSL software is 0.9.6g, then check whether it
-# contains the security fixes pulled up to netbsd-1-6 on 2003-11-07.
-# If it does, then treat it as the equivalent of openssl-0.9.6l. This
-# is not strictly true, but is good enough since the main differences
-# between 0.9.6g and 0.9.6l are security fixes that NetBSD has already
-# patched into its built-in OpenSSL software.
-#
-_OPENSSL_HAS_FIX!= \
- ${AWK} 'BEGIN { ans = "NO" } \
- /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")
-_OPENSSL_PKG= openssl-0.9.6l
-. endif
-
-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
-. endif
-MAKEFLAGS+= BUILDLINK_IS_BUILTIN.openssl=${BUILDLINK_IS_BUILTIN.openssl}
-.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[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.openssl= YES
-. else
-BUILDLINK_USE_BUILTIN.openssl= NO
-. endif
-
-. if !empty(PREFER_NATIVE:M[yY][eE][sS]) && \
- !empty(BUILDLINK_IS_BUILTIN.openssl:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.openssl= YES
-. endif
-. if !empty(PREFER_PKGSRC:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.openssl= NO
-. endif
-. if !empty(PREFER_NATIVE:Mopenssl) && \
- !empty(BUILDLINK_IS_BUILTIN.openssl:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.openssl= YES
-. endif
-. if !empty(PREFER_PKGSRC:Mopenssl)
-BUILDLINK_USE_BUILTIN.openssl= NO
-. endif
-.endif
-
-.if !defined(_NEED_NEWER_OPENSSL)
-_NEED_NEWER_OPENSSL?= NO
-. for _depend_ in ${BUILDLINK_DEPENDS.openssl}
-. if !empty(_NEED_NEWER_OPENSSL:M[nN][oO])
-_NEED_NEWER_OPENSSL!= \
- if ${PKG_ADMIN} pmatch '${_depend_}' ${_OPENSSL_PKGSRC_PKGNAME}; then \
- ${ECHO} "NO"; \
- else \
- ${ECHO} "YES"; \
- fi
-. endif
-. endfor
-MAKEFLAGS+= _NEED_NEWER_OPENSSL=${_NEED_NEWER_OPENSSL}
-.endif
-
-.if !empty(BUILDLINK_USE_BUILTIN.openssl:M[nN][oO]) && \
- (${_NEED_NEWER_OPENSSL} == "YES")
-PKG_SKIP_REASON= "Unable to satisfy dependency: ${BUILDLINK_DEPENDS.openssl}"
-.endif
-
-.if !empty(BUILDLINK_USE_BUILTIN.openssl:M[nN][oO])
-. if !empty(BUILDLINK_DEPTH:M+)
+.if !empty(BUILDLINK_DEPTH:M+)
BUILDLINK_DEPENDS+= openssl
-. if defined(USE_RSAREF2) && !empty(USE_RSAREF2:M[yY][eE][sS])
-BUILDLINK_DEPENDS+= rsaref
-. endif
-. endif
.endif
+BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Nopenssl}
+BUILDLINK_PACKAGES+= openssl
+
.if !empty(OPENSSL_BUILDLINK3_MK:M+)
-#
+BUILDLINK_DEPENDS.openssl+= openssl>=0.9.6l
+BUILDLINK_PKGSRCDIR.openssl?= ../../security/openssl
+
# Ensure that -lcrypt comes before -lcrypto when linking so that the
# system crypt() routine is used.
#
@@ -176,22 +24,10 @@ BUILDLINK_TRANSFORM+= reorder:l:crypt:crypto
SSLBASE= ${BUILDLINK_PREFIX.openssl}
BUILD_DEFS+= SSLBASE
-. if defined(PKG_SYSCONFDIR.openssl)
-SSLCERTS= ${PKG_SYSCONFDIR.openssl}/certs
-. elif ${OPSYS} == "NetBSD"
-SSLCERTS= /etc/openssl/certs
-. elif !empty(BUILDLINK_USE_BUILTIN.openssl:M[yY][eE][sS])
-SSLCERTS= /etc/ssl/certs # likely place where certs live
-. else
-SSLCERTS= ${PKG_SYSCONFBASEDIR}/openssl/certs
-. endif
-BUILD_DEFS+= SSLCERTS
+.if defined(USE_RSAREF2) && !empty(USE_RSAREF2:M[yY][eE][sS])
+. include "../../security/rsaref/buildlink3.mk"
+.endif
-. if !empty(BUILDLINK_USE_BUILTIN.openssl:M[nN][oO])
-. if defined(USE_RSAREF2) && !empty(USE_RSAREF2:M[yY][eE][sS])
-. include "../../security/rsaref/buildlink3.mk"
-. endif
-. endif
.endif # OPENSSL_BUILDLINK3_MK
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
diff --git a/security/openssl/builtin.mk b/security/openssl/builtin.mk
new file mode 100644
index 00000000000..c347cf00069
--- /dev/null
+++ b/security/openssl/builtin.mk
@@ -0,0 +1,135 @@
+# $NetBSD: builtin.mk,v 1.1 2004/03/10 17:57:15 jlam Exp $
+
+_OPENSSL_PKGSRC_PKGNAME= openssl-0.9.6l
+_OPENSSL_OPENSSLV_H= /usr/include/openssl/opensslv.h
+
+.if !defined(IS_BUILTIN.openssl)
+IS_BUILTIN.openssl= no
+. if exists(${_OPENSSL_OPENSSLV_H})
+IS_BUILTIN.openssl= 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.
+#
+_OPENSSL_MAJOR!= \
+ ${AWK} 'BEGIN { hex="0123456789abcdef" } \
+ /\#define[ ]*OPENSSL_VERSION_NUMBER/ { \
+ i = index(hex, substr($$3, 3, 1)) - 1; \
+ print i; \
+ exit 0; \
+ } \
+ ' ${_OPENSSL_OPENSSLV_H}
+_OPENSSL_MINOR!= \
+ ${AWK} 'BEGIN { hex="0123456789abcdef" } \
+ /\#define[ ]*OPENSSL_VERSION_NUMBER/ { \
+ i = 16 * (index(hex, substr($$3, 4, 1)) - 1); \
+ i += index(hex, substr($$3, 5, 1)) - 1; \
+ print i; \
+ exit 0; \
+ } \
+ ' ${_OPENSSL_OPENSSLV_H}
+_OPENSSL_TEENY!= \
+ ${AWK} 'BEGIN { hex="0123456789abcdef" } \
+ /\#define[ ]*OPENSSL_VERSION_NUMBER/ { \
+ i = 16 * (index(hex, substr($$3, 6, 1)) - 1); \
+ i += index(hex, substr($$3, 7, 1)) - 1; \
+ print i; \
+ exit 0; \
+ } \
+ ' ${_OPENSSL_OPENSSLV_H}
+_OPENSSL_PATCHLEVEL!= \
+ ${AWK} 'BEGIN { hex="0123456789abcdef"; \
+ split("abcdefghijklmnopqrstuvwxyz", alpha, ""); \
+ } \
+ /\#define[ ]*OPENSSL_VERSION_NUMBER/ { \
+ i = 16 * (index(hex, substr($$3, 8, 1)) - 1); \
+ i += index(hex, substr($$3, 9, 1)) - 1; \
+ if (i == 0) { \
+ print ""; \
+ } else if (i > 26) { \
+ print "a"; \
+ } else { \
+ print alpha[i]; \
+ } \
+ exit 0; \
+ } \
+ ' ${_OPENSSL_OPENSSLV_H}
+_OPENSSL_VERSION= ${_OPENSSL_MAJOR}.${_OPENSSL_MINOR}.${_OPENSSL_TEENY}${_OPENSSL_PATCHLEVEL}
+BUILTIN_PKG.openssl= openssl-${_OPENSSL_VERSION}
+#
+# If the built-in OpenSSL software is 0.9.6g, then check whether it
+# contains the security fixes pulled up to netbsd-1-6 on 2003-11-07.
+# If it does, then treat it as the equivalent of openssl-0.9.6l. This
+# is not strictly true, but is good enough since the main differences
+# between 0.9.6g and 0.9.6l are security fixes that NetBSD has already
+# patched into its built-in OpenSSL software.
+#
+_OPENSSL_HAS_FIX!= \
+ ${AWK} 'BEGIN { ans = "no" } \
+ /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")
+BUILTIN_PKG.openssl= openssl-0.9.6l
+. endif
+MAKEFLAGS+= BUILTIN_PKG.openssl=${BUILTIN_PKG.openssl}
+. endif
+MAKEFLAGS+= IS_BUILTIN.openssl=${IS_BUILTIN.openssl}
+.endif
+
+CHECK_BUILTIN.openssl?= no
+.if !empty(CHECK_BUILTIN.openssl:M[yY][eE][sS])
+USE_BUILTIN.openssl= yes
+.endif
+
+.if !defined(USE_BUILTIN.openssl)
+USE_BUILTIN.openssl?= ${IS_BUILTIN.openssl}
+
+. if defined(BUILTIN_PKG.openssl)
+USE_BUILTIN.openssl= yes
+. for _depend_ in ${BUILDLINK_DEPENDS.openssl}
+. if !empty(USE_BUILTIN.openssl:M[yY][eE][sS])
+USE_BUILTIN.openssl!= \
+ if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.openssl}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. endif
+. endfor
+. endif
+.endif # USE_BUILTIN.openssl
+
+.if !defined(_NEED_NEWER_OPENSSL)
+_NEED_NEWER_OPENSSL?= no
+. for _depend_ in ${BUILDLINK_DEPENDS.openssl}
+. if !empty(_NEED_NEWER_OPENSSL:M[nN][oO])
+_NEED_NEWER_OPENSSL!= \
+ if ${PKG_ADMIN} pmatch '${_depend_}' ${_OPENSSL_PKGSRC_PKGNAME}; then \
+ ${ECHO} "no"; \
+ else \
+ ${ECHO} "yes"; \
+ fi
+. endif
+. endfor
+MAKEFLAGS+= _NEED_NEWER_OPENSSL=${_NEED_NEWER_OPENSSL}
+.endif
+
+.if !empty(USE_BUILTIN.openssl:M[nN][oO]) && \
+ !empty(_NEED_NEWER_OPENSSL:M[yY][eE][sS])
+PKG_SKIP_REASON= \
+ "Unable to satisfy dependency: ${BUILDLINK_DEPENDS.openssl}"
+.endif
+
+.if defined(PKG_SYSCONFDIR.openssl)
+SSLCERTS= ${PKG_SYSCONFDIR.openssl}/certs
+.elif ${OPSYS} == "NetBSD"
+SSLCERTS= /etc/openssl/certs
+.elif !empty(USE_BUILTIN.openssl:M[yY][eE][sS])
+SSLCERTS= /etc/ssl/certs # likely place where certs live
+.else
+SSLCERTS= ${PKG_SYSCONFBASEDIR}/openssl/certs
+.endif
+BUILD_DEFS+= SSLCERTS
diff --git a/security/tcp_wrappers/buildlink3.mk b/security/tcp_wrappers/buildlink3.mk
index b2f6e8f58d2..d2108db559e 100644
--- a/security/tcp_wrappers/buildlink3.mk
+++ b/security/tcp_wrappers/buildlink3.mk
@@ -1,41 +1,18 @@
-# $NetBSD: buildlink3.mk,v 1.5 2004/01/24 03:12:32 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.6 2004/03/10 17:57:15 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
TCP_WRAPPERS_BUILDLINK3_MK:= ${TCP_WRAPPERS_BUILDLINK3_MK}+
-.include "../../mk/bsd.prefs.mk"
+.if !empty(BUILDLINK_DEPTH:M+)
+BUILDLINK_DEPENDS+= tcp_wrappers
+.endif
+
+BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Ntcp_wrappers}
+BUILDLINK_PACKAGES+= tcp_wrappers
.if !empty(TCP_WRAPPERS_BUILDLINK3_MK:M+)
-BUILDLINK_PACKAGES+= tcp_wrappers
BUILDLINK_DEPENDS.tcp_wrappers+= tcp_wrappers>=7.6.1nb1
BUILDLINK_PKGSRCDIR.tcp_wrappers?= ../../security/tcp_wrappers
.endif # TCP_WRAPPERS_BUILDLINK3_MK
-BUILDLINK_CHECK_BUILTIN.tcp_wrappers?= NO
-
-.if !defined(BUILDLINK_IS_BUILTIN.tcp_wrappers)
-BUILDLINK_IS_BUILTIN.tcp_wrappers= NO
-. if exists(/usr/include/tcpd.h)
-BUILDLINK_IS_BUILTIN.tcp_wrappers= YES
-. endif
-.endif
-
-.if !empty(BUILDLINK_CHECK_BUILTIN.tcp_wrappers:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.tcp_wrappers= YES
-.endif
-
-.if !defined(BUILDLINK_USE_BUILTIN.tcp_wrappers)
-. if !empty(BUILDLINK_IS_BUILTIN.tcp_wrappers:M[nN][oO])
-BUILDLINK_USE_BUILTIN.tcp_wrappers= NO
-. else
-BUILDLINK_USE_BUILTIN.tcp_wrappers= YES
-. endif
-.endif
-
-.if !empty(BUILDLINK_USE_BUILTIN.tcp_wrappers:M[nN][oO])
-. if !empty(BUILDLINK_DEPTH:M+)
-BUILDLINK_DEPENDS+= tcp_wrappers
-. endif
-.endif
-
-BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
+BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
diff --git a/security/tcp_wrappers/builtin.mk b/security/tcp_wrappers/builtin.mk
new file mode 100644
index 00000000000..468cc9ec558
--- /dev/null
+++ b/security/tcp_wrappers/builtin.mk
@@ -0,0 +1,15 @@
+# $NetBSD: builtin.mk,v 1.1 2004/03/10 17:57:15 jlam Exp $
+
+.if !defined(IS_BUILTIN.tcp_wrappers)
+IS_BUILTIN.tcp_wrappers= no
+. if exists(/usr/include/tcpd.h)
+IS_BUILTIN.tcp_wrappers= yes
+. endif
+.endif
+
+CHECK_BUILTIN.tcp_wrappers?= no
+.if !empty(CHECK_BUILTIN.tcp_wrappers:M[yY][eE][sS])
+USE_BUILTIN.tcp_wrappers= yes
+.endif
+
+USE_BUILTIN.tcp_wrappers?= ${IS_BUILTIN.tcp_wrappers}
diff --git a/textproc/expat/buildlink3.mk b/textproc/expat/buildlink3.mk
index 89609e1827b..925b04cc69d 100644
--- a/textproc/expat/buildlink3.mk
+++ b/textproc/expat/buildlink3.mk
@@ -1,105 +1,18 @@
-# $NetBSD: buildlink3.mk,v 1.9 2004/02/20 23:14:14 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.10 2004/03/10 17:57:15 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
EXPAT_BUILDLINK3_MK:= ${EXPAT_BUILDLINK3_MK}+
-.include "../../mk/bsd.prefs.mk"
-
-.if !empty(EXPAT_BUILDLINK3_MK:M+)
-BUILDLINK_PACKAGES+= expat
-BUILDLINK_DEPENDS.expat+= expat>=1.95.4
-BUILDLINK_PKGSRCDIR.expat?= ../../textproc/expat
-.endif # EXPAT_BUILDLINK3_MK
-
-BUILDLINK_CHECK_BUILTIN.expat?= NO
-
-_EXPAT_H= ${X11BASE}/include/expat.h
-_X11_TMPL= ${X11BASE}/lib/X11/config/X11.tmpl
-
-.if !defined(BUILDLINK_IS_BUILTIN.expat)
-BUILDLINK_IS_BUILTIN.expat= NO
-. if exists(${_X11_TMPL}) && exists(${_X11_EXTENSIONS_EXPAT_H})
-_IS_BUILTIN.expat!= \
- if ${GREP} -q BuildExpatLibrary ${_X11_TMPL}; then \
- ${ECHO} "YES"; \
- else \
- ${ECHO} "NO"; \
- fi
-BUILDLINK_IS_BUILTIN.expat= ${_IS_BUILTIN.expat}
-. if !empty(BUILDLINK_CHECK_BUILTIN.expat:M[nN][oO]) && \
- !empty(_IS_BUILTIN.expat:M[yY][eE][sS])
-#
-# Create an appropriate package name for the built-in expat 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.
-#
-_EXPAT_MAJOR!= \
- ${AWK} '/\#define[ ]*XML_MAJOR_REVISION/ { print $$3 }' \
- ${_EXPAT_H}
-_EXPAT_MINOR!= \
- ${AWK} '/\#define[ ]*XML_MINOR_REVISION/ { print $$3 }' \
- ${_EXPAT_H}
-_EXPAT_MICRO!= \
- ${AWK} '/\#define[ ]*XML_MICRO_REVISION/ { print $$3 }' \
- ${_EXPAT_H}
-_EXPAT_VERSION= ${_EXPAT_MAJOR}.${_EXPAT_MINOR}.${_EXPAT_MICRO}
-_EXPAT_PKG= expat-${_EXPAT_VERSION}
-BUILDLINK_IS_BUILTIN.expat?= YES
-. for _depend_ in ${BUILDLINK_DEPENDS.expat}
-. if !empty(BUILDLINK_IS_BUILTIN.expat:M[yY][eE][sS])
-BUILDLINK_IS_BUILTIN.expat!= \
- if ${PKG_ADMIN} pmatch '${_depend_}' ${_EXPAT_PKG}; then \
- ${ECHO} "YES"; \
- else \
- ${ECHO} "NO"; \
- fi
-. endif
-. endfor
-. endif
-. endif
-MAKEFLAGS+= BUILDLINK_IS_BUILTIN.expat=${BUILDLINK_IS_BUILTIN.expat}
+.if !empty(BUILDLINK_DEPTH:M+)
+BUILDLINK_DEPENDS+= expat
.endif
-.if !empty(BUILDLINK_CHECK_BUILTIN.expat:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.expat= YES
-.endif
-
-.if !defined(BUILDLINK_USE_BUILTIN.expat)
-. if !empty(BUILDLINK_IS_BUILTIN.expat:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.expat= YES
-. else
-BUILDLINK_USE_BUILTIN.expat= NO
-. endif
-
-. if !empty(PREFER_NATIVE:M[yY][eE][sS]) && \
- !empty(BUILDLINK_IS_BUILTIN.expat:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.expat= YES
-. endif
-. if !empty(PREFER_PKGSRC:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.expat= NO
-. endif
-. if !empty(PREFER_NATIVE:Mexpat) && \
- !empty(BUILDLINK_IS_BUILTIN.expat:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.expat= YES
-. endif
-. if !empty(PREFER_PKGSRC:Mexpat)
-BUILDLINK_USE_BUILTIN.expat= NO
-. endif
-.endif
-
-.if !empty(BUILDLINK_USE_BUILTIN.expat:M[nN][oO])
-. if !empty(BUILDLINK_DEPTH:M+)
-BUILDLINK_DEPENDS+= expat
-. endif
-.endif
+BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Nexpat}
+BUILDLINK_PACKAGES+= expat
.if !empty(EXPAT_BUILDLINK3_MK:M+)
BUILDLINK_DEPENDS.expat+= expat>=1.95.4
-. if !empty(BUILDLINK_USE_BUILTIN.expat:M[yY][eE][sS])
-BUILDLINK_PREFIX.expat= ${X11BASE}
-USE_X11= yes
-. endif
+BUILDLINK_PKGSRCDIR.expat?= ../../textproc/expat
.endif # EXPAT_BUILDLINK3_MK
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
diff --git a/textproc/expat/builtin.mk b/textproc/expat/builtin.mk
new file mode 100644
index 00000000000..affa0e49395
--- /dev/null
+++ b/textproc/expat/builtin.mk
@@ -0,0 +1,69 @@
+# $NetBSD: builtin.mk,v 1.1 2004/03/10 17:57:15 jlam Exp $
+
+_EXPAT_H= ${X11BASE}/include/expat.h
+_X11_TMPL= ${X11BASE}/lib/X11/config/X11.tmpl
+
+.if !defined(IS_BUILTIN.expat)
+IS_BUILTIN.expat= no
+. if exists(${_X11_TMPL}) && exists(${_EXPAT_H})
+IS_BUILTIN.expat!= \
+ if ${GREP} -q BuildExpatLibrary ${_X11_TMPL}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. if !empty(IS_BUILTIN.expat:M[yY][eE][sS])
+#
+# Create an appropriate package name for the built-in expat 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.
+#
+_EXPAT_MAJOR!= \
+ ${AWK} '/\#define[ ]*XML_MAJOR_VERSION/ { print $$3 }' \
+ ${_EXPAT_H}
+_EXPAT_MINOR!= \
+ ${AWK} '/\#define[ ]*XML_MINOR_VERSION/ { print $$3 }' \
+ ${_EXPAT_H}
+_EXPAT_MICRO!= \
+ ${AWK} '/\#define[ ]*XML_MICRO_VERSION/ { print $$3 }' \
+ ${_EXPAT_H}
+_EXPAT_VERSION= ${_EXPAT_MAJOR}.${_EXPAT_MINOR}.${_EXPAT_MICRO}
+BUILTIN_PKG.expat= expat-${_EXPAT_VERSION}
+MAKEFLAGS+= BUILTIN_PKG.expat=${BUILTIN_PKG.expat}
+. endif
+. endif
+MAKEFLAGS+= IS_BUILTIN.expat=${IS_BUILTIN.expat}
+.endif
+
+CHECK_BUILTIN.expat?= no
+.if !empty(CHECK_BUILTIN.expat:M[yY][eE][sS])
+USE_BUILTIN.expat= yes
+.endif
+
+.if !defined(USE_BUILTIN.expat)
+USE_BUILTIN.expat?= ${IS_BUILTIN.expat}
+
+. if defined(BUILTIN_PKG.expat)
+USE_BUILTIN.expat= yes
+. for _depend_ in ${BUILDLINK_DEPENDS.expat}
+. if !empty(USE_BUILTIN.expat:M[yY][eE][sS])
+USE_BUILTIN.expat!= \
+ if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.expat}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. endif
+. endfor
+. endif
+.endif # USE_BUILTIN.expat
+
+.if !empty(USE_BUILTIN.expat:M[nN][oO])
+BUILDLINK_DEPENDS.expat+= expat>=1.95.4
+.endif
+
+.if !empty(USE_BUILTIN.expat:M[yY][eE][sS])
+BUILDLINK_PREFIX.expat= ${X11BASE}
+USE_X11= yes
+.endif
diff --git a/x11/Xrandr-mixedcase/buildlink3.mk b/x11/Xrandr-mixedcase/buildlink3.mk
index 2e43737119c..571c9671547 100644
--- a/x11/Xrandr-mixedcase/buildlink3.mk
+++ b/x11/Xrandr-mixedcase/buildlink3.mk
@@ -1,144 +1,24 @@
-# $NetBSD: buildlink3.mk,v 1.12 2004/02/19 19:12:26 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.13 2004/03/10 17:57:15 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
XRANDR_BUILDLINK3_MK:= ${XRANDR_BUILDLINK3_MK}+
-.include "../../mk/bsd.prefs.mk"
+.if !empty(BUILDLINK_DEPTH:M+)
+BUILDLINK_DEPENDS+= Xrandr
+.endif
+
+BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:NXrandr}
+BUILDLINK_PACKAGES+= Xrandr
.if !empty(XRANDR_BUILDLINK3_MK:M+)
-BUILDLINK_PACKAGES+= Xrandr
BUILDLINK_DEPENDS.Xrandr+= Xrandr>=1.0
BUILDLINK_PKGSRCDIR.Xrandr?= ../../x11/Xrandr
-.endif # XRANDR_BUILDLINK3_MK
-
-BUILDLINK_CHECK_BUILTIN.Xrandr?= NO
-
-_X11_TMPL= ${X11BASE}/lib/X11/config/X11.tmpl
-
-.if !defined(BUILDLINK_IS_BUILTIN.Xrandr)
-BUILDLINK_IS_BUILTIN.Xrandr= NO
-. if exists(${_X11_TMPL})
-_IS_BUILTIN.Xrandr!= \
- if ${GREP} -q BuildRandRLibrary ${_X11_TMPL}; then \
- ${ECHO} "YES"; \
- else \
- ${ECHO} "NO"; \
- fi
-BUILDLINK_IS_BUILTIN.Xrandr= ${_IS_BUILTIN.Xrandr}
-. if !empty(BUILDLINK_CHECK_BUILTIN.Xrandr:M[nN][oO]) && \
- !empty(_IS_BUILTIN.Xrandr:M[yY][eE][sS])
-#
-# Create an appropriate package name for the built-in Xrandr 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.
-#
-# Xrandr doesn't provide a method of discovering the version number of
-# the software. Match up Xrandr versions with XFree86 versions for an
-# approximate determination of the Xrandr version.
-#
-_XRANDR_VERSIONS= 1.0.2 1.0.1 1.0
-_XRANDR_1.0= 4.2 4.2.* 4.3 4.3.[0-9] 4.3.[0-9].* 4.3.[1-8][0-9]* 4.3.9[0-8]*
-. if !defined(_XF86_VERSION)
-_X11_CONFIG_VERSION_DEF= ${X11BASE}/lib/X11/config/version.def
-. if !exists(${_X11_CONFIG_VERSION_DEF})
-_XF86_VERSION= 3.3
-. else
-_XF86_MAJOR!= \
- ${AWK} '/\#define[ ]*XF86_VERSION_MAJOR/ { print $$3 }' \
- ${_X11_CONFIG_VERSION_DEF}
-_XF86_MINOR!= \
- ${AWK} '/\#define[ ]*XF86_VERSION_MINOR/ { print $$3 }' \
- ${_X11_CONFIG_VERSION_DEF}
-_XF86_PATCH!= \
- ${AWK} '/\#define[ ]*XF86_VERSION_PATCH/ { print $$3 }' \
- ${_X11_CONFIG_VERSION_DEF}
-_XF86_SNAP!= \
- ${AWK} '/\#define[ ]*XF86_VERSION_SNAP/ { print $$3 }' \
- ${_X11_CONFIG_VERSION_DEF}
-_XF86_TEENY= ${_XF86_PATCH}.${_XF86_SNAP}
-. if !empty(_XF86_TEENY:M0.0)
-_XF86_VERSION= ${_XF86_MAJOR}.${_XF86_MINOR}
-. else
-_XF86_VERSION= ${_XF86_MAJOR}.${_XF86_MINOR}.${_XF86_TEENY}
-. endif
-. endif
-. endif
-. for _xrender_version_ in ${_XRANDR_VERSIONS}
-. for _pattern_ in ${_XRANDR_${_xrender_version_}}
-. if !empty(_XF86_VERSION:M${_pattern_})
-_XRANDR_VERSION?= ${_xrender_version_}
-. endif
-. endfor
-. endfor
-_XRANDR_VERSION?= 1.0
-_XRANDR_PKG= Xrandr-${_XRANDR_VERSION}
-
-BUILDLINK_IS_BUILTIN.Xrandr?= YES
-. for _depend_ in ${BUILDLINK_DEPENDS.Xrandr}
-. if !empty(BUILDLINK_IS_BUILTIN.Xrandr:M[yY][eE][sS])
-BUILDLINK_IS_BUILTIN.Xrandr!= \
- if ${PKG_ADMIN} pmatch '${_depend_}' ${_XRANDR_PKG}; then \
- ${ECHO} "YES"; \
- else \
- ${ECHO} "NO"; \
- fi
-. endif
-. endfor
-. endif
-. endif
-MAKEFLAGS+= BUILDLINK_IS_BUILTIN.Xrandr=${BUILDLINK_IS_BUILTIN.Xrandr}
-.endif
-
-.if !empty(BUILDLINK_CHECK_BUILTIN.Xrandr:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.Xrandr= YES
-.endif
-
-.if !defined(BUILDLINK_USE_BUILTIN.Xrandr)
-. if !empty(BUILDLINK_IS_BUILTIN.Xrandr:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.Xrandr= YES
-. else
-BUILDLINK_USE_BUILTIN.Xrandr= NO
-. endif
-. if !empty(PREFER_NATIVE:M[yY][eE][sS]) && \
- !empty(BUILDLINK_IS_BUILTIN.Xrandr:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.Xrandr= YES
-. endif
-. if !empty(PREFER_PKGSRC:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.Xrandr= NO
-. endif
-. if !empty(PREFER_NATIVE:MXrandr) && \
- !empty(BUILDLINK_IS_BUILTIN.Xrandr:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.Xrandr= YES
-. endif
-. if !empty(PREFER_PKGSRC:MXrandr)
-BUILDLINK_USE_BUILTIN.Xrandr= NO
-. endif
-.endif
-
-.if !empty(BUILDLINK_USE_BUILTIN.Xrandr:M[nN][oO])
-BUILDLINK_DEPENDS.Xrandr+= Xrandr>=1.0.1
-BUILDLINK_DEPENDS.Xrender+= Xrender>=0.8
-. if !empty(BUILDLINK_DEPTH:M+)
-BUILDLINK_DEPENDS+= Xrandr
-. endif
-.endif
+USE_X11= yes
-.if !empty(BUILDLINK_USE_BUILTIN.Xrandr:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.randrext= yes
-BUILDLINK_USE_BUILTIN.Xrender= yes
-.endif
+.include "../../x11/randrext/buildlink3.mk"
+.include "../../x11/Xrender/buildlink3.mk"
-.if !empty(XRANDR_BUILDLINK3_MK:M+)
-. if !empty(BUILDLINK_USE_BUILTIN.Xrandr:M[yY][eE][sS])
-BUILDLINK_PREFIX.Xrandr= ${X11BASE}
-. endif
-USE_X11= yes
-. if !empty(BUILDLINK_CHECK_BUILTIN.Xrandr:M[nN][oO])
-. include "../../x11/randrext/buildlink3.mk"
-. include "../../x11/Xrender/buildlink3.mk"
-. endif
.endif # XRANDR_BUILDLINK3_MK
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
diff --git a/x11/Xrandr-mixedcase/builtin.mk b/x11/Xrandr-mixedcase/builtin.mk
new file mode 100644
index 00000000000..26eeb68d4d2
--- /dev/null
+++ b/x11/Xrandr-mixedcase/builtin.mk
@@ -0,0 +1,99 @@
+# $NetBSD: builtin.mk,v 1.1 2004/03/10 17:57:15 jlam Exp $
+
+_X11_TMPL= ${X11BASE}/lib/X11/config/X11.tmpl
+
+.if !defined(IS_BUILTIN.Xrandr)
+IS_BUILTIN.Xrandr= no
+. if exists(${_X11_TMPL})
+IS_BUILTIN.Xrandr!= \
+ if ${GREP} -q BuildRandRLibrary ${_X11_TMPL}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. if !empty(IS_BUILTIN.Xrandr:M[yY][eE][sS])
+#
+# Create an appropriate package name for the built-in Xrandr 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.
+#
+# Xrandr doesn't provide a method of discovering the version number of
+# the software. Match up Xrandr versions with XFree86 versions for an
+# approximate determination of the Xrandr version.
+#
+_XRANDR_VERSIONS= 1.0.2 1.0.1 1.0
+_XRANDR_1.0= 4.2 4.2.* 4.3 4.3.[0-9] 4.3.[0-9].* 4.3.[1-8][0-9]* 4.3.9[0-8]*
+. if !defined(_XF86_VERSION)
+_X11_CONFIG_VERSION_DEF= ${X11BASE}/lib/X11/config/version.def
+_XF86_VERSION= 3.3
+. if exists(${_X11_CONFIG_VERSION_DEF})
+_XF86_MAJOR!= \
+ ${AWK} '/\#define[ ]*XF86_VERSION_MAJOR/ { print $$3 }' \
+ ${_X11_CONFIG_VERSION_DEF}
+_XF86_MINOR!= \
+ ${AWK} '/\#define[ ]*XF86_VERSION_MINOR/ { print $$3 }' \
+ ${_X11_CONFIG_VERSION_DEF}
+_XF86_PATCH!= \
+ ${AWK} '/\#define[ ]*XF86_VERSION_PATCH/ { print $$3 }' \
+ ${_X11_CONFIG_VERSION_DEF}
+_XF86_SNAP!= \
+ ${AWK} '/\#define[ ]*XF86_VERSION_SNAP/ { print $$3 }' \
+ ${_X11_CONFIG_VERSION_DEF}
+_XF86_TEENY= ${_XF86_PATCH}.${_XF86_SNAP}
+. if !empty(_XF86_TEENY:M0.0)
+_XF86_VERSION= ${_XF86_MAJOR}.${_XF86_MINOR}
+. else
+_XF86_VERSION= ${_XF86_MAJOR}.${_XF86_MINOR}.${_XF86_TEENY}
+. endif
+. endif
+MAKEFLAGS+= _XF86_VERSION=${_XF86_VERSION}
+. endif
+. for _xrandr_version_ in ${_XRANDR_VERSIONS}
+. for _pattern_ in ${_XRANDR_${_xrandr_version_}}
+. if !empty(_XF86_VERSION:M${_pattern_})
+_XRANDR_VERSION?= ${_xrandr_version_}
+. endif
+. endfor
+. endfor
+_XRANDR_VERSION?= 1.0
+BUILTIN_PKG.Xrandr= Xrandr-${_XRANDR_VERSION}
+MAKEFLAGS+= BUILTIN_PKG.Xrandr=${BUILTIN_PKG.Xrandr}
+. endif
+. endif
+MAKEFLAGS+= IS_BUILTIN.Xrandr=${IS_BUILTIN.Xrandr}
+.endif
+
+CHECK_BUILTIN.Xrandr?= no
+.if !empty(CHECK_BUILTIN.Xrandr:M[yY][eE][sS])
+USE_BUILTIN.Xrandr= yes
+.endif
+
+.if !defined(USE_BUILTIN.Xrandr)
+USE_BUILTIN.Xrandr?= ${IS_BUILTIN.Xrandr}
+
+. if defined(BUILTIN_PKG.Xrandr)
+USE_BUILTIN.Xrandr= yes
+. for _depend_ in ${BUILDLINK_DEPENDS.Xrandr}
+. if !empty(USE_BUILTIN.Xrandr:M[yY][eE][sS])
+USE_BUILTIN.Xrandr!= \
+ if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.Xrandr}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. endif
+. endfor
+. endif
+.endif # USE_BUILTIN.Xrandr
+
+.if !empty(USE_BUILTIN.Xrandr:M[nN][oO])
+BUILDLINK_DEPENDS.Xrandr+= Xrandr>=1.0.1
+BUILDLINK_DEPENDS.Xrender+= Xrender>=0.8
+.endif
+
+.if !empty(USE_BUILTIN.Xrandr:M[yY][eE][sS])
+BUILDLINK_PREFIX.Xrandr= ${X11BASE}
+USE_BUILTIN.randrext= yes
+USE_BUILTIN.Xrender= yes
+.endif
diff --git a/x11/Xrender/buildlink3.mk b/x11/Xrender/buildlink3.mk
index bbe7137be11..80e93c5e097 100644
--- a/x11/Xrender/buildlink3.mk
+++ b/x11/Xrender/buildlink3.mk
@@ -1,144 +1,23 @@
-# $NetBSD: buildlink3.mk,v 1.29 2004/02/29 00:22:43 recht Exp $
+# $NetBSD: buildlink3.mk,v 1.30 2004/03/10 17:57:15 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
XRENDER_BUILDLINK3_MK:= ${XRENDER_BUILDLINK3_MK}+
-.include "../../mk/bsd.prefs.mk"
+.if !empty(BUILDLINK_DEPTH:M+)
+BUILDLINK_DEPENDS+= Xrender
+.endif
+
+BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:NXrender}
+BUILDLINK_PACKAGES+= Xrender
.if !empty(XRENDER_BUILDLINK3_MK:M+)
-BUILDLINK_PACKAGES+= Xrender
BUILDLINK_DEPENDS.Xrender+= Xrender>=0.2
BUILDLINK_PKGSRCDIR.Xrender?= ../../x11/Xrender
-.endif # XRENDER_BUILDLINK3_MK
-
-BUILDLINK_CHECK_BUILTIN.Xrender?= NO
-
-_X11_TMPL= ${X11BASE}/lib/X11/config/X11.tmpl
-
-.if !defined(BUILDLINK_IS_BUILTIN.Xrender)
-BUILDLINK_IS_BUILTIN.Xrender= NO
-. if exists(${_X11_TMPL})
-_IS_BUILTIN.Xrender!= \
- if ${GREP} -q BuildRenderLibrary ${_X11_TMPL}; then \
- ${ECHO} "YES"; \
- else \
- ${ECHO} "NO"; \
- fi
-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
-# BUILDLINK_DEPENDS.<pkg> to see if we need to install the pkgsrc version
-# or if the built-in one is sufficient.
-#
-# Xrender doesn't provide a method of discovering the version number of
-# the software. Match up Xrender versions with XFree86 versions for an
-# approximate determination of the Xrender version.
-#
-_XRENDER_VERSIONS= 0.8.3 0.8.2 0.8.1 0.8 0.2 0.1
-_XRENDER_0.1= 4.0 4.0.* 4.1 4.1.[0-9] 4.1.[0-9].* 4.1.[1-8][0-9]* 4.1.9[0-8]*
-_XRENDER_0.2= 4.1.99.* 4.2 4.2.[0-9] 4.2.[0-9].* 4.2.[1-8][0-9]* 4.2.9[0-8]*
-_XRENDER_0.8= 4.2.99.* 4.3 4.3.[0-9] 4.3.[0-9].* 4.3.[1-8][0-9]* 4.3.9[0-8]*
-. if !defined(_XF86_VERSION)
-_X11_CONFIG_VERSION_DEF= ${X11BASE}/lib/X11/config/version.def
-. if !exists(${_X11_CONFIG_VERSION_DEF})
-_XF86_VERSION= 3.3
-. else
-_XF86_MAJOR!= \
- ${AWK} '/\#define[ ]*XF86_VERSION_MAJOR/ { print $$3 }' \
- ${_X11_CONFIG_VERSION_DEF}
-_XF86_MINOR!= \
- ${AWK} '/\#define[ ]*XF86_VERSION_MINOR/ { print $$3 }' \
- ${_X11_CONFIG_VERSION_DEF}
-_XF86_PATCH!= \
- ${AWK} '/\#define[ ]*XF86_VERSION_PATCH/ { print $$3 }' \
- ${_X11_CONFIG_VERSION_DEF}
-_XF86_SNAP!= \
- ${AWK} '/\#define[ ]*XF86_VERSION_SNAP/ { print $$3 }' \
- ${_X11_CONFIG_VERSION_DEF}
-_XF86_TEENY= ${_XF86_PATCH}.${_XF86_SNAP}
-. if !empty(_XF86_TEENY:M0.0)
-_XF86_VERSION= ${_XF86_MAJOR}.${_XF86_MINOR}
-. else
-_XF86_VERSION= ${_XF86_MAJOR}.${_XF86_MINOR}.${_XF86_TEENY}
-. endif
-. endif
-. endif
-. for _xrender_version_ in ${_XRENDER_VERSIONS}
-. for _pattern_ in ${_XRENDER_${_xrender_version_}}
-. if !empty(_XF86_VERSION:M${_pattern_})
-_XRENDER_VERSION?= ${_xrender_version_}
-. endif
-. endfor
-. endfor
-_XRENDER_VERSION?= 0.1
-_XRENDER_PKG= Xrender-${_XRENDER_VERSION}
-
-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
-. endif
-MAKEFLAGS+= BUILDLINK_IS_BUILTIN.Xrender=${BUILDLINK_IS_BUILTIN.Xrender}
-.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[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.Xrender= YES
-. else
-BUILDLINK_USE_BUILTIN.Xrender= NO
-. endif
-. if !empty(PREFER_NATIVE:M[yY][eE][sS]) && \
- !empty(BUILDLINK_IS_BUILTIN.Xrender:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.Xrender= YES
-. endif
-. if !empty(PREFER_PKGSRC:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.Xrender= NO
-. endif
-. if !empty(PREFER_NATIVE:MXrender) && \
- !empty(BUILDLINK_IS_BUILTIN.Xrender:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.Xrender= YES
-. endif
-. if !empty(PREFER_PKGSRC:MXrender)
-BUILDLINK_USE_BUILTIN.Xrender= NO
-. endif
-.endif
-
-.if !empty(BUILDLINK_USE_BUILTIN.Xrender:M[nN][oO])
-BUILDLINK_DEPENDS.Xrender+= Xrender>=0.8.2
-BUILDLINK_DEPENDS.render+= render>=0.8
-. if !empty(BUILDLINK_DEPTH:M+)
-BUILDLINK_DEPENDS+= Xrender
-. endif
-.endif
+USE_X11= yes
-.if !empty(BUILDLINK_USE_BUILTIN.Xrender:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.render= yes
-.endif
+.include "../../x11/render/buildlink3.mk"
-.if !empty(XRENDER_BUILDLINK3_MK:M+)
-. if !empty(BUILDLINK_USE_BUILTIN.Xrender:M[yY][eE][sS])
-BUILDLINK_PREFIX.Xrender= ${X11BASE}
-. endif
-USE_X11= yes
-. if !empty(BUILDLINK_CHECK_BUILTIN.Xrender:M[nN][oO])
-. include "../../x11/render/buildlink3.mk"
-. endif
.endif # XRENDER_BUILDLINK3_MK
-BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
+BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
diff --git a/x11/Xrender/builtin.mk b/x11/Xrender/builtin.mk
new file mode 100644
index 00000000000..b7a1940bc8c
--- /dev/null
+++ b/x11/Xrender/builtin.mk
@@ -0,0 +1,100 @@
+# $NetBSD: builtin.mk,v 1.1 2004/03/10 17:57:15 jlam Exp $
+
+_X11_TMPL= ${X11BASE}/lib/X11/config/X11.tmpl
+
+.if !defined(IS_BUILTIN.Xrender)
+IS_BUILTIN.Xrender= no
+. if exists(${_X11_TMPL})
+IS_BUILTIN.Xrender!= \
+ if ${GREP} -q BuildRenderLibrary ${_X11_TMPL}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. if !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
+# BUILDLINK_DEPENDS.<pkg> to see if we need to install the pkgsrc version
+# or if the built-in one is sufficient.
+#
+# Xrender doesn't provide a method of discovering the version number of
+# the software. Match up Xrender versions with XFree86 versions for an
+# approximate determination of the Xrender version.
+#
+_XRENDER_VERSIONS= 0.8.3 0.8.2 0.8.1 0.8 0.2 0.1
+_XRENDER_0.1= 4.0 4.0.* 4.1 4.1.[0-9] 4.1.[0-9].* 4.1.[1-8][0-9]* 4.1.9[0-8]*
+_XRENDER_0.2= 4.1.99.* 4.2 4.2.[0-9] 4.2.[0-9].* 4.2.[1-8][0-9]* 4.2.9[0-8]*
+_XRENDER_0.8= 4.2.99.* 4.3 4.3.[0-9] 4.3.[0-9].* 4.3.[1-8][0-9]* 4.3.9[0-8]*
+. if !defined(_XF86_VERSION)
+_X11_CONFIG_VERSION_DEF= ${X11BASE}/lib/X11/config/version.def
+_XF86_VERSION= 3.3
+. if exists(${_X11_CONFIG_VERSION_DEF})
+_XF86_MAJOR!= \
+ ${AWK} '/\#define[ ]*XF86_VERSION_MAJOR/ { print $$3 }' \
+ ${_X11_CONFIG_VERSION_DEF}
+_XF86_MINOR!= \
+ ${AWK} '/\#define[ ]*XF86_VERSION_MINOR/ { print $$3 }' \
+ ${_X11_CONFIG_VERSION_DEF}
+_XF86_PATCH!= \
+ ${AWK} '/\#define[ ]*XF86_VERSION_PATCH/ { print $$3 }' \
+ ${_X11_CONFIG_VERSION_DEF}
+_XF86_SNAP!= \
+ ${AWK} '/\#define[ ]*XF86_VERSION_SNAP/ { print $$3 }' \
+ ${_X11_CONFIG_VERSION_DEF}
+_XF86_TEENY= ${_XF86_PATCH}.${_XF86_SNAP}
+. if !empty(_XF86_TEENY:M0.0)
+_XF86_VERSION= ${_XF86_MAJOR}.${_XF86_MINOR}
+. else
+_XF86_VERSION= ${_XF86_MAJOR}.${_XF86_MINOR}.${_XF86_TEENY}
+. endif
+. endif
+MAKEFLAGS+= _XF86_VERSION=${_XF86_VERSION}
+. endif
+. for _xrender_version_ in ${_XRENDER_VERSIONS}
+. for _pattern_ in ${_XRENDER_${_xrender_version_}}
+. if !empty(_XF86_VERSION:M${_pattern_})
+_XRENDER_VERSION?= ${_xrender_version_}
+. endif
+. endfor
+. endfor
+_XRENDER_VERSION?= 0.1
+BUILTIN_PKG.Xrender= Xrender-${_XRENDER_VERSION}
+MAKEFLAGS+= BUILTIN_PKG.Xrender=${BUILTIN_PKG.Xrender}
+. endif
+. endif
+MAKEFLAGS+= IS_BUILTIN.Xrender=${IS_BUILTIN.Xrender}
+.endif
+
+CHECK_BUILTIN.Xrender?= no
+.if !empty(CHECK_BUILTIN.Xrender:M[yY][eE][sS])
+USE_BUILTIN.Xrender= yes
+.endif
+
+.if !defined(USE_BUILTIN.Xrender)
+USE_BUILTIN.Xrender?= ${IS_BUILTIN.Xrender}
+
+. if defined(BUILTIN_PKG.Xrender)
+USE_BUILTIN.Xrender= yes
+. for _depend_ in ${BUILDLINK_DEPENDS.Xrender}
+. if !empty(USE_BUILTIN.Xrender:M[yY][eE][sS])
+USE_BUILTIN.Xrender!= \
+ if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.Xrender}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. endif
+. endfor
+. endif
+.endif # USE_BUILTIN.Xrender
+
+.if !empty(USE_BUILTIN.Xrender:M[nN][oO])
+BUILDLINK_DEPENDS.Xrender+= Xrender>=0.8.2
+BUILDLINK_DEPENDS.render+= render>=0.8
+.endif
+
+.if !empty(USE_BUILTIN.Xrender:M[yY][eE][sS])
+BUILDLINK_PREFIX.Xrender= ${X11BASE}
+USE_BUILTIN.render= yes
+.endif
diff --git a/x11/randrext/buildlink3.mk b/x11/randrext/buildlink3.mk
index 3e4c7ecc2f0..c5c01ef3591 100644
--- a/x11/randrext/buildlink3.mk
+++ b/x11/randrext/buildlink3.mk
@@ -1,95 +1,22 @@
-# $NetBSD: buildlink3.mk,v 1.2 2004/02/18 16:35:27 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.3 2004/03/10 17:57:15 jlam Exp $
-BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
+BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
RANDREXT_BUILDLINK3_MK:= ${RANDREXT_BUILDLINK3_MK}+
-.include "../../mk/bsd.prefs.mk"
+.if !empty(BUILDLINK_DEPTH:M+)
+BUILDLINK_DEPENDS+= randrext
+.endif
+
+BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Nrandrext}
+BUILDLINK_PACKAGES+= randrext
.if !empty(RANDREXT_BUILDLINK3_MK:M+)
-BUILDLINK_PACKAGES+= randrext
BUILDLINK_DEPENDS.randrext+= randrext>=1.0
BUILDLINK_PKGSRCDIR.randrext?= ../../x11/randrext
BUILDLINK_DEPMETHOD.randrext?= build
-.endif # RANDREXT_BUILDLINK3_MK
-
-BUILDLINK_CHECK_BUILTIN.randrext?= NO
-
-_X11_EXTENSIONS_RANDR_H= ${X11BASE}/include/X11/extensions/randr.h
-
-.if !defined(BUILDLINK_IS_BUILTIN.randrext)
-BUILDLINK_IS_BUILTIN.randrext= NO
-. if exists(${_X11_EXTENSIONS_RANDR_H})
-BUILDLINK_IS_BUILTIN.randrext= YES
-. if !empty(BUILDLINK_CHECK_BUILTIN.randrext:M[nN][oO])
-#
-# Create an appropriate package name for the built-in randr 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.
-#
-_RANDR_MAJOR!= \
- ${AWK} '/\#define[ ]*RANDR_MAJOR/ { print $$3 }' \
- ${_X11_EXTENSIONS_RANDR_H}
-_RANDR_MINOR!= \
- ${AWK} '/\#define[ ]*RANDR_MINOR/ { print "."$$3 }' \
- ${_X11_EXTENSIONS_RANDR_H}
-_RANDR_VERSION= ${_RANDR_MAJOR}${_RANDR_MINOR}
-_RANDR_PKG= randr-${_RANDR_VERSION}
-BUILDLINK_IS_BUILTIN.randrext?= YES
-. for _depend_ in ${BUILDLINK_DEPENDS.randrext}
-. if !empty(BUILDLINK_IS_BUILTIN.randrext:M[yY][eE][sS])
-BUILDLINK_IS_BUILTIN.randrext!= \
- if ${PKG_ADMIN} pmatch '${_depend_}' ${_RANDR_PKG}; then \
- ${ECHO} "YES"; \
- else \
- ${ECHO} "NO"; \
- fi
-. endif
-. endfor
-. endif
-. endif
-MAKEFLAGS+= BUILDLINK_IS_BUILTIN.randrext=${BUILDLINK_IS_BUILTIN.randrext}
-.endif
-
-.if !empty(BUILDLINK_CHECK_BUILTIN.randrext:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.randrext= YES
-.endif
-.if !defined(BUILDLINK_USE_BUILTIN.randrext)
-. if !empty(BUILDLINK_IS_BUILTIN.randrext:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.randrext= YES
-. else
-BUILDLINK_USE_BUILTIN.randrext= NO
-. endif
-
-. if !empty(PREFER_NATIVE:M[yY][eE][sS]) && \
- !empty(BUILDLINK_IS_BUILTIN.randrext:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.randrext= YES
-. endif
-. if !empty(PREFER_PKGSRC:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.randrext= NO
-. endif
-. if !empty(PREFER_NATIVE:Mrandr) && \
- !empty(BUILDLINK_IS_BUILTIN.randrext:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.randrext= YES
-. endif
-. if !empty(PREFER_PKGSRC:Mrandr)
-BUILDLINK_USE_BUILTIN.randrext= NO
-. endif
-.endif
-
-.if !empty(BUILDLINK_USE_BUILTIN.randrext:M[nN][oO])
-. if !empty(BUILDLINK_DEPTH:M+)
-BUILDLINK_DEPENDS+= randrext
-. endif
-.endif
-
-.if !empty(RANDREXT_BUILDLINK3_MK:M+)
-BUILDLINK_DEPENDS.randrext+= randrext>=1.0
-. if !empty(BUILDLINK_USE_BUILTIN.randrext:M[yY][eE][sS])
-BUILDLINK_PREFIX.randrext= ${X11BASE}
-. endif
USE_X11= yes
+
.endif # RANDREXT_BUILDLINK3_MK
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
diff --git a/x11/randrext/builtin.mk b/x11/randrext/builtin.mk
new file mode 100644
index 00000000000..af142fe125d
--- /dev/null
+++ b/x11/randrext/builtin.mk
@@ -0,0 +1,58 @@
+# $NetBSD: builtin.mk,v 1.1 2004/03/10 17:57:15 jlam Exp $
+
+_X11_EXTENSIONS_RANDR_H= ${X11BASE}/include/X11/extensions/randr.h
+
+.if !defined(IS_BUILTIN.randrext)
+IS_BUILTIN.randrext= no
+. if exists(${_X11_EXTENSIONS_RANDR_H})
+IS_BUILTIN.randrext= yes
+#
+# Create an appropriate package name for the built-in randr 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.
+#
+_RANDR_MAJOR!= \
+ ${AWK} '/\#define[ ]*RANDR_MAJOR/ { print $$3 }' \
+ ${_X11_EXTENSIONS_RANDR_H}
+_RANDR_MINOR!= \
+ ${AWK} '/\#define[ ]*RANDR_MINOR/ { print "."$$3 }' \
+ ${_X11_EXTENSIONS_RANDR_H}
+_RANDR_VERSION= ${_RANDR_MAJOR}${_RANDR_MINOR}
+BUILTIN_PKG.randrext= randrext-${_RANDR_VERSION}
+MAKEFLAGS+= BUILTIN_PKG.randrext=${BUILTIN_PKG.randrext}
+. endif
+MAKEFLAGS+= IS_BUILTIN.randrext=${IS_BUILTIN.randrext}
+.endif
+
+CHECK_BUILTIN.randrext?= no
+.if !empty(CHECK_BUILTIN.randrext:M[yY][eE][sS])
+USE_BUILTIN.randrext= yes
+.endif
+
+.if !defined(USE_BUILTIN.randrext)
+USE_BUILTIN.randrext?= ${IS_BUILTIN.randrext}
+
+. if defined(BUILTIN_PKG.randrext)
+USE_BUILTIN.randrext= yes
+. for _depend_ in ${BUILDLINK_DEPENDS.randrext}
+. if !empty(USE_BUILTIN.randrext:M[yY][eE][sS])
+USE_BUILTIN.randrext!= \
+ if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.randrext}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. endif
+. endfor
+. endif
+.endif # USE_BUILTIN.randrext
+
+.if !empty(USE_BUILTIN.randrext:M[nN][oO])
+BUILDLINK_DEPENDS.randrext+= randrext>=1.0
+.endif
+
+.if !empty(USE_BUILTIN.randrext:M[yY][eE][sS])
+BUILDLINK_PREFIX.randrext= ${X11BASE}
+USE_X11= yes
+.endif
diff --git a/x11/render/buildlink3.mk b/x11/render/buildlink3.mk
index 5ea88adf8ff..4698900316e 100644
--- a/x11/render/buildlink3.mk
+++ b/x11/render/buildlink3.mk
@@ -1,95 +1,22 @@
-# $NetBSD: buildlink3.mk,v 1.5 2004/02/18 16:35:27 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.6 2004/03/10 17:57:15 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
RENDER_BUILDLINK3_MK:= ${RENDER_BUILDLINK3_MK}+
-.include "../../mk/bsd.prefs.mk"
+.if !empty(BUILDLINK_DEPTH:M+)
+BUILDLINK_DEPENDS+= render
+.endif
+
+BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Nrender}
+BUILDLINK_PACKAGES+= render
.if !empty(RENDER_BUILDLINK3_MK:M+)
-BUILDLINK_PACKAGES+= render
BUILDLINK_DEPENDS.render+= render>=0.2
BUILDLINK_PKGSRCDIR.render?= ../../x11/render
BUILDLINK_DEPMETHOD.render?= build
-.endif # RENDER_BUILDLINK3_MK
-
-BUILDLINK_CHECK_BUILTIN.render?= NO
-
-_X11_EXTENSIONS_RENDER_H= ${X11BASE}/include/X11/extensions/render.h
-
-.if !defined(BUILDLINK_IS_BUILTIN.render)
-BUILDLINK_IS_BUILTIN.render= NO
-. if exists(${_X11_EXTENSIONS_RENDER_H})
-BUILDLINK_IS_BUILTIN.render= YES
-. if !empty(BUILDLINK_CHECK_BUILTIN.render:M[nN][oO])
-#
-# Create an appropriate package name for the built-in render 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.
-#
-_RENDER_MAJOR!= \
- ${AWK} '/\#define[ ]*RENDER_MAJOR/ { print $$3 }' \
- ${_X11_EXTENSIONS_RENDER_H}
-_RENDER_MINOR!= \
- ${AWK} '/\#define[ ]*RENDER_MINOR/ { print "."$$3 }' \
- ${_X11_EXTENSIONS_RENDER_H}
-_RENDER_VERSION= ${_RENDER_MAJOR}${_RENDER_MINOR}
-_RENDER_PKG= render-${_RENDER_VERSION}
-BUILDLINK_IS_BUILTIN.render?= YES
-. for _depend_ in ${BUILDLINK_DEPENDS.render}
-. if !empty(BUILDLINK_IS_BUILTIN.render:M[yY][eE][sS])
-BUILDLINK_IS_BUILTIN.render!= \
- if ${PKG_ADMIN} pmatch '${_depend_}' ${_RENDER_PKG}; then \
- ${ECHO} "YES"; \
- else \
- ${ECHO} "NO"; \
- fi
-. endif
-. endfor
-. endif
-. endif
-MAKEFLAGS+= BUILDLINK_IS_BUILTIN.render=${BUILDLINK_IS_BUILTIN.render}
-.endif
-
-.if !empty(BUILDLINK_CHECK_BUILTIN.render:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.render= YES
-.endif
-
-.if !defined(BUILDLINK_USE_BUILTIN.render)
-. if !empty(BUILDLINK_IS_BUILTIN.render:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.render= YES
-. else
-BUILDLINK_USE_BUILTIN.render= NO
-. endif
-
-. if !empty(PREFER_NATIVE:M[yY][eE][sS]) && \
- !empty(BUILDLINK_IS_BUILTIN.render:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.render= YES
-. endif
-. if !empty(PREFER_PKGSRC:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.render= NO
-. endif
-. if !empty(PREFER_NATIVE:Mrender) && \
- !empty(BUILDLINK_IS_BUILTIN.render:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.render= YES
-. endif
-. if !empty(PREFER_PKGSRC:Mrender)
-BUILDLINK_USE_BUILTIN.render= NO
-. endif
-.endif
-.if !empty(BUILDLINK_USE_BUILTIN.render:M[nN][oO])
-. if !empty(BUILDLINK_DEPTH:M+)
-BUILDLINK_DEPENDS+= render
-. endif
-.endif
-
-.if !empty(RENDER_BUILDLINK3_MK:M+)
-BUILDLINK_DEPENDS.render+= render>=0.8
-. if !empty(BUILDLINK_USE_BUILTIN.render:M[yY][eE][sS])
-BUILDLINK_PREFIX.render= ${X11BASE}
-. endif
USE_X11= yes
+
.endif # RENDER_BUILDLINK3_MK
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
diff --git a/x11/render/builtin.mk b/x11/render/builtin.mk
new file mode 100644
index 00000000000..61bf829dc13
--- /dev/null
+++ b/x11/render/builtin.mk
@@ -0,0 +1,58 @@
+# $NetBSD: builtin.mk,v 1.1 2004/03/10 17:57:15 jlam Exp $
+
+_X11_EXTENSIONS_RENDER_H= ${X11BASE}/include/X11/extensions/render.h
+
+.if !defined(IS_BUILTIN.render)
+IS_BUILTIN.render= no
+. if exists(${_X11_EXTENSIONS_RENDER_H})
+IS_BUILTIN.render= yes
+#
+# Create an appropriate package name for the built-in render 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.
+#
+_RENDER_MAJOR!= \
+ ${AWK} '/\#define[ ]*RENDER_MAJOR/ { print $$3 }' \
+ ${_X11_EXTENSIONS_RENDER_H}
+_RENDER_MINOR!= \
+ ${AWK} '/\#define[ ]*RENDER_MINOR/ { print "."$$3 }' \
+ ${_X11_EXTENSIONS_RENDER_H}
+_RENDER_VERSION= ${_RENDER_MAJOR}${_RENDER_MINOR}
+BUILTIN_PKG.render= render-${_RENDER_VERSION}
+MAKEFLAGS+= BUILTIN_PKG.render=${BUILTIN_PKG.render}
+. endif
+MAKEFLAGS+= IS_BUILTIN.render=${IS_BUILTIN.render}
+.endif
+
+CHECK_BUILTIN.render?= no
+.if !empty(CHECK_BUILTIN.render:M[yY][eE][sS])
+USE_BUILTIN.render= yes
+.endif
+
+.if !defined(USE_BUILTIN.render)
+USE_BUILTIN.render?= ${IS_BUILTIN.render}
+
+. if defined(BUILTIN_PKG.render)
+USE_BUILTIN.render= yes
+. for _depend_ in ${BUILDLINK_DEPENDS.render}
+. if !empty(USE_BUILTIN.render:M[yY][eE][sS])
+USE_BUILTIN.render!= \
+ if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.render}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. endif
+. endfor
+. endif
+.endif # USE_BUILTIN.render
+
+.if !empty(USE_BUILTIN.render:M[nN][oO])
+BUILDLINK_DEPENDS.render+= render>=0.8
+.endif
+
+.if !empty(USE_BUILTIN.render:M[yY][eE][sS])
+BUILDLINK_PREFIX.render= ${X11BASE}
+USE_X11= yes
+.endif
diff --git a/x11/xcursor/buildlink3.mk b/x11/xcursor/buildlink3.mk
index 308b3a7c7ba..aa7d3027cfd 100644
--- a/x11/xcursor/buildlink3.mk
+++ b/x11/xcursor/buildlink3.mk
@@ -1,110 +1,26 @@
-# $NetBSD: buildlink3.mk,v 1.11 2004/02/19 19:12:26 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.12 2004/03/10 17:57:15 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
XCURSOR_BUILDLINK3_MK:= ${XCURSOR_BUILDLINK3_MK}+
-.include "../../mk/bsd.prefs.mk"
+.if !empty(BUILDLINK_DEPTH:M+)
+BUILDLINK_DEPENDS+= xcursor
+.endif
+
+BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Nxcursor}
+BUILDLINK_PACKAGES+= xcursor
.if !empty(XCURSOR_BUILDLINK3_MK:M+)
-BUILDLINK_PACKAGES+= xcursor
BUILDLINK_DEPENDS.xcursor+= xcursor>=1.0
BUILDLINK_PKGSRCDIR.xcursor?= ../../x11/xcursor
-.endif # XCURSOR_BUILDLINK3_MK
-
-BUILDLINK_CHECK_BUILTIN.xcursor?= NO
-_X11_XCURSOR_XCURSOR_H= ${X11BASE}/include/X11/Xcursor/Xcursor.h
-
-.if !defined(BUILDLINK_IS_BUILTIN.xcursor)
-BUILDLINK_IS_BUILTIN.xcursor= NO
-. if exists(${_X11_XCURSOR_XCURSOR_H})
-BUILDLINK_IS_BUILTIN.xcursor= YES
-. if !empty(BUILDLINK_CHECK_BUILTIN.xcursor:M[nN][oO])
-#
-# Create an appropriate package name for the built-in Xcursor 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.
-#
-_XCURSOR_MAJOR!= \
- ${AWK} '/\#define[ ]*XCURSOR_MAJOR/ { print $$3 }' \
- ${_X11_XCURSOR_XCURSOR_H}
-_XCURSOR_MINOR!= \
- ${AWK} '/\#define[ ]*XCURSOR_MINOR/ { print "."$$3 }' \
- ${_X11_XCURSOR_XCURSOR_H}
-_XCURSOR_REVISION!= \
- ${AWK} '/\#define[ ]*XCURSOR_MINOR/ { print "."$$3 }' \
- ${_X11_XCURSOR_XCURSOR_H}
-_XCURSOR_VERSION= ${_XCURSOR_MAJOR}${_XCURSOR_MINOR}${_XCURSOR_REVISION}
-_XCURSOR_PKG= xcursor-${_XCURSOR_VERSION}
-
-BUILDLINK_IS_BUILTIN.xcursor?= YES
-. for _depend_ in ${BUILDLINK_DEPENDS.xcursor}
-. if !empty(BUILDLINK_IS_BUILTIN.xcursor:M[yY][eE][sS])
-BUILDLINK_IS_BUILTIN.xcursor!= \
- if ${PKG_ADMIN} pmatch '${_depend_}' ${_XCURSOR_PKG}; then \
- ${ECHO} "YES"; \
- else \
- ${ECHO} "NO"; \
- fi
-. endif
-. endfor
-. endif
-. endif
-MAKEFLAGS+= BUILDLINK_IS_BUILTIN.xcursor=${BUILDLINK_IS_BUILTIN.xcursor}
-.endif
-
-.if !empty(BUILDLINK_CHECK_BUILTIN.xcursor:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.xcursor= YES
-.endif
-
-.if !defined(BUILDLINK_USE_BUILTIN.xcursor)
-. if !empty(BUILDLINK_IS_BUILTIN.xcursor:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.xcursor= YES
-. else
-BUILDLINK_USE_BUILTIN.xcursor= NO
-. endif
+USE_X11= yes
-. if !empty(PREFER_NATIVE:M[yY][eE][sS]) && \
- !empty(BUILDLINK_IS_BUILTIN.xcursor:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.xcursor= YES
-. endif
-. if !empty(PREFER_PKGSRC:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.xcursor= NO
-. endif
-. if !empty(PREFER_NATIVE:Mxcursor) && \
- !empty(BUILDLINK_IS_BUILTIN.xcursor:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.xcursor= YES
-. endif
-. if !empty(PREFER_PKGSRC:Mxcursor)
-BUILDLINK_USE_BUILTIN.xcursor= NO
-. endif
-.endif
+# Xfixes/buildlink3.mk is included by xcursor/builtin.mk
+#.include "../../x11/Xfixes/buildlink3.mk"
-.if !empty(BUILDLINK_USE_BUILTIN.xcursor:M[nN][oO])
-BUILDLINK_DEPENDS.xcursor+= xcursor>=1.1.1
-BUILDLINK_DEPENDS.Xrender+= Xrender>=0.8
-. if !empty(BUILDLINK_DEPTH:M+)
-BUILDLINK_DEPENDS+= xcursor
-. endif
-.endif
+.include "../../x11/Xrender/buildlink3.mk"
-.if !empty(BUILDLINK_USE_BUILTIN.xcursor:M[yY][eE][sS])
-BUILDLINK_USE_BUILTIN.Xrender= yes
-.endif
-
-.if !empty(XCURSOR_BUILDLINK3_MK:M+)
-. if !empty(BUILDLINK_USE_BUILTIN.xcursor:M[yY][eE][sS])
-BUILDLINK_PREFIX.xcursor= ${X11BASE}
-BUILDLINK_FILES.xcursor+= lib/pkgconfig/xcursor.pc
-. endif
-USE_X11= yes
-. if !empty(BUILDLINK_CHECK_BUILTIN.xcursor:M[nN][oO])
-. if !empty(BUILDLINK_USE_BUILTIN.xcursor:M[nN][oO])
-. include "../../x11/Xfixes/buildlink3.mk"
-. endif
-. include "../../x11/Xrender/buildlink3.mk"
-. endif
.endif # XCURSOR_BUILDLINK3_MK
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
diff --git a/x11/xcursor/builtin.mk b/x11/xcursor/builtin.mk
new file mode 100644
index 00000000000..817c2d7c25b
--- /dev/null
+++ b/x11/xcursor/builtin.mk
@@ -0,0 +1,68 @@
+# $NetBSD: builtin.mk,v 1.1 2004/03/10 17:57:15 jlam Exp $
+
+_X11_XCURSOR_XCURSOR_H= ${X11BASE}/include/X11/Xcursor/Xcursor.h
+
+.if !defined(IS_BUILTIN.xcursor)
+IS_BUILTIN.xcursor= no
+. if exists(${_X11_XCURSOR_XCURSOR_H})
+IS_BUILTIN.xcursor= yes
+#
+# Create an appropriate package name for the built-in Xcursor 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.
+#
+_XCURSOR_MAJOR!= \
+ ${AWK} '/\#define[ ]*XCURSOR_MAJOR/ { print $$3 }' \
+ ${_X11_XCURSOR_XCURSOR_H}
+_XCURSOR_MINOR!= \
+ ${AWK} '/\#define[ ]*XCURSOR_MINOR/ { print "."$$3 }' \
+ ${_X11_XCURSOR_XCURSOR_H}
+_XCURSOR_REVISION!= \
+ ${AWK} '/\#define[ ]*XCURSOR_MINOR/ { print "."$$3 }' \
+ ${_X11_XCURSOR_XCURSOR_H}
+_XCURSOR_VERSION= ${_XCURSOR_MAJOR}${_XCURSOR_MINOR}${_XCURSOR_REVISION}
+BUILTIN_PKG.xcursor= xcursor-${_XCURSOR_VERSION}
+MAKEFLAGS+= BUILTIN_PKG.xcursor=${BUILTIN_PKG.xcursor}
+. endif
+MAKEFLAGS+= IS_BUILTIN.xcursor=${IS_BUILTIN.xcursor}
+.endif
+
+CHECK_BUILTIN.xcursor?= no
+.if !empty(CHECK_BUILTIN.xcursor:M[yY][eE][sS])
+USE_BUILTIN.xcursor= yes
+.endif
+
+.if !defined(USE_BUILTIN.xcursor)
+USE_BUILTIN.xcursor?= ${IS_BUILTIN.xcursor}
+
+. if defined(BUILTIN_PKG.xcursor)
+USE_BUILTIN.xcursor= yes
+. for _depend_ in ${BUILDLINK_DEPENDS.xcursor}
+. if !empty(USE_BUILTIN.xcursor:M[yY][eE][sS])
+USE_BUILTIN.xcursor!= \
+ if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.xcursor}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. endif
+. endfor
+. endif
+.endif # USE_BUILTIN.xcursor
+
+.if !empty(USE_BUILTIN.xcursor:M[nN][oO])
+BUILDLINK_DEPENDS.xcursor+= xcursor>=1.1.1
+BUILDLINK_DEPENDS.Xrender+= Xrender>=0.8
+. for _mkfile_ in buildlink3.mk builtin.mk
+. if exists(../../x11/Xfixes/${_mkfile_})
+. include "../../x11/Xfixes/${_mkfile_}"
+. endif
+. endfor
+.endif
+
+.if !empty(USE_BUILTIN.xcursor:M[yY][eE][sS])
+BUILDLINK_PREFIX.xcursor= ${X11BASE}
+BUILDLINK_FILES.xcursor+= lib/pkgconfig/xcursor.pc
+USE_BUILTIN.Xrender= yes
+.endif