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
"{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
#### 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
# 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"