From 022c4606fcc3bd0780b781561db11a457e1b2757 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. --- graphics/MesaLib/buildlink3.mk | 20 ++++++-------------- graphics/MesaLib/builtin.mk | 6 +----- 2 files changed, 7 insertions(+), 19 deletions(-) (limited to 'graphics/MesaLib') diff --git a/graphics/MesaLib/buildlink3.mk b/graphics/MesaLib/buildlink3.mk index 1044f72bbec..c1c23e96505 100644 --- a/graphics/MesaLib/buildlink3.mk +++ b/graphics/MesaLib/buildlink3.mk @@ -1,17 +1,10 @@ -# $NetBSD: buildlink3.mk,v 1.46 2008/05/15 19:46:47 tron Exp $ +# $NetBSD: buildlink3.mk,v 1.47 2009/03/20 19:24:36 joerg Exp $ -BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+ -MESALIB_BUILDLINK3_MK:= ${MESALIB_BUILDLINK3_MK}+ +BUILDLINK_TREE+= MesaLib -.if !empty(BUILDLINK_DEPTH:M+) -BUILDLINK_DEPENDS+= MesaLib -.endif - -BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:NMesaLib} -BUILDLINK_PACKAGES+= MesaLib -BUILDLINK_ORDER:= ${BUILDLINK_ORDER} ${BUILDLINK_DEPTH}MesaLib +.if !defined(MESALIB_BUILDLINK3_MK) +MESALIB_BUILDLINK3_MK:= -.if !empty(MESALIB_BUILDLINK3_MK:M+) BUILDLINK_API_DEPENDS.MesaLib+= MesaLib>=3.4.2 BUILDLINK_ABI_DEPENDS.MesaLib+= MesaLib>=7.0.3 BUILDLINK_PKGSRCDIR.MesaLib?= ../../graphics/MesaLib @@ -30,12 +23,11 @@ pkgbase:= MesaLib . include "../../graphics/MesaLib/dri.mk" .endif -.endif # MESALIB_BUILDLINK3_MK - .if !empty(MACHINE_PLATFORM:MNetBSD-[12].*) .include "../../devel/pthread-stublib/buildlink3.mk" .endif .include "../../x11/libXext/buildlink3.mk" +.endif # MESALIB_BUILDLINK3_MK -BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//} +BUILDLINK_TREE+= -MesaLib diff --git a/graphics/MesaLib/builtin.mk b/graphics/MesaLib/builtin.mk index f2a3808be25..59f7bb2d230 100644 --- a/graphics/MesaLib/builtin.mk +++ b/graphics/MesaLib/builtin.mk @@ -1,4 +1,4 @@ -# $NetBSD: builtin.mk,v 1.16 2009/02/03 08:35:13 obache Exp $ +# $NetBSD: builtin.mk,v 1.17 2009/03/20 19:24:36 joerg Exp $ BUILTIN_PKG:= MesaLib @@ -68,15 +68,11 @@ CHECK_BUILTIN.MesaLib?= no .if !empty(CHECK_BUILTIN.MesaLib:M[nN][oO]) . if !empty(USE_BUILTIN.MesaLib:M[nN][oO]) -BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+ . include "../../mk/pthread.buildlink3.mk" . include "../../mk/pthread.builtin.mk" -BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//} BUILTIN_PKG:= MesaLib . endif -BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+ . include "../../mk/x11.builtin.mk" -BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//} .endif # CHECK_BUILTIN.MesaLib -- cgit v1.2.3