3 # Matthias Jahn jahn dôt matthias ât freenet dôt de 2007 (pmarat)
5 import os
, sys
, imp
, types
, ccroot
7 import Utils
, Configure
, Options
11 'win32': ['msvc', 'g++'],
14 'aix': ['xlc++', 'g++'],
15 'linux': ['g++', 'icpc', 'sunc++'],
16 'sunos': ['g++', 'sunc++'],
23 def __list_possible_compiler(platform
):
25 return cxx_compiler
[platform
]
27 return cxx_compiler
["default"]
30 try: test_for_compiler
= Options
.options
.check_cxx_compiler
31 except AttributeError: raise Configure
.ConfigurationError("Add set_options(opt): opt.tool_options('compiler_cxx')")
33 for compiler
in test_for_compiler
.split():
35 conf
.env
= orig
.copy()
36 conf
.check_tool(compiler
)
37 except Configure
.ConfigurationError
, e
:
38 debug('compiler_cxx: %r' % e
)
41 orig
.table
= conf
.env
.get_merged_dict()
43 conf
.check_message(compiler
, '', True)
44 conf
.env
['COMPILER_CXX'] = compiler
46 conf
.check_message(compiler
, '', False)
49 conf
.fatal('could not configure a cxx compiler!')
52 build_platform
= Utils
.unversioned_sys_platform()
53 possible_compiler_list
= __list_possible_compiler(build_platform
)
54 test_for_compiler
= ' '.join(possible_compiler_list
)
55 cxx_compiler_opts
= opt
.add_option_group('C++ Compiler Options')
56 cxx_compiler_opts
.add_option('--check-cxx-compiler', default
="%s" % test_for_compiler
,
57 help='On this platform (%s) the following C++ Compiler will be checked by default: "%s"' % (build_platform
, test_for_compiler
),
58 dest
="check_cxx_compiler")
60 for cxx_compiler
in test_for_compiler
.split():
61 opt
.tool_options('%s' % cxx_compiler
, option_group
=cxx_compiler_opts
)