summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorjoerg <joerg@pkgsrc.org>2009-03-20 19:23:50 +0000
committerjoerg <joerg@pkgsrc.org>2009-03-20 19:23:50 +0000
commit2d1ba244e90207d03eef397a99aa4091baeec5b3 (patch)
tree647e974495c5d41703d41ca2e71c9b6063b9153a /pkgtools
parent4bf0a20854ae9e07b7965977a713f2efee890976 (diff)
downloadpkgsrc-2d1ba244e90207d03eef397a99aa4091baeec5b3.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')
-rw-r--r--pkgtools/compat_headers/buildlink3.mk19
-rw-r--r--pkgtools/createbuildlink/Makefile4
-rwxr-xr-xpkgtools/createbuildlink/files/createbuildlink27
-rw-r--r--pkgtools/packagekit/buildlink3.mk19
-rw-r--r--pkgtools/x11-links/buildlink3.mk25
-rw-r--r--pkgtools/x11-links/xfree.mk6
-rw-r--r--pkgtools/x11-links/xorg.mk6
7 files changed, 36 insertions, 70 deletions
diff --git a/pkgtools/compat_headers/buildlink3.mk b/pkgtools/compat_headers/buildlink3.mk
index c9a401d8335..623c71141f1 100644
--- a/pkgtools/compat_headers/buildlink3.mk
+++ b/pkgtools/compat_headers/buildlink3.mk
@@ -1,20 +1,13 @@
-# $NetBSD: buildlink3.mk,v 1.2 2008/05/25 17:38:37 tnn Exp $
+# $NetBSD: buildlink3.mk,v 1.3 2009/03/20 19:25:13 joerg Exp $
-BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
-COMPAT_HEADERS_BUILDLINK3_MK:= ${COMPAT_HEADERS_BUILDLINK3_MK}+
+BUILDLINK_TREE+= compat_headers
-.if !empty(BUILDLINK_DEPTH:M+)
-BUILDLINK_DEPENDS+= compat_headers
-.endif
+.if !defined(COMPAT_HEADERS_BUILDLINK3_MK)
+COMPAT_HEADERS_BUILDLINK3_MK:=
-BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Ncompat_headers}
-BUILDLINK_PACKAGES+= compat_headers
-BUILDLINK_ORDER:= ${BUILDLINK_ORDER} ${BUILDLINK_DEPTH}compat_headers
-
-.if !empty(COMPAT_HEADERS_BUILDLINK3_MK:M+)
BUILDLINK_API_DEPENDS.compat_headers+= compat_headers>=0.2
BUILDLINK_PKGSRCDIR.compat_headers?= ../../pkgtools/compat_headers
BUILDLINK_DEPMETHOD.compat_headers?= build
-.endif # COMPAT_HEADERS_BUILDLINK3_MK
+.endif # COMPAT_HEADERS_BUILDLINK3_MK
-BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
+BUILDLINK_TREE+= -compat_headers
diff --git a/pkgtools/createbuildlink/Makefile b/pkgtools/createbuildlink/Makefile
index 1014f49bcb7..3d6cd597b05 100644
--- a/pkgtools/createbuildlink/Makefile
+++ b/pkgtools/createbuildlink/Makefile
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.44 2007/06/30 12:58:59 tnn Exp $
+# $NetBSD: Makefile,v 1.45 2009/03/20 19:25:13 joerg Exp $
-DISTNAME= createbuildlink-3.13
+DISTNAME= createbuildlink-3.14
CATEGORIES= pkgtools sysutils
MASTER_SITES= # Nothing
DISTFILES= # Nothing
diff --git a/pkgtools/createbuildlink/files/createbuildlink b/pkgtools/createbuildlink/files/createbuildlink
index abcd10015d8..0a6208fa9ea 100755
--- a/pkgtools/createbuildlink/files/createbuildlink
+++ b/pkgtools/createbuildlink/files/createbuildlink
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $NetBSD: createbuildlink,v 1.33 2007/07/10 15:27:57 joerg Exp $
+# $NetBSD: createbuildlink,v 1.34 2009/03/20 19:25:13 joerg Exp $
#
# Copyright (c) 2002 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -39,7 +39,7 @@
# Create an initial buildlink3.mk from a package's Makefile and PLIST
#
-REV=`echo '$Revision: 1.33 $' | sed 's/\\$//g'`
+REV=`echo '$Revision: 1.34 $' | sed 's/\\$//g'`
tmpdir=/tmp
spacesintab=8
makefile=Makefile
@@ -138,21 +138,11 @@ for i in 1 2 3; do
done
sed -f $sedrules <<EOF
-BUILDLINK_DEPTH:=${gap}\${BUILDLINK_DEPTH}+
-${PKGUPPER}_BUILDLINK3_MK:= \${${PKGUPPER}_BUILDLINK3_MK}+
-EOF
-
-sed -f $sedrules <<EOF
+BUILDLINK_TREE+= $PKGNOVER
-.if \${BUILDLINK_DEPTH} == "+"
-BUILDLINK_DEPENDS+= ${PKGNOVER}
-.endif
+.if !defined(${PKGUPPER}_BUILDLINK3_MK)
+${PKGUPPER}_BUILDLINK3_MK:=
-BUILDLINK_PACKAGES:= \${BUILDLINK_PACKAGES:N${PKGNOVER}}
-BUILDLINK_PACKAGES+= $PKGNOVER
-BUILDLINK_ORDER:= \${BUILDLINK_ORDER} \${BUILDLINK_DEPTH}$PKGNOVER
-
-.if \${${PKGUPPER}_BUILDLINK3_MK} == "+"
EOF
sed -f $sedrules <<EOF
@@ -169,10 +159,6 @@ if [ $CREATEPLSUBST = "true" ]; then
echo ""
fi
-sed -f $sedrules <<EOF
-.endif # ${PKGUPPER}_BUILDLINK3_MK
-EOF
-
##
## buildlinked dependencies
##
@@ -192,8 +178,9 @@ for i in $makefile $commons ; do
done
sed -f $sedrules <<EOF
+.endif # ${PKGUPPER}_BUILDLINK3_MK
-BUILDLINK_DEPTH:=${gap}\${BUILDLINK_DEPTH:S/+\$//}
+BUILDLINK_TREE+= -$PKGNOVER
EOF
rm -f $sedrules
diff --git a/pkgtools/packagekit/buildlink3.mk b/pkgtools/packagekit/buildlink3.mk
index 651abc90d3b..63ae2b2ae68 100644
--- a/pkgtools/packagekit/buildlink3.mk
+++ b/pkgtools/packagekit/buildlink3.mk
@@ -1,24 +1,17 @@
-# $NetBSD: buildlink3.mk,v 1.1.1.1 2009/01/08 00:21:00 jmcneill Exp $
+# $NetBSD: buildlink3.mk,v 1.2 2009/03/20 19:25:13 joerg Exp $
-BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
-PACKAGEKIT_BUILDLINK3_MK:= ${PACKAGEKIT_BUILDLINK3_MK}+
+BUILDLINK_TREE+= packagekit
-.if ${BUILDLINK_DEPTH} == "+"
-BUILDLINK_DEPENDS+= packagekit
-.endif
+.if !defined(PACKAGEKIT_BUILDLINK3_MK)
+PACKAGEKIT_BUILDLINK3_MK:=
-BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Npackagekit}
-BUILDLINK_PACKAGES+= packagekit
-BUILDLINK_ORDER:= ${BUILDLINK_ORDER} ${BUILDLINK_DEPTH}packagekit
-
-.if ${PACKAGEKIT_BUILDLINK3_MK} == "+"
BUILDLINK_API_DEPENDS.packagekit+= packagekit>=0.4.0
BUILDLINK_PKGSRCDIR.packagekit?= ../../pkgtools/packagekit
-.endif # PACKAGEKIT_BUILDLINK3_MK
.include "../../databases/sqlite3/buildlink3.mk"
.include "../../devel/glib2/buildlink3.mk"
.include "../../sysutils/dbus/buildlink3.mk"
.include "../../sysutils/dbus-glib/buildlink3.mk"
+.endif # PACKAGEKIT_BUILDLINK3_MK
-BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
+BUILDLINK_TREE+= -packagekit
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_})