From 2d1ba244e90207d03eef397a99aa4091baeec5b3 Mon Sep 17 00:00:00 2001 From: joerg Date: Fri, 20 Mar 2009 19:23:50 +0000 Subject: 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. --- pkgtools/createbuildlink/Makefile | 4 ++-- pkgtools/createbuildlink/files/createbuildlink | 27 +++++++------------------- 2 files changed, 9 insertions(+), 22 deletions(-) (limited to 'pkgtools/createbuildlink') 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 <