summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2016-10-18 11:33:07 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2016-10-18 11:44:33 +0530
commit3cffdfd74a812c8dd8c127998589abcd06b21de4 (patch)
treef10a25e04364ffac8541fa6cdd9b7134167f45f3
parentfb42d4ec9b8e7bce1cdfb4bb03e283a99b55ebf8 (diff)
config/ios: Add ios_min_version and add to xcode8 workaround
Add a configuration option for the minimum iOS version to target, and add it to the xcode8 workaround utility function. iOS 10.0 introduced the same issue as macOS 10.12 w.r.t. symbol availability.
-rw-r--r--cerbero/config.py3
-rw-r--r--cerbero/utils/__init__.py11
-rw-r--r--config/ios.config15
3 files changed, 19 insertions, 10 deletions
diff --git a/cerbero/config.py b/cerbero/config.py
index 9cc6e4eb..47f0ea8b 100644
--- a/cerbero/config.py
+++ b/cerbero/config.py
@@ -91,7 +91,8 @@ class Config (object):
'recipes_remotes', 'ios_platform', 'extra_build_tools',
'distro_packages_install', 'interactive',
'target_arch_flags', 'sysroot', 'isysroot',
- 'extra_lib_path', 'cached_sources', 'tools_prefix']
+ 'extra_lib_path', 'cached_sources', 'tools_prefix',
+ 'ios_min_version']
def __init__(self):
self._check_uninstalled()
diff --git a/cerbero/utils/__init__.py b/cerbero/utils/__init__.py
index 041c92f6..1771a683 100644
--- a/cerbero/utils/__init__.py
+++ b/cerbero/utils/__init__.py
@@ -370,8 +370,13 @@ def needs_xcode8_sdk_workaround(config):
'''
Returns whether the XCode 8 clock_gettime, mkostemp, getentropy workaround
from https://bugzilla.gnome.org/show_bug.cgi?id=772451 is needed
+
+ These symbols are only available on macOS 10.12+ and iOS 10.0+
'''
- if config.target_platform == Platform.DARWIN and \
- StrictVersion(config.min_osx_sdk_version) < StrictVersion('10.12'):
- return True
+ if config.target_platform == Platform.DARWIN:
+ if StrictVersion(config.min_osx_sdk_version) < StrictVersion('10.12'):
+ return True
+ elif config.target_platform == Platform.IOS:
+ if StrictVersion(config.ios_min_version) < StrictVersion('10.0'):
+ return True
return False
diff --git a/config/ios.config b/config/ios.config
index 2b9ac76e..38fd3814 100644
--- a/config/ios.config
+++ b/config/ios.config
@@ -14,7 +14,7 @@ variants += ['nogtk3', 'noclutter', 'nopython', 'notestspackage']
# used later. System libs are passed through the -isysroot option
allow_system_libs=False
-min_version='6.0'
+ios_min_version = ios_min_version or '6.0'
if target_distro_version == distro_version:
target_distro_version = None
@@ -92,15 +92,18 @@ os.environ['AR']= 'ar'
os.environ['NM']= 'nm'
os.environ['NMEDIT']= 'nmedit'
os.environ['RANLIB']= 'ranlib'
+os.environ['CPPFLAGS'] = '{} -isysroot {} '.format(arch_cflags, sysroot)
+os.environ['LDFLAGS'] = os.environ['CPPFLAGS']
if ios_platform == 'iPhoneOS':
- os.environ['CFLAGS'] = '%s -isysroot %s -miphoneos-version-min=%s %s' %(arch_cflags, sysroot, min_version, extra_cflags)
- os.environ['LDFLAGS'] = '%s -isysroot %s -miphoneos-version-min=%s -Wl,-iphoneos_version_min,%s -Wl,-undefined,error -Wl,-headerpad_max_install_names %s' %(arch_cflags, sysroot, min_version, min_version, extra_ldflags)
+ os.environ['CFLAGS'] = '-miphoneos-version-min={} '.format(ios_min_version)
+ os.environ['LDFLAGS'] += '-miphoneos-version-min={0} -Wl,-iphoneos_version_min,{0} '.format(ios_min_version)
else:
- os.environ['CFLAGS'] = '%s -isysroot %s -mios-simulator-version-min=%s %s' %(arch_cflags, sysroot, min_version, extra_cflags)
- os.environ['LDFLAGS'] = '%s -isysroot %s -mios-simulator-version-min=%s -Wl,-ios_simulator_version_min,%s -Wl,-undefined,error -Wl,-headerpad_max_install_names %s' %(arch_cflags, sysroot, min_version, min_version, extra_ldflags)
+ os.environ['CFLAGS'] = '-mios-simulator-version-min={} '.format(ios_min_version)
+ os.environ['LDFLAGS'] += '-mios-simulator-version-min={0} -Wl,-ios_simulator_version_min,{0} '.format(ios_min_version)
+os.environ['CFLAGS'] += extra_cflags
+os.environ['LDFLAGS'] += '-Wl,-undefined,error -Wl,-headerpad_max_install_names ' + extra_ldflags
os.environ['OBJCFLAGS'] = os.environ['CFLAGS']
os.environ['OBJLDFLAGS'] = os.environ['LDFLAGS']
-os.environ['CPPFLAGS'] = '%s -isysroot %s' % (arch_cflags, sysroot)
os.environ['CXXFLAGS'] = os.environ['CFLAGS']
os.environ['AS']= 'as'