diff options
author | Steven Knight <knight@baldmt.com> | 2004-09-17 14:13:57 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2004-09-17 14:13:57 (GMT) |
commit | 797e94a2484a11a771fb537619bdc011bf94bf2d (patch) | |
tree | 3392ab4df5bb1d830751fdca495f7d5619e1d485 | |
parent | 844d789e8312b2ba38acc000e958f722077393a9 (diff) | |
download | SCons-797e94a2484a11a771fb537619bdc011bf94bf2d.zip SCons-797e94a2484a11a771fb537619bdc011bf94bf2d.tar.gz SCons-797e94a2484a11a771fb537619bdc011bf94bf2d.tar.bz2 |
Fix inconsistency in conf.CheckFunc().
-rw-r--r-- | doc/man/scons.1 | 17 | ||||
-rw-r--r-- | src/CHANGES.txt | 4 | ||||
-rw-r--r-- | src/engine/SCons/SConf.py | 4 | ||||
-rw-r--r-- | src/engine/SCons/SConfTests.py | 2 |
4 files changed, 24 insertions, 3 deletions
diff --git a/doc/man/scons.1 b/doc/man/scons.1 index 217c01f..d4f2103 100644 --- a/doc/man/scons.1 +++ b/doc/man/scons.1 @@ -6629,12 +6629,27 @@ to \N'34'). Returns 1 on success and 0 on failure. .TP -.RI Configure.CheckFunc( self ", " function_name ", [" language ]) +.RI Configure.CheckFunc( self ", " function_name ", [" header ", " language ]) Checks if the specified C or C++ function is available. .I function_name is the name of the function to check for. The optional +.I header +argument is a string +that will be +placed at the top +of the test file +that will be compiled +to check if the function exists; +the default is: +.ES +#ifdef __cplusplus +extern "C" +#endif +char function_name(); +.EE +The optional .I language argument should be .B C diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 6ee412c..b035acb 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -49,6 +49,10 @@ RELEASE 0.97 - XXX "{building,cleaning} terminated because of errors" to "done {building,cleaning} targets (errors occurred during {build,clean})." + - Allow Configure.CheckFunc() to take an optional header argument + (already supported by Conftest.py) to specify text at the top of + the compiled test file. + From Elliot Murphy: - Enhance the tests to guarantee persistence of ListOption diff --git a/src/engine/SCons/SConf.py b/src/engine/SCons/SConf.py index 4d6c831..76df30a 100644 --- a/src/engine/SCons/SConf.py +++ b/src/engine/SCons/SConf.py @@ -768,8 +768,8 @@ class CheckContext: #### End of stuff used by Conftest.py. -def CheckFunc(context, function_name, language = None): - res = SCons.Conftest.CheckFunc(context, function_name, language = language) +def CheckFunc(context, function_name, header = None, language = None): + res = SCons.Conftest.CheckFunc(context, function_name, header = header, language = language) context.did_show_result = 1 return not res diff --git a/src/engine/SCons/SConfTests.py b/src/engine/SCons/SConfTests.py index 1f6e65c..b704f62 100644 --- a/src/engine/SCons/SConfTests.py +++ b/src/engine/SCons/SConfTests.py @@ -475,6 +475,8 @@ int main() { # CheckFunc() r = sconf.CheckFunc('strcpy') assert r, "did not find strcpy" + r = sconf.CheckFunc('strcpy', '/* header */ char strcpy();') + assert r, "did not find strcpy" r = sconf.CheckFunc('hopefullynofunction') assert not r, "unexpectedly found hopefullynofunction" |