summaryrefslogtreecommitdiff
path: root/buildtools
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-03-07 17:05:36 +1100
committerAndrew Tridgell <tridge@samba.org>2010-04-06 20:26:44 +1000
commit165b5b660a60b2d79361bd32441e7a1b8c10edd3 (patch)
treebd32bd04151003a618d750ee5c21b3a0c58c2bc9 /buildtools
parenta2c866a5e6540b213947eecf09e32245ce77da3f (diff)
downloadsamba-165b5b660a60b2d79361bd32441e7a1b8c10edd3.tar.gz
samba-165b5b660a60b2d79361bd32441e7a1b8c10edd3.tar.bz2
samba-165b5b660a60b2d79361bd32441e7a1b8c10edd3.zip
build: move gettimeofday check to libreplace
- add checklink option to CHECK_FUNC() - Used for when a prototype is not available
Diffstat (limited to 'buildtools')
-rw-r--r--buildtools/wafsamba/samba_autoconf.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py
index 804e65391c..be8e125896 100644
--- a/buildtools/wafsamba/samba_autoconf.py
+++ b/buildtools/wafsamba/samba_autoconf.py
@@ -120,17 +120,19 @@ def CHECK_DECLS(conf, vars, reverse=False, headers=None):
@runonce
-def CHECK_FUNC(conf, f):
+def CHECK_FUNC(conf, f, checklink=False):
'''check for a function'''
+ if checklink:
+ return CHECK_CODE(conf, '%s()' % f, execute=False, define='HAVE_%s' % f.upper())
return conf.check(function_name=f, header_name=conf.env.hlist)
@conf
-def CHECK_FUNCS(conf, list):
+def CHECK_FUNCS(conf, list, checklink=False):
'''check for a list of functions'''
ret = True
for f in to_list(list):
- if not CHECK_FUNC(conf, f):
+ if not CHECK_FUNC(conf, f, checklink):
ret = False
return ret
@@ -184,11 +186,11 @@ def CHECK_CODE(conf, code, define,
execute = 0
if addmain:
- fragment='#include "confdefs.h"\n%s\n int main(void) { %s; return 0; }' % (hdrs, code)
+ fragment='#include "__confdefs.h"\n%s\n int main(void) { %s; return 0; }' % (hdrs, code)
else:
- fragment='#include "confdefs.h"\n%s\n%s' % (hdrs, code)
+ fragment='#include "__confdefs.h"\n%s\n%s' % (hdrs, code)
- conf.write_config_header('confdefs.h', top=True)
+ conf.write_config_header('__confdefs.h', top=True)
if msg is None:
msg="Checking for %s" % define