summaryrefslogtreecommitdiff
path: root/pkgtools/x11-links
diff options
context:
space:
mode:
authorjoerg <joerg>2009-03-20 19:23:50 +0000
committerjoerg <joerg>2009-03-20 19:23:50 +0000
commit405c61d80251d8e80401aed2264d4bede218cb22 (patch)
tree647e974495c5d41703d41ca2e71c9b6063b9153a /pkgtools/x11-links
parentf0f715d4dd4a290c5c6ae716c774f59caf5aa61c (diff)
downloadpkgsrc-405c61d80251d8e80401aed2264d4bede218cb22.tar.gz
Simply and speed up buildlink3.mk files and processing.
This changes the buildlink3.mk files to use an include guard for the recursive include. The use of BUILDLINK_DEPTH, BUILDLINK_DEPENDS, BUILDLINK_PACKAGES and BUILDLINK_ORDER is handled by a single new variable BUILDLINK_TREE. Each buildlink3.mk file adds a pair of enter/exit marker, which can be used to reconstruct the tree and to determine first level includes. Avoiding := for large variables (BUILDLINK_ORDER) speeds up parse time as += has linear complexity. The include guard reduces system time by avoiding reading files over and over again. For complex packages this reduces both %user and %sys time to half of the former time.
Diffstat (limited to 'pkgtools/x11-links')
-rw-r--r--pkgtools/x11-links/buildlink3.mk25
-rw-r--r--pkgtools/x11-links/xfree.mk6
-rw-r--r--pkgtools/x11-links/xorg.mk6
3 files changed, 15 insertions, 22 deletions
diff --git a/pkgtools/x11-links/buildlink3.mk b/pkgtools/x11-links/buildlink3.mk
index 4f2f17b866c..c53151c504c 100644
--- a/pkgtools/x11-links/buildlink3.mk
+++ b/pkgtools/x11-links/buildlink3.mk
@@ -1,23 +1,17 @@
-# $NetBSD: buildlink3.mk,v 1.20 2009/03/08 00:03:37 snj Exp $
+# $NetBSD: buildlink3.mk,v 1.21 2009/03/20 19:25:13 joerg Exp $
#
# Don't include this file manually! It will be included as necessary
# by bsd.buildlink3.mk.
-BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
-X11_LINKS_BUILDLINK3_MK:= ${X11_LINKS_BUILDLINK3_MK}+
+# x11-links is sorted first in mk/buildlink3/bsd.buildlink3.mk,
+# so that symlinks created from it can be overriden by other packages.
+#
-.if !empty(BUILDLINK_DEPTH:M+)
-BUILDLINK_DEPENDS+= x11-links
-.endif
+BUILDLINK_TREE+= x11-links
-# x11-links must come first so that packages listed later can overwrite
-# any symlinks created by buildlinking x11-links.
-#
-BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Nx11-links}
-BUILDLINK_PACKAGES:= x11-links ${BUILDLINK_PACKAGES}
-BUILDLINK_ORDER:= ${BUILDLINK_ORDER} ${BUILDLINK_DEPTH}x11-links
+.if !defined(X11_LINKS_BUILDLINK3_MK)
+X11_LINKS_BUILDLINK3_MK:=
-.if !empty(X11_LINKS_BUILDLINK3_MK:M+)
BUILDLINK_API_DEPENDS.x11-links+= x11-links>=0.43
BUILDLINK_PKGSRCDIR.x11-links?= ../../pkgtools/x11-links
BUILDLINK_DEPMETHOD.x11-links?= build
@@ -32,7 +26,6 @@ BUILDLINK_CONTENTS_FILTER.x11-links= \
# and ${BUILDLINK_X11_DIR}/lib.
#
BUILDLINK_FNAME_TRANSFORM.x11-links+= -e "s|/share/x11-links/|/|"
+.endif # X11_LINKS_BUILDLINK3_MK
-.endif # X11_LINKS_BUILDLINK3_MK
-
-BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
+BUILDLINK_TREE+= -x11-links
diff --git a/pkgtools/x11-links/xfree.mk b/pkgtools/x11-links/xfree.mk
index ce9ed5e1836..22588b347f5 100644
--- a/pkgtools/x11-links/xfree.mk
+++ b/pkgtools/x11-links/xfree.mk
@@ -1,4 +1,4 @@
-# $NetBSD: xfree.mk,v 1.15 2006/12/15 20:33:00 joerg Exp $
+# $NetBSD: xfree.mk,v 1.16 2009/03/20 19:25:13 joerg Exp $
FILES_LIST= ${FILESDIR}/xfree
@@ -18,14 +18,14 @@ FILES_LIST= ${FILESDIR}/xfree
# Check if any headers and libraries for ${X11_MODULES} found in
# ${X11BASE} actually belong to the base XFree86 or not.
#
-.for _pkg_ in ${BUILDLINK_PACKAGES:Nx11-links}
+.for _pkg_ in ${BUILDLINK_TREE:N-*:Nx11-links:O:u}
CHECK_BUILTIN.${_pkg_}:= yes
USE_BUILTIN.${_pkg_}= yes
. sinclude "${BUILDLINK_PKGSRCDIR.${_pkg_}}/builtin.mk"
CHECK_BUILTIN.${_pkg_}:= no
.endfor
-.for _pkg_ in ${BUILDLINK_PACKAGES:Nx11-links}
+.for _pkg_ in ${BUILDLINK_TREE:N-*:Nx11-links:O:u}
IGNORE_PKG.${_pkg_}= yes
. if (defined(IS_BUILTIN.${_pkg_}) && !empty(IS_BUILTIN.${_pkg_}:M[yY][eE][sS]) ) && \
exists(${FILESDIR}/xfree.${_pkg_})
diff --git a/pkgtools/x11-links/xorg.mk b/pkgtools/x11-links/xorg.mk
index 9600b1917a0..0606645bc6f 100644
--- a/pkgtools/x11-links/xorg.mk
+++ b/pkgtools/x11-links/xorg.mk
@@ -1,4 +1,4 @@
-# $NetBSD: xorg.mk,v 1.14 2008/12/04 04:16:41 cube Exp $
+# $NetBSD: xorg.mk,v 1.15 2009/03/20 19:25:13 joerg Exp $
#
# This is for X.org, but use "xfree" files also.
@@ -76,14 +76,14 @@ FILES_LIST= ${FILESDIR}/xorg
# ${X11BASE} actually belong to the base Xorg or not.
#
# XXX: maybe skip iconv and zlib too?
-.for _pkg_ in ${BUILDLINK_PACKAGES:Nx11-links}
+.for _pkg_ in ${BUILDLINK_TREE:N-*:Nx11-links:O:u}
CHECK_BUILTIN.${_pkg_}:= yes
USE_BUILTIN.${_pkg_}= yes
. sinclude "${BUILDLINK_PKGSRCDIR.${_pkg_}}/builtin.mk"
CHECK_BUILTIN.${_pkg_}:= no
.endfor
-.for _pkg_ in ${BUILDLINK_PACKAGES:Nx11-links}
+.for _pkg_ in ${BUILDLINK_TREE:N-*:Nx11-links:O:u}
IGNORE_PKG.${_pkg_}= yes
. if defined(IS_BUILTIN.${_pkg_}) && !empty(IS_BUILTIN.${_pkg_}:M[yY][eE][sS])
. if exists(${FILESDIR}/xorg.${_pkg_})