Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r83790 - trunk/tools/build/v2/build
From: steven_at_[hidden]
Date: 2013-04-06 21:29:14


Author: steven_watanabe
Date: 2013-04-06 21:29:13 EDT (Sat, 06 Apr 2013)
New Revision: 83790
URL: http://svn.boost.org/trac/boost/changeset/83790

Log:
Add missing file
Added:
   trunk/tools/build/v2/build/config-cache.jam (contents, props changed)

Added: trunk/tools/build/v2/build/config-cache.jam
==============================================================================
--- (empty file)
+++ trunk/tools/build/v2/build/config-cache.jam 2013-04-06 21:29:13 EDT (Sat, 06 Apr 2013)
@@ -0,0 +1,63 @@
+# Copyright 2012 Steven Watanabe
+# Distributed under the Boost Software License, Version 1.0.
+# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
+
+import modules ;
+import errors ;
+import regex ;
+import path ;
+import project ;
+
+rule get ( name )
+{
+ return $(.vars.$(name)) ;
+}
+
+rule set ( name : value * )
+{
+ .all-vars += $(name) ;
+ .vars.$(name) = $(value) ;
+}
+
+rule save ( )
+{
+ if $(.cache-file)
+ {
+ local target = <new-cache-file>$(.cache-file) ;
+ local contents = "# Automatically generated by Boost.Build.\n# Do not edit.\n\nmodule config-cache {\n" ;
+ for local var in $(.all-vars)
+ {
+ local transformed ;
+ for local value in $(.vars.$(var))
+ {
+ transformed += [ regex.escape $(value) : \"\\ : \\ ] ;
+ }
+ local quoted = \"$(transformed)\" ;
+ contents += " set \"$(var)\" : $(quoted:J= ) ;\n" ;
+ }
+ contents += "}\n" ;
+ FILE_CONTENTS on $(target) = $(contents) ;
+ ALWAYS $(target) ;
+ config-cache.write $(target) ;
+ UPDATE_NOW $(target) : [ modules.peek configure : .log-fd ] : ignore-minus-n ;
+ }
+}
+
+actions write
+{
+ @($(STDOUT):E=$(FILE_CONTENTS:J=)) > "$(<)"
+}
+
+rule load ( cache-file )
+{
+ if $(.cache-file)
+ {
+ errors.error duplicate load of cache file ;
+ }
+ cache-file = $(cache-file) ;
+ if [ path.exists $(cache-file) ] && ! ( --reconfigure in [ modules.peek : ARGV ] )
+ {
+ include <old-cache-file>$(cache-file) ;
+ }
+ .cache-file = $(cache-file) ;
+}


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk