diff options
| author | David Cournapeau <cournape@gmail.com> | 2008-09-03 08:31:30 (GMT) |
|---|---|---|
| committer | David Cournapeau <cournape@gmail.com> | 2008-09-03 08:31:30 (GMT) |
| commit | 8541ccdb15ed1ed1f0c9063277e6d20bd26224da (patch) | |
| tree | efa4fbfe652371b5586102ae859d0b42acb8c361 /src/engine | |
| parent | a180479aa2b533e29f09d62ec4c82f1913a714dd (diff) | |
| download | SCons-8541ccdb15ed1ed1f0c9063277e6d20bd26224da.zip SCons-8541ccdb15ed1ed1f0c9063277e6d20bd26224da.tar.gz SCons-8541ccdb15ed1ed1f0c9063277e6d20bd26224da.tar.bz2 | |
Add CheckSHCC and CheckSHCXX checkers (test fail).
Diffstat (limited to 'src/engine')
| -rw-r--r-- | src/engine/SCons/Conftest.py | 40 | ||||
| -rw-r--r-- | src/engine/SCons/SConf.py | 10 |
2 files changed, 50 insertions, 0 deletions
diff --git a/src/engine/SCons/Conftest.py b/src/engine/SCons/Conftest.py index de918b1..d9db957 100644 --- a/src/engine/SCons/Conftest.py +++ b/src/engine/SCons/Conftest.py @@ -162,6 +162,26 @@ int main() _YesNoResult(context, ret, None, text) return ret +def CheckSHCC(context): + """ + Configure check for a working shared C compiler. + + This checks whether the C compiler, as defined in the $SHCC construction + variable, can compile a C source file. It uses the current $SHCCCOM value + too, so that it can test against non working flags. + + """ + context.Display("Checking whether the (shared) C compiler works") + text = """ +int foo() +{ + return 0; +} +""" + ret = _check_empty_program(context, 'SHCC', text, 'C') + _YesNoResult(context, ret, None, text) + return ret + def CheckCXX(context): """ Configure check for a working CXX compiler. @@ -182,6 +202,26 @@ int main() _YesNoResult(context, ret, None, text) return ret +def CheckSHCXX(context): + """ + Configure check for a working shared CXX compiler. + + This checks whether the CXX compiler, as defined in the $SHCXX construction + variable, can compile a CXX source file. It uses the current $SHCXXCOM value + too, so that it can test against non working flags. + + """ + context.Display("Checking whether the (shared) C++ compiler works") + text = """ +int main() +{ + return 0; +} +""" + ret = _check_empty_program(context, 'SHCXX', text, 'C++') + _YesNoResult(context, ret, None, text) + return ret + def _check_empty_program(context, comp, text, language): """Return 0 on success, 1 otherwise.""" if not context.env.has_key(comp) or not context.env[comp]: diff --git a/src/engine/SCons/SConf.py b/src/engine/SCons/SConf.py index bee823b..7512816 100644 --- a/src/engine/SCons/SConf.py +++ b/src/engine/SCons/SConf.py @@ -403,6 +403,8 @@ class SConfBase: default_tests = { 'CheckCC' : CheckCC, 'CheckCXX' : CheckCXX, + 'CheckSHCC' : CheckSHCC, + 'CheckSHCXX' : CheckSHCXX, 'CheckFunc' : CheckFunc, 'CheckType' : CheckType, 'CheckTypeSize' : CheckTypeSize, @@ -932,6 +934,14 @@ def CheckCXX(context): res = SCons.Conftest.CheckCXX(context) return not res +def CheckSHCC(context): + res = SCons.Conftest.CheckSHCC(context) + return not res + +def CheckSHCXX(context): + res = SCons.Conftest.CheckSHCXX(context) + return not res + # Bram: Make this function obsolete? CheckHeader() is more generic. def CheckCHeader(context, header, include_quotes = '""'): |
