aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2015-10-15 20:20:38 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2015-10-18 01:08:04 +0300
commit572ce0f4519488840d466befde6bb38ccb044e40 (patch)
tree122b04efd982683829ca5678e6ab5e5ee4cc274d
parent1c186d4a300f4e0d4355d9ce1f5c16af54d27dd9 (diff)
downloadmeson-572ce0f4519488840d466befde6bb38ccb044e40.zip
meson-572ce0f4519488840d466befde6bb38ccb044e40.tar.gz
meson-572ce0f4519488840d466befde6bb38ccb044e40.tar.bz2
Added cpu family property to system information.
-rw-r--r--cross/iphone.txt1
-rw-r--r--cross/ubuntu-armhf.txt3
-rw-r--r--cross/ubuntu-faketarget.txt1
-rw-r--r--cross/ubuntu-mingw.txt6
-rw-r--r--interpreter.py13
-rwxr-xr-xmeson.py3
6 files changed, 20 insertions, 7 deletions
diff --git a/cross/iphone.txt b/cross/iphone.txt
index de48551..b2fe3c9 100644
--- a/cross/iphone.txt
+++ b/cross/iphone.txt
@@ -21,6 +21,7 @@ has_function_hfkerhisadf = false
[host_machine]
system = 'ios'
+cpu_family = 'arm'
cpu = 'armv7'
endian = 'little'
diff --git a/cross/ubuntu-armhf.txt b/cross/ubuntu-armhf.txt
index d15780e..09cbced 100644
--- a/cross/ubuntu-armhf.txt
+++ b/cross/ubuntu-armhf.txt
@@ -15,5 +15,6 @@ has_function_hfkerhisadf = false
[host_machine]
system = 'linux'
-cpu = 'arm'
+cpu_family = 'arm'
+cpu = 'armv7' # Not sure if correct.
endian = 'little'
diff --git a/cross/ubuntu-faketarget.txt b/cross/ubuntu-faketarget.txt
index 37e5033..cc43998 100644
--- a/cross/ubuntu-faketarget.txt
+++ b/cross/ubuntu-faketarget.txt
@@ -8,5 +8,6 @@
[target_machine]
system = 'linux'
+cpu_family = 'mips'
cpu = 'mips'
endian = 'little'
diff --git a/cross/ubuntu-mingw.txt b/cross/ubuntu-mingw.txt
index c0cfa69..2373565 100644
--- a/cross/ubuntu-mingw.txt
+++ b/cross/ubuntu-mingw.txt
@@ -13,10 +13,12 @@ root = '/usr/i686-w64-mingw32'
[host_machine]
system = 'windows'
-cpu = 'x86'
+cpu_family = 'x86'
+cpu = 'i686'
endian = 'little'
[target_machine]
system = 'darwin'
-cpu = 'arm'
+cpu_family = 'arm'
+cpu = 'armv7h' # Don't know if this is correct.
endian = 'little'
diff --git a/interpreter.py b/interpreter.py
index 70ce271..8cb272c 100644
--- a/interpreter.py
+++ b/interpreter.py
@@ -308,6 +308,7 @@ class BuildMachine(InterpreterObject):
def __init__(self):
InterpreterObject.__init__(self)
self.methods.update({'system' : self.system_method,
+ 'cpu_family' : self.cpu_family_method,
'cpu' : self.cpu_method,
'endian' : self.endian_method,
})
@@ -316,18 +317,18 @@ class BuildMachine(InterpreterObject):
# It returns different values for the same cpu.
# For x86 it might return 'x86', 'i686' or somesuch.
# Do some canonicalization.
- def cpu_method(self, args, kwargs):
+ def cpu_family_method(self, args, kwargs):
trial = platform.machine().lower()
if trial.startswith('i') and trial.endswith('86'):
return 'x86'
- # This might be wrong. Maybe we should return the more
- # specific string such as 'armv7l'. Need to get user
- # feedback first.
if trial.startswith('arm'):
return 'arm'
# Add fixes here as bugs are reported.
return trial
+ def cpu_method(self, args, kwargs):
+ return platform.machine().lower()
+
def system_method(self, args, kwargs):
return platform.system().lower()
@@ -342,6 +343,7 @@ class CrossMachineInfo(InterpreterObject):
self.info = cross_info
self.methods.update({'system' : self.system_method,
'cpu' : self.cpu_method,
+ 'cpu_family' : self.cpu_family_method,
'endian' : self.endian_method,
})
@@ -351,6 +353,9 @@ class CrossMachineInfo(InterpreterObject):
def cpu_method(self, args, kwargs):
return self.info['cpu']
+ def cpu_family_method(self, args, kwargs):
+ return self.info['cpu_family']
+
def endian_method(self, args, kwargs):
return self.info['endian']
diff --git a/meson.py b/meson.py
index 1e80b9f..a51f5dd 100755
--- a/meson.py
+++ b/meson.py
@@ -158,8 +158,11 @@ itself as required.'''
intr = interpreter.Interpreter(b, g)
if env.is_cross_build():
+ mlog.log('Host machine cpu family:', mlog.bold(intr.builtin['host_machine'].cpu_family_method([], {})))
mlog.log('Host machine cpu:', mlog.bold(intr.builtin['host_machine'].cpu_method([], {})))
+ mlog.log('Target machine cpu family:', mlog.bold(intr.builtin['target_machine'].cpu_family_method([], {})))
mlog.log('Target machine cpu:', mlog.bold(intr.builtin['target_machine'].cpu_method([], {})))
+ mlog.log('Build machine cpu family:', mlog.bold(intr.builtin['build_machine'].cpu_family_method([], {})))
mlog.log('Build machine cpu:', mlog.bold(intr.builtin['build_machine'].cpu_method([], {})))
intr.run()
g.generate(intr)