summaryrefslogtreecommitdiff
path: root/buildtools/wafsamba/samba_autoconf.py
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-03-30 12:47:54 +1100
committerAndrew Tridgell <tridge@samba.org>2010-04-06 20:27:17 +1000
commit7da57cc94b8e6ddfac1b9e1f35956667ebee2abc (patch)
treeb1e374d2ace6d7f7b34f912594df35a12d1318e9 /buildtools/wafsamba/samba_autoconf.py
parent9da89b4dda291ff2f42fa2e63cf84034c3a6f824 (diff)
downloadsamba-7da57cc94b8e6ddfac1b9e1f35956667ebee2abc.tar.gz
samba-7da57cc94b8e6ddfac1b9e1f35956667ebee2abc.tar.bz2
samba-7da57cc94b8e6ddfac1b9e1f35956667ebee2abc.zip
build: tweak the strategy for finding functions
Based on a problem with res_ndestroy() on sunx in the build farm, I've changed the default strategy for finding functions with CHECK_FUNC(). It now accepts either a macro of a linked function, but won't accept a declaration only unless you set link=False.
Diffstat (limited to 'buildtools/wafsamba/samba_autoconf.py')
-rw-r--r--buildtools/wafsamba/samba_autoconf.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py
index 539564b0dc..c7c04f6364 100644
--- a/buildtools/wafsamba/samba_autoconf.py
+++ b/buildtools/wafsamba/samba_autoconf.py
@@ -187,7 +187,7 @@ def CHECK_DECLS(conf, vars, reverse=False, headers=None):
return ret
-def CHECK_FUNC(conf, f, link=None, lib=None, headers=None):
+def CHECK_FUNC(conf, f, link=True, lib=None, headers=None):
'''check for a function'''
define='HAVE_%s' % f.upper()
@@ -206,7 +206,12 @@ def CHECK_FUNC(conf, f, link=None, lib=None, headers=None):
if link is None or link == True:
ret = CHECK_CODE(conf,
- 'int main(void) { extern void %s(void); %s(); return 0; }' % (f, f),
+ '''int main(void) {
+ #ifndef %s
+ extern void %s(void); %s();
+ #endif
+ return 0;
+ }''' % (f, f, f),
execute=False,
link=True,
addmain=False,
@@ -226,7 +231,7 @@ def CHECK_FUNC(conf, f, link=None, lib=None, headers=None):
@conf
-def CHECK_FUNCS(conf, list, link=None, lib=None, headers=None):
+def CHECK_FUNCS(conf, list, link=True, lib=None, headers=None):
'''check for a list of functions'''
ret = True
for f in TO_LIST(list):
@@ -416,7 +421,7 @@ def CHECK_LIB(conf, libs, mandatory=False, empty_decl=True):
@conf
def CHECK_FUNCS_IN(conf, list, library, mandatory=False, checklibc=False,
- headers=None, link=None, empty_decl=True):
+ headers=None, link=True, empty_decl=True):
"""
check that the functions in 'list' are available in 'library'
if they are, then make that library available as a dependency