summaryrefslogtreecommitdiff
path: root/jam-files/boost-build/util/option.jam
diff options
context:
space:
mode:
authorAvneesh Saluja <asaluja@gmail.com>2013-03-28 18:28:16 -0700
committerAvneesh Saluja <asaluja@gmail.com>2013-03-28 18:28:16 -0700
commit5b8253e0e1f1393a509fb9975ba8c1347af758ed (patch)
tree1790470b1d07a0b4973ebce19192e896566ea60b /jam-files/boost-build/util/option.jam
parent2389a5a8a43dda87c355579838559515b0428421 (diff)
parentb203f8c5dc8cff1b9c9c2073832b248fcad0765a (diff)
fixed conflicts
Diffstat (limited to 'jam-files/boost-build/util/option.jam')
-rw-r--r--jam-files/boost-build/util/option.jam109
1 files changed, 0 insertions, 109 deletions
diff --git a/jam-files/boost-build/util/option.jam b/jam-files/boost-build/util/option.jam
deleted file mode 100644
index f6dc3752..00000000
--- a/jam-files/boost-build/util/option.jam
+++ /dev/null
@@ -1,109 +0,0 @@
-# Copyright (c) 2005 Vladimir Prus.
-#
-# Use, modification and distribution is subject to 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 ;
-
-# Set a value for a named option, to be used when not overridden on the command
-# line.
-rule set ( name : value ? )
-{
- .option.$(name) = $(value) ;
-}
-
-rule get ( name : default-value ? : implied-value ? )
-{
- local m = [ MATCH --$(name)=(.*) : [ modules.peek : ARGV ] ] ;
- if $(m)
- {
- return $(m[1]) ;
- }
- else
- {
- m = [ MATCH (--$(name)) : [ modules.peek : ARGV ] ] ;
- if $(m) && $(implied-value)
- {
- return $(implied-value) ;
- }
- else if $(.option.$(name))
- {
- return $(.option.$(name)) ;
- }
- else
- {
- return $(default-value) ;
- }
- }
-}
-
-
-# Check command-line args as soon as possible. For each option try to load
-# module named after option. Is that succeeds, invoke 'process' rule in the
-# module. The rule may return "true" to indicate that the regular build process
-# should not be attempted.
-#
-# Options take the general form of: --<name>[=<value>] [<value>]
-#
-rule process ( )
-{
- local ARGV = [ modules.peek : ARGV ] ;
- local BOOST_BUILD_PATH = [ modules.peek : BOOST_BUILD_PATH ] ;
-
- local dont-build ;
- local args = $(ARGV) ;
- while $(args)
- {
- local arg = [ MATCH ^--(.*) : $(args[1]) ] ;
- while $(args[2-]) && ! $(arg)
- {
- args = $(args[2-]) ;
- arg = [ MATCH ^--(.*) : $(args[1]) ] ;
- }
- args = $(args[2-]) ;
-
- if $(arg)
- {
- local split = [ MATCH ^(([^-=]+)[^=]*)(=?)(.*)$ : $(arg) ] ;
- local full-name = $(split[1]) ;
- local prefix = $(split[2]) ;
- local values ;
-
- if $(split[3])
- {
- values = $(split[4]) ;
- }
- if $(args) && ! [ MATCH ^(--).* : $(args[1]) ]
- {
- values += $(args[1]) ;
- args = $(args[2-]) ;
- }
-
- # Jook in options subdirectories of BOOST_BUILD_PATH for modules
- # matching the full option name and then its prefix.
- local plugin-dir = options ;
- local option-files = [ GLOB $(plugin-dir:D=$(BOOST_BUILD_PATH)) :
- $(full-name).jam $(prefix).jam ] ;
-
- if $(option-files)
- {
- # Load the file into a module named for the option.
- local f = $(option-files[1]) ;
- local module-name = --$(f:D=:S=) ;
- modules.load $(module-name) : $(f:D=) : $(f:D) ;
-
- # If there is a process rule, call it with the full option name
- # and its value (if any). If there was no "=" in the option, the
- # value will be empty.
- if process in [ RULENAMES $(module-name) ]
- {
- dont-build += [ modules.call-in $(module-name) : process
- --$(full-name) : $(values) ] ;
- }
- }
- }
- }
-
- return $(dont-build) ;
-}