diff options
| author | William Deegan <bill@baddogconsulting.com> | 2015-09-29 17:04:02 (GMT) |
|---|---|---|
| committer | William Deegan <bill@baddogconsulting.com> | 2015-09-29 17:04:02 (GMT) |
| commit | 22de916b1766151a0e1d2b598eec19b00607cd9a (patch) | |
| tree | 6ed95a9bb7b6256864a971d90c8f099fba0f010b /src | |
| parent | 739878908fb7b8ffae09804369069ee33056dec5 (diff) | |
| parent | 72d8407c28fc02cb986fa561c793e1b202e53867 (diff) | |
| download | SCons-22de916b1766151a0e1d2b598eec19b00607cd9a.zip SCons-22de916b1766151a0e1d2b598eec19b00607cd9a.tar.gz SCons-22de916b1766151a0e1d2b598eec19b00607cd9a.tar.bz2 | |
Merged in carandraug/scons (pull request #248)
Diffstat (limited to 'src')
| -rw-r--r-- | src/CHANGES.txt | 17 | ||||
| -rw-r--r-- | src/engine/SCons/Conftest.py | 16 | ||||
| -rw-r--r-- | src/engine/SCons/SConf.py | 9 | ||||
| -rw-r--r-- | src/engine/SCons/SConfTests.py | 18 |
4 files changed, 54 insertions, 6 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt index bafd0d1..47a3f97 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -6,13 +6,21 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER - From Florian Miedniak: - - Fixed tigris issue #3011: Glob() excludes didn't work when used with VariantDir(duplicate=0) + From Dirk Baechle: + - Fixed license of SVG titlepage files in the context of Debian + packaging, such that they allow for commercial use too (#2985). From William Blevins: - InstallVersionedLib now available in the DefaultEnvironment context. - Improves orthogonality of use cases between different Install functions. - + + From Carnë Draug: + - Added new configure check, CheckProg, to check for + existence of a program. + + From Florian Miedniak: + - Fixed tigris issue #3011: Glob() excludes didn't work when used with VariantDir(duplicate=0) + From William Roberts: - Fix bug 2831 and allow Help() text to be appended to AddOption() help. @@ -43,9 +51,6 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER - Library versioning is currently implemented for the following linker tools: 'cyglink', 'gnulink', 'sunlink'. - From Dirk Baechle: - - Fixed license of SVG titlepage files in the context of Debian - packaging, such that they allow for commercial use too (#2985). RELEASE 2.4.0 - Mon, 21 Sep 2015 08:56:00 -0700 diff --git a/src/engine/SCons/Conftest.py b/src/engine/SCons/Conftest.py index e9702ff..87a3022 100644 --- a/src/engine/SCons/Conftest.py +++ b/src/engine/SCons/Conftest.py @@ -684,6 +684,22 @@ return 0; return ret +def CheckProg(context, prog_name): + """ + Configure check for a specific program. + + Check whether program prog_name exists in path. If it is found, + returns the path for it, otherwise returns None. + """ + context.Display("Checking whether %s program exists..." % prog_name) + path = context.env.WhereIs(prog_name) + if path: + context.Display(path + "\n") + else: + context.Display("no\n") + return path + + # # END OF PUBLIC FUNCTIONS # diff --git a/src/engine/SCons/SConf.py b/src/engine/SCons/SConf.py index 8bce8ce..987b8ea 100644 --- a/src/engine/SCons/SConf.py +++ b/src/engine/SCons/SConf.py @@ -444,6 +444,7 @@ class SConfBase(object): 'CheckCXXHeader' : CheckCXXHeader, 'CheckLib' : CheckLib, 'CheckLibWithHeader' : CheckLibWithHeader, + 'CheckProg' : CheckProg, } self.AddTests(default_tests) self.AddTests(custom_tests) @@ -1047,6 +1048,14 @@ def CheckLibWithHeader(context, libs, header, language, context.did_show_result = 1 return not res +def CheckProg(context, prog_name): + """Simple check if a program exists in the path. Returns the path + for the application, or None if not found. + """ + res = SCons.Conftest.CheckProg(context, prog_name) + context.did_show_result = 1 + return res + # Local Variables: # tab-width:4 # indent-tabs-mode:nil diff --git a/src/engine/SCons/SConfTests.py b/src/engine/SCons/SConfTests.py index 233ee78..57a9d04 100644 --- a/src/engine/SCons/SConfTests.py +++ b/src/engine/SCons/SConfTests.py @@ -611,6 +611,24 @@ int main() { finally: sconf.Finish() + def test_CheckProg(self): + """Test SConf.CheckProg() + """ + self._resetSConfState() + sconf = self.SConf.SConf(self.scons_env, + conf_dir=self.test.workpath('config.tests'), + log_file=self.test.workpath('config.log')) + + try: + r = sconf.CheckProg('sh') + assert r, "/bin/sh" + r = sconf.CheckProg('hopefully-not-a-program') + assert r is None + + finally: + sconf.Finish() + + def test_Define(self): """Test SConf.Define() """ |
