104 lines
5.1 KiB
Diff
104 lines
5.1 KiB
Diff
diff -u -r ../meson-0.44.0/mesonbuild/build.py ./mesonbuild/build.py
|
|
--- ../meson-0.44.0/mesonbuild/build.py 2018-01-14 21:22:09.965589742 +0000
|
|
+++ ./mesonbuild/build.py 2018-01-14 21:22:24.605417600 +0000
|
|
@@ -22,7 +22,7 @@
|
|
from .mesonlib import File, MesonException, listify, extract_as_list
|
|
from .mesonlib import typeslistify, stringlistify, classify_unity_sources
|
|
from .mesonlib import get_filenames_templates_dict, substitute_values
|
|
-from .mesonlib import for_windows, for_darwin, for_cygwin
|
|
+from .mesonlib import for_windows, for_darwin, for_cygwin, for_android
|
|
from .compilers import is_object, clike_langs, sort_clike, lang_suffixes
|
|
|
|
known_basic_kwargs = {'install': True,
|
|
@@ -1278,6 +1278,7 @@
|
|
if not hasattr(self, 'suffix'):
|
|
self.suffix = None
|
|
self.basic_filename_tpl = '{0.prefix}{0.name}.{0.suffix}'
|
|
+ self.is_cross = is_cross
|
|
self.determine_filenames(is_cross, environment)
|
|
|
|
def determine_filenames(self, is_cross, env):
|
|
@@ -1380,25 +1381,26 @@
|
|
|
|
def process_kwargs(self, kwargs, environment):
|
|
super().process_kwargs(kwargs, environment)
|
|
- # Shared library version
|
|
- if 'version' in kwargs:
|
|
- self.ltversion = kwargs['version']
|
|
- if not isinstance(self.ltversion, str):
|
|
- raise InvalidArguments('Shared library version needs to be a string, not ' + type(self.ltversion).__name__)
|
|
- if not re.fullmatch(r'[0-9]+(\.[0-9]+){0,2}', self.ltversion):
|
|
- raise InvalidArguments('Invalid Shared library version "{0}". Must be of the form X.Y.Z where all three are numbers. Y and Z are optional.'.format(self.ltversion))
|
|
- # Try to extract/deduce the soversion
|
|
- if 'soversion' in kwargs:
|
|
- self.soversion = kwargs['soversion']
|
|
- if isinstance(self.soversion, int):
|
|
- self.soversion = str(self.soversion)
|
|
- if not isinstance(self.soversion, str):
|
|
- raise InvalidArguments('Shared library soversion is not a string or integer.')
|
|
- elif self.ltversion:
|
|
- # library version is defined, get the soversion from that
|
|
- # We replicate what Autotools does here and take the first
|
|
- # number of the version by default.
|
|
- self.soversion = self.ltversion.split('.')[0]
|
|
+ if not for_android(self.is_cross, environment):
|
|
+ # Shared library version
|
|
+ if 'version' in kwargs:
|
|
+ self.ltversion = kwargs['version']
|
|
+ if not isinstance(self.ltversion, str):
|
|
+ raise InvalidArguments('Shared library version needs to be a string, not ' + type(self.ltversion).__name__)
|
|
+ if not re.fullmatch(r'[0-9]+(\.[0-9]+){0,2}', self.ltversion):
|
|
+ raise InvalidArguments('Invalid Shared library version "{0}". Must be of the form X.Y.Z where all three are numbers. Y and Z are optional.'.format(self.ltversion))
|
|
+ # Try to extract/deduce the soversion
|
|
+ if 'soversion' in kwargs:
|
|
+ self.soversion = kwargs['soversion']
|
|
+ if isinstance(self.soversion, int):
|
|
+ self.soversion = str(self.soversion)
|
|
+ if not isinstance(self.soversion, str):
|
|
+ raise InvalidArguments('Shared library soversion is not a string or integer.')
|
|
+ elif self.ltversion:
|
|
+ # library version is defined, get the soversion from that
|
|
+ # We replicate what Autotools does here and take the first
|
|
+ # number of the version by default.
|
|
+ self.soversion = self.ltversion.split('.')[0]
|
|
# Visual Studio module-definitions file
|
|
if 'vs_module_defs' in kwargs:
|
|
path = kwargs['vs_module_defs']
|
|
diff -u -r ../meson-0.44.0/mesonbuild/environment.py ./mesonbuild/environment.py
|
|
--- ../meson-0.44.0/mesonbuild/environment.py 2017-11-26 23:37:45.000000000 +0000
|
|
+++ ./mesonbuild/environment.py 2018-01-14 21:19:33.339431007 +0000
|
|
@@ -76,6 +76,17 @@
|
|
'd': 'DFLAGS',
|
|
'vala': 'VALAFLAGS'}
|
|
|
|
+def for_android(is_cross, env):
|
|
+ """
|
|
+ Host machine is Android?
|
|
+
|
|
+ Note: 'host' is the machine on which compiled binaries will run
|
|
+ """
|
|
+ if not is_cross:
|
|
+ return mesonlib.is_android()
|
|
+ elif env.cross_info.has_host():
|
|
+ return env.cross_info.config['host_machine']['system'] == 'android'
|
|
+ return False
|
|
|
|
def find_coverage_tools():
|
|
gcovr_exe = 'gcovr'
|
|
diff -u -r ../meson-0.44.0/mesonbuild/mesonlib.py ./mesonbuild/mesonlib.py
|
|
--- ../meson-0.44.0/mesonbuild/mesonlib.py 2017-12-10 13:37:19.000000000 +0000
|
|
+++ ./mesonbuild/mesonlib.py 2018-01-14 21:19:33.339431007 +0000
|
|
@@ -245,6 +245,12 @@
|
|
def is_haiku():
|
|
return platform.system().lower() == 'haiku'
|
|
|
|
+def is_android():
|
|
+ import sysconfig
|
|
+ # Taken from Lib/test/support/__init__.py of the python source:
|
|
+ _ANDROID_API_LEVEL = sysconfig.get_config_var('ANDROID_API_LEVEL')
|
|
+ return _ANDROID_API_LEVEL is not None and _ANDROID_API_LEVEL > 0
|
|
+
|
|
def is_windows():
|
|
platname = platform.system().lower()
|
|
return platname == 'windows' or 'mingw' in platname
|