From 092843cd025c532e28e0666c197c9822b4a4fad2 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Wed, 5 Oct 2016 21:17:12 +0200 Subject: [PATCH] [DEV] add support of heritage of target and better support of Debian distro --- lutin/module.py | 116 +++++++++++++------------- lutin/system.py | 81 ++++++++++-------- lutin/target.py | 18 ++-- lutin/tools.py | 8 ++ lutin/z_target/lutinTarget_Android.py | 12 +-- lutin/z_target/lutinTarget_Debian.py | 53 +++--------- lutin/z_target/lutinTarget_IOs.py | 4 +- lutin/z_target/lutinTarget_Linux.py | 4 +- lutin/z_target/lutinTarget_MacOs.py | 4 +- lutin/z_target/lutinTarget_Windows.py | 4 +- 10 files changed, 150 insertions(+), 154 deletions(-) diff --git a/lutin/module.py b/lutin/module.py index 41e8000..0da96fd 100644 --- a/lutin/module.py +++ b/lutin/module.py @@ -928,26 +928,26 @@ class Module: ## ## @brief Add a tools in dependency ## @param[in] self (handle) Class handle - ## @param[in] in_list ([string,...] or string) Name(s) of the tools + ## @param[in] list ([string,...] or string) Name(s) of the tools ## @return None ## - def add_tools(self, in_list): - tools.list_append_to(self._tools, in_list, True) + def add_tools(self, list): + tools.list_append_to(self._tools, list, True) ## ## @brief Add a dependency on this module ## @param[in] self (handle) Class handle - ## @param[in] in_list ([string,...] or string) Name(s) of the modules dependency + ## @param[in] list ([string,...] or string) Name(s) of the modules dependency ## @return None ## - def add_depend(self, in_list): - tools.list_append_to(self._depends, in_list, True) + def add_depend(self, list): + tools.list_append_to(self._depends, list, True) ## @brief deprecated ... ## @return None - def add_module_depend(self, in_list): + def add_module_depend(self, list): debug.warning("[" + self._name + "] add_module_depend is deprecated ==> use add_depend(...)") - self.add_depend(in_list) + self.add_depend(list) ## ## @brief Add an optionnal dependency on this module @@ -971,64 +971,64 @@ class Module: ## ## @brief Add a path to include when build ## @param[in] self (handle) Class handle - ## @param[in] in_list ([string,...] or string) List of path to include (default: local path) only relative path... - ## @param[in] in_type (string) inclusion group name 'c', 'c++', 'java' ... + ## @param[in] list ([string,...] or string) List of path to include (default: local path) only relative path... + ## @param[in] type (string) inclusion group name 'c', 'c++', 'java' ... ## @param[in] export (bool) export the include path. ## @return None ## - def add_path(self, in_list=".", in_type='c', export=False): - if type(in_list) == list: + def add_path(self, list=".", type='c', export=False): + if tools.get_type_string(list) == "list": add_list = [] - for elem in in_list: + for elem in list: if len(elem) > 1 \ and elem[0] == '/': # unix case - debug.warning(" add_path(" + in_list + ")") - debug.warning("[" + self._name + "] Not permited to add a path that start in / directory (only relative path) (compatibility until 3.x)") + debug.warning(" add_path(" + list + ")") + debug.warning("[" + self._name + "] Not permited to add a path that start in / directory (only relative path) (compatibility until 2.x)") add_list.append(elem) elif len(elem) > 2 \ and elem[1] == ':': # windows case : - debug.warning(" add_path(" + in_list + ")") - debug.warning("[" + self._name + "] Not permited to add a path that start in '" + elem[0] + ":' directory (only relative path) (compatibility until 3.x)") + debug.warning(" add_path(" + list + ")") + debug.warning("[" + self._name + "] Not permited to add a path that start in '" + elem[0] + ":' directory (only relative path) (compatibility until 2.x)") add_list.append(elem) if elem == ".": add_list.append(tools.get_current_path(self._origin_file)) else: add_list.append(os.path.join(tools.get_current_path(self._origin_file), elem)) else: - if len(in_list) > 1 \ - and in_list[0] == '/': + if len(list) > 1 \ + and list[0] == '/': # unix case - debug.warning(" add_path(" + in_list + ")") - debug.warning("[" + self._name + "] Not permited to add a path that start in / directory (only relative path) (compatibility until 3.x)") - add_list = in_list - elif len(in_list) > 2 \ - and in_list[1] == ':': + debug.warning(" add_path(" + list + ")") + debug.warning("[" + self._name + "] Not permited to add a path that start in / directory (only relative path) (compatibility until 2.x)") + add_list = list + elif len(list) > 2 \ + and list[1] == ':': # windows case : - debug.warning(" add_path(" + in_list + ")") - debug.warning("[" + self._name + "] Not permited to add a path that start in '" + in_list[0] + ":' directory (only relative path) (compatibility until 3.x)") - add_list = in_list - elif in_list == ".": + debug.warning(" add_path(" + list + ")") + debug.warning("[" + self._name + "] Not permited to add a path that start in '" + list[0] + ":' directory (only relative path) (compatibility until 2.x)") + add_list = list + elif list == ".": add_list = tools.get_current_path(self._origin_file) else: - add_list = os.path.join(tools.get_current_path(self._origin_file), in_list) - debug.verbose("Convert path : " + str(in_list) + " in " + str(add_list)) - self._add_path(add_list, in_type, export) + add_list = os.path.join(tools.get_current_path(self._origin_file), list) + debug.verbose("Convert path : " + str(list) + " in " + str(add_list)) + self._add_path(add_list, type, export) ## ## @brief (INTERNAL API) Add a path to include when build ## @param[in] self (handle) Class handle - ## @param[in] in_list ([string,...] or string) List of path to include (default: local path) - ## @param[in] in_type (string) inclusion group name 'c', 'c++', 'java' ... + ## @param[in] list ([string,...] or string) List of path to include (default: local path) + ## @param[in] type (string) inclusion group name 'c', 'c++', 'java' ... ## @param[in] export (bool) export the include path. ## @return None ## - def _add_path(self, in_list=".", in_type='c', export=False): + def _add_path(self, list=".", type='c', export=False): if export == True: - tools.list_append_to_2(self._path["export"], in_type, in_list) + tools.list_append_to_2(self._path["export"], type, list) else: - tools.list_append_to_2(self._path["local"], in_type, in_list) + tools.list_append_to_2(self._path["local"], type, list) ## ## @brief deprecated ... @@ -1041,27 +1041,27 @@ class Module: ## @brief Add compilation flags ## @param[in] self (handle) Class handle ## @param[in] type (string) inclusion group name 'c', 'c++', 'java' ... - ## @param[in] in_list ([string,...] or string) List of path to include + ## @param[in] list ([string,...] or string) List of path to include ## @param[in] export (bool) export the flat that has been requested to add if module is present. ## @return None ## - def add_flag(self, type, in_list, export=False): + def add_flag(self, type, list, export=False): if export == True: - tools.list_append_to_2(self._flags["export"], type, in_list) + tools.list_append_to_2(self._flags["export"], type, list) else: - tools.list_append_to_2(self._flags["local"], type, in_list) + tools.list_append_to_2(self._flags["local"], type, list) ## @brief deprecated ... ## @return None - def add_export_flag(self, type, in_list): + def add_export_flag(self, type, list): debug.warning("[" + self._name + "] add_export_flag is deprecated ==> use add_flag(xxx, yyy, export=True)") - self.add_flag(type, in_list, export=True) + self.add_flag(type, list, export=True) ## @brief deprecated ... ## @return None - def compile_flags(self, type, in_list): + def compile_flags(self, type, list): debug.warning("[" + self._name + "] compile_flags is deprecated ==> use add_flag(xxx, yyy)") - self.add_flag(type, in_list) + self.add_flag(type, list) ## ## @brief Set the compilation version of the @@ -1109,15 +1109,15 @@ class Module: ## ## @brief Add source file to compile ## @param[in] self (handle) Class handle - ## @param[in] in_list ([string,...] or string) File(s) to compile + ## @param[in] list ([string,...] or string) File(s) to compile ## @return None ## - def add_src_file(self, in_list): - tools.list_append_to(self._src, in_list, True) + def add_src_file(self, list): + tools.list_append_to(self._src, list, True) ## ## @brief An an header file in the install directory ## @param[in] self (handle) Class handle - ## @param[in] in_list ([string,...] or string) List of element that is needed to install + ## @param[in] list ([string,...] or string) List of element that is needed to install ## @param[in] destination_path (string) Path to install the files (remove all the path of the file) ## @param[in] clip_path (string) Remove a part of the path set in the list and install data in generic include path ## @param[in] recursive (bool) when use regexp in file list ==> we can add recursive property @@ -1160,13 +1160,13 @@ class Module: ## ## @return None ## - def add_header_file(self, in_list, destination_path=None, clip_path=None, recursive=False): + def add_header_file(self, list, destination_path=None, clip_path=None, recursive=False): if destination_path != None: debug.verbose("Change destination PATH: '" + str(destination_path) + "'") new_list = [] - if type(in_list) == str: - in_list = [in_list] - for elem in in_list: + if tools.get_type_string(list) == "string": + list = [list] + for elem in list: base = os.path.basename(elem) if destination_path != None: if clip_path != None: @@ -1270,7 +1270,7 @@ class Module: ## @return None ## def _print_list(self, description, input_list): - if type(input_list) == list: + if tools.get_type_string(input_list) == "list": if len(input_list) > 0: print(' ' + str(description)) for elem in input_list: @@ -1364,13 +1364,13 @@ class Module: and value[0] == '/': # unix case debug.warning(" set_pkg('ICON', " + value + ")") - debug.warning("[" + self._name + "] Not permited to add an ICON that start in / directory (only relative path) (compatibility until 3.x)") + debug.warning("[" + self._name + "] Not permited to add an ICON that start in / directory (only relative path) (compatibility until 2.x)") self._package_prop[variable] = value elif len(value) > 2 \ and value[1] == ':': # windows case : debug.warning(" set_pkg('ICON', " + value + ")") - debug.warning("[" + self._name + "] Not permited to add a path that start in '" + value[0] + ":' directory (only relative path) (compatibility until 3.x)") + debug.warning("[" + self._name + "] Not permited to add a path that start in '" + value[0] + ":' directory (only relative path) (compatibility until 2.x)") self._package_prop[variable] = value else: self._package_prop[variable] = os.path.join(tools.get_current_path(self._origin_file), value) @@ -1404,13 +1404,13 @@ class Module: and value[0] == '/': # unix case debug.warning(" set_pkg('ANDROID_SIGN', " + value + ")") - debug.warning("[" + self._name + "] Not permited to add an ICON that start in / directory (only relative path) (compatibility until 3.x)") + debug.warning("[" + self._name + "] Not permited to add an ICON that start in / directory (only relative path) (compatibility until 2.x)") self._package_prop[variable] = value elif len(value) > 2 \ and value[1] == ':': # windows case : debug.warning(" set_pkg('ANDROID_SIGN', " + value + ")") - debug.warning("[" + self._name + "] Not permited to add a path that start in '" + value[0] + ":' directory (only relative path) (compatibility until 3.x)") + debug.warning("[" + self._name + "] Not permited to add a path that start in '" + value[0] + ":' directory (only relative path) (compatibility until 2.x)") self._package_prop[variable] = value else: self._package_prop[variable] = os.path.join(tools.get_current_path(self._origin_file), value) @@ -1553,7 +1553,7 @@ def load_module(target, name): tmp_element = None elif "create" in dir(the_module): # parse in a second time to permit to implement retro-compat build - debug.warning("[DEPRECATED] (" + name + ") module creation: function 'create', use 'configure' ... (remove compatibility in next major version (3.x)") + debug.warning("[DEPRECATED] (" + name + ") module creation: function 'create', use 'configure' ... (remove compatibility in next major version (2.x)") tmp_element = the_module.create(target, name) if tmp_element != None: # overwrite some package default property (if not set by user) diff --git a/lutin/system.py b/lutin/system.py index 38db86c..829ee6b 100644 --- a/lutin/system.py +++ b/lutin/system.py @@ -254,52 +254,67 @@ def display(): ## ## @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] list_target_name ([string,...]) list of name of the target (ordered by request order) ## @param[in] target (handle) Handle on the @ref Target build engine ## @return (bool) find the system lib or not ## -def exist(lib_name, target_name, target) : +def exist(lib_name, list_target_name, target) : global __system_list - debug.verbose("exist= " + lib_name + " in " + target_name) - if target_name not in __system_list: + debug.verbose("exist= " + lib_name + " in " + str(list_target_name)) + find_target = False + for target_name in list_target_name: + if target_name in __system_list: + find_target = True + if find_target == False: return False - 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: - debug.verbose("add to path: '" + os.path.dirname(data["path"]) + "'") - sys.path.append(os.path.dirname(data["path"])) - debug.verbose("import system : '" + data["name"] + "'") - the_system = __import__(env.get_build_system_base_name() + __start_system_name + target_name + "_" + data["name"]) - #create the system module - debug.verbose("SYSTEM: request: " + str(data["name"])) - if "System" in dir(the_system): - data["system"] = the_system.System(target) - data["exist"] = data["system"].get_valid() - else: - debug.warning("Not find: '" + data["name"] + "' ==> get exception") - return data["exist"] + for target_name in reversed(list_target_name): + if target_name not in __system_list: + continue + 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: + debug.verbose("add to path: '" + os.path.dirname(data["path"]) + "'") + sys.path.append(os.path.dirname(data["path"])) + debug.verbose("import system : '" + data["name"] + "'") + the_system = __import__(env.get_build_system_base_name() + __start_system_name + target_name + "_" + data["name"]) + #create the system module + debug.verbose("SYSTEM: request: " + str(data["name"])) + if "System" in dir(the_system): + data["system"] = the_system.System(target) + data["exist"] = data["system"].get_valid() + else: + debug.warning("Not find: '" + data["name"] + "' ==> get exception") + 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 +## @param[in] list_target_name ([string,...]) list of name of the target (ordered by request order) ## @return None ## -def load(target, lib_name, target_name): +def load(target, lib_name, list_target_name): global __system_list - if target_name not in __system_list: + find_target = False + for target_name in list_target_name: + if target_name in __system_list: + find_target = True + if find_target == False: debug.error("you must call this function after checking of the system exist() !1!") - 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!") - if data["module"] == None: - # create a module from the system interface... - data["module"] = create_module_from_system(target, data) - data["loaded"] = True - target.add_module(data["module"]) - return + return + for target_name in reversed(list_target_name): + if target_name not in __system_list: + continue + 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!") + if data["module"] == None: + # create a module from the system interface... + data["module"] = create_module_from_system(target, data) + data["loaded"] = True + target.add_module(data["module"]) + return diff --git a/lutin/target.py b/lutin/target.py index d5169e2..33aee66 100644 --- a/lutin/target.py +++ b/lutin/target.py @@ -27,11 +27,15 @@ from . import env class Target: ## ## @brief contructor - ## @param[in] name (string) Name of the target + ## @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): + if tools.get_type_string(name) != "list": + debug.error("You must define a name in a list ...") + if len(name) < 1: + debug.error("You must define a name for your target ...") ## configuration of the build self.config = config @@ -48,10 +52,11 @@ class Target: self.end_generate_package = config["generate-package"] # todo : remove this : - self._name = name - self._config_based_on = [name] + self._name = name[-1] + self._config_based_on = name debug.info("================================="); debug.info("== Target='" + self._name + "' " + self.config["bus-size"] + " bits for arch '" + self.config["arch"] + "'"); + debug.info("== Target list=" + str(self._config_based_on)) debug.info("================================="); self.set_cross_base() @@ -78,8 +83,9 @@ class Target: self.path_generate_code="/generate_header" self.path_arch = "/" + self._name + for elem in self._config_based_on: + self.add_flag("c", '-D__TARGET_OS__' + elem) self.add_flag("c", [ - '-D__TARGET_OS__' + self._name, '-D__TARGET_ARCH__' + self.config["arch"], '-D__TARGET_ADDR__' + self.config["bus-size"] + 'BITS', '-D_REENTRANT' @@ -583,9 +589,9 @@ class Target: module.load_module(self, name) return True; # need to import the module (or the system module ...) - exist = system.exist(name, self._name, self) + exist = system.exist(name, self._config_based_on, self) if exist == True: - system.load(self, name, self._name) + system.load(self, name, self._config_based_on) return True; # we did not find the module ... return False; diff --git a/lutin/tools.py b/lutin/tools.py index d6f3e09..d004f92 100644 --- a/lutin/tools.py +++ b/lutin/tools.py @@ -316,6 +316,14 @@ def store_warning(file, output, err): file2.flush() file2.close() +def get_type_string(in_type): + if type(in_type) == str: + return "string" + elif type(in_type) == list: + return "list" + elif type(in_type) == dict: + return "dict" + return "unknow" ## List tools: def list_append_and_check(listout, newElement, order): diff --git a/lutin/z_target/lutinTarget_Android.py b/lutin/z_target/lutinTarget_Android.py index efb8d74..c3e2f53 100644 --- a/lutin/z_target/lutinTarget_Android.py +++ b/lutin/z_target/lutinTarget_Android.py @@ -18,7 +18,7 @@ import os import sys class Target(target.Target): - def __init__(self, config): + def __init__(self, config, sub_name=[]): #processor type selection (auto/arm/ppc/x86) if config["arch"] == "auto": config["arch"] = "arm" @@ -26,7 +26,7 @@ class Target(target.Target): if config["bus-size"] == "auto": config["bus-size"] = "32" self.type_arch = "" - target.Target.__init__(self, "Android", config, self.type_arch) + target.Target.__init__(self, ["Android"] + sub_name, config, self.type_arch) if config["bus-size"] == "32": self.type_arch="armv7" @@ -330,10 +330,10 @@ class Target(target.Target): debug.error("missing parameter 'ANDROID_MANIFEST' in the properties ... ") #add properties on wallpaper : - # myModule.pkg_add("ANDROID_WALLPAPER_PROPERTIES", ["list", key, title, summary, [["key","value display"],["key2","value display 2"]]) - # myModule.pkg_add("ANDROID_WALLPAPER_PROPERTIES", ["list", "testpattern", "Select test pattern", "Choose which test pattern to display", [["key","value display"],["key2","value display 2"]]]) - # myModule.pkg_add("ANDROID_WALLPAPER_PROPERTIES", ["bool", key, title, summary, ["enable string", "disable String"]) - # myModule.pkg_add("ANDROID_WALLPAPER_PROPERTIES", ["bool", "movement", "Motion", "Apply movement to test pattern", ["Moving test pattern", "Still test pattern"] + # myModule.add_pkg("ANDROID_WALLPAPER_PROPERTIES", ["list", key, title, summary, [["key","value display"],["key2","value display 2"]]) + # myModule.add_pkg("ANDROID_WALLPAPER_PROPERTIES", ["list", "testpattern", "Select test pattern", "Choose which test pattern to display", [["key","value display"],["key2","value display 2"]]]) + # myModule.add_pkg("ANDROID_WALLPAPER_PROPERTIES", ["bool", key, title, summary, ["enable string", "disable String"]) + # myModule.add_pkg("ANDROID_WALLPAPER_PROPERTIES", ["bool", "movement", "Motion", "Apply movement to test pattern", ["Moving test pattern", "Still test pattern"] #copy needed resources : for res_source, res_dest in pkg_properties["ANDROID_RESOURCES"]: if res_source == "": diff --git a/lutin/z_target/lutinTarget_Debian.py b/lutin/z_target/lutinTarget_Debian.py index 70f8cd5..b277a2d 100644 --- a/lutin/z_target/lutinTarget_Debian.py +++ b/lutin/z_target/lutinTarget_Debian.py @@ -16,38 +16,11 @@ import stat import re from lutin import host from lutin import multiprocess +import lutinTarget_Linux -class Target(target.Target): - def __init__(self, config): - #processor type selection (auto/arm/ppc/x86) - if config["arch"] == "auto": - config["arch"] = "x86" - #bus size selection (auto/32/64) - if config["bus-size"] == "auto": - config["bus-size"] = str(host.BUS_SIZE) - target.Target.__init__(self, "Linux", config, "") - if self.config["bus-size"] == "64": - # 64 bits - if host.BUS_SIZE != 64: - self.add_flag("c", "-m64") - else: - # 32 bits - if host.BUS_SIZE != 32: - self.add_flag("c", "-m32") - - self.add_flag("c", "-fpic") - - self.pkg_path_data = "share" - self.pkg_path_bin = "bin" - self.pkg_path_lib = "lib" - self.pkg_path_license = "license" - - self.add_flag("link-lib", [ - "dl" - ]) - self.add_flag("link", [ - "-rdynamic" - ]) +class Target(lutinTarget_Linux.Target): + def __init__(self, config, sub_name=[]): + lutinTarget_Linux.Target.__init__(self, config, ["Debian"] + sub_name) """ .local/application @@ -80,6 +53,8 @@ class Target(target.Target): *--> sources """ def make_package_binary(self, pkg_name, pkg_properties, base_pkg_path, heritage_list, static): + # http://alp.developpez.com/tutoriels/debian/creer-paquet/ + debianpkg_name = re.sub("_", "-", pkg_name) debug.debug("------------------------------------------------------------------------") debug.info("Generate generic '" + pkg_name + "' v" + tools.version_to_string(pkg_properties["VERSION"])) debug.debug("------------------------------------------------------------------------") @@ -98,23 +73,15 @@ class Target(target.Target): ## Create generic files: self.make_package_generic_files(target_outpath, pkg_properties, pkg_name, base_pkg_path, heritage_list, static) - + """ ## create the package: debug.debug("package : " + self.get_staging_path(pkg_name) + "/" + pkg_name + ".app.pkg") os.system("cd " + self.get_staging_path(pkg_name) + " ; tar -czf " + pkg_name + ".app.tar.gz " + pkg_name + ".app") #multiprocess.run_command("cd " + self.get_staging_path(pkg_name) + " ; tar -czf " + pkg_name + ".app.tar.gz " + pkg_name + ".app") tools.create_directory_of_file(self.get_final_path()) tools.copy_file(self.get_staging_path(pkg_name) + "/" + pkg_name + ".app.tar.gz", self.get_final_path() + "/" + pkg_name + ".app.gpkg") - - - - - def make_package_debian(self, pkg_name, pkg_properties, base_pkg_path, heritage_list): - # http://alp.developpez.com/tutoriels/debian/creer-paquet/ - debianpkg_name = re.sub("_", "-", pkg_name) - debug.debug("------------------------------------------------------------------------") - debug.info("Generate package '" + debianpkg_name + "' v"+pkg_properties["VERSION"]) - debug.debug("------------------------------------------------------------------------") + def make_package_binary(self, pkg_name, pkg_properties, base_pkg_path, heritage_list, static): + """ self.get_staging_path(pkg_name) target_outpathDebian = self.get_staging_path(pkg_name) + "/DEBIAN/" finalFileControl = target_outpathDebian + "control" @@ -126,7 +93,7 @@ class Target(target.Target): tools.create_directory_of_file(finalFileControl) tmpFile = open(finalFileControl, 'w') tmpFile.write("Package: " + debianpkg_name + "\n") - tmpFile.write("Version: " + pkg_properties["VERSION"] + "\n") + tmpFile.write("Version: " + tools.version_to_string(pkg_properties["VERSION"]) + "\n") tmpFile.write("Section: " + self.generate_list_separate_coma(pkg_properties["SECTION"]) + "\n") tmpFile.write("Priority: " + pkg_properties["PRIORITY"] + "\n") tmpFile.write("Architecture: all\n") diff --git a/lutin/z_target/lutinTarget_IOs.py b/lutin/z_target/lutinTarget_IOs.py index 2e49f99..aba180b 100644 --- a/lutin/z_target/lutinTarget_IOs.py +++ b/lutin/z_target/lutinTarget_IOs.py @@ -20,7 +20,7 @@ import random import re class Target(target.Target): - def __init__(self, config): + def __init__(self, config, sub_name=[]): if config["compilator"] == "gcc": debug.info("compile only with clang for IOs"); config["compilator"] = "clang" @@ -41,7 +41,7 @@ class Target(target.Target): else: arch="arm64" # for ipad air #arch="armv7" # for Iphone 4 - target.Target.__init__(self, "IOs", config, arch) + target.Target.__init__(self, ["IOs"] + sub_name, config, arch) if self.config["simulation"] == True: self.set_cross_base("/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/") else: diff --git a/lutin/z_target/lutinTarget_Linux.py b/lutin/z_target/lutinTarget_Linux.py index ed4bbb2..eebd838 100644 --- a/lutin/z_target/lutinTarget_Linux.py +++ b/lutin/z_target/lutinTarget_Linux.py @@ -19,14 +19,14 @@ from lutin import host from lutin import multiprocess class Target(target.Target): - def __init__(self, config): + def __init__(self, config, sub_name=[]): #processor type selection (auto/arm/ppc/x86) if config["arch"] == "auto": config["arch"] = "x86" #bus size selection (auto/32/64) if config["bus-size"] == "auto": config["bus-size"] = str(host.BUS_SIZE) - target.Target.__init__(self, "Linux", config, "") + target.Target.__init__(self, ["Linux"] + sub_name, config, "") if self.config["bus-size"] == "64": # 64 bits if host.BUS_SIZE != 64: diff --git a/lutin/z_target/lutinTarget_MacOs.py b/lutin/z_target/lutinTarget_MacOs.py index b8598da..672280c 100644 --- a/lutin/z_target/lutinTarget_MacOs.py +++ b/lutin/z_target/lutinTarget_MacOs.py @@ -18,7 +18,7 @@ import stat import shutil class Target(target.Target): - def __init__(self, config): + def __init__(self, config, sub_name=[]): #processor type selection (auto/arm/ppc/x86) if config["arch"] == "auto": config["arch"] = "x86" @@ -30,7 +30,7 @@ class Target(target.Target): config["compilator"] = "clang" # http://biolpc22.york.ac.uk/pub/linux-mac-cross/ # http://devs.openttd.org/~truebrain/compile-farm/apple-darwin9.txt - target.Target.__init__(self, "MacOs", config, "") + target.Target.__init__(self, ["MacOs"] + sub_name, config, "") #self.path_bin="MacOS" #self.path_lib="lib" diff --git a/lutin/z_target/lutinTarget_Windows.py b/lutin/z_target/lutinTarget_Windows.py index 9884982..1d1f87d 100644 --- a/lutin/z_target/lutinTarget_Windows.py +++ b/lutin/z_target/lutinTarget_Windows.py @@ -19,7 +19,7 @@ from lutin import zip from lutin import multiprocess class Target(target.Target): - def __init__(self, config): + def __init__(self, config, sub_name=[]): if config["compilator"] != "gcc": debug.error("Windows does not support '" + config["compilator"] + "' compilator ... availlable : [gcc]") config["compilator"] = "gcc" @@ -31,7 +31,7 @@ class Target(target.Target): if config["bus-size"] == "auto": config["bus-size"] = str(host.BUS_SIZE) - target.Target.__init__(self, "Windows", config, "") + target.Target.__init__(self, ["Windows"] + sub_name, config, "") # on windows board the basic path is not correct # TODO : get external PATH for the minGW path