From b4cb506ceaae9254fa5e6fd25b4d936daa826712 Mon Sep 17 00:00:00 2001 From: Nils Philippsen Date: Sat, 9 Nov 2013 10:54:47 +0100 Subject: [PATCH] improve architecture detection Recognize ppc64, ppc, s390x, s390 CPUs, default to 'none' instead of i686 (which tries to build with SSE and fails on non-x86 architectures). --- wscript | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/wscript b/wscript index 99bd46ddef..13060707ea 100644 --- a/wscript +++ b/wscript @@ -182,16 +182,15 @@ def set_compiler_flags (conf,opt): else: conf.env['build_target'] = 'mountainlion' else: - if re.search ("x86_64", cpu) != None: - conf.env['build_target'] = 'x86_64' - elif re.search("i[0-5]86", cpu) != None: - conf.env['build_target'] = 'i386' - elif re.search("powerpc", cpu) != None: - conf.env['build_target'] = 'powerpc' - elif re.search("arm", cpu) != None: - conf.env['build_target'] = 'arm' + match = re.search( + "(?Pi[0-6]86|x86_64|powerpc|ppc|ppc64|arm|s390x?)", + cpu) + if (match): + conf.env['build_target'] = match.group("cpu") + if re.search("i[0-5]86", conf.env['build_target']): + conf.env['build_target'] = "i386" else: - conf.env['build_target'] = 'i686' + conf.env['build_target'] = 'none' else: conf.env['build_target'] = opt.dist_target