[DEV] add better flag for android

This commit is contained in:
Edouard DUPIN 2016-10-11 21:00:08 +02:00
parent f0690cd75a
commit 42e3deed44
2 changed files with 44 additions and 2 deletions

View File

@ -0,0 +1,26 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license APACHE v2.0 (see license file)
##
from lutin import debug
from lutin import system
from lutin import tools
from lutin import env
import os
class System(system.System):
def __init__(self, target):
system.System.__init__(self)
# create some HELP:
self.set_help("shlwapi interface")
self.set_valid(True)
self.add_flag('link-lib', 'shlwapi')

View File

@ -154,6 +154,12 @@ class Target(target.Target):
self.sysroot = "--sysroot=" + os.path.join(self.path_ndk, "platforms", "android-" + str(self.board_id), "arch-arm") self.sysroot = "--sysroot=" + os.path.join(self.path_ndk, "platforms", "android-" + str(self.board_id), "arch-arm")
if True:
self._mode_arm = "thumb"
else:
self._mode_arm = "arm"
self.add_flag("c", [ self.add_flag("c", [
"-D__ARM_ARCH_5__", "-D__ARM_ARCH_5__",
"-D__ARM_ARCH_5T__", "-D__ARM_ARCH_5T__",
@ -174,9 +180,12 @@ class Target(target.Target):
# -- arm V7 (Neon) : # -- arm V7 (Neon) :
# ----------------------- # -----------------------
self.add_flag("c", [ self.add_flag("c", [
"-m"+self._mode_arm,
"-mfpu=neon", "-mfpu=neon",
"-march=armv7-a", "-march=armv7-a",
"-mtune=cortex-a8",
"-mfloat-abi=softfp", "-mfloat-abi=softfp",
"-mvectorize-with-neon-quad",
"-D__ARM_ARCH_7__", "-D__ARM_ARCH_7__",
"-D__ARM_NEON__" "-D__ARM_NEON__"
]) ])
@ -194,7 +203,7 @@ class Target(target.Target):
]) ])
""" """
# the -mthumb must be set for all the android produc, some ot the not work coretly without this one ... (all android code is generated with this flags) # the -mthumb must be set for all the android produc, some ot the not work coretly without this one ... (all android code is generated with this flags)
self.add_flag("c", "-mthumb") #self.add_flag("c", "-mthumb")
# ----------------------- # -----------------------
# -- Common flags : # -- Common flags :
# ----------------------- # -----------------------
@ -205,7 +214,7 @@ class Target(target.Target):
"-funwind-tables", "-funwind-tables",
"-fstack-protector", "-fstack-protector",
"-Wno-psabi", "-Wno-psabi",
"-mtune=xscale", #"-mtune=xscale",
"-fomit-frame-pointer", "-fomit-frame-pointer",
"-fno-strict-aliasing" "-fno-strict-aliasing"
]) ])
@ -215,6 +224,13 @@ class Target(target.Target):
"-Wa,--noexecstack" "-Wa,--noexecstack"
]) ])
##
## @brief Get the arm mode that is build
## @return "thumb" for thumb mode and "arm for normal mode
##
def get_arm_mode(self):
return self._mode_arm
def convert_name_application(self, pkg_name): def convert_name_application(self, pkg_name):
value = pkg_name.lower() value = pkg_name.lower()
value = value.replace(' ', '') value = value.replace(' ', '')