[DEBUG/DEV] correct android build (gcc) and add force optimisation to build with -O3 in debug

This commit is contained in:
Edouard DUPIN 2016-01-23 01:01:20 +01:00
parent 83d7154254
commit 31fb9818ff
6 changed files with 84 additions and 7 deletions

View File

@ -34,6 +34,7 @@ myArgs.add(arguments.ArgDefine("P", "pretty", desc="Print the debug has pretty d
myArgs.add(arguments.ArgDefine("j", "jobs", haveParam=True, desc="Specifies the number of jobs (commands) to run simultaneously"))
myArgs.add(arguments.ArgDefine("d", "depth", haveParam=True, desc="Depth of the search of sub element lutin_*.py (default=" + str(env.get_parse_depth()) + ")"))
myArgs.add(arguments.ArgDefine("s", "force-strip", desc="Force the stripping of the compile elements"))
myArgs.add(arguments.ArgDefine("o", "force-optimisation", desc="Force optimisation of the build"))
myArgs.add(arguments.ArgDefine("w", "warning", desc="Store warning in a file build file"))
myArgs.add_section("properties", "keep in the sequency of the cible")
@ -211,7 +212,14 @@ def parseGenericArg(argument, active):
return True
elif argument.get_option_name() == "force-build":
if active==True:
env.set_force_mode(True)
if argument.get_arg() == "" \
or argument.get_arg() == "1" \
or argument.get_arg() == "true" \
or argument.get_arg() == "True" \
or argument.get_arg() == True:
env.set_force_mode(True)
else:
env.set_force_mode(False)
return True
elif argument.get_option_name() == "pretty":
if active==True:
@ -224,6 +232,17 @@ def parseGenericArg(argument, active):
else:
env.set_print_pretty_mode(False)
return True
elif argument.get_option_name() == "force-optimisation":
if active==True:
if argument.get_arg() == "" \
or argument.get_arg() == "1" \
or argument.get_arg() == "true" \
or argument.get_arg() == "True" \
or argument.get_arg() == True:
env.set_force_optimisation(True)
else:
env.set_force_optimisation(False)
return True
elif argument.get_option_name() == "force-strip":
if active==True:
if argument.get_arg() == "" \

View File

@ -26,6 +26,19 @@ def get_force_mode():
global force_mode
return force_mode
force_optimisation=False
def set_force_optimisation(val):
global force_optimisation
if val==1:
force_optimisation = 1
else:
force_optimisation = 0
def get_force_optimisation():
global force_optimisation
return force_optimisation
parse_depth = 9999999
def set_parse_depth(val):
@ -116,6 +129,19 @@ def print_pretty(my_string, force=False):
"-classpath",
"-sourcepath"
]
elif end_with(cmdApplication, ["java"]) == True:
baseElementList = [
"-z",
"-f",
"-rf"
]
elif end_with(cmdApplication, ["jarsigner"]) == True:
baseElementList = [
"-sigalg",
"-digestalg",
"-storepass",
"-keypass"
]
elif end_with(cmdApplication, ["jar"]) == True:
baseElementList = [
"cf",

View File

@ -107,9 +107,12 @@ class Target:
if "debug" == self.config["mode"]:
self.add_flag("c", [
"-g",
"-DDEBUG",
"-O0"
"-DDEBUG"
])
if env.get_force_optimisation() == False:
self.add_flag("c", "-O0")
else:
self.add_flag("c", "-O3")
else:
self.add_flag("c", [
"-DNDEBUG",

View File

@ -99,6 +99,10 @@ def link(file, binary, target, depancy, flags, name, basic_path, static=False):
cmd.append(file_src)
except:
pass
try:
cmd.append(list_static)
except:
pass
for view in ["local", "export"]:
if view not in flags:
continue
@ -113,10 +117,6 @@ def link(file, binary, target, depancy, flags, name, basic_path, static=False):
cmd.append(target.global_flags[type])
if 'src' in depancy.src:
cmd.append(tools.filter_extention(depancy.src['src'], get_input_type()))
try:
cmd.append(list_static)
except:
pass
try:
for elem in list_dynamic:
lib_path = os.path.dirname(elem)

View File

@ -48,6 +48,7 @@ class System(system.System):
else:
self.add_export_flag("c++", "-D__STDCPP_GNU__")
self.add_export_flag("c++-remove","-nostdlib")
self.add_export_flag("need-libstdc++", True)
# GPL v3 (+ exception link for gcc compilator)
self.add_export_path(os.path.join(target.path_ndk, "sources", "cxx-stl", "gnu-libstdc++", target.compilator_version, "include"))
if target.type_arch == "armv5":

View File

@ -0,0 +1,28 @@
#!/usr/bin/python
##
## @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
import os
class System(system.System):
def __init__(self, target):
system.System.__init__(self)
# create some HELP:
self.help="Z : z library \n Can be install with the package:\n - zlib1g-dev"
# check if the library exist:
if not os.path.isfile("/usr/include/zlib.h"):
# we did not find the library reqiested (just return) (automaticly set at false)
return;
self.valid = True
# todo : create a searcher of the presence of the library:
self.add_export_flag("link-lib", "z")