1#~ Copyright 2005 Rene Rivera.
2#~ Distributed under the Boost Software License, Version 1.0.
3#~ (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
4
5# Automatic configuration for CodeWarrior toolset. To use, just import this module.
6
7import os ;
8import toolset : using ;
9
10if [ os.name ] = NT
11{
12    for local R in 9 8 7
13    {
14        local cw-path = [ W32_GETREG
15            "HKEY_LOCAL_MACHINE\\SOFTWARE\\Metrowerks\\CodeWarrior\\Product Versions\\CodeWarrior for Windows R$(R)"
16            : "PATH" ] ;
17        local cw-version = [ W32_GETREG
18            "HKEY_LOCAL_MACHINE\\SOFTWARE\\Metrowerks\\CodeWarrior\\Product Versions\\CodeWarrior for Windows R$(R)"
19            : "VERSION" ] ;
20        cw-path ?= [ W32_GETREG
21            "HKEY_LOCAL_MACHINE\\SOFTWARE\\Metrowerks\\CodeWarrior for Windows\\$(R).0"
22            : "PATH" ] ;
23        cw-version ?= $(R).0 ;
24
25        if $(cw-path)
26        {
27            if --debug-configuration in [ modules.peek : ARGV ]
28            {
29                ECHO "notice:" using cw ":" $(cw-version) ":" "$(cw-path)\\Other Metrowerks Tools\\Command Line Tools\\mwcc.exe" ;
30            }
31            using cw : $(cw-version) : "$(cw-path)\\Other Metrowerks Tools\\Command Line Tools\\mwcc.exe" ;
32        }
33    }
34}
35