diff options
author | joerg <joerg@pkgsrc.org> | 2009-03-20 19:23:50 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2009-03-20 19:23:50 +0000 |
commit | 2d1ba244e90207d03eef397a99aa4091baeec5b3 (patch) | |
tree | 647e974495c5d41703d41ca2e71c9b6063b9153a /pkgtools/createbuildlink | |
parent | 4bf0a20854ae9e07b7965977a713f2efee890976 (diff) | |
download | pkgsrc-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/createbuildlink')
-rw-r--r-- | pkgtools/createbuildlink/Makefile | 4 | ||||
-rwxr-xr-x | pkgtools/createbuildlink/files/createbuildlink | 27 |
2 files changed, 9 insertions, 22 deletions
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 |