aboutsummaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-connectivity/samba/samba/0001-waf-add-support-of-cross_compile.patch
blob: 23b35a8145ba42931ea940281d4c567fe7df07ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
From 4b8463ff43f8983a706b181c5292491f9f954be1 Mon Sep 17 00:00:00 2001
From: Changqing Li <changqing.li@windriver.com>
Date: Fri, 25 Jan 2019 15:00:59 +0800
Subject: [PATCH] waf: add support of cross_compile

After upgrade, waf also upgraded 

on 1.5.19, for cross_compile, subprocess.Popen is set to be
samba_cross.cross_Popen, which will not execute testprog on
host, but only read result from cross-answers.txt which is
passed by option --cross-answer

part of old code:
    args = Utils.to_list(kw.get('exec_args', []))
    proc = Utils.pproc.Popen([lastprog] + args, stdout=Utils.pproc.PIPE, stderr=Utils.pproc.PIPE)

but on new version, exec_args is not used and cause do_configure
failed with Exec format error

fixed by append cross anser related args to cmd

Upstream-Status: Submitted [https://gitlab.com/samba-team/samba/merge_requests/211]

Signed-off-by: Changqing Li <changqing.li@windriver.com>
---
 third_party/waf/waflib/Tools/c_config.py | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/third_party/waf/waflib/Tools/c_config.py b/third_party/waf/waflib/Tools/c_config.py
index 7608215..767cf33 100644
--- a/third_party/waf/waflib/Tools/c_config.py
+++ b/third_party/waf/waflib/Tools/c_config.py
@@ -660,20 +660,21 @@ class test_exec(Task.Task):
 	"""
 	color = 'PINK'
 	def run(self):
+		args = self.generator.bld.kw.get('exec_args', [])
 		if getattr(self.generator, 'rpath', None):
 			if getattr(self.generator, 'define_ret', False):
-				self.generator.bld.retval = self.generator.bld.cmd_and_log([self.inputs[0].abspath()])
-			else:
-				self.generator.bld.retval = self.generator.bld.exec_command([self.inputs[0].abspath()])
+				self.generator.bld.retval = self.generator.bld.cmd_and_log([self.inputs[0].abspath()] + args)
+			else: 
+				self.generator.bld.retval = self.generator.bld.exec_command([self.inputs[0].abspath()] + args)
 		else:
 			env = self.env.env or {}
 			env.update(dict(os.environ))
 			for var in ('LD_LIBRARY_PATH', 'DYLD_LIBRARY_PATH', 'PATH'):
 				env[var] = self.inputs[0].parent.abspath() + os.path.pathsep + env.get(var, '')
 			if getattr(self.generator, 'define_ret', False):
-				self.generator.bld.retval = self.generator.bld.cmd_and_log([self.inputs[0].abspath()], env=env)
+				self.generator.bld.retval = self.generator.bld.cmd_and_log([self.inputs[0].abspath()] + args, env=env)
 			else:
-				self.generator.bld.retval = self.generator.bld.exec_command([self.inputs[0].abspath()], env=env)
+				self.generator.bld.retval = self.generator.bld.exec_command([self.inputs[0].abspath()] + args, env=env)
 
 @feature('test_exec')
 @after_method('apply_link')
-- 
2.7.4