002aeba3de
Bump to the latest 4.1.7 version and improve the cross-build logic. With the new patches the build is basically architecture-agnostic making it possible to ditch the arch-specific cache to use a generic one. Some toolchains might not be too happy with samba4 because of bitrot, hopefully we'll find and fix or blacklist those with autobuilder help. Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
67 lines
2.5 KiB
Diff
67 lines
2.5 KiB
Diff
From fd3eb1e9f712e4c96c0b55d4203745afb2bcc8c2 Mon Sep 17 00:00:00 2001
|
|
From: Gustavo Zacarias <gustavo@zacarias.com.ar>
|
|
Date: Wed, 9 Apr 2014 10:21:59 -0300
|
|
Subject: [PATCH 3/5] build: make wafsamba CHECK_SIZEOF cross-compile friendly
|
|
|
|
Use the same trick as commit 0d9bb86293c9d39298786df095c73a6251b08b7e
|
|
We do the same array trick iteratively starting from 1 (byte) by powers
|
|
of 2 up to 32.
|
|
|
|
The new 'critical' option is used to make the invocation die or not
|
|
according to each test.
|
|
The default is True since normally it's expected to find a proper
|
|
result and should error out if not.
|
|
|
|
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
|
|
---
|
|
buildtools/wafsamba/samba_autoconf.py | 28 ++++++++++++++++------------
|
|
1 file changed, 16 insertions(+), 12 deletions(-)
|
|
|
|
diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py
|
|
index 59d9e79..f60ce9d 100644
|
|
--- a/buildtools/wafsamba/samba_autoconf.py
|
|
+++ b/buildtools/wafsamba/samba_autoconf.py
|
|
@@ -304,23 +304,27 @@ def CHECK_FUNCS(conf, list, link=True, lib=None, headers=None):
|
|
|
|
|
|
@conf
|
|
-def CHECK_SIZEOF(conf, vars, headers=None, define=None):
|
|
+def CHECK_SIZEOF(conf, vars, headers=None, define=None, critical=True):
|
|
'''check the size of a type'''
|
|
- ret = True
|
|
for v in TO_LIST(vars):
|
|
v_define = define
|
|
+ ret = False
|
|
if v_define is None:
|
|
v_define = 'SIZEOF_%s' % v.upper().replace(' ', '_')
|
|
- if not CHECK_CODE(conf,
|
|
- 'printf("%%u", (unsigned)sizeof(%s))' % v,
|
|
- define=v_define,
|
|
- execute=True,
|
|
- define_ret=True,
|
|
- quote=False,
|
|
- headers=headers,
|
|
- local_include=False,
|
|
- msg="Checking size of %s" % v):
|
|
- ret = False
|
|
+ for size in list((1, 2, 4, 8, 16, 32)):
|
|
+ if CHECK_CODE(conf,
|
|
+ 'static int test_array[1 - 2 * !(((long int)(sizeof(%s))) <= %d)];' % (v, size),
|
|
+ define=v_define,
|
|
+ quote=False,
|
|
+ headers=headers,
|
|
+ local_include=False,
|
|
+ msg="Checking if size of %s == %d" % (v, size)):
|
|
+ conf.DEFINE(v_define, size)
|
|
+ ret = True
|
|
+ break
|
|
+ if not ret and critical:
|
|
+ Logs.error("Couldn't determine size of '%s'" % v)
|
|
+ sys.exit(1)
|
|
return ret
|
|
|
|
@conf
|
|
--
|
|
1.8.3.2
|
|
|