cmdline = self.tizen + ' list rootstrap'
ret = Executor().run(cmdline, show=False)
for x in ret.splitlines():
- if re.search('(mobile|wearable)-(2.4|3.0)-(device|emulator).core.*', x):
+ if re.search('(mobile|wearable)-(2.4|3.0|4.0|5.0)-(device|emulator|device64|emulator64).core.*', x):
if self.rootstrap_list == None:
self.rootstrap_list = []
self.rootstrap_list.append(x.split(' ')[0])
rs = None #_Rootstrap class instance
rootstrap_list = None
- sdk_to_search = ['tizen-sdk/tools/ide/bin/tizen', \
+ sdk_to_search = ['tizen-studio/tools/ide/bin/tizen', \
+ 'tizen-sdk/tools/ide/bin/tizen', \
'tizen-sdk-ux/tools/ide/bin/tizen', \
'tizen-sdk-cli/tools/ide/bin/tizen']
myZipFile.close()
return rsrc_zip
- def build_native(self, source, rootstrap=None, arch=None, conf='Debug'):
+ def build_native(self, source, rootstrap=None, arch=None, conf='Debug', jobs=None):
"""SDK CLI build command"""
_rootstrap = self.check_rootstrap(rootstrap)
rootstrap = _rootstrap
self.arch = 'x86'
elif arch is None:
- if 'emulator' in rootstrap: self.arch = 'x86'
+ if 'emulator64' in rootstrap: self.arch = 'x86_64'
+ elif 'device64' in rootstrap: self.arch = 'aarch64'
+ elif 'emulator' in rootstrap: self.arch = 'x86'
elif 'device' in rootstrap: self.arch = 'arm'
elif rootstrap is None:
- if arch not in ['x86', 'arm']:
+ if arch not in ['x86', 'arm', 'aarch64', 'x86_64']:
raise LocalError('Architecture and rootstrap mismatch')
+
rootstrap = _rootstrap
- if arch == 'arm': rootstrap = rootstrap.replace('emulator', 'device')
+ if arch == 'x86_64': rootstrap = rootstrap.replace('emulator', 'emulator64')
+ elif arch == 'aarch64': rootstrap = rootstrap.replace('emulator', 'device64')
+ elif arch == 'arm': rootstrap = rootstrap.replace('emulator', 'device')
for x in source.project_list:
- out = self._run('build-native', ['-r', rootstrap, '-a', self.arch, '-C', conf, '--' , x['path']], checker=True)
+ b_args = ['-r', rootstrap, '-a', self.arch, '-C', conf, '-c', 'gcc']
+ if jobs is not None: b_args.extend(['-j', jobs])
+ b_args.extend(['--', x['path']])
+ out = self._run('build-native', b_args, checker=True)
logpath = os.path.join(source.output_dir, \
'build_%s_%s' % (rootstrap, os.path.basename(x['path'])))
if not os.path.isdir(source.output_dir):
with open(logpath, 'w') as lf:
lf.write(out)
ret = self.error_parser.check(out)
- if ret:
+ if True:
with open(logpath+'.log', 'w') as lf:
lf.write(out)
+ if ret:
raise LocalError(ret)
def package(self, source, cert=None, pkg_type=None, conf=None):
strip_cmd = os.path.join(os.path.dirname(self.tizen), '../../i386-linux-gnueabi-gcc-4.9/bin/i386-linux-gnueabi-strip')
elif self.arch == 'arm' :
strip_cmd = os.path.join(os.path.dirname(self.tizen), '../../arm-linux-gnueabi-gcc-4.9/bin/arm-linux-gnueabi-strip')
+ elif self.arch == 'x86_64' :
+ strip_cmd = os.path.join(os.path.dirname(self.tizen), '../../x86_64-linux-gnu-gcc-4.9/bin/x86_64-linux-gnu-strip')
+ elif self.arch == 'aarch64' :
+ strip_cmd = os.path.join(os.path.dirname(self.tizen), '../../aarch64-linux-gnu-gcc-4.9/bin/aarch64-linux-gnu-strip')
print strip_cmd
mydict['path'] = path
return mydict
+ def set_user_options(self, c_opts=None, cpp_opts=None, link_opts=None):
+ if c_opts is not None:
+ os.environ['USER_C_OPTS'] = c_opts
+ print 'Set USER_C_OPTS=[%s]' % os.getenv('USER_C_OPTS')
+ if cpp_opts is not None:
+ os.environ['USER_CPP_OPTS'] = cpp_opts
+ print 'Set USER_CPP_OPTS=[%s]' % os.getenv('USER_CPP_OPTS')
+ if link_opts is not None:
+ os.environ['USER_LINK_OPTS'] = link_opts
+ print 'Set USER_LINK_OPTS=[%s]' % os.getenv('USER_LINK_OPTS')
+
def pre_process(self):
if os.path.isfile(os.path.join(self.workspace, self.multi_conf_file)):
build.add_argument('-r', '--rootstrap', action='store', dest='rootstrap', \
help='(ex, mobile-3.0-device.core) rootstrap name')
build.add_argument('-a', '--arch', action='store', dest='arch', \
- help='(x86|arm) Architecture to build')
+ help='(x86|arm|x86_64|aarch64) Architecture to build')
build.add_argument('-t', '--type', action='store', dest='type', \
help='(tpk|wgt) Packaging type')
build.add_argument('-s', '--cert', action='store', dest='cert', \
help='(ex, ABS) Certificate profile name')
build.add_argument('-c', '--conf', action='store',default='Release', dest='conf', \
help='(ex, Debug|Release) Build Configuration')
+ build.add_argument('-j', '--jobs', action='store', dest='jobs', \
+ help='(number of jobs) The number of parallel builds')
build.add_argument('--sdkpath', action='store', dest='sdkpath', \
help='Specify Tizen SDK installation root (one time init).' \
' ex) /home/yours/tizen-sdk/')
+ build.add_argument('--c-opts', action='store', dest='c_opts', \
+ help='Extra compile options USER_C_OPTS')
+ build.add_argument('--cpp-opts', action='store', dest='cpp_opts', \
+ help='Extra compile options USER_CPP_OPTS')
+ build.add_argument('--link-opts', action='store', dest='link_opts', \
+ help='Extra linking options USER_LINK_OPTS')
return parser.parse_args(argv[1:])
"""Command [build] entry point."""
my_source = Source(src=args.workspace)
+ my_source.set_user_options(c_opts=args.c_opts, cpp_opts=args.cpp_opts, link_opts=args.link_opts)
my_sdk = Sdk(sdkpath=args.sdkpath)
my_sdk.clean(my_source)
- my_sdk.build_native(my_source, rootstrap=args.rootstrap, arch=args.arch, conf=args.conf)
+ my_sdk.build_native(my_source, rootstrap=args.rootstrap, arch=args.arch, conf=args.conf, jobs=args.jobs)
if args.conf == 'Debug' :
my_sdk.package_new(my_source, pkg_type=args.type, cert=args.cert, conf=args.conf)
my_sdk.package_new(my_source, pkg_type=args.type, cert=args.cert, conf=args.conf, manual_strip=True)
except Exception, e:
print 'Exception %s' % str(e)
sys.exit(1)
-