2014-02-10 02:10:30 +01:00
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
import string
|
|
|
|
import methods
|
|
|
|
|
|
|
|
|
|
|
|
def is_active():
|
2016-11-02 22:26:55 +01:00
|
|
|
return True
|
2016-04-02 20:26:12 +02:00
|
|
|
|
2016-11-02 22:29:36 +01:00
|
|
|
|
2014-02-10 02:10:30 +01:00
|
|
|
def get_name():
|
2016-11-02 22:26:55 +01:00
|
|
|
return "BlackBerry 10"
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2016-11-02 22:29:36 +01:00
|
|
|
|
2014-02-10 02:10:30 +01:00
|
|
|
def can_build():
|
|
|
|
|
2016-11-02 22:26:55 +01:00
|
|
|
import os
|
|
|
|
if (not os.environ.has_key("QNX_TARGET")):
|
|
|
|
return False
|
|
|
|
return True
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2016-11-02 22:29:36 +01:00
|
|
|
|
2014-02-10 02:10:30 +01:00
|
|
|
def get_opts():
|
|
|
|
|
2016-11-02 22:26:55 +01:00
|
|
|
return [
|
|
|
|
('QNX_HOST', 'path to qnx host', os.environ.get("QNX_HOST", 0)),
|
|
|
|
('QNX_TARGET', 'path to qnx target', os.environ.get("QNX_TARGET", 0)),
|
|
|
|
('QNX_CONFIGURATION', 'path to qnx configuration', os.environ.get("QNX_CONFIGURATION", 0)),
|
|
|
|
('qnx_target', 'Qnx target (armle or x86', 'armle'),
|
|
|
|
('bb10_payment_service', 'Enable Payment Service for BlackBerry10', 'yes'),
|
|
|
|
('bb10_lgles_override', 'Force legacy GLES (1.1) on iOS', 'no'),
|
|
|
|
('bb10_exceptions', 'Use exceptions when compiling on bb10', 'no'),
|
|
|
|
]
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2016-11-02 22:29:36 +01:00
|
|
|
|
2014-02-10 02:10:30 +01:00
|
|
|
def get_flags():
|
|
|
|
|
2016-11-02 22:26:55 +01:00
|
|
|
return [
|
|
|
|
('tools', 'no'),
|
|
|
|
('module_theora_enabled', 'no'),
|
|
|
|
]
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2016-11-02 22:29:36 +01:00
|
|
|
|
2014-02-10 02:10:30 +01:00
|
|
|
def configure(env):
|
|
|
|
|
2016-11-02 22:26:55 +01:00
|
|
|
if env['PLATFORM'] == 'win32':
|
|
|
|
env.Tool('mingw')
|
|
|
|
env['SPAWN'] = methods.win32_spawn
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2016-11-02 22:26:55 +01:00
|
|
|
env['qnx_target_ver'] = env['qnx_target']
|
|
|
|
if env['qnx_target'] == "armle":
|
|
|
|
env['qnx_prefix'] = 'ntoarmv7'
|
|
|
|
env['qnx_target_ver'] = 'armle-v7'
|
|
|
|
else:
|
|
|
|
env['qnx_prefix'] = 'ntox86'
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2016-11-02 22:26:55 +01:00
|
|
|
env['OBJSUFFIX'] = ".qnx.${qnx_target}.o"
|
|
|
|
env['LIBSUFFIX'] = ".qnx.${qnx_target}.a"
|
|
|
|
env['PROGSUFFIX'] = ".qnx.${qnx_target}"
|
2016-11-02 22:28:28 +01:00
|
|
|
print("PROGSUFFIX: " + env['PROGSUFFIX'] + " target: " + env['qnx_target'])
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2016-11-02 22:26:55 +01:00
|
|
|
env.PrependENVPath('PATH', env['QNX_CONFIGURATION'] + '/bin')
|
|
|
|
env.PrependENVPath('PATH', env['QNX_CONFIGURATION'] + '/usr/bin')
|
|
|
|
env['ENV']['QNX_HOST'] = env['QNX_HOST']
|
|
|
|
env['ENV']['QNX_TARGET'] = env['QNX_TARGET']
|
|
|
|
env['ENV']['QNX_CONFIGURATION'] = env['QNX_CONFIGURATION']
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2016-11-02 22:26:55 +01:00
|
|
|
env['CC'] = '$qnx_prefix-gcc'
|
|
|
|
env['CXX'] = '$qnx_prefix-g++'
|
|
|
|
env['AR'] = '$qnx_prefix-ar'
|
|
|
|
env['RANLIB'] = '$qnx_prefix-ranlib'
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2016-11-02 22:28:28 +01:00
|
|
|
env.Append(CPPPATH=['#platform/bb10'])
|
|
|
|
env.Append(LIBPATH=['#platform/bb10/lib/$qnx_target', '#platform/bb10/lib/$qnx_target_ver'])
|
|
|
|
env.Append(CCFLAGS=string.split('-DBB10_ENABLED -DUNIX_ENABLED -DGLES2_ENABLED -DGLES1_ENABLED -D_LITTLE_ENDIAN -DNO_THREADS -DNO_FCNTL'))
|
|
|
|
if env['bb10_exceptions'] == "yes":
|
|
|
|
env.Append(CCFLAGS=['-fexceptions'])
|
2016-11-02 22:26:55 +01:00
|
|
|
else:
|
2016-11-02 22:28:28 +01:00
|
|
|
env.Append(CCFLAGS=['-fno-exceptions'])
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2016-11-02 22:28:28 +01:00
|
|
|
# env.Append(LINKFLAGS = string.split()
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2016-11-02 22:28:28 +01:00
|
|
|
if (env["target"] == "release"):
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2016-11-02 22:28:28 +01:00
|
|
|
env.Append(CCFLAGS=['-O3', '-DRELEASE_BUILD'])
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2016-11-02 22:28:28 +01:00
|
|
|
elif (env["target"] == "debug"):
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2016-11-02 22:28:28 +01:00
|
|
|
env.Append(CCFLAGS=['-g', '-O0', '-DDEBUG_ENABLED', '-D_DEBUG'])
|
2016-11-02 22:26:55 +01:00
|
|
|
env.Append(LINKFLAGS=['-g'])
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2016-11-02 22:26:55 +01:00
|
|
|
env.Append(LIBS=['bps', 'pps', 'screen', 'socket', 'EGL', 'GLESv2', 'GLESv1_CM', 'm', 'asound'])
|