f --gc in $(ARGV)
{
    --boehm-gc = true ;
}
if $(--boehm-gc)
{
    --extra-include += [ .path [ PWD ] "boehm_gc" "include" ] ;
}

# Duma?
if --duma in $(ARGV)
{
    --duma = true ;
}
if $(--duma)
{
    --extra-include += [ .path [ PWD ] "duma" ] ;
}

# An explicit root for the toolset? (trim spaces)
toolset-root = [ MATCH --toolset-root=(.*) : $(ARGV) ] ;
{
    local t = [ MATCH "[ ]*(.*)" : $(toolset-root:J=" ") ] ;
    toolset-root = ;
    while $(t)
    {
        t = [ MATCH "([^ ]+)([ ]*)(.*)" : $(t) ] ;
        toolset-root += $(t[1]) ;
        if $(t[3]) { toolset-root += $(t[2]) ; }
        t = $(t[3]) ;
    }
    toolset-root = $(toolset-root:J="") ;
}

# Configure the implemented toolsets. These are minimal commands and options to
# compile the full Jam. When adding new toolsets make sure to add them to the
# "known" list also.

rule toolset ( name command .type ? : opt.out + : opt.define * : flags * : linklibs * )
{
    .type ?= "" ;
    tool.$(name)$(.type).cc ?= $(command) ;
    tool.$(name)$(.type).opt.out ?= $(opt.out) ;
    tool.$(name)$(.type).opt.define ?= $(opt.define) ;
    tool.$(name)$(.type).flags ?= $(flags) ;
    tool.$(name)$(.type).linklibs ?= $(linklibs) ;
    if ! $(name) in $(toolsets) { toolsets += $(name) ; }
}

rule if-os ( os + : yes-opt * : no-opt * )
    { if $(os) in $(OS) { return $(yes-opt) ; } else { return $(no-opt) ; } }

rule opt ( type : yes-opt * : no-opt * )
    { if $(type) in $(ARGV) { return $(yes-opt) ; } else { return $(no-opt) ; } }

## HP-UX aCC compiler
toolset acc cc : "-o " : -D
    : -Ae
    [ opt --release : -s -O3 ]
    [ opt --debug : -g -pg ]
    -I$(--python-include) -I$(--extra-include)
    : -L$(--python-lib[1]) -l$(--python-lib[2]) ;
## Borland C++ 5.5.x
toolset borland bcc32 : -e -n : /D
    : -WC -w- -q "-I$(toolset-root)Include" "-L$(toolset-root)Lib"
    [ opt --release : -O2 -vi -w-inl ]
    [ opt --debug : -v -Od -vi- ]
    -I$(--python-include) -I$(--extra-include)
    : $(--python-lib[1]) ;
## Generic Unix cc
if ! $(CC) { CC = cc ; }
toolse