pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk *.makevars.mk doesn't exist until after ${WRKDIR} i...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/ca4c52f53943
branches:  trunk
changeset: 495005:ca4c52f53943
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Wed Jun 01 17:27:22 2005 +0000

description:
*.makevars.mk doesn't exist until after ${WRKDIR} is created, which
doesn't happen until after the package is extracted.  Prior to
extraction, cache the variables named in MAKEVARS using MAKEFLAGS
instead.  This avoids invoking each expensive computation up to four
times before it gets cached.  For packages that include lots of
buildlink3.mk files, this saves a lot of CPU time.

diffstat:

 mk/bsd.pkg.mk |  15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diffs (29 lines):

diff -r ee7e4fecfa0a -r ca4c52f53943 mk/bsd.pkg.mk
--- a/mk/bsd.pkg.mk     Wed Jun 01 17:05:19 2005 +0000
+++ b/mk/bsd.pkg.mk     Wed Jun 01 17:27:22 2005 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.pkg.mk,v 1.1683 2005/06/01 17:05:19 jlam Exp $
+#      $NetBSD: bsd.pkg.mk,v 1.1684 2005/06/01 17:27:22 jlam Exp $
 #
 # This file is in the public domain.
 #
@@ -4836,6 +4836,19 @@
 .endfor
 .undef _phase_
 
+# *.makevars.mk doesn't exist until after ${WRKDIR} is created, which
+# doesn't happen until after the package is extracted.  Prior to
+# extraction, cache the variables named in MAKEVARS using MAKEFLAGS
+# instead.
+#
+.if !exists(${EXTRACT_COOKIE})
+.  for _var_ in ${MAKEVARS:O:u}
+.    if defined(${_var_})
+MAKEFLAGS+=    ${_var_}=${${_var_}:Q}
+.    endif
+.  endfor
+.endif
+
 # show-tools emits a /bin/sh shell script that defines all known tools
 # to the values they have in the pkgsrc infrastructure.
 #



Home | Main Index | Thread Index | Old Index