diff --git a/bin/lutin b/bin/lutin index 0f25e0f..862a0a7 100755 --- a/bin/lutin +++ b/bin/lutin @@ -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() == "" \ diff --git a/lutin/env.py b/lutin/env.py index 3ecd5fb..f3efb90 100644 --- a/lutin/env.py +++ b/lutin/env.py @@ -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", diff --git a/lutin/target.py b/lutin/target.py index 07ff06f..b2d4b69 100644 --- a/lutin/target.py +++ b/lutin/target.py @@ -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", diff --git a/lutin/z_builder/lutinBuilder_libraryDynamic.py b/lutin/z_builder/lutinBuilder_libraryDynamic.py index e09ac54..94bcaf3 100644 --- a/lutin/z_builder/lutinBuilder_libraryDynamic.py +++ b/lutin/z_builder/lutinBuilder_libraryDynamic.py @@ -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) diff --git a/lutin/z_system/lutinSystem_Android_cxx.py b/lutin/z_system/lutinSystem_Android_cxx.py index 8397b25..aed7b5b 100644 --- a/lutin/z_system/lutinSystem_Android_cxx.py +++ b/lutin/z_system/lutinSystem_Android_cxx.py @@ -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": diff --git a/lutin/z_system/lutinSystem_Android_z.py b/lutin/z_system/lutinSystem_Android_z.py new file mode 100644 index 0000000..9f8e949 --- /dev/null +++ b/lutin/z_system/lutinSystem_Android_z.py @@ -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") + +