summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mk/wrapper/bsd.wrapper.mk4
-rw-r--r--mk/wrapper/logic9
2 files changed, 8 insertions, 5 deletions
diff --git a/mk/wrapper/bsd.wrapper.mk b/mk/wrapper/bsd.wrapper.mk
index 19b4074911d..71973ff9be7 100644
--- a/mk/wrapper/bsd.wrapper.mk
+++ b/mk/wrapper/bsd.wrapper.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.wrapper.mk,v 1.74 2007/11/28 13:18:50 rillig Exp $
+# $NetBSD: bsd.wrapper.mk,v 1.75 2007/11/28 14:45:22 rillig Exp $
#
# Copyright (c) 2005 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -615,7 +615,7 @@ ${_WRAP_BUILDCMD.${_wrappee_}}: ${WRAPPER_SRCDIR}/buildcmd
. if !target(${_WRAP_CACHE.${_wrappee_}})
${_WRAP_CACHE.${_wrappee_}}:
${RUN} ${MKDIR} ${.TARGET:H}
- ${RUN} echo "cachehit=no" > ${.TARGET}
+ ${RUN} echo "cache_lookup() { cachehit=no; }" > ${.TARGET}
. endif
. if !target(${_WRAP_CACHE_BODY.${_wrappee_}})
diff --git a/mk/wrapper/logic b/mk/wrapper/logic
index bbef4ff48da..208b8de9888 100644
--- a/mk/wrapper/logic
+++ b/mk/wrapper/logic
@@ -1,4 +1,4 @@
-# $NetBSD: logic,v 1.15 2007/09/13 10:50:43 rillig Exp $
+# $NetBSD: logic,v 1.16 2007/11/28 14:45:22 rillig Exp $
#
# Copyright (c) 2004 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -35,6 +35,7 @@
# POSSIBILITY OF SUCH DAMAGE.
# Empty out the argument buffer and fill up the command buffer.
+. $cache
skipargs=0
while ! queue_is_empty argbuf; do
#
@@ -79,7 +80,7 @@ while ! queue_is_empty argbuf; do
#
case $do_transform in
yes)
- . $cache
+ cache_lookup
case $cachehit in
yes)
# The cache was hit and $arg is set.
@@ -135,10 +136,12 @@ while ! queue_is_empty argbuf; do
$cat >> $cache_body << EOF
$cachearg) arg=$cachedarg; split_arg=$split_arg; cachehit=yes ;;
EOF
- { echo "case \$arg in"
+ { echo "cache_lookup() {"
+ echo "case \$arg in"
$cat $cache_body
echo "*) cachehit=no ;;"
echo "esac"
+ echo "}"
} > $cache-$$.tmp
$mv -f $cache-$$.tmp $cache
;;