[gimp] meson: improve host cpu detection



commit 0ce7c25dd4d85c1c5a5dd1c546abd411bb7387a8
Author: Ell <ell_se yahoo com>
Date:   Mon Oct 28 08:00:28 2019 +0200

    meson: improve host cpu detection
    
    See gegl@6bcf95fd0f32cf5e8b1ddbe17b14d9ad049bded8.

 meson.build | 32 ++++++++++++++++++--------------
 1 file changed, 18 insertions(+), 14 deletions(-)
---
diff --git a/meson.build b/meson.build
index b0433de6c5..8b12e5657e 100644
--- a/meson.build
+++ b/meson.build
@@ -98,22 +98,26 @@ linker_args = []
 ################################################################################
 # Host system detection
 
-cpu = host_machine.cpu().to_lower()
-
-arch_x86_64 = (cpu == 'x86_64')
-arch_x86    = (cpu.startswith('i') and cpu.endswith('86')) or arch_x86_64
-arch_ppc64  = (cpu == 'ppc64' or cpu == 'powerpc64')
-arch_ppc    = (cpu == 'ppc'   or cpu == 'powerpc') or arch_ppc64
-
-if not (arch_x86 or arch_ppc)
-  error('Unknown host architecture')
+host_cpu_family = host_machine.cpu_family()
+message('Host machine cpu family: ' + host_cpu_family)
+
+host_cpu_family = host_machine.cpu_family()
+if   host_cpu_family == 'x86'
+  have_x86 = true
+  conf.set10('ARCH_X86',    true)
+elif host_cpu_family == 'x86_64'
+  have_x86 = true
+  conf.set10('ARCH_X86',    true)
+  conf.set10('ARCH_X86_64', true)
+elif host_cpu_family == 'ppc'
+  have_ppc = true
+  conf.set10('ARCH_PPC',    true)
+elif host_cpu_family == 'ppc64'
+  have_ppc = true
+  conf.set10('ARCH_PPC',    true)
+  conf.set10('ARCH_PPC64',  true)
 endif
 
-conf.set10('ARCH_X86',    arch_x86)
-conf.set10('ARCH_X86_64', arch_x86_64)
-conf.set10('ARCH_PPC',    arch_ppc)
-conf.set10('ARCH_PPC64',  arch_ppc64)
-
 
 host_os = host_machine.system().to_lower()
 message('Host os: ' + host_os)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]