From 40d2e8eac15ee3b1f2f0bc905659656ed6bb915d Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Wed, 7 Sep 2016 22:17:41 +0200 Subject: [PATCH] [API/DOC] change API to have a good coherency --- lutin/module.py | 97 ++-- lutin/system.py | 206 ++++++--- lutin/target.py | 419 +++++++++++------- lutin/z_builder/lutinBuilder_binary.py | 7 +- lutin/z_builder/lutinBuilder_jar.py | 7 +- .../z_builder/lutinBuilder_libraryDynamic.py | 12 +- lutin/z_builder/lutinBuilder_libraryStatic.py | 13 +- lutin/z_system/lutinSystem_Android_ADMOD.py | 2 +- lutin/z_system/lutinSystem_Android_SDK.py | 8 +- lutin/z_system/lutinSystem_Android_cxx.py | 52 +-- lutin/z_system/lutinSystem_Android_m.py | 2 +- lutin/z_system/lutinSystem_Android_opengl.py | 4 +- lutin/z_system/lutinSystem_Android_pthread.py | 4 +- lutin/z_system/lutinSystem_Android_z.py | 2 +- lutin/z_system/lutinSystem_IOs_CoreAudio.py | 4 +- lutin/z_system/lutinSystem_IOs_cxx.py | 6 +- lutin/z_system/lutinSystem_IOs_m.py | 2 +- lutin/z_system/lutinSystem_Linux_X11.py | 4 +- lutin/z_system/lutinSystem_Linux_alsa.py | 6 +- lutin/z_system/lutinSystem_Linux_arpa.py | 4 +- lutin/z_system/lutinSystem_Linux_boost.py | 4 +- lutin/z_system/lutinSystem_Linux_c.py | 2 +- lutin/z_system/lutinSystem_Linux_cxx.py | 10 +- lutin/z_system/lutinSystem_Linux_jack.py | 4 +- lutin/z_system/lutinSystem_Linux_m.py | 4 +- lutin/z_system/lutinSystem_Linux_opengl.py | 12 +- lutin/z_system/lutinSystem_Linux_oss.py | 2 +- lutin/z_system/lutinSystem_Linux_pthread.py | 4 +- lutin/z_system/lutinSystem_Linux_pulse.py | 8 +- lutin/z_system/lutinSystem_Linux_rpc.py | 6 +- lutin/z_system/lutinSystem_Linux_uuid.py | 6 +- lutin/z_system/lutinSystem_Linux_z.py | 6 +- lutin/z_system/lutinSystem_MacOs_CoreAudio.py | 4 +- lutin/z_system/lutinSystem_MacOs_cxx.py | 6 +- lutin/z_system/lutinSystem_MacOs_m.py | 2 +- lutin/z_system/lutinSystem_Windows_cxx.py | 8 +- lutin/z_system/lutinSystem_Windows_ds.py | 2 +- lutin/z_system/lutinSystem_Windows_m.py | 2 +- lutin/z_target/lutinTarget_IOs.py | 12 +- 39 files changed, 571 insertions(+), 394 deletions(-) diff --git a/lutin/module.py b/lutin/module.py index 23f6ab1..b07d072 100644 --- a/lutin/module.py +++ b/lutin/module.py @@ -39,12 +39,21 @@ class Module: ## @param[in] self (handle) Class handle ## @param[in] file (string) Plugin file name (use __file__ to get it) ## @param[in] module_name (string) Name of the module - ## @param[in] moduleType (string) Type of the module + ## @param[in] module_type (string) Type of the module: + ## - BINARY + ## - BINARY_SHARED + ## - BINARY_STAND_ALONE + ## - LIBRARY + ## - LIBRARY_DYNAMIC + ## - LIBRARY_STATIC + ## - PACKAGE + ## - PREBUILD + ## - DATA ## @return None ## - def __init__(self, file, module_name, moduleType): + def __init__(self, file, module_name, module_type): ## Remove all variable to prevent error of multiple deffinition of the module ... - debug.verbose("Create a new module : '" + module_name + "' TYPE=" + moduleType) + debug.verbose("Create a new module : '" + module_name + "' TYPE=" + module_type) self._origin_file='' self._origin_path='' # type of the module: @@ -78,19 +87,19 @@ class Module: # The module has been already build ... self._isbuild = False ## end of basic INIT ... - if moduleType == 'BINARY' \ - or moduleType == 'BINARY_SHARED' \ - or moduleType == 'BINARY_STAND_ALONE' \ - or moduleType == 'LIBRARY' \ - or moduleType == 'LIBRARY_DYNAMIC' \ - or moduleType == 'LIBRARY_STATIC' \ - or moduleType == 'PACKAGE' \ - or moduleType == 'PREBUILD' \ - or moduleType == 'DATA': - self._type=moduleType + if module_type == 'BINARY' \ + or module_type == 'BINARY_SHARED' \ + or module_type == 'BINARY_STAND_ALONE' \ + or module_type == 'LIBRARY' \ + or module_type == 'LIBRARY_DYNAMIC' \ + or module_type == 'LIBRARY_STATIC' \ + or module_type == 'PACKAGE' \ + or module_type == 'PREBUILD' \ + or module_type == 'DATA': + self._type=module_type else : debug.error('for module "%s"' %module_name) - debug.error(' ==> error : "%s" ' %moduleType) + debug.error(' ==> error : "%s" ' %module_type) raise 'Input value error' self._origin_file = file; self._origin_path = tools.get_current_path(self._origin_file) @@ -184,7 +193,7 @@ class Module: ## @param[in] self (handle) Class handle ## @return None ## - def add_extra_compile_flags(self): + def add_extra_flags(self): self.add_flag('c', [ "-Wall", "-Wsign-compare", @@ -514,7 +523,7 @@ class Module: # optionnal dependency : for dep, option, export in self._depends_optionnal: debug.verbose("try find optionnal dependency: '" + str(dep) + "'") - inherit_list, isBuilt = target.build(dep, package_name, True) + inherit_list, isBuilt = target.build(dep, True) if isBuilt == True: self._local_heritage.add_depends(dep); # TODO : Add optionnal Flags ... @@ -527,7 +536,7 @@ class Module: self._sub_heritage_list.add_heritage_list(inherit_list) for dep in self._depends: debug.debug("module: '" + str(self._name) + "' request: '" + dep + "'") - inherit_list = target.build(dep, package_name, False) + inherit_list = target.build(dep, False) # add at the heritage list : self._sub_heritage_list.add_heritage_list(inherit_list) # do sub library action for automatic generating ... @@ -927,9 +936,15 @@ class Module: ## @param[in] list ([string,...] or string) Name(s) of the modules dependency ## @return None ## - def add_module_depend(self, list): + def add_depend(self, list): tools.list_append_to(self._depends, list, True) + ## @brief deprecated ... + ## @return None + def add_module_depend(self, list): + debug.warning("[" + self._name + "] add_module_depend is deprecated ==> use add_depend(...)") + self.add_depend(list) + ## ## @brief Add an optionnal dependency on this module ## @param[in] self (handle) Class handle @@ -938,9 +953,15 @@ class Module: ## @param[in] export (bool) export the flat that has been requested to add if module is present. ## @return None ## - def add_optionnal_module_depend(self, module_name, compilation_flags=["", ""], export=False): + def add_optionnal_depend(self, module_name, compilation_flags=["", ""], export=False): tools.list_append_and_check(self._depends_optionnal, [module_name, compilation_flags, export], True) + ## @brief deprecated ... + ## @return None + def add_optionnal_module_depend(self, module_name, compilation_flags=["", ""], export=False): + debug.warning("[" + self._name + "] add_optionnal_module_depend is deprecated ==> use add_optionnal_depend(...)") + self.add_optionnal_depend(module_name, compilation_flags, export) + ## ## @brief Add a path to include when build ## @param[in] self (handle) Class handle @@ -961,7 +982,6 @@ class Module: debug.warning("[" + self._name + "] add_export_path is deprecated ==> use add_path(xxx, yyy, export=True)") self.add_path(list, type, export=True) - ## ## @brief Add compilation flags ## @param[in] self (handle) Class handle @@ -979,13 +999,13 @@ class Module: ## @brief deprecated ... ## @return None def add_export_flag(self, type, list): - debug.warning("[" + self._name + "] Add_export_flag is deprecated ==> use add_flag(xxx, yyy, export=True)") + debug.warning("[" + self._name + "] add_export_flag is deprecated ==> use add_flag(xxx, yyy, export=True)") self.add_flag(type, list, export=True) ## @brief deprecated ... ## @return None def compile_flags(self, type, list): - debug.warning("[" + self._name + "] Compile_flags is deprecated ==> use add_flag(xxx, yyy)") + debug.warning("[" + self._name + "] compile_flags is deprecated ==> use add_flag(xxx, yyy)") self.add_flag(type, list) ## @@ -1345,39 +1365,6 @@ class Module: else: self._package_prop[variable] = [value] - ## - ## @brief Add an external project module - ## @param[in] self (handle) Class handle - ## @param[in] target (handle) @ref lutin.target.Target handle - ## @param[in] projectMng (string) name of the project manager - ## @param[in] added_module ([string,...]) Modules to add - ## @return None - ## - def ext_project_add_module(self, target, projectMng, added_module = []): - if self._name in added_module: - return - added_module.append(self._name) - debug.verbose("add a module to the project generator :" + self._name) - debug.verbose("local path :" + self._origin_path) - projectMng.add_files(self._name, self._origin_path, self._src) - #projectMng.add_data_file(self.origin_path, self.files) - #projectMng.add_data_path(self.origin_path, self.paths) - """ - for depend in self.depends: - target.project_add_module(depend, projectMng, added_module) - """ - - ## - ## @brief Create a project for external build environement - ## @param[in] self (handle) Class handle - ## @param[in] target (handle) @ref lutin.target.Target handle - ## @param[in] projectMng (string) name of the project manager - ## @return None - ## - def create_project(self, target, projectMng): - projectMng.set_project_name(self._name) - self.ext_project_add_module(target, projectMng) - projectMng.generate_project_file() __module_list=[] __start_module_name="_" diff --git a/lutin/system.py b/lutin/system.py index e49b0bc..c5d0bd6 100644 --- a/lutin/system.py +++ b/lutin/system.py @@ -22,40 +22,78 @@ from . import env ## @brief System class represent the pre-build Module that are already install and accessible in the system environment ## class System: + ## + ## @brief Constructor + ## @param[in] self (handle) Class handle + ## @return None + ## def __init__(self): - self.valid=False; - self.help=""; - self.export_depends=[] - self.export_flags={} - self.export_src=[] - self.export_path=[] - self.action_on_state={} - self.headers=[] - self.version=None - - def add_export_sources(self, list): - tools.list_append_to(self.export_src, list) + self._valid=False; + self._help=""; + self._export_depends=[] + self._export_flags={} + self._export_src=[] + self._export_path=[] + self._action_on_state={} + self._headers=[] + self._version=None + ## + ## @brief Add source element + ## @param[in] self (handle) Class handle + ## @param[in] list ([string,...]) List of all Files to add. ex: *.a, *.so ... + ## @return None + ## + def add_sources(self, list): + tools.list_append_to(self._export_src, list) + ## + ## @brief Add include path of the sources + ## @param[in] self (handle) Class handle + ## @param[in] list ([string,...]) List of all path to add in the -I include element + ## @return None + ## # todo : add other than C ... - def add_export_path(self, list): - tools.list_append_to(self.export_path, list) + def add_path(self, list): + tools.list_append_to(self._export_path, list) - def add_module_depend(self, list): - tools.list_append_to(self.export_depends, list, True) + ## + ## @brief Add a dependency on this module + ## @param[in] self (handle) Class handle + ## @param[in] list ([string,...] or string) Name(s) of the modules dependency + ## @return None + ## + def add_depend(self, list): + tools.list_append_to(self._export_depends, list, True) - def add_export_flag(self, type, list): - tools.list_append_to_2(self.export_flags, type, list) + ## + ## @brief Add compilation flags + ## @param[in] self (handle) Class handle + ## @param[in] type (string) inclusion group name 'c', 'c++', 'java' ... + ## @param[in] list ([string,...] or string) List of path to include + ## @return None + ## + def add_flag(self, type, list): + tools.list_append_to_2(self._export_flags, type, list) + ## + ## @brief Set version of the module + ## @param[in] self (handle) Class handle + ## @param[in] version_list ([int,...]) Ids of the version. ex: [1,2,5] or [0,8,"dev"] + ## @return None + ## def set_version(self, version_list): - self.version = version_list + self._version = version_list + ## @copydoc lutin.module.Target.add_action def add_action(self, name_of_state="PACKAGE", level=5, name="no-name", action=None): - if name_of_state not in self.action_on_add_src_filestate: - self.action_on_state[name_of_state] = [[level, name, action]] + if name_of_state not in self._action_on_state: + self._action_on_state[name_of_state] = [[level, name, action]] else: - self.action_on_state[name_of_state].append([level, name, action]) + self._action_on_state[name_of_state].append([level, name, action]) + + ## @copydoc lutin.module.Module.add_header_file def add_header_file(self, list, destination_path=None, clip_path=None, recursive=False): - self.headers.append({ + self._headers.append({ "list":list, "dst":destination_path, "clip":clip_path, @@ -68,41 +106,56 @@ class System: ## def __repr__(self): return "{lutin.System}" + + ## + ## @brief Configure a module with internal datas + ## @param[in] self (handle) Class handle + ## @param[in] target (handle) @ref lutin.module.Target handle + ## @param[in] module (handle) @ref lutin.module.Module handle + ## @return None + ## + def configure_module(self, target, module): + # add element flags to export + for elem in self._export_flags: + debug.verbose("add element :" + str(elem) + " elems=" + str(self._export_flags[elem])) + module.add_flag(elem, self._export_flags[elem], export=True) + # add module dependency + module.add_depend(self._export_depends) + # add exporting sources + module.add_src_file(self._export_src) + # add export path + module.add_path(self._export_path, export=True) + # Export all actions ... + for elem in self._action_on_state: + level, name, action = self._action_on_state[elem] + target.add_action(elem, level, name, action) + for elem in self._headers: + module.add_header_file( + elem["list"], + destination_path=elem["dst"], + clip_path=elem["clip"], + recursive=elem["recursive"]) + if self._version != None: + module.pkg_set("VERSION", self._version); + - +## +## @brief Create a @ref lutin.module.Module for the system list elements +## @param[in] target (handle) @ref lutin.target.Target handle +## @param[in] name (string) Name of the system module +## def create_module_from_system(target, dict): - myModule = module.Module(dict["path"], dict["name"], 'PREBUILD') - # add element flags to export - for elem in dict["system"].export_flags: - debug.verbose("add element :" + str(elem) + " elems=" + str(dict["system"].export_flags[elem])) - myModule.add_flag(elem, dict["system"].export_flags[elem], export=True) - # add module dependency - myModule.add_module_depend(dict["system"].export_depends) - # add exporting sources - myModule.add_src_file(dict["system"].export_src) - # add export path - myModule.add_path(dict["system"].export_path, export=True) - # Export all actions ... - for elem in dict["system"].action_on_state: - level, name, action = dict["system"].action_on_state[elem] - target.add_action(elem, level, name, action) - for elem in dict["system"].headers: - myModule.add_header_file( - elem["list"], - destination_path=elem["dst"], - clip_path=elem["clip"], - recursive=elem["recursive"]) - if dict["system"].version != None: - myModule.package_prop["VERSION"] = dict["system"].version - return myModule + my_module = module.Module(dict["path"], dict["name"], 'PREBUILD') + dict["system"].configure_module(target, my_module) + return my_module # Dictionnaire of Target name # inside table of ["Name of the lib", "path of the lib", boolean loaded, module loaded] -system_list={} +__system_list={} __start_system_name="System_" ## @@ -110,7 +163,7 @@ __start_system_name="System_" ## @param[in] path_list ([string,...]) List of file that start with env.get_build_system_base_name() in the running worktree (Parse one time ==> faster) ## def import_path(path_list): - global system_list + global __system_list global_base = env.get_build_system_base_name() debug.debug("SYSTEM: Init with Files list:") for elem in path_list: @@ -129,49 +182,49 @@ def import_path(path_list): system_name = filename[len(__start_system_name):] system_type, system_name = system_name.split('_') debug.verbose("SYSTEM: Integrate: '" + system_type + "':'" + system_name + "' from '" + elem + "'") - if system_type in system_list: - system_list[system_type].append({"name":system_name, + if system_type in __system_list: + __system_list[system_type].append({"name":system_name, + "path":elem, + "system":None, + "loaded":False, + "exist":False, + "module":None}) + else: + __system_list[system_type] = [{"name":system_name, "path":elem, "system":None, "loaded":False, "exist":False, - "module":None}) - else: - system_list[system_type] = [{"name":system_name, - "path":elem, - "system":None, - "loaded":False, - "exist":False, - "module":None}] + "module":None}] debug.verbose("New list system: ") - for elem in system_list: + for elem in __system_list: debug.verbose(" " + str(elem)) - for val in system_list[elem]: + for val in __system_list[elem]: debug.verbose(" " + str(val["name"])) ## ## @brief Display all the system binary that can be used ## def display(): - global system_list - for elementName in system_list: + global __system_list + for elementName in __system_list: debug.info("SYSTEM: Integrate system: '" + elementName +"'") - for data in system_list[elementName]: + for data in __system_list[elementName]: debug.info("SYSTEM: '" + data["name"] +"' in " + data["path"]) ## -## @brief Check if a library is availlable for a specific target +## @brief Check if a system Module is availlable for a specific target ## @param[in] lib_name (string) Name of the Library ## @param[in] target_name (string) Name of the target ## @param[in] target (handle) Handle on the @ref Target build engine -## @return +## @return (bool) find the system lib or not ## def exist(lib_name, target_name, target) : - global system_list + global __system_list debug.verbose("exist= " + lib_name + " in " + target_name) - if target_name not in system_list: + if target_name not in __system_list: return False - for data in system_list[target_name]: + for data in __system_list[target_name]: if data["name"] == lib_name: # we find it in the List ==> need to check if it is present in the system : if data["loaded"] == False: @@ -189,11 +242,18 @@ def exist(lib_name, target_name, target) : return data["exist"] return False +## +## @brief Load a system Module for a specific target +## @param[in] target (handle) Handle on the @ref Target build engine +## @param[in] lib_name (string) Name of the Library +## @param[in] target_name (string) Name of the target +## @return None +## def load(target, lib_name, target_name): - global system_list - if target_name not in system_list: + global __system_list + if target_name not in __system_list: debug.error("you must call this function after checking of the system exist() !1!") - for data in system_list[target_name]: + for data in __system_list[target_name]: if data["name"] == lib_name: if data["exist"] == False: debug.error("you must call this function after checking of the system exist() !2!") diff --git a/lutin/target.py b/lutin/target.py index 42935c8..9c96f83 100644 --- a/lutin/target.py +++ b/lutin/target.py @@ -25,6 +25,12 @@ from . import env ## @brief Target class represent the buyild environement for a specific platform like Linux, or Android .... ## class Target: + ## + ## @brief contructor + ## @param[in] name (string) Name of the target + ## @param[in] config (dict) User configuration + ## @param[in] arch (string) specific parameter for gcc -arch element + ## def __init__(self, name, config, arch): self.config = config @@ -59,21 +65,6 @@ class Target: # Target global variables. ############################################################################### self.global_include_cc=[] - """ - self.global_flags_cc=['-D__TARGET_OS__'+self.name, - '-D__TARGET_ARCH__'+self.select_arch, - '-D__TARGET_ADDR__'+self.select_bus + 'BITS', - '-D_REENTRANT'] - self.global_flags_xx=[] - self.global_flags_mm=[] - if self.name == "Windows": - self.global_flags_xx=['-static-libgcc', '-static-libstdc++'] - self.global_flags_mm=[] - self.global_flags_m=[] - self.global_flags_ar=['rcs'] - self.global_flags_ld=[] - self.global_flags_ld_shared=[] - """ self.global_flags={} self.global_libs_ld=[] @@ -105,8 +96,10 @@ class Target: self.add_flag("ar", 'rcs') if self.name == "Windows": - self.add_flag("c++", ['-static-libgcc', '-static-libstdc++']) - + self.add_flag("c++", [ + '-static-libgcc', + '-static-libstdc++' + ]) if "debug" == self.config["mode"]: self.add_flag("c", [ "-g", @@ -141,7 +134,7 @@ class Target: "--coverage" ]) - self.update_path_tree() + self._update_path_tree() self.path_bin="bin" self.path_lib="lib" self.path_data="share" @@ -182,7 +175,8 @@ class Target: ## ## @brief Get the type of the target: ["Linux, ...] - ## @return The current target name and other sub name type (ubuntu ...) + ## @param[in] self (handle) Class handle + ## @return ([string,...]) The current target name and other sub name type (ubuntu ...) ## def get_type(self): out = [self.name] @@ -192,20 +186,40 @@ class Target: ## ## @brief Get build mode of the target: ["debug", "release"] + ## @param[in] self (handle) Class handle ## @return The current target build mode. ## def get_mode(self): return self.config["mode"] + ## + ## @brief Add global target flags + ## @param[in] self (handle) Class handle + ## @param[in] type (string) inclusion group name 'c', 'c++', 'java' ... + ## @param[in] list ([string,...] or string) List of path to include + ## @return None + ## def add_flag(self, type, list): tools.list_append_to_2(self.global_flags, type, list) - def update_path_tree(self): + ## + ## @brief Update basic tree path positions on the build tree + ## @param[in] self (handle) Class handle + ## @return None + ## + def _update_path_tree(self): self.path_out = os.path.join("out", self.name + "_" + self.config["arch"] + "_" + self.config["bus-size"], self.config["mode"]) self.path_final = os.path.join("final", self.config["compilator"]) self.path_staging = os.path.join("staging", self.config["compilator"]) self.path_build = os.path.join("build", self.config["compilator"]) + # TODO: Remove this from here ==> this is a tools + ## + ## @brief create a string version number with the associated list values + ## @param[in] self (handle) Class handle + ## @param[in] data ([int|string,...]) version basic number + ## @return (string) version number + ## def create_number_from_version_string(self, data): tmp_data = data.split("-") if len(tmp_data) > 1: @@ -225,6 +239,12 @@ class Target: offset /= 1000 return out + ## + ## @brief Configure the cross toolchain + ## @param[in] self (handle) Class handle + ## @param[in] cross (string) Path of the cross toolchain + ## @return None + ## def set_cross_base(self, cross=""): self.cross = cross debug.debug("== Target='" + self.cross + "'"); @@ -258,7 +278,7 @@ class Target: self.nm = self.cross + "nm" self.strip = self.cross + "strip" self.dlltool = self.cross + "dlltool" - self.update_path_tree() + self._update_path_tree() #some static libraries that is sometime needed when not use stdlib ... ret = multiprocess.run_command_direct(self.xx + " -print-file-name=libgcc.a"); @@ -270,13 +290,14 @@ class Target: debug.error("Can not get the g++/clang++ libsupc++.a ...") self.stdlib_name_libsupc = ret; + ## + ## @brief Get the current build mode + ## @param[in] self (handle) Class handle + ## @return Build mode value [debug,release] + ## def get_build_mode(self): return self.config["mode"] - def clean_module_tree(self): - self.build_tree_done = [] - self.list_final_file = [] - def get_full_name_source(self, basePath, file): if file[0] == '/': if tools.os.path.isfile(file): @@ -312,120 +333,153 @@ class Target: def get_full_dependency(self, module_name, basePath, file): return self.get_build_path_object(module_name) + "/" + file + self.suffix_dependence - """ - return a list of 3 elements : - 0 : sources files (can be a list) - 1 : destination file - 2 : dependence files module (*.d) - """ - # TODO : Remove this it is urgent ... - def generate_file(self, - binary_name, - module_name, - basePath, - file, - type): - #debug.warning("genrate_file(" + str(binary_name) + "," + str(module_name) + "," + str(basePath) + "," + str(file) + "," + str(type) + ")") - list=[] - if (type=="bin"): - list.append(file) - list.append(self.get_build_file_bin(binary_name)) - list.append(os.path.join(self.get_build_path(module_name), module_name + self.suffix_dependence)) - list.append(self.get_build_file_bin(binary_name) + self.suffix_cmd_line) - list.append(self.get_build_file_bin(binary_name) + self.suffix_warning) - elif (type=="lib-shared"): - list.append(file) - list.append(self.get_build_file_dynamic(module_name)) - list.append(os.path.join(self.get_build_path(module_name), self.path_lib, module_name + self.suffix_dependence)) - list.append(self.get_build_file_dynamic(module_name) + self.suffix_cmd_line) - list.append(self.get_build_file_dynamic(module_name) + self.suffix_warning) - elif (type=="lib-static"): - list.append(file) - list.append(self.get_build_file_static(module_name)) - list.append(os.path.join(self.get_build_path(module_name), self.path_lib, module_name + self.suffix_dependence)) - list.append(self.get_build_file_static(module_name) + self.suffix_cmd_line) - list.append(self.get_build_file_static(module_name) + self.suffix_warning) - elif (type=="jar"): - list.append(file) - list.append(os.path.join(self.get_build_path(module_name), module_name + ".jar")) - list.append(os.path.join(self.get_build_path(module_name), module_name + ".jar" + self.suffix_dependence)) - list.append(os.path.join(self.get_build_path(module_name), module_name + ".jar" + self.suffix_cmd_line)) - list.append(os.path.join(self.get_build_path(module_name), module_name + ".jar" + self.suffix_warning)) - elif (type=="image"): - list.append(os.path.join(self.get_build_path(binary_name), "data", file + self.suffix_cmd_line)) - else: - debug.error("unknow type : " + type) - return list - ## - ## @brief Get the fianal path ==> contain all the generated packages - ## @return The path of the pa + ## @brief Get the final path ==> contain all the generated packages + ## @param[in] self (handle) Class handle + ## @return (string) The path ## def get_final_path(self): return os.path.join(tools.get_run_path(), self.path_out, self.path_final) - def get_staging_path(self, binary_name): - return os.path.join(tools.get_run_path(), self.path_out, self.path_staging, binary_name) + ## + ## @brief Get the staging path ==> all install stangalone package (no dependency file, no object files, no cmdlines files + ## @param[in] self (handle) Class handle + ## @param[in] name (string) Name of the module + ## @return (string) The path + ## + def get_staging_path(self, name): + return os.path.join(tools.get_run_path(), self.path_out, self.path_staging, name) - def get_build_path(self, module_name): - #debug.warning("A=" + str(tools.get_run_path()) + " " + str(self.path_out) + " " + str(self.path_build) + " " + str(module_name)) - return os.path.join(tools.get_run_path(), self.path_out, self.path_build, module_name) + ## + ## @brief Get the build path ==> dependency file, object files, cmdlines files, generate files, local install headers ... + ## @param[in] self (handle) Class handle + ## @param[in] name (string) Name of the module + ## @return (string) The path + ## + def get_build_path(self, name): + return os.path.join(tools.get_run_path(), self.path_out, self.path_build, name) + + ## + ## @brief Get the build object path where write .o files + ## @param[in] self (handle) Class handle + ## @param[in] name (string) Name of the module + ## @return (string) The path + ## + def get_build_path_object(self, name): + return os.path.join(self.get_build_path(name), self.path_object) + + ## + ## @brief Get the build binary path where write .bin, .exe ... files + ## @param[in] self (handle) Class handle + ## @param[in] name (string) Name of the module + ## @return (string) The path + ## + def get_build_path_bin(self, name): + return os.path.join(self.get_build_path(name), self.path_bin) + + ## + ## @brief Get the shared/static library object path where write .a / .so files + ## @param[in] self (handle) Class handle + ## @param[in] name (string) Name of the module + ## @return (string) The path + ## + def get_build_path_lib(self, name): + return os.path.join(self.get_build_path(name), self.path_lib) + + ## + ## @brief Get the data path where pre-write the install "data" files + ## @param[in] self (handle) Class handle + ## @param[in] name (string) Name of the module + ## @return (string) The path + ## + def get_build_path_data(self, name): + return os.path.join(self.get_build_path(name), self.path_data, name) + + ## + ## @brief Get the include path where pre-install "include" headers files + ## @param[in] self (handle) Class handle + ## @param[in] name (string) Name of the module + ## @return (string) The path + ## + def get_build_path_include(self, name): + return os.path.join(self.get_build_path(name), self.path_include) + + ## + ## @brief Get the path where to generate files when needed (before compiling / installing it) + ## @param[in] self (handle) Class handle + ## @param[in] name (string) Name of the module + ## @return (string) The path + ## + def get_build_path_temporary_generate(self, name): + return os.path.join(self.get_build_path(name), self.path_temporary_generate) + + ## + ## @brief Get the path filename of the build binary name + ## @param[in] self (handle) Class handle + ## @param[in] name (string) Name of the module + ## @return (string) The path + ## + def get_build_file_bin(self, name): + return os.path.join(self.get_build_path_bin(name), name + self.suffix_binary) + + ## + ## @brief Get the path filename of the build static library name + ## @param[in] self (handle) Class handle + ## @param[in] name (string) Name of the module + ## @return (string) The path + ## + def get_build_file_static(self, name): + return os.path.join(self.get_build_path_lib(name), self.prefix_lib + name + self.suffix_lib_static) + + ## + ## @brief Get the path filename of the build shared library name + ## @param[in] self (handle) Class handle + ## @param[in] name (string) Name of the module + ## @return (string) The path + ## + def get_build_file_dynamic(self, name): + return os.path.join(self.get_build_path_lib(name), self.prefix_lib + name + self.suffix_lib_dynamic) - def get_build_path_object(self, binary_name): - return os.path.join(self.get_build_path(binary_name), self.path_object) + ## + ## @brief Get the bin path for staging step + ## @param[in] self (handle) Class handle + ## @param[in] name (string) Name of the package + ## @return (string) The path + ## + def get_staging_path_bin(self, name): + return os.path.join(self.get_staging_path(name), self.path_bin) - def get_build_path_bin(self, binary_name): - return os.path.join(self.get_build_path(binary_name), self.path_bin) - - def get_build_path_lib(self, binary_name): - return os.path.join(self.get_build_path(binary_name), self.path_lib) - - def get_build_path_data(self, binary_name): - return os.path.join(self.get_build_path(binary_name), self.path_data, binary_name) - - def get_build_path_include(self, binary_name): - return os.path.join(self.get_build_path(binary_name), self.path_include) - - def get_build_path_temporary_generate(self, binary_name): - return os.path.join(self.get_build_path(binary_name), self.path_temporary_generate) - - - def get_build_file_bin(self, binary_name): - return os.path.join(self.get_build_path_bin(binary_name), binary_name + self.suffix_binary) - - def get_build_file_static(self, binary_name): - return os.path.join(self.get_build_path_lib(binary_name), self.prefix_lib + binary_name + self.suffix_lib_static) - - def get_build_file_dynamic(self, binary_name): - return os.path.join(self.get_build_path_lib(binary_name), self.prefix_lib + binary_name + self.suffix_lib_dynamic) - - - - - def get_staging_path_bin(self, package_name): - return os.path.join(self.get_staging_path(package_name), self.path_bin) - - def get_staging_path_lib(self, package_name): - return os.path.join(self.get_staging_path(package_name), self.path_lib, package_name) - - def get_staging_path_data(self, package_name): - return os.path.join(self.get_staging_path(package_name), self.path_data, package_name) - - def get_staging_path_include(self, package_name): - return os.path.join(self.get_staging_path(package_name), self.path_include) - - """ - def get_staging_file_bin(self, package_name, binary_name): - return os.path.join(self.get_staging_path_bin(package_name), binary_name + self.suffix_binary) - """ + ## + ## @brief Get the lib path for staging step + ## @param[in] self (handle) Class handle + ## @param[in] name (string) Name of the package + ## @return (string) The path + ## + def get_staging_path_lib(self, name): + return os.path.join(self.get_staging_path(name), self.path_lib, name) + ## + ## @brief Get the data path for staging step + ## @param[in] self (handle) Class handle + ## @param[in] name (string) Name of the package + ## @return (string) The path + ## + def get_staging_path_data(self, name): + return os.path.join(self.get_staging_path(name), self.path_data, name) + ## + ## @brief Get the include path for staging step + ## @param[in] self (handle) Class handle + ## @param[in] name (string) Name of the package + ## @return (string) The path + ## + def get_staging_path_include(self, name): + return os.path.join(self.get_staging_path(name), self.path_include) def get_doc_path(self, module_name): return os.path.join(tools.get_run_path(), self.path_out, self.path_doc, module_name) - def is_module_build(self, my_module): for mod in self.build_done: if mod == my_module: @@ -440,10 +494,22 @@ class Target: self.build_tree_done.append(my_module) return False - def add_module(self, newModule): - debug.debug("Add nodule for Taget : " + newModule.get_name()) - self.module_list.append(newModule) + ## + ## @brief Add new loaded module + ## @param[in] self (handle) Class handle + ## @param[in] new_module (handle) pointer on the module instance + ## @return None + ## + def add_module(self, new_module): + debug.debug("Add nodule for Taget : " + new_module.get_name()) + self.module_list.append(new_module) + ## + ## @brief Get a module handle that is used in this target + ## @param[in] self (handle) Class handle + ## @param[in] name (string) Name of the module + ## @return (handle|None) @ref lutin.module.Module pointer on the module requested or None + ## def get_module(self, name): for mod in self.module_list: if mod.get_name() == name: @@ -451,22 +517,26 @@ class Target: debug.error("the module '" + str(name) + "'does not exist/already build") return None - # return inherit packages ... - """ - def build(self, name, packagesName): - for module in self.module_list: - if module.name == name: - return module.build(self, packagesName) - debug.error("request to build an un-existant module name : '" + name + "'") - """ - - def build_tree(self, name, packagesName): + ## + ## @brief Build data associated at the module name in a specific package + ## @param[in] self (handle) Class handle + ## @param[in] name (string) Name of the module + ## @param[in] package_name (string) Name of the package + ## @return None + ## + def build_tree(self, name, package_name): for mod in self.module_list: if mod.get_name() == name: - mod.build_tree(self, packagesName) + mod.build_tree(self, package_name) return debug.error("request to build tree on un-existant module name : '" + name + "'") + ## + ## @brief Clean a specific module for this target (clean all data in the "out" path) + ## @param[in] self (handle) Class handle + ## @param[in] name (string) Name of the module + ## @return None + ## def clean(self, name): for mod in self.module_list: if mod.get_name() == name: @@ -474,6 +544,13 @@ class Target: return debug.error("request to clean an un-existant module name : '" + name + "'") + ## + ## @brief Load a specific module if it accessible + ## @param[in] self (handle) Class handle + ## @param[in] name (string) Name of the module to load + ## @param[in] optionnal (bool) not create an error if the module does not exist. + ## @return (bool) module loading status + ## def load_if_needed(self, name, optionnal=False): for elem in self.module_list: if elem.get_name() == name: @@ -491,19 +568,26 @@ class Target: # we did not find the module ... return False; + ## + ## @brief Load all module that are accessible in the worktree + ## @param[in] self (handle) Class handle + ## @return None + ## def load_all(self): listOfAllTheModule = module.list_all_module() for modName in listOfAllTheModule: self.load_if_needed(modName) - def project_add_module(self, name, projectMng, addedModule): - for mod in self.module_list: - if mod.get_name() == name: - mod.ext_project_add_module(self, projectMng, addedModule) - return - - - def build(self, name, packagesName=None, optionnal=False, actions=[]): + ## + ## @brief Build action on the target (execute specific actions on the modules...) + ## @note Recursive call ... + ## @param[in] self (handle) Class handle + ## @param[in] name (string) Module to build + ## @param[in] optionnal (bool) If the module is not accessible, this is not a probleme ==> optionnal dependency requested + ## @param[in] actions ([string,...]) list of action to do. ex: build, gcov, dump, all, clean, install, uninstall, run, log + ## @return (None|Module handle| ...) complicated return ... + ## + def build(self, name, optionnal=False, actions=[]): if len(name.split("?")) != 1\ or len(name.split("@")) != 1: debug.error("need update") @@ -635,6 +719,23 @@ class Target: if len(action_list) == 1: return ret + ## + ## @brief Add action to do for package specific part when build upper element + ## @param[in] name_of_state (string) a state to call action + ## - BINARY + ## - BINARY_SHARED + ## - BINARY_STAND_ALONE + ## - LIBRARY + ## - LIBRARY_DYNAMIC + ## - LIBRARY_STATIC + ## - PACKAGE + ## - PREBUILD + ## - DATA + ## @param[in] level (int) Value order to apply action + ## @param[in] name (string) Name of the action + ## @param[in] action (function handle) Function to call to execure action + ## @return None + ## def add_action(self, name_of_state="PACKAGE", level=5, name="no-name", action=None): debug.verbose("add action : " + name) if name_of_state not in self.action_on_state: @@ -868,7 +969,7 @@ class Target: return result -target_list=[] +__target_list=[] __start_target_name="Target_" ## @@ -876,7 +977,7 @@ __start_target_name="Target_" ## @param[in] path_list ([string,...]) List of file that start with env.get_build_system_base_name() in the running worktree (Parse one time ==> faster) ## def import_path(path_list): - global target_list + global __target_list global_base = env.get_build_system_base_name() debug.debug("TARGET: Init with Files list:") for elem in path_list: @@ -894,21 +995,21 @@ def import_path(path_list): # Remove local patern target_name = filename[len(__start_target_name):] debug.verbose("TARGET: Integrate: '" + target_name + "' from '" + elem + "'") - target_list.append([target_name, elem]) + __target_list.append([target_name, elem]) debug.verbose("New list TARGET: ") - for elem in target_list: + for elem in __target_list: debug.verbose(" " + str(elem[0])) ## -## @brief +## @brief Load a specific target ## def load_target(name, config): - global target_list + global __target_list debug.debug("load target: " + name) - if len(target_list) == 0: + if len(__target_list) == 0: debug.error("No target to compile !!!") - debug.debug("list target: " + str(target_list)) - for mod in target_list: + debug.debug("list target: " + str(__target_list)) + for mod in __target_list: if mod[0] == name: debug.verbose("add to path: '" + os.path.dirname(mod[1]) + "'") sys.path.append(os.path.dirname(mod[1])) @@ -920,16 +1021,16 @@ def load_target(name, config): raise KeyError("No entry for : " + name) def list_all_target(): - global target_list + global __target_list tmpListName = [] - for mod in target_list: + for mod in __target_list: tmpListName.append(mod[0]) return tmpListName def list_all_target_with_desc(): - global target_list + global __target_list tmpList = [] - for mod in target_list: + for mod in __target_list: sys.path.append(os.path.dirname(mod[1])) theTarget = __import__(env.get_build_system_base_name() + __start_target_name + mod[0]) try: diff --git a/lutin/z_builder/lutinBuilder_binary.py b/lutin/z_builder/lutinBuilder_binary.py index 83d1799..6fba65d 100644 --- a/lutin/z_builder/lutinBuilder_binary.py +++ b/lutin/z_builder/lutinBuilder_binary.py @@ -58,7 +58,12 @@ def get_support_multithreading(): ## @brief Commands for running gcc to link an executable. ## def link(file, binary, target, depancy, flags, name, basic_path, static = False): - file_src, file_dst, file_depend, file_cmd, file_warning = target.generate_file(binary, name, basic_path, file, "bin") + file_src = file + file_dst = target.get_build_file_bin(binary) + file_depend = file_dst + target.suffix_dependence + file_cmd = file_dst + target.suffix_cmd_line + file_warning = file_dst + target.suffix_warning + debug.extreme_verbose("list files = " + str(depancy.src)) list_static = [] list_dynamic = [] diff --git a/lutin/z_builder/lutinBuilder_jar.py b/lutin/z_builder/lutinBuilder_jar.py index 003ac4e..88f6dc8 100644 --- a/lutin/z_builder/lutinBuilder_jar.py +++ b/lutin/z_builder/lutinBuilder_jar.py @@ -57,7 +57,12 @@ def get_support_multithreading(): ## @brief Commands for running gcc to link a shared library. ## def link(file, binary, target, depancy, flags, name, basic_path): - file_src, file_dst, file_depend, file_cmd, file_warning = target.generate_file(binary, name, basic_path, file, "jar") + file_src = file + file_dst = os.path.join(target.get_build_path(name), name + ".jar") + file_depend = file_dst + target.suffix_dependence + file_cmd = file_dst + target.suffix_cmd_line + file_warning = file_dst + target.suffix_warning + #create command Line cmd = [ target.jar, diff --git a/lutin/z_builder/lutinBuilder_libraryDynamic.py b/lutin/z_builder/lutinBuilder_libraryDynamic.py index 94bcaf3..ebef104 100644 --- a/lutin/z_builder/lutinBuilder_libraryDynamic.py +++ b/lutin/z_builder/lutinBuilder_libraryDynamic.py @@ -57,7 +57,17 @@ def get_support_multithreading(): ## @brief Commands for running gcc to link a shared library. ## def link(file, binary, target, depancy, flags, name, basic_path, static=False): - file_src, file_dst, file_depend, file_cmd, file_warning = target.generate_file(binary, name, basic_path, file, "lib-shared") + file_src = file + file_dst = target.get_build_file_dynamic(name) + file_depend = file_dst + target.suffix_dependence + file_cmd = file_dst + target.suffix_cmd_line + file_warning = file_dst + target.suffix_warning + + debug.extreme_verbose("file_dst = " + file_dst) + debug.extreme_verbose("file_depend = " + file_depend) + debug.extreme_verbose("file_cmd = " + file_cmd) + debug.extreme_verbose("file_warning = " + file_warning) + list_static = [] list_dynamic = [] if static == True: diff --git a/lutin/z_builder/lutinBuilder_libraryStatic.py b/lutin/z_builder/lutinBuilder_libraryStatic.py index f566c4b..e6030ca 100644 --- a/lutin/z_builder/lutinBuilder_libraryStatic.py +++ b/lutin/z_builder/lutinBuilder_libraryStatic.py @@ -57,8 +57,17 @@ def get_support_multithreading(): ## @brief Commands for running ar. ## def link(file, binary, target, depancy, flags, name, basic_path): - file_src, file_dst, file_depend, file_cmd, file_warning = target.generate_file(binary, name, basic_path, file, "lib-static") - #$(Q)$(TARGET_AR) $(TARGET_GLOBAL_ARFLAGS) $(PRIVATE_ARFLAGS) $@ $(PRIVATE_ALL_OBJECTS) + file_src = file + file_dst = target.get_build_file_static(name) + file_depend = file_dst + target.suffix_dependence + file_cmd = file_dst + target.suffix_cmd_line + file_warning = file_dst + target.suffix_warning + + debug.extreme_verbose("file_dst = " + file_dst) + debug.extreme_verbose("file_depend = " + file_depend) + debug.extreme_verbose("file_cmd = " + file_cmd) + debug.extreme_verbose("file_warning = " + file_warning) + cmd = [ target.ar ] diff --git a/lutin/z_system/lutinSystem_Android_ADMOD.py b/lutin/z_system/lutinSystem_Android_ADMOD.py index 4b7382b..1cc25a4 100644 --- a/lutin/z_system/lutinSystem_Android_ADMOD.py +++ b/lutin/z_system/lutinSystem_Android_ADMOD.py @@ -22,7 +22,7 @@ class System(system.System): # todo : Check if present ... self.valid = True # todo : create a searcher of the presence of the library: - self.add_export_sources(target.path_sdk + "/extras/google/google_play_services/libproject/google-play-services_lib/libs/google-play-services.jar") + self.add_sources(target.path_sdk + "/extras/google/google_play_services/libproject/google-play-services_lib/libs/google-play-services.jar") self.add_action("PACKAGE", 10, "admod-auto-wrapper", tool_generate_main_java_class) diff --git a/lutin/z_system/lutinSystem_Android_SDK.py b/lutin/z_system/lutinSystem_Android_SDK.py index 329938a..715c328 100644 --- a/lutin/z_system/lutinSystem_Android_SDK.py +++ b/lutin/z_system/lutinSystem_Android_SDK.py @@ -24,9 +24,9 @@ class System(system.System): # TODO : Check if the android sdk android.jar is present ... self.valid = True # todo : create a searcher of the presence of the library: - self.add_export_sources(jar_file_path) - self.add_export_flag("link-lib", "dl") - self.add_export_flag("link-lib", "log") - self.add_export_flag("link-lib", "android") + self.add_sources(jar_file_path) + self.add_flag("link-lib", "dl") + self.add_flag("link-lib", "log") + self.add_flag("link-lib", "android") diff --git a/lutin/z_system/lutinSystem_Android_cxx.py b/lutin/z_system/lutinSystem_Android_cxx.py index e29504d..766d2dd 100644 --- a/lutin/z_system/lutinSystem_Android_cxx.py +++ b/lutin/z_system/lutinSystem_Android_cxx.py @@ -25,53 +25,53 @@ class System(system.System): debug.error("Clang work only with the board wersion >= 21 : android 5.x.x") self.valid = False return - self.add_export_flag("c++", "-D__STDCPP_LLVM__") + self.add_flag("c++", "-D__STDCPP_LLVM__") # llvm is BSD-like licence - self.add_export_path(os.path.join(target.path_ndk, "sources", "cxx-stl", "llvm-libc++", "libcxx", "include")) + self.add_path(os.path.join(target.path_ndk, "sources", "cxx-stl", "llvm-libc++", "libcxx", "include")) if target.type_arch == "armv5": stdCppBasePath = os.path.join(target.path_ndk, "sources", "cxx-stl", "llvm-libc++", "libcxx", "libs", "armeabi") - self.add_export_path( os.path.join(stdCppBasePath, "include")) - self.add_export_flag("link", os.path.join(stdCppBasePath, "libc++_static.a")) + self.add_path( os.path.join(stdCppBasePath, "include")) + self.add_flag("link", os.path.join(stdCppBasePath, "libc++_static.a")) elif target.type_arch == "armv7": stdCppBasePath = os.path.join(target.path_ndk, "sources", "cxx-stl", "llvm-libc++", "libs", "armeabi-v7a") - self.add_export_path( os.path.join(stdCppBasePath + "include")) - self.add_export_flag("link", os.path.join(stdCppBasePath, "thumb", "libc++_static.a")) + self.add_path( os.path.join(stdCppBasePath + "include")) + self.add_flag("link", os.path.join(stdCppBasePath, "thumb", "libc++_static.a")) elif target.type_arch == "mips": stdCppBasePath = os.path.join(target.path_ndk, "sources", "cxx-stl", "llvm-libc++", "libcxx", "libs", "mips") - self.add_export_path( os.path.join(stdCppBasePath + "include")) - self.add_export_flag("link", os.path.join(stdCppBasePath + "libc++_static.a")) + self.add_path( os.path.join(stdCppBasePath + "include")) + self.add_flag("link", os.path.join(stdCppBasePath + "libc++_static.a")) elif target.type_arch == "x86": stdCppBasePath = os.path.join(target.path_ndk, "sources", "cxx-stl", "llvm-libc++", "libcxx", "libs", "x86") - self.add_export_path( os.path.join(stdCppBasePath, "include")) - self.add_export_flag("link", os.path.join(stdCppBasePath, "libc++_static.a")) + self.add_path( os.path.join(stdCppBasePath, "include")) + self.add_flag("link", os.path.join(stdCppBasePath, "libc++_static.a")) else: debug.warning("unknow architecture: '" + str(target.arch) + "'"); else: - self.add_export_flag("c++", "-D__STDCPP_GNU__") - self.add_export_flag("c++-remove","-nostdlib") - self.add_export_flag("need-libstdc++", True) + self.add_flag("c++", "-D__STDCPP_GNU__") + self.add_flag("c++-remove","-nostdlib") + self.add_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")) + self.add_path(os.path.join(target.path_ndk, "sources", "cxx-stl", "gnu-libstdc++", target.compilator_version, "include")) if target.type_arch == "armv5": stdCppBasePath = os.path.join(target.path_ndk, "sources", "cxx-stl", "gnu-libstdc++", target.compilator_version, "libs", "armeabi") - self.add_export_path( os.path.join(stdCppBasePath, "include")) - self.add_export_flag("link", os.path.join(stdCppBasePath, "thumb", "libgnustl_static.a")) - self.add_export_flag("link", os.path.join(stdCppBasePath, "thumb", "libsupc++.a")) + self.add_path( os.path.join(stdCppBasePath, "include")) + self.add_flag("link", os.path.join(stdCppBasePath, "thumb", "libgnustl_static.a")) + self.add_flag("link", os.path.join(stdCppBasePath, "thumb", "libsupc++.a")) elif target.type_arch == "armv7": stdCppBasePath = os.path.join(target.path_ndk, "sources", "cxx-stl", "gnu-libstdc++", target.compilator_version, "libs", "armeabi-v7a") - self.add_export_path( os.path.join(stdCppBasePath, "include")) - self.add_export_flag("link", os.path.join(stdCppBasePath, "thumb", "libgnustl_static.a")) - self.add_export_flag("link", os.path.join(stdCppBasePath, "thumb", "libsupc++.a")) + self.add_path( os.path.join(stdCppBasePath, "include")) + self.add_flag("link", os.path.join(stdCppBasePath, "thumb", "libgnustl_static.a")) + self.add_flag("link", os.path.join(stdCppBasePath, "thumb", "libsupc++.a")) elif target.type_arch == "mips": stdCppBasePath = os.path.join(target.path_ndk, "sources", "cxx-stl", "gnu-libstdc++", target.compilator_version, "libs", "mips") - self.add_export_path( os.path.join(stdCppBasePath, "include/")) - self.add_export_flag("link", os.path.join(stdCppBasePath, "libgnustl_static.a")) - self.add_export_flag("link", os.path.join(stdCppBasePath, "libsupc++.a")) + self.add_path( os.path.join(stdCppBasePath, "include/")) + self.add_flag("link", os.path.join(stdCppBasePath, "libgnustl_static.a")) + self.add_flag("link", os.path.join(stdCppBasePath, "libsupc++.a")) elif target.type_arch == "x86": stdCppBasePath = os.path.join(target.path_ndk, "sources", "cxx-stl", "gnu-libstdc++", target.compilator_version, "libs", "x86") - self.add_export_path( os.path.join(stdCppBasePath, "include")) - self.add_export_flag("link", os.path.join(stdCppBasePath, "libgnustl_static.a")) - self.add_export_flag("link", os.path.join(stdCppBasePath, "libsupc++.a")) + self.add_path( os.path.join(stdCppBasePath, "include")) + self.add_flag("link", os.path.join(stdCppBasePath, "libgnustl_static.a")) + self.add_flag("link", os.path.join(stdCppBasePath, "libsupc++.a")) else: debug.warning("unknow architecture: '" + str(target.arch) + "'"); debug.warning("plop") \ No newline at end of file diff --git a/lutin/z_system/lutinSystem_Android_m.py b/lutin/z_system/lutinSystem_Android_m.py index b72825e..41b3c96 100644 --- a/lutin/z_system/lutinSystem_Android_m.py +++ b/lutin/z_system/lutinSystem_Android_m.py @@ -22,6 +22,6 @@ class System(system.System): # No check ==> on the basic std libs: self.valid = True # todo : create a searcher of the presence of the library: - self.add_export_flag("link-lib", "m") + self.add_flag("link-lib", "m") diff --git a/lutin/z_system/lutinSystem_Android_opengl.py b/lutin/z_system/lutinSystem_Android_opengl.py index cc1aeeb..13d8c23 100644 --- a/lutin/z_system/lutinSystem_Android_opengl.py +++ b/lutin/z_system/lutinSystem_Android_opengl.py @@ -21,7 +21,7 @@ class System(system.System): self.help = "OpenGL: Generic graphic library" self.valid = True # no check needed ==> just add this: - self.add_module_depend([ + self.add_depend([ 'c', ]) """ @@ -31,6 +31,6 @@ class System(system.System): destination_path="GL", recursive=True) """ - self.add_export_flag('link-lib', "GLESv2") + self.add_flag('link-lib', "GLESv2") diff --git a/lutin/z_system/lutinSystem_Android_pthread.py b/lutin/z_system/lutinSystem_Android_pthread.py index f8b1a1d..ea96219 100644 --- a/lutin/z_system/lutinSystem_Android_pthread.py +++ b/lutin/z_system/lutinSystem_Android_pthread.py @@ -27,8 +27,8 @@ class System(system.System): """ self.valid = True # todo : create a searcher of the presence of the library: - #self.add_export_flag("link-lib", "pthread") - self.add_module_depend([ + #self.add_flag("link-lib", "pthread") + self.add_depend([ 'c' ]) diff --git a/lutin/z_system/lutinSystem_Android_z.py b/lutin/z_system/lutinSystem_Android_z.py index b4c1f3c..91511c9 100644 --- a/lutin/z_system/lutinSystem_Android_z.py +++ b/lutin/z_system/lutinSystem_Android_z.py @@ -24,6 +24,6 @@ class System(system.System): return; self.valid = True # todo : create a searcher of the presence of the library: - self.add_export_flag("link-lib", "z") + self.add_flag("link-lib", "z") diff --git a/lutin/z_system/lutinSystem_IOs_CoreAudio.py b/lutin/z_system/lutinSystem_IOs_CoreAudio.py index 4c6e517..27e110b 100644 --- a/lutin/z_system/lutinSystem_IOs_CoreAudio.py +++ b/lutin/z_system/lutinSystem_IOs_CoreAudio.py @@ -21,7 +21,7 @@ class System(system.System): self.help="CoreAudio : Ios interface for audio (all time present, just system interface)" self.valid = True # todo : create a searcher of the presence of the library: - self.add_export_flag("link", "-framework CoreAudio") - self.add_export_flag("link", "-framework AudioToolbox") + self.add_flag("link", "-framework CoreAudio") + self.add_flag("link", "-framework AudioToolbox") diff --git a/lutin/z_system/lutinSystem_IOs_cxx.py b/lutin/z_system/lutinSystem_IOs_cxx.py index 82bfa61..6e75ecb 100644 --- a/lutin/z_system/lutinSystem_IOs_cxx.py +++ b/lutin/z_system/lutinSystem_IOs_cxx.py @@ -21,8 +21,8 @@ class System(system.System): self.help = "CXX: Generic C++ library" self.valid = True # no check needed ==> just add this: - self.add_export_flag("c++", "-D__STDCPP_LLVM__") - self.add_export_flag("c++-remove", "-nostdlib") - self.add_export_flag("need-libstdc++", True) + self.add_flag("c++", "-D__STDCPP_LLVM__") + self.add_flag("c++-remove", "-nostdlib") + self.add_flag("need-libstdc++", True) diff --git a/lutin/z_system/lutinSystem_IOs_m.py b/lutin/z_system/lutinSystem_IOs_m.py index b72825e..41b3c96 100644 --- a/lutin/z_system/lutinSystem_IOs_m.py +++ b/lutin/z_system/lutinSystem_IOs_m.py @@ -22,6 +22,6 @@ class System(system.System): # No check ==> on the basic std libs: self.valid = True # todo : create a searcher of the presence of the library: - self.add_export_flag("link-lib", "m") + self.add_flag("link-lib", "m") diff --git a/lutin/z_system/lutinSystem_Linux_X11.py b/lutin/z_system/lutinSystem_Linux_X11.py index 0a29a68..899144a 100644 --- a/lutin/z_system/lutinSystem_Linux_X11.py +++ b/lutin/z_system/lutinSystem_Linux_X11.py @@ -21,8 +21,8 @@ class System(system.System): self.help = "X11: Basic interface of Linux Graphic interface" self.valid = True # no check needed ==> just add this: - self.add_module_depend(['c']) - self.add_export_flag('link-lib', 'X11') + self.add_depend(['c']) + self.add_flag('link-lib', 'X11') if env.get_isolate_system() == True: self.add_header_file([ "/usr/include/X11/*" diff --git a/lutin/z_system/lutinSystem_Linux_alsa.py b/lutin/z_system/lutinSystem_Linux_alsa.py index 5f027b3..738bfc8 100644 --- a/lutin/z_system/lutinSystem_Linux_alsa.py +++ b/lutin/z_system/lutinSystem_Linux_alsa.py @@ -26,9 +26,9 @@ class System(system.System): return; self.valid = True if env.get_isolate_system() == False: - self.add_export_flag("link-lib", "asound") + self.add_flag("link-lib", "asound") else: - self.add_export_flag("link-lib", "asound") + self.add_flag("link-lib", "asound") self.add_header_file([ "/usr/include/alsa/*", ], @@ -39,7 +39,7 @@ class System(system.System): ], destination_path="dssi", recursive=True) - self.add_module_depend([ + self.add_depend([ 'c' ]) diff --git a/lutin/z_system/lutinSystem_Linux_arpa.py b/lutin/z_system/lutinSystem_Linux_arpa.py index 3b1359f..22915f0 100644 --- a/lutin/z_system/lutinSystem_Linux_arpa.py +++ b/lutin/z_system/lutinSystem_Linux_arpa.py @@ -26,13 +26,13 @@ class System(system.System): # No check ==> on the basic std libs: self.valid = True if env.get_isolate_system() == True: - #self.add_export_flag("link-lib", "xns") + #self.add_flag("link-lib", "xns") self.add_header_file([ "/usr/include/arpa/*" ], destination_path="arpa", recursive=True) - self.add_module_depend([ + self.add_depend([ 'c' ]) diff --git a/lutin/z_system/lutinSystem_Linux_boost.py b/lutin/z_system/lutinSystem_Linux_boost.py index 0553fe4..54159db 100644 --- a/lutin/z_system/lutinSystem_Linux_boost.py +++ b/lutin/z_system/lutinSystem_Linux_boost.py @@ -26,7 +26,7 @@ class System(system.System): self.valid = True if env.get_isolate_system() == False: # todo : create a searcher of the presence of the library: - self.add_export_flag("link-lib", [ + self.add_flag("link-lib", [ "boost_system", "boost_thread", "boost_chrono" @@ -37,7 +37,7 @@ class System(system.System): ], destination_path="boost", recursive=True) - self.add_module_depend([ + self.add_depend([ 'cxx' ]) diff --git a/lutin/z_system/lutinSystem_Linux_c.py b/lutin/z_system/lutinSystem_Linux_c.py index 6b6a29f..2ebe916 100644 --- a/lutin/z_system/lutinSystem_Linux_c.py +++ b/lutin/z_system/lutinSystem_Linux_c.py @@ -171,5 +171,5 @@ class System(system.System): ], destination_path="net", recursive=True) - self.add_export_flag("link", "-B/usr/lib") + self.add_flag("link", "-B/usr/lib") diff --git a/lutin/z_system/lutinSystem_Linux_cxx.py b/lutin/z_system/lutinSystem_Linux_cxx.py index 7d91b1a..89c57c9 100644 --- a/lutin/z_system/lutinSystem_Linux_cxx.py +++ b/lutin/z_system/lutinSystem_Linux_cxx.py @@ -22,17 +22,17 @@ class System(system.System): self.help = "CXX: Generic C++ library" self.valid = True # no check needed ==> just add this: - self.add_module_depend([ + self.add_depend([ 'c', 'm', 'pthread' ]) - self.add_export_flag("c++", "-D__STDCPP_GNU__") + self.add_flag("c++", "-D__STDCPP_GNU__") if env.get_isolate_system() == False: - self.add_export_flag("c++-remove", "-nostdlib") - self.add_export_flag("need-libstdc++", True) + self.add_flag("c++-remove", "-nostdlib") + self.add_flag("need-libstdc++", True) else: - self.add_export_flag("link-lib", "stdc++") + self.add_flag("link-lib", "stdc++") compilator_gcc = "g++" if target.config["compilator-version"] != "": compilator_gcc = compilator_gcc + "-" + target.config["compilator-version"] diff --git a/lutin/z_system/lutinSystem_Linux_jack.py b/lutin/z_system/lutinSystem_Linux_jack.py index 4eee1ab..e31dde6 100644 --- a/lutin/z_system/lutinSystem_Linux_jack.py +++ b/lutin/z_system/lutinSystem_Linux_jack.py @@ -24,11 +24,11 @@ class System(system.System): # we did not find the library reqiested (just return) (automaticly set at false) return; self.valid = True - self.add_module_depend([ + self.add_depend([ 'uuid', 'c' ]) - self.add_export_flag("link-lib", "jack") + self.add_flag("link-lib", "jack") if env.get_isolate_system() == True: self.add_header_file([ "/usr/include/jack/*", diff --git a/lutin/z_system/lutinSystem_Linux_m.py b/lutin/z_system/lutinSystem_Linux_m.py index 3739ed9..d56ede8 100644 --- a/lutin/z_system/lutinSystem_Linux_m.py +++ b/lutin/z_system/lutinSystem_Linux_m.py @@ -22,8 +22,8 @@ class System(system.System): # No check ==> on the basic std libs: self.valid = True # todo : create a searcher of the presence of the library: - self.add_export_flag("link-lib", "m") - self.add_module_depend([ + self.add_flag("link-lib", "m") + self.add_depend([ 'c' ]) if env.get_isolate_system() == True: diff --git a/lutin/z_system/lutinSystem_Linux_opengl.py b/lutin/z_system/lutinSystem_Linux_opengl.py index 1a9f059..c18405f 100644 --- a/lutin/z_system/lutinSystem_Linux_opengl.py +++ b/lutin/z_system/lutinSystem_Linux_opengl.py @@ -21,11 +21,11 @@ class System(system.System): self.help = "OpenGL: Generic graphic library" self.valid = True # no check needed ==> just add this: - self.add_module_depend([ + self.add_depend([ 'c', 'X11' ]) - self.add_export_flag('link-lib', 'GL') + self.add_flag('link-lib', 'GL') if env.get_isolate_system() == True: self.add_header_file([ "/usr/include/GL/*" @@ -37,16 +37,16 @@ class System(system.System): if target.name=="Linux": elif target.name=="Android": - my_module.add_export_flag('link-lib', "GLESv2") + my_module.add_flag('link-lib', "GLESv2") elif target.name=="Windows": - my_module.add_module_depend([ + my_module.add_depend([ "glew" ]) elif target.name=="MacOs": - my_module.add_export_flag('link', [ + my_module.add_flag('link', [ "-framework OpenGL"]) elif target.name=="IOs": - my_module.add_export_flag('link', [ + my_module.add_flag('link', [ "-framework OpenGLES" ]) """ diff --git a/lutin/z_system/lutinSystem_Linux_oss.py b/lutin/z_system/lutinSystem_Linux_oss.py index c198709..5517c22 100644 --- a/lutin/z_system/lutinSystem_Linux_oss.py +++ b/lutin/z_system/lutinSystem_Linux_oss.py @@ -26,7 +26,7 @@ class System(system.System): return; self.valid = True # todo : create a searcher of the presence of the library: - self.add_export_flag("link-lib", "oss") + self.add_flag("link-lib", "oss") """ diff --git a/lutin/z_system/lutinSystem_Linux_pthread.py b/lutin/z_system/lutinSystem_Linux_pthread.py index 3c0c477..9132163 100644 --- a/lutin/z_system/lutinSystem_Linux_pthread.py +++ b/lutin/z_system/lutinSystem_Linux_pthread.py @@ -25,8 +25,8 @@ class System(system.System): return; self.valid = True # todo : create a searcher of the presence of the library: - self.add_export_flag("link-lib", "pthread") - self.add_module_depend([ + self.add_flag("link-lib", "pthread") + self.add_depend([ 'c' ]) if env.get_isolate_system() == True: diff --git a/lutin/z_system/lutinSystem_Linux_pulse.py b/lutin/z_system/lutinSystem_Linux_pulse.py index 6bad1dd..de32498 100644 --- a/lutin/z_system/lutinSystem_Linux_pulse.py +++ b/lutin/z_system/lutinSystem_Linux_pulse.py @@ -39,23 +39,23 @@ class System(system.System): return self.set_version([int(version),int(version2)]) self.valid = True - self.add_module_depend([ + self.add_depend([ 'c' ]) if env.get_isolate_system() == False: - self.add_export_flag("link-lib", [ + self.add_flag("link-lib", [ "pulse-simple", "pulse" ]) else: # todo : create a searcher of the presence of the library: - self.add_export_flag("link-lib", [ + self.add_flag("link-lib", [ "pulsecommon-" + version + ".0", "pulse-mainloop-glib", "pulse-simple", "pulse" ]) - self.add_export_flag("link", "-L/usr/lib/pulseaudio") + self.add_flag("link", "-L/usr/lib/pulseaudio") self.add_header_file([ "/usr/include/pulse/*", ], diff --git a/lutin/z_system/lutinSystem_Linux_rpc.py b/lutin/z_system/lutinSystem_Linux_rpc.py index 1959531..00f9d7d 100644 --- a/lutin/z_system/lutinSystem_Linux_rpc.py +++ b/lutin/z_system/lutinSystem_Linux_rpc.py @@ -21,12 +21,12 @@ class System(system.System): self.help="rpc : generic RPC library (developed by oracle)" # No check ==> on the basic std libs: self.valid = True - self.add_module_depend([ + self.add_depend([ 'c' ]) # todo : create a searcher of the presence of the library: - self.add_export_flag("link-lib", "rpcsvc") - if env.get_isolate_system() == False: + self.add_flag("link-lib", "rpcsvc") + if env.get_isolate_system() == True: self.add_header_file([ "/usr/include/rpc/*" ], diff --git a/lutin/z_system/lutinSystem_Linux_uuid.py b/lutin/z_system/lutinSystem_Linux_uuid.py index d0a2e21..4b3f828 100644 --- a/lutin/z_system/lutinSystem_Linux_uuid.py +++ b/lutin/z_system/lutinSystem_Linux_uuid.py @@ -24,12 +24,12 @@ class System(system.System): # we did not find the library reqiested (just return) (automaticly set at false) return; self.valid = True - self.add_module_depend([ + self.add_depend([ 'c' ]) # todo : create a searcher of the presence of the library: - self.add_export_flag("link-lib", "uuid") - if env.get_isolate_system() == False: + self.add_flag("link-lib", "uuid") + if env.get_isolate_system() == True: self.add_header_file([ "/usr/include/uuid/*", ], diff --git a/lutin/z_system/lutinSystem_Linux_z.py b/lutin/z_system/lutinSystem_Linux_z.py index 302da69..eab12a8 100644 --- a/lutin/z_system/lutinSystem_Linux_z.py +++ b/lutin/z_system/lutinSystem_Linux_z.py @@ -25,12 +25,12 @@ class System(system.System): return; self.valid = True # todo : create a searcher of the presence of the library: - self.add_export_flag("link-lib", "z") - self.add_module_depend([ + self.add_flag("link-lib", "z") + self.add_depend([ 'c' ]) - if env.get_isolate_system() == False: + if env.get_isolate_system() == True: self.add_header_file([ "/usr/include/zlib.h" ], diff --git a/lutin/z_system/lutinSystem_MacOs_CoreAudio.py b/lutin/z_system/lutinSystem_MacOs_CoreAudio.py index 52df831..17607e3 100644 --- a/lutin/z_system/lutinSystem_MacOs_CoreAudio.py +++ b/lutin/z_system/lutinSystem_MacOs_CoreAudio.py @@ -21,6 +21,6 @@ class System(system.System): self.help="CoreAudio : MacOs interface for audio (all time present, just system interface)" self.valid = True # todo : create a searcher of the presence of the library: - self.add_export_flag("link", "-framework CoreAudio") - self.add_export_flag("link", "-framework CoreFoundation") + self.add_flag("link", "-framework CoreAudio") + self.add_flag("link", "-framework CoreFoundation") diff --git a/lutin/z_system/lutinSystem_MacOs_cxx.py b/lutin/z_system/lutinSystem_MacOs_cxx.py index 5fe5e0e..c3f79d7 100644 --- a/lutin/z_system/lutinSystem_MacOs_cxx.py +++ b/lutin/z_system/lutinSystem_MacOs_cxx.py @@ -21,8 +21,8 @@ class System(system.System): self.help = "CXX: Generic C++ library" self.valid = True # no check needed ==> just add this: - self.add_export_flag("c++","-D__STDCPP_LLVM__") - self.add_export_flag("c++-remove","-nostdlib") - self.add_export_flag("need-libstdc++", True) + self.add_flag("c++","-D__STDCPP_LLVM__") + self.add_flag("c++-remove","-nostdlib") + self.add_flag("need-libstdc++", True) diff --git a/lutin/z_system/lutinSystem_MacOs_m.py b/lutin/z_system/lutinSystem_MacOs_m.py index b72825e..41b3c96 100644 --- a/lutin/z_system/lutinSystem_MacOs_m.py +++ b/lutin/z_system/lutinSystem_MacOs_m.py @@ -22,6 +22,6 @@ class System(system.System): # No check ==> on the basic std libs: self.valid = True # todo : create a searcher of the presence of the library: - self.add_export_flag("link-lib", "m") + self.add_flag("link-lib", "m") diff --git a/lutin/z_system/lutinSystem_Windows_cxx.py b/lutin/z_system/lutinSystem_Windows_cxx.py index 89b5f0d..92555c2 100644 --- a/lutin/z_system/lutinSystem_Windows_cxx.py +++ b/lutin/z_system/lutinSystem_Windows_cxx.py @@ -21,14 +21,14 @@ class System(system.System): self.help = "CXX: Generic C++ library" self.valid = True # no check needed ==> just add this: - self.add_export_flag("c++","-D__STDCPP_GNU__") - self.add_export_flag("c++-remove","-nostdlib") + self.add_flag("c++","-D__STDCPP_GNU__") + self.add_flag("c++-remove","-nostdlib") # force static link to prenvent many errors ... - self.add_export_flag("link", [ + self.add_flag("link", [ "-static-libgcc", "-static-libstdc++", "-static" ]) - self.add_export_flag("need-libstdc++", True) + self.add_flag("need-libstdc++", True) diff --git a/lutin/z_system/lutinSystem_Windows_ds.py b/lutin/z_system/lutinSystem_Windows_ds.py index 42c6587..95491a4 100644 --- a/lutin/z_system/lutinSystem_Windows_ds.py +++ b/lutin/z_system/lutinSystem_Windows_ds.py @@ -25,7 +25,7 @@ class System(system.System): return; self.valid = True # todo : create a searcher of the presence of the library: - self.add_export_flag("link-lib",[ + self.add_flag("link-lib",[ "dsound", "winmm", "ole32" diff --git a/lutin/z_system/lutinSystem_Windows_m.py b/lutin/z_system/lutinSystem_Windows_m.py index b72825e..41b3c96 100644 --- a/lutin/z_system/lutinSystem_Windows_m.py +++ b/lutin/z_system/lutinSystem_Windows_m.py @@ -22,6 +22,6 @@ class System(system.System): # No check ==> on the basic std libs: self.valid = True # todo : create a searcher of the presence of the library: - self.add_export_flag("link-lib", "m") + self.add_flag("link-lib", "m") diff --git a/lutin/z_target/lutinTarget_IOs.py b/lutin/z_target/lutinTarget_IOs.py index 523fb7d..22a1618 100644 --- a/lutin/z_target/lutinTarget_IOs.py +++ b/lutin/z_target/lutinTarget_IOs.py @@ -353,7 +353,7 @@ class Target(target.Target): cmdLine += ' ' + self.get_staging_path(pkg_name) multiprocess.run_command(cmdLine) - def createRandomNumber(self, len): + def create_random_number(self, len): out = "" for iii in range(0,len): out += random.choice(["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"]) @@ -378,15 +378,15 @@ class Target(target.Target): if tools.file_size(simulatorIdFile) < 10: #create the file: tmpFile = open(simulatorIdFile, 'w') - tmpFile.write(self.createRandomNumber(8)) + tmpFile.write(self.create_random_number(8)) tmpFile.write("-") - tmpFile.write(self.createRandomNumber(4)) + tmpFile.write(self.create_random_number(4)) tmpFile.write("-") - tmpFile.write(self.createRandomNumber(4)) + tmpFile.write(self.create_random_number(4)) tmpFile.write("-") - tmpFile.write(self.createRandomNumber(4)) + tmpFile.write(self.create_random_number(4)) tmpFile.write("-") - tmpFile.write(self.createRandomNumber(12)) + tmpFile.write(self.create_random_number(12)) tmpFile.flush() tmpFile.close() simulatorId = tools.file_read_data(simulatorIdFile)