summaryrefslogtreecommitdiffstats
path: root/SCons/Conftest.py
diff options
context:
space:
mode:
authorMats Wichmann <mats@linux.com>2023-01-27 15:00:28 (GMT)
committerMats Wichmann <mats@linux.com>2023-01-27 18:29:09 (GMT)
commit8aae133794ddeea09be2579d084ff87cd77b86f2 (patch)
treed56f17747c6b352d095c8a5701e9de63ee851b84 /SCons/Conftest.py
parent04bc3eaab31c5437764b10ee942b19740b5139c9 (diff)
downloadSCons-8aae133794ddeea09be2579d084ff87cd77b86f2.zip
SCons-8aae133794ddeea09be2579d084ff87cd77b86f2.tar.gz
SCons-8aae133794ddeea09be2579d084ff87cd77b86f2.tar.bz2
Add unique kwarg to CheckLibs
Minor tweak to CheckFunc - the dummy prototype should have a dummy arg list too (comment from Python setuptools discussion). Might as well fail the official way: #error instead of C syntax error. Fixes #2768 Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'SCons/Conftest.py')
-rw-r--r--SCons/Conftest.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/SCons/Conftest.py b/SCons/Conftest.py
index 83175cb..3c52ef4 100644
--- a/SCons/Conftest.py
+++ b/SCons/Conftest.py
@@ -267,7 +267,7 @@ def CheckFunc(context, function_name, header = None, language = None):
#ifdef __cplusplus
extern "C"
#endif
-char %s();""" % function_name
+char %s(void);""" % function_name
lang, suffix, msg = _lang2suffix(language)
if msg:
@@ -285,7 +285,7 @@ char %s();""" % function_name
int main(void) {
#if defined (__stub_%(name)s) || defined (__stub___%(name)s)
- fail fail fail
+ #error "%(name)s has a GNU stub, cannot check"
#else
%(name)s();
#endif
@@ -627,7 +627,7 @@ int main(void) {
def CheckLib(context, libs, func_name = None, header = None,
extra_libs = None, call = None, language = None, autoadd = 1,
- append = True):
+ append=True, unique=False):
"""
Configure check for a C or C++ libraries "libs". Searches through
the list of libraries, until one is found where the test succeeds.
@@ -713,9 +713,9 @@ return 0;
if extra_libs:
l.extend(extra_libs)
if append:
- oldLIBS = context.AppendLIBS(l)
+ oldLIBS = context.AppendLIBS(l, unique)
else:
- oldLIBS = context.PrependLIBS(l)
+ oldLIBS = context.PrependLIBS(l, unique)
sym = "HAVE_LIB" + lib_name
else:
oldLIBS = -1