summaryrefslogtreecommitdiff
path: root/lang/ruby
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 /lang/ruby
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 'lang/ruby')
-rw-r--r--lang/ruby/buildlink3.mk21
1 files changed, 6 insertions, 15 deletions
diff --git a/lang/ruby/buildlink3.mk b/lang/ruby/buildlink3.mk
index 1a11fd04caf..c9426dc097f 100644
--- a/lang/ruby/buildlink3.mk
+++ b/lang/ruby/buildlink3.mk
@@ -1,21 +1,13 @@
-# $NetBSD: buildlink3.mk,v 1.9 2006/07/08 23:10:56 jlam Exp $
-
-BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
-RUBY_BUILDLINK3_MK:= ${RUBY_BUILDLINK3_MK}+
+# $NetBSD: buildlink3.mk,v 1.10 2009/03/20 19:24:52 joerg Exp $
.if !defined(_RUBYVERSION_MK)
.include "../../lang/ruby/rubyversion.mk"
.endif
-.if !empty(BUILDLINK_DEPTH:M+)
-BUILDLINK_DEPENDS+= ${RUBY_BASE}
-.endif
-
-BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:N${RUBY_BASE}}
-BUILDLINK_PACKAGES+= ${RUBY_BASE}
-BUILDLINK_ORDER:= ${BUILDLINK_ORDER} ${BUILDLINK_DEPTH}${RUBY_BASE}
+BUILDLINK_TREE+= ${RUBY_BASE}
-.if !empty(RUBY_BUILDLINK3_MK:M+)
+.if !defined(RUBY_BUILDLINK3_MK)
+RUBY_BUILDLINK3_MK:=
BUILDLINK_API_DEPENDS.${RUBY_BASE}?= ${RUBY_BASE}>=${RUBY_REQD}
BUILDLINK_ABI_DEPENDS.${RUBY_BASE}?= ${RUBY_BASE}>=${RUBY_VERSION}
@@ -31,7 +23,6 @@ buildlink-bin-ruby:
if ${TEST} -f $$f; then \
${LN} -s $$f ${BUILDLINK_DIR}/bin/ruby; \
fi
+.endif # RUBY_BUILDLINK3_MK
-.endif # RUBY_BUILDLINK3_MK
-
-BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
+BUILDLINK_TREE+= -${RUBY_BASE}