Compare commits
13 Commits
Author | SHA1 | Date | |
---|---|---|---|
bf6fde3770 | |||
97db63bcfd | |||
43c7947b95 | |||
1c32b7089a | |||
760a589cbe | |||
d38ecf5432 | |||
7e44373f79 | |||
3804de2078 | |||
8fa25bb8ec | |||
beb97f4bed | |||
47dcca5578 | |||
dde9c9c280 | |||
598d301284 |
@@ -16,12 +16,12 @@ from . import debug
|
||||
def append_to_list(list_out, elem):
|
||||
if type(elem) == str:
|
||||
if elem not in list_out:
|
||||
list_out.append(elem)
|
||||
list_out.append(copy.deepcopy(elem))
|
||||
else:
|
||||
# mulyiple imput in the list ...
|
||||
for element in elem:
|
||||
if element not in list_out:
|
||||
list_out.append(element)
|
||||
list_out.append(copy.deepcopy(element))
|
||||
|
||||
|
||||
|
||||
@@ -61,6 +61,7 @@ class HeritageList:
|
||||
self.regenerate_tree()
|
||||
|
||||
def regenerate_tree(self):
|
||||
debug.verbose("Regenerate heritage list:")
|
||||
self.flags = {}
|
||||
# sources list:
|
||||
self.src = { 'src':[],
|
||||
@@ -72,30 +73,37 @@ class HeritageList:
|
||||
listHeritage = self.list_heritage
|
||||
self.list_heritage = []
|
||||
# first step : add all lib with no dependency:
|
||||
debug.extreme_verbose(" add element with no dependency:")
|
||||
for herit in listHeritage:
|
||||
if len(herit.depends) == 0:
|
||||
self.list_heritage.append(herit)
|
||||
debug.extreme_verbose(" add: " + str(herit.name))
|
||||
self.list_heritage.append(copy.deepcopy(herit))
|
||||
listHeritage.remove(herit)
|
||||
debug.extreme_verbose(" add element with dependency:")
|
||||
while len(listHeritage) > 0:
|
||||
currentHeritageSize = len(listHeritage)
|
||||
debug.verbose("list heritage = " + str([[x.name, x.depends] for x in listHeritage]))
|
||||
debug.verbose(" list heritage = " + str([[x.name, x.depends] for x in listHeritage]))
|
||||
debug.extreme_verbose(" list heritage (rest):")
|
||||
for tmppp_herit in listHeritage:
|
||||
debug.extreme_verbose(" elem= " + str(tmppp_herit.name) + " : " + str(tmppp_herit.depends))
|
||||
# Add element only when all dependence are resolved
|
||||
for herit in listHeritage:
|
||||
listDependsName = [y.name for y in self.list_heritage]
|
||||
if all(x in listDependsName for x in herit.depends) == True:
|
||||
debug.extreme_verbose(" add: " + str(herit.name))
|
||||
listHeritage.remove(herit)
|
||||
self.list_heritage.append(herit)
|
||||
self.list_heritage.append(copy.deepcopy(herit))
|
||||
if currentHeritageSize == len(listHeritage):
|
||||
debug.warning("Not resolve dependency between the library ==> can be a cyclic dependency !!!")
|
||||
for herit in listHeritage:
|
||||
self.list_heritage.append(herit)
|
||||
self.list_heritage.append(copy.deepcopy(herit))
|
||||
listHeritage = []
|
||||
debug.warning("new heritage list:")
|
||||
for element in self.list_heritage:
|
||||
debug.warning(" " + element.name + " " + str(element.depends))
|
||||
debug.verbose("new heritage list:")
|
||||
debug.extreme_verbose("new heritage list:")
|
||||
for element in self.list_heritage:
|
||||
debug.verbose(" " + element.name + " " + str(element.depends))
|
||||
debug.extreme_verbose(" " + element.name + " " + str(element.depends))
|
||||
for element in reversed(self.list_heritage):
|
||||
for flags in element.flags:
|
||||
# get value
|
||||
@@ -122,15 +130,26 @@ class HeritageList:
|
||||
# keep only true, if false ==> bad case ...
|
||||
if self.flags[flags] < value:
|
||||
self.flags[flags] = value
|
||||
append_to_list(self.src['src'], element.src['src'])
|
||||
append_to_list(self.src['dynamic'], element.src['dynamic'])
|
||||
append_to_list(self.src['static'], element.src['static'])
|
||||
for element in self.list_heritage:
|
||||
debug.extreme_verbose(" elem: " + str(element.name))
|
||||
debug.extreme_verbose(" Path (base): " + str(self.path))
|
||||
debug.extreme_verbose(" inside: " + str(element.path))
|
||||
for ppp in element.path:
|
||||
value = element.path[ppp]
|
||||
value = copy.deepcopy(element.path[ppp])
|
||||
if ppp not in self.path:
|
||||
self.path[ppp] = value
|
||||
else:
|
||||
append_to_list(self.path[ppp], value)
|
||||
append_to_list(self.src['src'], element.src['src'])
|
||||
append_to_list(self.src['dynamic'], element.src['dynamic'])
|
||||
append_to_list(self.src['static'], element.src['static'])
|
||||
debug.extreme_verbose("Path : " + str(self.path))
|
||||
for ppp in self.path:
|
||||
tmp = self.path[ppp]
|
||||
self.path[ppp] = []
|
||||
for iii in reversed(tmp):
|
||||
self.path[ppp].append(iii)
|
||||
debug.extreme_verbose("Path : " + str(self.path))
|
||||
|
||||
def __repr__(self):
|
||||
return "{HeritageList:" + str(self.list_heritage) + "}"
|
||||
@@ -157,8 +176,8 @@ class heritage:
|
||||
self.name = module.name
|
||||
self.depends = copy.deepcopy(module.depends)
|
||||
# keep reference because the flags can change in time
|
||||
self.flags = module.flags["export"]
|
||||
self.path = module.path["export"]
|
||||
self.flags = module.flags["export"] # have no deep copy here is a feature ...
|
||||
self.path = copy.deepcopy(module.path["export"])
|
||||
# if the user install some header ==> they will ba autoamaticaly exported ...
|
||||
if target != None:
|
||||
if len(module.header) > 0:
|
||||
@@ -210,7 +229,7 @@ class heritage:
|
||||
for flags in other.flags:
|
||||
value = other.flags[flags]
|
||||
if flags not in self.flags:
|
||||
self.flags[flags] = value
|
||||
self.flags[flags] = copy.deepcopy(value)
|
||||
else:
|
||||
append_to_list(self.flags[flags], value)
|
||||
self.add_import_path(other.path)
|
||||
|
241
lutin/module.py
241
lutin/module.py
@@ -78,7 +78,8 @@ class Module:
|
||||
or moduleType == 'LIBRARY_DYNAMIC' \
|
||||
or moduleType == 'LIBRARY_STATIC' \
|
||||
or moduleType == 'PACKAGE' \
|
||||
or moduleType == 'PREBUILD':
|
||||
or moduleType == 'PREBUILD' \
|
||||
or moduleType == 'DATA':
|
||||
self.type=moduleType
|
||||
else :
|
||||
debug.error('for module "%s"' %module_name)
|
||||
@@ -129,6 +130,7 @@ class Module:
|
||||
"ANDROID_SIGN" : True
|
||||
}
|
||||
self.sub_heritage_list = None
|
||||
self.generate_file = []
|
||||
|
||||
def __repr__(self):
|
||||
return "{lutin.Module:" + str(self.name) + "}"
|
||||
@@ -166,8 +168,9 @@ class Module:
|
||||
##
|
||||
## @brief Send image in the build data directory
|
||||
## @param[in] target Target object
|
||||
## @param[in] copy_list When copy file, this API permit to remove unneeded files
|
||||
##
|
||||
def image_to_build(self, target):
|
||||
def image_to_build(self, target, copy_list):
|
||||
for source, destination, sizeX, sizeY in self.image_to_copy:
|
||||
extension = source[source.rfind('.'):]
|
||||
if extension != ".png" \
|
||||
@@ -187,13 +190,17 @@ class Module:
|
||||
image.resize(source, os.path.join(target.get_build_path_data(self.name), destination), sizeX, sizeY, file_cmd)
|
||||
else:
|
||||
debug.verbose("Might copy file : " + display_source + " ==> " + destination)
|
||||
tools.copy_file(source, os.path.join(target.get_build_path_data(self.name), destination), file_cmd)
|
||||
tools.copy_file(source,
|
||||
os.path.join(target.get_build_path_data(self.name), destination),
|
||||
file_cmd,
|
||||
in_list=copy_list)
|
||||
|
||||
##
|
||||
## @brief Send files in the build data directory
|
||||
## @param[in] target Target object
|
||||
## @param[in] copy_list When copy file, this API permit to remove unneeded files
|
||||
##
|
||||
def files_to_build(self, target):
|
||||
def files_to_build(self, target, copy_list):
|
||||
for source, destination in self.files:
|
||||
display_source = source
|
||||
source = os.path.join(self.origin_path, source)
|
||||
@@ -203,13 +210,17 @@ class Module:
|
||||
# TODO : set it back : file_cmd = target.get_build_path_data(self.name)
|
||||
file_cmd = ""
|
||||
debug.verbose("Might copy file : " + display_source + " ==> " + destination)
|
||||
tools.copy_file(source, os.path.join(target.get_build_path_data(self.name), destination), file_cmd)
|
||||
tools.copy_file(source,
|
||||
os.path.join(target.get_build_path_data(self.name), destination),
|
||||
force_identical=True,
|
||||
in_list=copy_list)
|
||||
|
||||
##
|
||||
## @brief Send compleate folder in the build data directory
|
||||
## @param[in] target Target object
|
||||
## @param[in] copy_list When copy file, this API permit to remove unneeded files
|
||||
##
|
||||
def paths_to_build(self, target):
|
||||
def paths_to_build(self, target, copy_list):
|
||||
for source, destination in self.paths:
|
||||
debug.debug("Might copy path : " + source + "==>" + destination)
|
||||
tmp_path = os.path.dirname(os.path.realpath(os.path.join(self.origin_path, source)))
|
||||
@@ -232,7 +243,10 @@ class Module:
|
||||
# new_destination = os.path.join(new_destination, root[len(source)-1:])
|
||||
debug.verbose("Might copy : '" + os.path.join(root, cycle_file) + "' ==> '" + os.path.join(target.get_build_path_data(self.name), new_destination, cycle_file) + "'" )
|
||||
file_cmd = "" # TODO : ...
|
||||
tools.copy_file(os.path.join(root, cycle_file), os.path.join(target.get_build_path_data(self.name), new_destination, cycle_file), file_cmd)
|
||||
tools.copy_file(os.path.join(root, cycle_file),
|
||||
os.path.join(target.get_build_path_data(self.name), new_destination, cycle_file),
|
||||
file_cmd,
|
||||
in_list=copy_list)
|
||||
|
||||
|
||||
|
||||
@@ -327,8 +341,9 @@ class Module:
|
||||
for line_base in start_with:
|
||||
if elem[:len(line_base)] == line_base:
|
||||
find = True
|
||||
elem = elem[len(line_base)+1:]
|
||||
elem = elem[len(line_base):]
|
||||
break;
|
||||
debug.verbose(" temp Value: " + str(elem))
|
||||
if find == False:
|
||||
debug.warning(" gcov ret : " + str(elem));
|
||||
debug.warning(" ==> does not start with : " + str(start_with));
|
||||
@@ -375,6 +390,7 @@ class Module:
|
||||
debug.info(" % " + str(elem[1]) + "\r\t\t" + str(elem[0]));
|
||||
else:
|
||||
debug.info(" % " + str(elem[1]) + "\r\t\t" + str(elem[0]));
|
||||
debug.verbose(" " + str(elem[2]) + " / " + str(elem[3]));
|
||||
try:
|
||||
pourcent = 100.0*float(executed_lines)/float(executable_lines)
|
||||
except ZeroDivisionError:
|
||||
@@ -433,6 +449,7 @@ class Module:
|
||||
self.sub_heritage_list = heritage.HeritageList()
|
||||
# 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)
|
||||
if isBuilt == True:
|
||||
self.local_heritage.add_depends(dep);
|
||||
@@ -469,7 +486,9 @@ class Module:
|
||||
# -- Generic library help --
|
||||
# ----------------------------------------------------
|
||||
package_version_string = tools.version_to_string(self.package_prop["VERSION"]);
|
||||
if self.type == 'PREBUILD':
|
||||
if self.type == 'DATA':
|
||||
debug.print_element("Data", self.name, "-", package_version_string)
|
||||
elif self.type == 'PREBUILD':
|
||||
debug.print_element("Prebuild", self.name, "-", package_version_string)
|
||||
elif self.type == 'LIBRARY':
|
||||
debug.print_element("Library", self.name, "-", package_version_string)
|
||||
@@ -485,9 +504,59 @@ class Module:
|
||||
debug.print_element("Binary (stand alone)", self.name, "-", package_version_string)
|
||||
elif self.type == 'PACKAGE':
|
||||
debug.print_element("Package", self.name, "-", package_version_string)
|
||||
# ----------------------------------------------------
|
||||
# -- Sources compilation --
|
||||
# ----------------------------------------------------
|
||||
|
||||
# list of all file to copy:
|
||||
copy_list={}
|
||||
# ---------------------------------------------------------------------------
|
||||
# -- install header (generated header files) --
|
||||
# ---------------------------------------------------------------------------
|
||||
generate_path = target.get_build_path_temporary_generate(self.name)
|
||||
include_path = target.get_build_path_include(self.name)
|
||||
have_only_generate_file = False
|
||||
if len(self.generate_file) > 0:
|
||||
debug.debug("install GENERATED headers ...")
|
||||
for elem_generate in self.generate_file:
|
||||
ret_write = tools.file_write_data(os.path.join(generate_path, elem_generate["filename"]), elem_generate["data"], only_if_new=True)
|
||||
if ret_write == True:
|
||||
debug.print_element("generate", self.name, "##", elem_generate["filename"])
|
||||
dst = os.path.join(include_path, elem_generate["filename"])
|
||||
copy_list[dst] = {"src":os.path.join(generate_path, elem_generate["filename"]),
|
||||
"cmd_file":None,
|
||||
"need_copy":ret_write}
|
||||
if elem_generate["install"] == True:
|
||||
have_only_generate_file = True
|
||||
if have_only_generate_file == True:
|
||||
self.add_path(generate_path)
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# -- install header (do it first for extern lib and gcov better interface) --
|
||||
# ---------------------------------------------------------------------------
|
||||
debug.debug("install headers ...")
|
||||
for file in self.header:
|
||||
src_path = os.path.join(self.origin_path, file["src"])
|
||||
if "multi-dst" in file:
|
||||
dst_path = os.path.join(include_path, file["multi-dst"])
|
||||
tools.copy_anything(src_path,
|
||||
dst_path,
|
||||
recursive=file["recursive"],
|
||||
force_identical=True,
|
||||
in_list=copy_list)
|
||||
else:
|
||||
dst_path = os.path.join(include_path, file["dst"])
|
||||
tools.copy_file(src_path,
|
||||
dst_path,
|
||||
force_identical=True,
|
||||
in_list=copy_list)
|
||||
#real copy files
|
||||
tools.copy_list(copy_list)
|
||||
# remove unneded files (NOT folder ...)
|
||||
tools.clean_directory(include_path, copy_list)
|
||||
# add the pat to the usable dirrectory
|
||||
self.add_path(include_path)
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# -- Sources compilation --
|
||||
# ---------------------------------------------------------------------------
|
||||
if self.type != 'PREBUILD':
|
||||
# build local sources in a specific order:
|
||||
for extention_local in self.extention_order_build:
|
||||
@@ -708,43 +777,23 @@ class Module:
|
||||
basic_path = self.origin_path)
|
||||
except ValueError:
|
||||
debug.error(" UN-SUPPORTED link format: 'binary'")
|
||||
elif self.type == "DATA":
|
||||
debug.debug("Data package have noting to build... just install")
|
||||
else:
|
||||
debug.error("Did not known the element type ... (impossible case) type=" + self.type)
|
||||
|
||||
# ----------------------------------------------------
|
||||
# -- install header --
|
||||
# ----------------------------------------------------
|
||||
debug.debug("install headers ...")
|
||||
copy_list={}
|
||||
include_path = target.get_build_path_include(self.name)
|
||||
for file in self.header:
|
||||
src_path = os.path.join(self.origin_path, file["src"])
|
||||
if "multi-dst" in file:
|
||||
dst_path = os.path.join(include_path, file["multi-dst"])
|
||||
tools.copy_anything(src_path,
|
||||
dst_path,
|
||||
recursive=False,
|
||||
force_identical=True,
|
||||
in_list=copy_list)
|
||||
else:
|
||||
dst_path = os.path.join(include_path, file["dst"])
|
||||
tools.copy_file(src_path,
|
||||
dst_path,
|
||||
force_identical=True,
|
||||
in_list=copy_list)
|
||||
#real copy files
|
||||
tools.copy_list(copy_list)
|
||||
# remove unneded files (NOT folder ...)
|
||||
tools.clean_directory(include_path, copy_list)
|
||||
|
||||
# ----------------------------------------------------
|
||||
# -- install data --
|
||||
# ----------------------------------------------------
|
||||
debug.debug("install datas")
|
||||
self.image_to_build(target)
|
||||
self.files_to_build(target)
|
||||
self.paths_to_build(target)
|
||||
# TODO : do sothing that create a list of file set in this directory and remove it if necessary ... ==> if not needed anymore ...
|
||||
copy_list={}
|
||||
self.image_to_build(target, copy_list) # TODO : When file is resized, the final file is not removed if the file is not needed anymore
|
||||
self.files_to_build(target, copy_list)
|
||||
self.paths_to_build(target, copy_list)
|
||||
#real copy files
|
||||
tools.copy_list(copy_list)
|
||||
# remove unneded files (NOT folder ...)
|
||||
tools.clean_directory(target.get_build_path_data(self.name), copy_list)
|
||||
|
||||
# create local heritage specification
|
||||
self.local_heritage.auto_add_build_header()
|
||||
@@ -849,25 +898,117 @@ class Module:
|
||||
|
||||
def add_src_file(self, list):
|
||||
tools.list_append_to(self.src, list, True)
|
||||
|
||||
def add_header_file(self, list, destination_path=None):
|
||||
##
|
||||
## @brief An an header file in the install directory
|
||||
## @param[in] list List of element that is needed to install (can be a list or a simple string)
|
||||
## @param[in,optional] destination_path Path to install the files (remove all the path of the file)
|
||||
## @param[in,optional] clip_path Remove a part of the path set in the list and install data in generic include path
|
||||
## @param[in,optional] recursive when use regexp in file list ==> we can add recursive property
|
||||
##
|
||||
## @code
|
||||
## my_module.add_header_file([
|
||||
## 'include/ewol/widget.h',
|
||||
## 'include/ewol/context/context.h',
|
||||
## ])
|
||||
## @endcode
|
||||
## Here the user need to acces to the file wrote: #include <include/ewol/cotext/context.h>
|
||||
##
|
||||
## We can simplify it:
|
||||
## @code
|
||||
## my_module.add_header_file([
|
||||
## 'include/ewol/widget.h',
|
||||
## 'include/ewol/context/context.h',
|
||||
## ],
|
||||
## destination_path='ewol')
|
||||
## @endcode
|
||||
## Here the user need to acces to the file wrote: #include <ewol/context.h> ==> the internal path has been removed
|
||||
##
|
||||
## An other way is:
|
||||
## @code
|
||||
## my_module.add_header_file([
|
||||
## 'include/ewol/widget.h',
|
||||
## 'include/ewol/context/context.h',
|
||||
## ],
|
||||
## clip_path='include')
|
||||
## @endcode
|
||||
## Here the user need to acces to the file wrote: #include <ewol/context/context.h> ==> it just remove the include data
|
||||
##
|
||||
## With a copy all methode:
|
||||
## @code
|
||||
## my_module.add_header_file(
|
||||
## 'include/*.h',
|
||||
## recursive=True)
|
||||
## @endcode
|
||||
## Here the user need to acces to the file wrote: #include <ewol/context/context.h> ==> it just remove the include data
|
||||
##
|
||||
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(list) == str:
|
||||
list = [list]
|
||||
for elem in list:
|
||||
base = os.path.basename(elem)
|
||||
if destination_path != None:
|
||||
base = os.path.basename(elem)
|
||||
if '*' in base or '[' in base or '(' in base:
|
||||
if clip_path != None:
|
||||
debug.error("can not use 'destination_path' and 'clip_path' at the same time ...");
|
||||
if '*' in base \
|
||||
or '[' in base \
|
||||
or '(' in base:
|
||||
new_list.append({"src":elem,
|
||||
"multi-dst":destination_path})
|
||||
"multi-dst":destination_path,
|
||||
"recursive":recursive})
|
||||
else:
|
||||
new_list.append({"src":elem,
|
||||
"dst":os.path.join(destination_path, base)})
|
||||
"dst":os.path.join(destination_path, base),
|
||||
"recursive":recursive})
|
||||
else:
|
||||
new_list.append({"src":elem,
|
||||
"dst":elem})
|
||||
if clip_path == None:
|
||||
if '*' in base \
|
||||
or '[' in base \
|
||||
or '(' in base:
|
||||
new_list.append({"src":elem,
|
||||
"multi-dst":"",
|
||||
"recursive":recursive})
|
||||
else:
|
||||
new_list.append({"src":elem,
|
||||
"dst":elem,
|
||||
"recursive":recursive})
|
||||
else:
|
||||
if len(clip_path)>len(elem):
|
||||
debug.error("can not clip a path with not the same name: '" + clip_path + "' != '" + elem + "' (size too small)")
|
||||
if clip_path != elem[:len(clip_path)]:
|
||||
debug.error("can not clip a path with not the same name: '" + clip_path + "' != '" + elem[:len(clip_path)] + "'")
|
||||
out_elem = elem[len(clip_path):]
|
||||
while len(out_elem) > 0 \
|
||||
and out_elem[0] == "/":
|
||||
out_elem = out_elem[1:]
|
||||
if '*' in base \
|
||||
or '[' in base \
|
||||
or '(' in base:
|
||||
new_list.append({"src":elem,
|
||||
"multi-dst":"",
|
||||
"recursive":recursive})
|
||||
else:
|
||||
new_list.append({"src":elem,
|
||||
"dst":out_elem,
|
||||
"recursive":recursive})
|
||||
tools.list_append_to(self.header, new_list, True)
|
||||
|
||||
##
|
||||
## @brief Many library need to generate dynamic file configuration, use this to generat your configuration and add it in the include path
|
||||
## @param[in] data_file Data of the file that is generated
|
||||
## @param[in] destination_path Path where to install data
|
||||
## @param[in] install_element add the file in the include path and not only in the generate path
|
||||
## @note this does not rewrite the file if it is not needed
|
||||
##
|
||||
def add_generated_header_file(self, data_file, destination_path, install_element=False):
|
||||
self.generate_file.append({
|
||||
"data":data_file,
|
||||
"filename":destination_path,
|
||||
"install":install_element
|
||||
});
|
||||
|
||||
def add_export_path(self, list, type='c'):
|
||||
tools.list_append_to_2(self.path["export"], type, list)
|
||||
|
||||
|
@@ -28,6 +28,8 @@ class System:
|
||||
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)
|
||||
@@ -42,12 +44,21 @@ class System:
|
||||
def add_export_flag(self, type, list):
|
||||
tools.list_append_to_2(self.export_flags, type, list)
|
||||
|
||||
def set_version(self, version_list):
|
||||
self.version = version_list
|
||||
|
||||
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]]
|
||||
else:
|
||||
self.action_on_state[name_of_state].append([level, name, action])
|
||||
|
||||
def add_header_file(self, list, destination_path=None, clip_path=None, recursive=False):
|
||||
self.headers.append({
|
||||
"list":list,
|
||||
"dst":destination_path,
|
||||
"clip":clip_path,
|
||||
"recursive":recursive
|
||||
})
|
||||
def __repr__(self):
|
||||
return "{lutin.System}"
|
||||
|
||||
@@ -69,7 +80,14 @@ def create_module_from_system(target, dict):
|
||||
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
|
||||
|
||||
|
||||
@@ -140,13 +158,13 @@ def exist(lib_name, target_name, target) :
|
||||
debug.verbose("add to path: '" + os.path.dirname(data["path"]) + "'")
|
||||
sys.path.append(os.path.dirname(data["path"]))
|
||||
debug.verbose("import system : '" + data["name"] + "'")
|
||||
theSystem = __import__(env.get_build_system_base_name() + __start_system_name + target_name + "_" + data["name"])
|
||||
the_system = __import__(env.get_build_system_base_name() + __start_system_name + target_name + "_" + data["name"])
|
||||
#create the system module
|
||||
try:
|
||||
debug.verbose("SYSTEM: request: " + data["name"])
|
||||
data["system"] = theSystem.System(target)
|
||||
debug.verbose("SYSTEM: request: " + str(data["name"]))
|
||||
if "System" in dir(the_system):
|
||||
data["system"] = the_system.System(target)
|
||||
data["exist"] = data["system"].valid
|
||||
except:
|
||||
else:
|
||||
debug.warning("Not find: '" + data["name"] + "' ==> get exception")
|
||||
return data["exist"]
|
||||
return False
|
||||
|
@@ -98,6 +98,7 @@ class Target:
|
||||
'-D__TARGET_ADDR__' + self.select_bus + 'BITS',
|
||||
'-D_REENTRANT'
|
||||
])
|
||||
self.add_flag("c", "-nodefaultlibs")
|
||||
self.add_flag("c++", "-nostdlib")
|
||||
self.add_flag("ar", 'rcs')
|
||||
|
||||
@@ -144,6 +145,7 @@ class Target:
|
||||
self.path_data="share"
|
||||
self.path_doc="doc"
|
||||
self.path_include="include"
|
||||
self.path_temporary_generate="generate"
|
||||
self.path_object="obj"
|
||||
|
||||
|
||||
@@ -361,6 +363,9 @@ class Target:
|
||||
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)
|
||||
|
@@ -127,6 +127,7 @@ def link(file, binary, target, depancy, flags, name, basic_path, static = False)
|
||||
cmd.append("-Wl,-R$ORIGIN/../lib/")
|
||||
except:
|
||||
pass
|
||||
cmd.append("-Wl,-rpath,\"\$ORIGIN/../lib\"")
|
||||
try:
|
||||
cmd.append(flags["local"]["link"])
|
||||
except:
|
||||
@@ -145,12 +146,20 @@ def link(file, binary, target, depancy, flags, name, basic_path, static = False)
|
||||
for type in ["link-lib"]:
|
||||
if type in flags[view]:
|
||||
cmd.append([("-l" + sss).replace("-l/", "/") for sss in flags[view][type] ])
|
||||
for type in ["link-bin"]:
|
||||
if type in flags[view]:
|
||||
cmd.append(flags[view][type])
|
||||
for type in ["link-lib"]:
|
||||
if type in depancy.flags:
|
||||
cmd.append([("-l" + sss).replace("-l/", "/") for sss in depancy.flags[type] ])
|
||||
for type in ["link-lib"]:
|
||||
if type in target.global_flags:
|
||||
cmd.append([("-l" + sss).replace("-l/", "/") for sss in target.global_flags[type] ])
|
||||
for type in ["link-bin"]:
|
||||
if type in target.global_flags:
|
||||
cmd.append(target.global_flags[type])
|
||||
if type in depancy.flags:
|
||||
cmd.append(depancy.flags[type])
|
||||
cmd_line = tools.list_to_str(cmd)
|
||||
# check the dependency for this file :
|
||||
if depend.need_re_package(file_dst, file_src, True, file_cmd=file_cmd, cmd_line=cmd_line) == False \
|
||||
|
@@ -70,8 +70,7 @@ def compile(file, binary, target, depancy, flags, path, name, basic_path, module
|
||||
target.cc,
|
||||
"-o", file_dst,
|
||||
target.arch,
|
||||
target.sysroot,
|
||||
target.global_include_cc]
|
||||
target.sysroot]
|
||||
for view in ["export", "local"]:
|
||||
try:
|
||||
cmd.append(tools.add_prefix("-I", path[view]["c"]))
|
||||
@@ -81,6 +80,7 @@ def compile(file, binary, target, depancy, flags, path, name, basic_path, module
|
||||
cmd.append(tools.add_prefix("-I", depancy.path["c"]))
|
||||
except:
|
||||
pass
|
||||
cmd.append(target.global_include_cc)
|
||||
try:
|
||||
cmd.append(get_version_compilation_flags(flags, depancy.flags))
|
||||
except:
|
||||
|
@@ -75,8 +75,7 @@ def compile(file, binary, target, depancy, flags, path, name, basic_path, module
|
||||
target.xx,
|
||||
"-o", file_dst,
|
||||
target.arch,
|
||||
target.sysroot,
|
||||
target.global_include_cc
|
||||
target.sysroot
|
||||
]
|
||||
for view in ["export", "local"]:
|
||||
for type in ["c", "c++"]:
|
||||
@@ -89,6 +88,7 @@ def compile(file, binary, target, depancy, flags, path, name, basic_path, module
|
||||
cmd.append(tools.add_prefix("-I",depancy.path[type]))
|
||||
except:
|
||||
pass
|
||||
cmd.append(target.global_include_cc)
|
||||
try:
|
||||
cmd.append(get_version_compilation_flags(flags, depancy.flags))
|
||||
except:
|
||||
|
@@ -49,3 +49,57 @@ def get_output_type():
|
||||
##
|
||||
def get_support_multithreading():
|
||||
return True
|
||||
|
||||
##
|
||||
## @brief Commands for running gcc to compile a C file in object file.
|
||||
##
|
||||
def compile(file, binary, target, depancy, flags, path, name, basic_path, module_src):
|
||||
file_src = target.get_full_name_source(basic_path, file)
|
||||
file_cmd = target.get_full_name_cmd(name, basic_path, file)
|
||||
file_dst = target.get_full_name_destination(name, basic_path, file, get_output_type())
|
||||
file_depend = target.get_full_dependency(name, basic_path, file)
|
||||
file_warning = target.get_full_name_warning(name, basic_path, file)
|
||||
|
||||
# create the command line befor requesting start:
|
||||
cmd = [
|
||||
target.cc,
|
||||
"-o", file_dst,
|
||||
target.arch,
|
||||
target.sysroot]
|
||||
for view in ["export", "local"]:
|
||||
try:
|
||||
cmd.append(tools.add_prefix("-I", path[view]["c"]))
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
cmd.append(tools.add_prefix("-I", depancy.path["c"]))
|
||||
except:
|
||||
pass
|
||||
cmd.append(target.global_include_cc)
|
||||
try:
|
||||
cmd.append(target.global_flags["c"])
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
cmd.append(depancy.flags["c"])
|
||||
except:
|
||||
pass
|
||||
for view in ["local", "export"]:
|
||||
try:
|
||||
cmd.append(flags[view]["c"])
|
||||
except:
|
||||
pass
|
||||
cmd.append("-c")
|
||||
cmd.append("-MMD")
|
||||
cmd.append("-MP")
|
||||
cmd.append(file_src)
|
||||
# Create cmd line
|
||||
cmdLine=tools.list_to_str(cmd)
|
||||
# check the dependency for this file :
|
||||
if depend.need_re_build(file_dst, file_src, file_depend, file_cmd, cmdLine) == False:
|
||||
return {"action":"add", "file":file_dst}
|
||||
tools.create_directory_of_file(file_dst)
|
||||
comment = ["s", name, "<==", file]
|
||||
# process element
|
||||
multiprocess.run_in_pool(cmdLine, comment, file_cmd, store_output_file=file_warning)
|
||||
return {"action":"add", "file":file_dst}
|
||||
|
22
lutin/z_system/lutinSystem_Android_c.py
Normal file
22
lutin/z_system/lutinSystem_Android_c.py
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.help = "C: Generic C library"
|
||||
self.valid = True
|
||||
|
35
lutin/z_system/lutinSystem_Android_opengl.py
Normal file
35
lutin/z_system/lutinSystem_Android_opengl.py
Normal file
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.help = "OpenGL: Generic graphic library"
|
||||
self.valid = True
|
||||
# no check needed ==> just add this:
|
||||
self.add_module_depend([
|
||||
'c',
|
||||
])
|
||||
"""
|
||||
self.add_header_file([
|
||||
"/usr/include/GL/*"
|
||||
],
|
||||
destination_path="GL",
|
||||
recursive=True)
|
||||
"""
|
||||
self.add_export_flag('link-lib', "GLESv2")
|
||||
|
||||
|
34
lutin/z_system/lutinSystem_Android_pthread.py
Normal file
34
lutin/z_system/lutinSystem_Android_pthread.py
Normal file
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.help="pthread : Generic multithreading system\n Can be install with the package:\n - pthread-dev"
|
||||
# check if the library exist:
|
||||
"""
|
||||
if not os.path.isfile("/usr/include/pthread.h"):
|
||||
# we did not find the library reqiested (just return) (automaticly set at false)
|
||||
return;
|
||||
"""
|
||||
self.valid = True
|
||||
# todo : create a searcher of the presence of the library:
|
||||
#self.add_export_flag("link-lib", "pthread")
|
||||
self.add_module_depend([
|
||||
'c'
|
||||
])
|
||||
|
||||
|
33
lutin/z_system/lutinSystem_Linux_X11.py
Normal file
33
lutin/z_system/lutinSystem_Linux_X11.py
Normal file
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
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_header_file([
|
||||
"/usr/include/X11/*"
|
||||
],
|
||||
destination_path="X11",
|
||||
recursive=True)
|
||||
|
||||
self.add_export_flag('link-lib', 'X11')
|
||||
|
||||
|
@@ -26,5 +26,18 @@ class System(system.System):
|
||||
self.valid = True
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_export_flag("link-lib", "asound")
|
||||
self.add_header_file([
|
||||
"/usr/include/alsa/*",
|
||||
],
|
||||
destination_path="alsa",
|
||||
recursive=True)
|
||||
self.add_header_file([
|
||||
"/usr/include/dssi/*",
|
||||
],
|
||||
destination_path="dssi",
|
||||
recursive=True)
|
||||
self.add_module_depend([
|
||||
'c'
|
||||
])
|
||||
|
||||
|
||||
|
36
lutin/z_system/lutinSystem_Linux_arpa.py
Normal file
36
lutin/z_system/lutinSystem_Linux_arpa.py
Normal file
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.help="rpc : generic RPC library (developed by oracle)"
|
||||
# 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", "xns")
|
||||
self.add_header_file([
|
||||
"/usr/include/arpa/*"
|
||||
],
|
||||
destination_path="arpa",
|
||||
recursive=True)
|
||||
self.add_module_depend([
|
||||
'c'
|
||||
])
|
||||
|
||||
|
||||
|
||||
|
173
lutin/z_system/lutinSystem_Linux_c.py
Normal file
173
lutin/z_system/lutinSystem_Linux_c.py
Normal file
@@ -0,0 +1,173 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.help = "C: 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++", "-nodefaultlibs")
|
||||
# grep "This file is part of the GNU C Library" /usr/include/*
|
||||
self.add_header_file([
|
||||
'/usr/include/aio.h',
|
||||
'/usr/include/aliases.h',
|
||||
'/usr/include/alloca.h',
|
||||
'/usr/include/ansidecl.h',
|
||||
'/usr/include/argp.h',
|
||||
'/usr/include/argz.h',
|
||||
'/usr/include/ar.h',
|
||||
'/usr/include/assert.h',
|
||||
'/usr/include/byteswap.h',
|
||||
'/usr/include/complex.h',
|
||||
'/usr/include/cpio.h',
|
||||
'/usr/include/ctype.h',
|
||||
'/usr/include/dirent.h',
|
||||
'/usr/include/dlfcn.h',
|
||||
'/usr/include/elf.h',
|
||||
'/usr/include/endian.h',
|
||||
'/usr/include/envz.h',
|
||||
'/usr/include/err.h',
|
||||
'/usr/include/errno.h',
|
||||
'/usr/include/error.h',
|
||||
'/usr/include/execinfo.h',
|
||||
'/usr/include/fcntl.h',
|
||||
'/usr/include/features.h',
|
||||
'/usr/include/fenv.h',
|
||||
'/usr/include/fmtmsg.h',
|
||||
'/usr/include/fnmatch.h',
|
||||
'/usr/include/fpu_control.h',
|
||||
'/usr/include/fts.h',
|
||||
'/usr/include/ftw.h',
|
||||
'/usr/include/gconv.h',
|
||||
'/usr/include/getopt.h',
|
||||
'/usr/include/glob.h',
|
||||
'/usr/include/gnu-versions.h',
|
||||
'/usr/include/grp.h',
|
||||
'/usr/include/gshadow.h',
|
||||
'/usr/include/iconv.h',
|
||||
'/usr/include/ieee754.h',
|
||||
'/usr/include/ifaddrs.h',
|
||||
'/usr/include/inttypes.h',
|
||||
'/usr/include/langinfo.h',
|
||||
'/usr/include/libgen.h',
|
||||
'/usr/include/libintl.h',
|
||||
'/usr/include/libio.h',
|
||||
'/usr/include/limits.h',
|
||||
'/usr/include/link.h',
|
||||
'/usr/include/locale.h',
|
||||
'/usr/include/malloc.h',
|
||||
'/usr/include/mcheck.h',
|
||||
'/usr/include/memory.h',
|
||||
'/usr/include/mntent.h',
|
||||
'/usr/include/monetary.h',
|
||||
'/usr/include/mqueue.h',
|
||||
'/usr/include/netdb.h',
|
||||
'/usr/include/nl_types.h',
|
||||
'/usr/include/nss.h',
|
||||
'/usr/include/obstack.h',
|
||||
'/usr/include/printf.h',
|
||||
'/usr/include/pthread.h',
|
||||
'/usr/include/pty.h',
|
||||
'/usr/include/pwd.h',
|
||||
'/usr/include/re_comp.h',
|
||||
'/usr/include/regex.h',
|
||||
'/usr/include/regexp.h',
|
||||
'/usr/include/sched.h',
|
||||
'/usr/include/search.h',
|
||||
'/usr/include/semaphore.h',
|
||||
'/usr/include/setjmp.h',
|
||||
'/usr/include/sgtty.h',
|
||||
'/usr/include/shadow.h',
|
||||
'/usr/include/signal.h',
|
||||
'/usr/include/spawn.h',
|
||||
'/usr/include/stdc-predef.h',
|
||||
'/usr/include/stdint.h',
|
||||
'/usr/include/stdio_ext.h',
|
||||
'/usr/include/stdio.h',
|
||||
'/usr/include/stdlib.h',
|
||||
'/usr/include/string.h',
|
||||
'/usr/include/strings.h',
|
||||
'/usr/include/stropts.h',
|
||||
'/usr/include/tar.h',
|
||||
'/usr/include/termios.h',
|
||||
'/usr/include/tgmath.h',
|
||||
'/usr/include/thread_db.h',
|
||||
'/usr/include/time.h',
|
||||
'/usr/include/uchar.h',
|
||||
'/usr/include/ucontext.h',
|
||||
'/usr/include/ulimit.h',
|
||||
'/usr/include/unistd.h',
|
||||
'/usr/include/utime.h',
|
||||
'/usr/include/utmp.h',
|
||||
'/usr/include/utmpx.h',
|
||||
'/usr/include/values.h',
|
||||
'/usr/include/wchar.h',
|
||||
'/usr/include/wctype.h',
|
||||
'/usr/include/wordexp.h',
|
||||
'/usr/include/xlocale.h',
|
||||
],
|
||||
destination_path="")
|
||||
self.add_header_file([
|
||||
'/usr/include/poll.h',
|
||||
'/usr/include/unistdio.h',
|
||||
'/usr/include/syslog.h',
|
||||
'/usr/include/_G_config.h',
|
||||
],
|
||||
destination_path="")
|
||||
self.add_header_file([
|
||||
"/usr/include/sys/*",
|
||||
],
|
||||
destination_path="sys",
|
||||
recursive=True)
|
||||
self.add_header_file([
|
||||
"/usr/include/bits/*",
|
||||
],
|
||||
destination_path="bits",
|
||||
recursive=True)
|
||||
self.add_header_file([
|
||||
"/usr/include/gnu/*",
|
||||
],
|
||||
destination_path="gnu",
|
||||
recursive=True)
|
||||
self.add_header_file([
|
||||
"/usr/include/linux/*",
|
||||
],
|
||||
destination_path="linux",
|
||||
recursive=True)
|
||||
self.add_header_file([
|
||||
"/usr/include/asm/*",
|
||||
],
|
||||
destination_path="asm",
|
||||
recursive=True)
|
||||
self.add_header_file([
|
||||
"/usr/include/asm-generic/*",
|
||||
],
|
||||
destination_path="asm-generic",
|
||||
recursive=True)
|
||||
self.add_header_file([
|
||||
"/usr/include/netinet/*",
|
||||
],
|
||||
destination_path="netinet",
|
||||
recursive=True)
|
||||
self.add_header_file([
|
||||
"/usr/include/net/*",
|
||||
],
|
||||
destination_path="net",
|
||||
recursive=True)
|
||||
self.add_export_flag("link", "-B/usr/lib")
|
||||
|
@@ -20,8 +20,18 @@ class System(system.System):
|
||||
self.help = "CXX: Generic C++ library"
|
||||
self.valid = True
|
||||
# no check needed ==> just add this:
|
||||
self.add_module_depend([
|
||||
'c',
|
||||
'm',
|
||||
'pthread'
|
||||
])
|
||||
self.add_export_flag("c++", "-D__STDCPP_GNU__")
|
||||
self.add_export_flag("c++-remove", "-nostdlib")
|
||||
self.add_export_flag("need-libstdc++", True)
|
||||
#self.add_export_flag("c++-remove", "-nostdlib")
|
||||
#self.add_export_flag("need-libstdc++", True)
|
||||
self.add_export_flag("link-lib", "stdc++")
|
||||
self.add_header_file([
|
||||
"/usr/include/c++/6.1.1/*"
|
||||
],
|
||||
recursive=True)
|
||||
|
||||
|
||||
|
@@ -25,5 +25,14 @@ class System(system.System):
|
||||
self.valid = True
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_export_flag("link-lib", "jack")
|
||||
self.add_module_depend([
|
||||
'uuid',
|
||||
'c'
|
||||
])
|
||||
self.add_header_file([
|
||||
"/usr/include/jack/*",
|
||||
],
|
||||
destination_path="jack",
|
||||
recursive=True)
|
||||
|
||||
|
||||
|
@@ -22,5 +22,14 @@ class System(system.System):
|
||||
self.valid = True
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_export_flag("link-lib", "m")
|
||||
self.add_module_depend([
|
||||
'c'
|
||||
])
|
||||
self.add_header_file([
|
||||
"/usr/include/math.h"
|
||||
],
|
||||
clip_path="/usr/include",
|
||||
recursive=False)
|
||||
|
||||
|
||||
|
||||
|
53
lutin/z_system/lutinSystem_Linux_opengl.py
Normal file
53
lutin/z_system/lutinSystem_Linux_opengl.py
Normal file
@@ -0,0 +1,53 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.help = "OpenGL: Generic graphic library"
|
||||
self.valid = True
|
||||
# no check needed ==> just add this:
|
||||
self.add_module_depend([
|
||||
'c',
|
||||
'X11'
|
||||
])
|
||||
|
||||
self.add_header_file([
|
||||
"/usr/include/GL/*"
|
||||
],
|
||||
destination_path="GL",
|
||||
recursive=True)
|
||||
|
||||
self.add_export_flag('link-lib', 'GL')
|
||||
"""
|
||||
if target.name=="Linux":
|
||||
|
||||
elif target.name=="Android":
|
||||
my_module.add_export_flag('link-lib', "GLESv2")
|
||||
elif target.name=="Windows":
|
||||
my_module.add_module_depend([
|
||||
"glew"
|
||||
])
|
||||
elif target.name=="MacOs":
|
||||
my_module.add_export_flag('link', [
|
||||
"-framework OpenGL"])
|
||||
elif target.name=="IOs":
|
||||
my_module.add_export_flag('link', [
|
||||
"-framework OpenGLES"
|
||||
])
|
||||
"""
|
||||
|
||||
|
37
lutin/z_system/lutinSystem_Linux_pthread.py
Normal file
37
lutin/z_system/lutinSystem_Linux_pthread.py
Normal file
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.help="pthread : Generic multithreading system\n Can be install with the package:\n - pthread-dev"
|
||||
# check if the library exist:
|
||||
if not os.path.isfile("/usr/include/pthread.h"):
|
||||
# we did not find the library reqiested (just return) (automaticly set at false)
|
||||
return;
|
||||
self.valid = True
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_export_flag("link-lib", "pthread")
|
||||
self.add_header_file([
|
||||
"/usr/include/sched.h",
|
||||
"/usr/include/pthread.h"
|
||||
],
|
||||
clip_path="/usr/include/")
|
||||
self.add_module_depend([
|
||||
'c'
|
||||
])
|
||||
|
||||
|
@@ -22,8 +22,37 @@ class System(system.System):
|
||||
if not os.path.isfile("/usr/include/pulse/pulseaudio.h"):
|
||||
# we did not find the library reqiested (just return) (automaticly set at false)
|
||||
return;
|
||||
dst_data = tools.file_read_data("/usr/include/pulse/version.h")
|
||||
lines = dst_data.split("\n")
|
||||
patern = "#define pa_get_headers_version() (\""
|
||||
version = None
|
||||
for line in lines:
|
||||
if line[:len(patern)] == patern:
|
||||
#Find the version line
|
||||
version = line[len(patern)]
|
||||
version2 = line[len(patern)+2]
|
||||
debug.verbose("detect version '" + version + "'")
|
||||
break;
|
||||
if version == None:
|
||||
debug.warning("Can not det version of Pulseaudio ... ==> remove it")
|
||||
return
|
||||
self.set_version([int(version),int(version2)])
|
||||
self.valid = True
|
||||
self.add_module_depend([
|
||||
'c'
|
||||
])
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_export_flag("link-lib", ["pulse-simple", "pulse"])
|
||||
self.add_export_flag("link-lib", [
|
||||
"pulsecommon-" + version + ".0",
|
||||
"pulse-mainloop-glib",
|
||||
"pulse-simple",
|
||||
"pulse"
|
||||
])
|
||||
self.add_export_flag("link", "-L/usr/lib/pulseaudio")
|
||||
self.add_header_file([
|
||||
"/usr/include/pulse/*",
|
||||
],
|
||||
destination_path="pulse",
|
||||
recursive=True)
|
||||
|
||||
|
||||
|
36
lutin/z_system/lutinSystem_Linux_rpc.py
Normal file
36
lutin/z_system/lutinSystem_Linux_rpc.py
Normal file
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.help="rpc : generic RPC library (developed by oracle)"
|
||||
# No check ==> on the basic std libs:
|
||||
self.valid = True
|
||||
self.add_module_depend([
|
||||
'c'
|
||||
])
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_export_flag("link-lib", "rpcsvc")
|
||||
self.add_header_file([
|
||||
"/usr/include/rpc/*"
|
||||
],
|
||||
destination_path="rpc",
|
||||
recursive=True)
|
||||
|
||||
|
||||
|
||||
|
37
lutin/z_system/lutinSystem_Linux_uuid.py
Normal file
37
lutin/z_system/lutinSystem_Linux_uuid.py
Normal file
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.help="uuid: Unique ID library"
|
||||
# check if the library exist:
|
||||
if not os.path.isfile("/usr/include/uuid/uuid.h"):
|
||||
# we did not find the library reqiested (just return) (automaticly set at false)
|
||||
return;
|
||||
self.valid = True
|
||||
self.add_module_depend([
|
||||
'c'
|
||||
])
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_export_flag("link-lib", "uuid")
|
||||
self.add_header_file([
|
||||
"/usr/include/uuid/*",
|
||||
],
|
||||
destination_path="uuid",
|
||||
recursive=True)
|
||||
|
||||
|
@@ -25,5 +25,12 @@ class System(system.System):
|
||||
self.valid = True
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_export_flag("link-lib", "z")
|
||||
self.add_module_depend([
|
||||
'c'
|
||||
])
|
||||
self.add_header_file([
|
||||
"/usr/include/zlib.h"
|
||||
],
|
||||
destination_path="")
|
||||
|
||||
|
||||
|
@@ -174,13 +174,15 @@ class Target(target.Target):
|
||||
# -----------------------
|
||||
self.add_flag("c", [
|
||||
"-mfpu=neon",
|
||||
"-march=armv7-a",
|
||||
"-mfloat-abi=softfp",
|
||||
"-D__ARM_ARCH_7__",
|
||||
"-D__ARM_NEON__"
|
||||
])
|
||||
self.add_flag("link", [
|
||||
"-mfpu=neon",
|
||||
"-mfloat-abi=softfp"
|
||||
"-mfloat-abi=softfp",
|
||||
"-Wl,--fix-cortex-a8",
|
||||
])
|
||||
|
||||
# the -mthumb must be set for all the android produc, some ot the not work coretly without this one ... (all android code is generated with this flags)
|
||||
|
@@ -41,6 +41,9 @@ class Target(target.Target):
|
||||
self.pkg_path_bin = "bin"
|
||||
self.pkg_path_lib = "lib"
|
||||
self.pkg_path_license = "license"
|
||||
|
||||
self.sysroot = "--sysroot=/aDirectoryThatDoesNotExist/"
|
||||
|
||||
|
||||
"""
|
||||
.local/application
|
||||
|
2
setup.py
2
setup.py
@@ -16,7 +16,7 @@ def readme():
|
||||
|
||||
# https://pypi.python.org/pypi?%3Aaction=list_classifiers
|
||||
setup(name='lutin',
|
||||
version='1.2.2',
|
||||
version='1.2.4',
|
||||
description='Lutin generic builder (might replace makefile, CMake ...)',
|
||||
long_description=readme(),
|
||||
url='http://github.com/HeeroYui/lutin',
|
||||
|
Reference in New Issue
Block a user