summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--buildtools/wafsamba/samba_autoconf.py8
-rw-r--r--lib/replace/wscript6
2 files changed, 10 insertions, 4 deletions
diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py
index c61a55f14b..fef44ea95b 100644
--- a/buildtools/wafsamba/samba_autoconf.py
+++ b/buildtools/wafsamba/samba_autoconf.py
@@ -115,7 +115,7 @@ def CHECK_FUNCS(conf, list):
return ret
@conf
-def CHECK_SIZEOF(conf, vars, headers=None):
+def CHECK_SIZEOF(conf, vars, headers=None, define=None):
hdrs=''
if headers is not None:
hlist = to_list(headers)
@@ -124,6 +124,10 @@ def CHECK_SIZEOF(conf, vars, headers=None):
for h in hlist:
hdrs += '#include <%s>\n' % h
for v in to_list(vars):
+ if define is None:
+ define_name = 'SIZEOF_%s' % string.replace(v.upper(), ' ', '_')
+ else:
+ define_name = define
conf.check(fragment=
'''
%s
@@ -134,7 +138,7 @@ def CHECK_SIZEOF(conf, vars, headers=None):
''' % (hdrs, v),
execute=1,
define_ret=True,
- define_name='SIZEOF_%s' % v.upper(),
+ define_name=define_name,
quote=False,
msg="Checking size of %s" % v)
diff --git a/lib/replace/wscript b/lib/replace/wscript
index 067b80edea..0d93f9604e 100644
--- a/lib/replace/wscript
+++ b/lib/replace/wscript
@@ -84,8 +84,7 @@ def configure(conf):
conf.define('SHLIBEXT', "so", quote=True)
- conf.check(type_name='long long')
- conf.CHECK_TYPES('intptr_t uintptr_t ptrdiff_t')
+ conf.CHECK_TYPES('"long long" intptr_t uintptr_t ptrdiff_t')
conf.CHECK_TYPES('comparison_fn_t socklen_t bool')
conf.CHECK_TYPE('int8_t', 'char')
@@ -134,6 +133,9 @@ def configure(conf):
conf.CHECK_DECLS('dirfd environ errno getgrent_r getpwent_r', reverse=True)
conf.CHECK_DECLS('pread pwrite setenv setresgid setresuid', reverse=True)
+ conf.CHECK_SIZEOF('char int "long long" long off_t short size_t ssize_t')
+ conf.CHECK_SIZEOF('void*', define='SIZEOF_VOID_P')
+
conf.check_cc(fragment='''
#include <stdarg.h>
va_list ap1,ap2;