Compare commits

...

23 Commits
2.3.0 ... 2.5.0

Author SHA1 Message Date
48d1ff1937 [RELEASE] new version 2.5.0 2019-04-26 23:56:04 +02:00
6386467b45 [DEV] update at the new external argument parser (death) 2019-04-26 23:41:11 +02:00
017cbc50ba [DEV] update at the new external log system 2019-04-26 23:41:11 +02:00
d3be28a1a3 [RELEASE] new version 2.4.0 2019-04-15 22:41:41 +02:00
cb4c8c050f [DEV] update doc to commit on pip 2019-04-15 22:40:22 +02:00
3a39092af2 [DEV] add some logs 2019-04-01 22:15:41 +02:00
a7732fba54 [DEV] add C++20 2018-08-16 23:10:54 +02:00
66e98727b9 [DEBUG] correct the run of the library 2018-07-09 21:56:54 +02:00
55e5f44c42 [DOC] update doc for gcov 2018-06-19 21:01:15 +02:00
d7383332cb [DOC] add helper doc 2018-06-19 07:14:58 +02:00
f29316f493 [DEV] add ysql interface 2018-04-12 23:17:42 +02:00
6b2563483f [DEV] small fix 2018-02-27 21:17:34 +01:00
3058308f18 [DEV] add ccache 2018-02-27 21:17:34 +01:00
b4bce09b46 [DEBUG] correct the log display 2018-01-12 21:25:15 +01:00
a994af78d4 [DEBUG] remove UTF8 error print when add some µs in files 2017-10-21 23:19:47 +02:00
f6abd70d75 [DEBUG] some naming correction 2017-10-09 10:23:52 +02:00
0946252a10 [DEV] try to remove dependency on STL 2017-09-07 23:35:23 +02:00
03742be308 [DEV] try isolate in macOs 2017-09-07 23:35:35 +02:00
7ca034a430 [DEV] add doc and set android in openGL ES 3 limit at API 19(4.3) 2017-06-28 08:20:50 +02:00
9131d375b8 [DEV] add a get version 2017-04-21 21:07:04 +02:00
ed7fc49324 [DEBUG] correct pulseaudio (step 3) 2017-04-13 21:36:11 +02:00
64d39a9def [DEBUG] correct pulseaudio (step 2) 2017-04-13 21:10:27 +02:00
87bd7f8e7a [DEV] set back pulseaudio 2017-04-12 23:32:32 +02:00
120 changed files with 628 additions and 834 deletions

View File

@@ -12,9 +12,10 @@
import sys
import os
import copy
from realog import debug as debug
import lutin
import lutin.debug as debug
import lutin.arg as arguments
import death.Arguments as arguments
import death.ArgElement as arg_element
import lutin.host as host
import lutin.module as module
import lutin.target as target
@@ -24,7 +25,7 @@ import lutin.tools as tools
import lutin.host as lutinHost
import lutin.tools as lutinTools
myArgs = arguments.LutinArg()
myArgs = arguments.Arguments()
myArgs.add("h", "help", desc="Display this help")
myArgs.add("H", "HELP", desc="Display this help (with all compleate information)")
myArgs.add_section("option", "Can be set one time in all case")
@@ -38,6 +39,7 @@ myArgs.add("s", "force-strip", desc="Force the stripping of the compile elements
myArgs.add("o", "force-optimisation", desc="Force optimisation of the build")
myArgs.add("w", "warning", desc="Store warning in a file build file")
myArgs.add("i", "isolate-system", desc="Isolate system build (copy header of c and c++ system lib to not include unneeded external libs) EXPERIMENTAL (archlinux)")
myArgs.add("K", "ccache", desc="Enable the ccache interface")
myArgs.add_section("properties", "keep in the sequency of the cible")
myArgs.add("t", "target", haveParam=True, desc="Select a target (by default the platform is the computer that compile this) To know list : 'lutin.py --list-target'")
@@ -162,8 +164,12 @@ def usage(full=False):
print(" maintainers:")
for elem in mod["maintainer"]:
print(" " + str(elem))
print(" ex: " + sys.argv[0] + " all --target=Android all -t Windows -m debug all")
print(" ex: " + sys.argv[0] + " -cclang -mdebug zeus-package-base?build?run%zeus-launcher:--srv=user:--elog-level=5")
print(" ex simple 1: " + sys.argv[0])
print(" ex simple 2: " + sys.argv[0] + " -t Windows")
print(" ex multiple platform : " + sys.argv[0] + " all --target=Android all -t Windows -m debug all")
print(" ex complex arguments : " + sys.argv[0] + " -cclang -mdebug zeus-package-base?build?run%zeus-launcher:--srv=user:--elog-level=5")
print(" ex gcov: " + sys.argv[0] + " -cgcc --gcov -mdebug etk-test?build?run etk?gcov")
print(" ex gcov with output: " + sys.argv[0] + " -cgcc --gcov -mdebug etk-test?build?run etk?gcov:output")
exit(0)
def check_boolean(value):
@@ -216,6 +222,13 @@ def parseGenericArg(argument, active):
if active == True:
env.set_parse_depth(int(argument.get_arg()))
return True
elif argument.get_option_name()=="ccache":
if active == True:
if check_boolean(argument.get_arg()) == True:
env.set_ccache(True)
else:
env.set_ccache(False)
return True
elif argument.get_option_name() == "verbose":
if active == True:
debug.set_level(int(argument.get_arg()))
@@ -289,37 +302,42 @@ if os.path.isfile(config_file) == True:
if "get_parsing_depth" in dir(configuration_file):
data = configuration_file.get_parsing_depth()
debug.debug(" get default config 'get_parsing_depth' val='" + str(data) + "'")
parseGenericArg(arguments.ArgElement("depth", str(data)), True)
parseGenericArg(arg_element.ArgElement("depth", str(data)), True)
if "get_ccache" in dir(configuration_file):
data = configuration_file.get_ccache()
debug.debug(" get default config 'get_ccache' val='" + str(data) + "'")
parseGenericArg(arg_element.ArgElement("ccache", str(data)), True)
if "get_default_jobs" in dir(configuration_file):
data = configuration_file.get_default_jobs()
debug.debug(" get default config 'get_default_jobs' val='" + str(data) + "'")
parseGenericArg(arguments.ArgElement("jobs", str(data)), True)
parseGenericArg(arg_element.ArgElement("jobs", str(data)), True)
if "get_default_color" in dir(configuration_file):
data = configuration_file.get_default_color()
debug.debug(" get default config 'get_default_color' val='" + str(data) + "'")
parseGenericArg(arguments.ArgElement("color", str(data)), True)
parseGenericArg(arg_element.ArgElement("color", str(data)), True)
if "get_default_debug_level" in dir(configuration_file):
data = configuration_file.get_default_debug_level()
debug.debug(" get default config 'get_default_debug_level' val='" + str(data) + "'")
parseGenericArg(arguments.ArgElement("verbose", str(data)), True)
parseGenericArg(arg_element.ArgElement("verbose", str(data)), True)
if "get_default_print_pretty" in dir(configuration_file):
data = configuration_file.get_default_print_pretty()
debug.debug(" get default config 'get_default_print_pretty' val='" + str(data) + "'")
parseGenericArg(arguments.ArgElement("pretty", str(data)), True)
parseGenericArg(arg_element.ArgElement("pretty", str(data)), True)
if "get_default_force_optimisation" in dir(configuration_file):
data = configuration_file.get_default_force_optimisation()
debug.debug(" get default config 'get_default_force_optimisation' val='" + str(data) + "'")
parseGenericArg(arguments.ArgElement("force-optimisation", str(data)), True)
parseGenericArg(arg_element.ArgElement("force-optimisation", str(data)), True)
if "get_default_isolate_system" in dir(configuration_file):
data = configuration_file.get_default_isolate_system()
debug.debug(" get default config 'get_default_isolate_system' val='" + str(data) + "'")
parseGenericArg(arguments.ArgElement("isolate-system", str(data)), True)
parseGenericArg(arg_element.ArgElement("isolate-system", str(data)), True)

View File

@@ -47,8 +47,8 @@ Do it ... it does not work ...
lutin -C -D -tIOs yourApplication?install
```
Appliocation ID
---------------
Application ID
--------------
It miss some things to do:

15
doc/101_Use_on_Android.md Normal file
View File

@@ -0,0 +1,15 @@
Connect device
To connect to a real device or phone via ADB under Arch, you must:
install android-udev
plug in your android device via USB.
Enable USB Debugging on your phone or device:
Jelly Bean (4.2) and newer: Go to Settings --> About Phone tap “Build Number” 7 times until you get a popup that you have become a developer. Then go to Settings --> Developer --> USB debugging and enable it. The device will ask to allow the computer with its fingerprint to connect. allowing it permanent will copy $HOME/.android/adbkey.pub onto the devices /data/misc/adb/adb_keys folder.
If android-udev has been installed, add yourself to the adbusers group:
# gpasswd -a username adbusers

View File

@@ -17,7 +17,7 @@ from . import builder
from . import system
from . import host
from . import tools
from . import debug
from realog import debug
from . import module
from . import env
is_init = False

View File

@@ -1,378 +0,0 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license MPL v2.0 (see license file)
##
import sys
from . import debug
##
## @brief Single argument class. It permit to define the getted argument.
##
class ArgElement:
##
## @brief Contructor.
## @param[in] self Class handle
## @param[in] option (string) Option name (write in fullmode ex: '--verbose' even if user write '-v')
## @param[in] value (string) Writed value by the user (defult '')
##
def __init__(self, option, value=""):
self.option = option;
self.arg = value;
##
## @brief Get the name of the argument: (write in fullmode ex: '--verbose' even if user write '-v')
## @param[in] self Class handle
## @return (string) The argument name
##
def get_option_name(self):
return self.option
##
## @brief Get argument data set by the user
## @param[in] self Class handle
## @return (string) The argument value
##
def get_arg(self):
return self.arg
##
## @brief Display the Argument property
## @param[in] self Class handle
##
def display(self):
if len(self.arg) == 0:
debug.info("option : " + self.option)
elif len(self.option) == 0:
debug.info("element : " + self.arg)
else:
debug.info("option : " + self.option + ":" + self.arg)
##
## @brief Declare a possibility of an argument value
##
class ArgDefine:
##
## @brief Contructor.
## @param[in] self Class handle
## @param[in] smallOption (char) Value for the small option ex: '-v' '-k' ... 1 single char element (no need of '-')
## @param[in] bigOption (string) Value of the big option name ex: '--verbose' '--kill' ... stated with -- and with the full name (no need of '--')
## @param[in] list ([[string,string],...]) Optionnal list of availlable option: '--mode=debug' ==> [['debug', 'debug mode'],['release', 'release the software']]
## @param[in] desc (string) user friendly description with this parameter (default "")
## @param[in] haveParam (bool) The option must have a parameter (default False)
##
def __init__(self,
smallOption="", # like v for -v
bigOption="", # like verbose for --verbose
list=[], # ["val", "description"]
desc="",
haveParam=False):
self.option_small = smallOption;
self.option_big = bigOption;
self.list = list;
if len(self.list)!=0:
self.have_param = True
else:
if True==haveParam:
self.have_param = True
else:
self.have_param = False
self.description = desc;
##
## @brief Get the small name of the option ex: '-v'
## @param[in] self Class handle
## @return (string) Small name value
##
def get_option_small(self):
return self.option_small
##
## @brief Get the big name of the option ex: '--verbose'
## @param[in] self Class handle
## @return (string) Big name value
##
def get_option_big(self):
return self.option_big
##
## @brief Get the status of getting user parameter value
## @param[in] self Class handle
## @return True The user must write a value
## @return False The user must NOT write a value
##
def need_parameters(self):
return self.have_param
##
## @brief Compatibility with @ref ArgSection class
## @param[in] self Class handle
## @return (string) empty string
##
def get_porperties(self):
return ""
##
## @brief Check if the user added value is correct or not with the list of availlable value
## @param[in] self Class handle
## @param[in] argument (string) User parameter value (string)
## @return True The parameter is OK
## @return False The parameter is NOT Availlable
##
def check_availlable(self, argument):
if len(self.list)==0:
return True
for element,desc in self.list:
if element == argument:
return True
return False
##
## @brief Display the argument property when user request help
## @param[in] self Class handle
##
def display(self):
color = debug.get_color_set()
if self.option_small != "" and self.option_big != "":
print(" " + color['red'] + "-" + self.option_small + "" + color['default'] + " / " + color['red'] + "--" + self.option_big + color['default'])
elif self.option_small != "":
print(" " + color['red'] + "-" + self.option_small + color['default'])
elif self.option_big != "":
print(" " + color['red'] + "--" + self.option_big + color['default'])
else:
print(" ???? ==> internal error ...")
if self.description != "":
print(" " + self.description)
if len(self.list)!=0:
hasDescriptiveElement=False
for val,desc in self.list:
if desc!="":
hasDescriptiveElement=True
break;
if hasDescriptiveElement==True:
for val,desc in self.list:
print(" " + val + " : " + desc)
else:
tmpElementPrint = ""
for val,desc in self.list:
if len(tmpElementPrint)!=0:
tmpElementPrint += " / "
tmpElementPrint += val
print(" { " + tmpElementPrint + " }")
##
## @brief Section Class definition (permit to add a comment when requesting help
##
class ArgSection:
##
## @brief Constructor
## @param[in] self Class handle
## @param[in] sectionName (string) Name of the cestion ex: "option" is displayed [option]
## @param[in] desc (string) Comment assiciated with the group
##
def __init__(self,
sectionName="",
desc=""):
self.section = sectionName;
self.description = desc;
##
## @brief Compatibility with @ref ArgDefine class
## @param[in] self Class handle
## @return empty string
##
def get_option_small(self):
return ""
##
## @brief Compatibility with @ref ArgDefine class
## @param[in] self Class handle
## @return empty string
##
def get_option_big(self):
return ""
##
## @brief get property print value with the correct writing mode
## @param[in] self Class handle
## @return String to display in the short line help
##
def get_porperties(self):
color = debug.get_color_set()
return " [" + color['blue'] + self.section + color['default'] + "]"
##
## @brief Display the argument property when user request help
## @param[in] self Class handle
##
def display(self):
color = debug.get_color_set()
print(" [" + color['blue'] + self.section + color['default'] + "] : " + self.description)
##
## @brief Class to define the agmument list availlable for a program
##
class LutinArg:
##
## @brief Constructor.
## @param[in] self Class handle
##
def __init__(self):
self.list_properties = []
##
## @brief Add a new argument possibilities...
## @param[in] self Class handle
## @param[in] smallOption (char) Value for the small option ex: '-v' '-k' ... 1 single char element (no need of '-')
## @param[in] bigOption (string) Value of the big option name ex: '--verbose' '--kill' ... stated with -- and with the full name (no need of '--')
## @param[in] list ([[string,string],...]) Optionnal list of availlable option: '--mode=debug' ==> [['debug', 'debug mode'],['release', 'release the software']]
## @param[in] desc (string) user friendly description with this parameter (default "")
## @param[in] haveParam (bool) The option must have a parameter (default False)
##
def add(self, smallOption="", bigOption="", list=[], desc="", haveParam=False):
self.list_properties.append(ArgDefine(smallOption, bigOption, list, desc, haveParam))
##
## @brief Add section on argument list
## @param[in] self Class handle
## @param[in] sectionName (string) Name of the cestion ex: "option" is displayed [option]
## @param[in] sectionDesc (string) Comment assiciated with the group
##
def add_section(self, sectionName, sectionDesc):
self.list_properties.append(ArgSection(sectionName, sectionDesc))
##
## @brief Parse the argument set in the command line
## @param[in] self Class handle
##
def parse(self):
listArgument = [] # composed of list element
NotparseNextElement=False
for iii in range(1, len(sys.argv)):
# special case of parameter in some elements
if NotparseNextElement==True:
NotparseNextElement = False
continue
debug.verbose("parse [" + str(iii) + "]=" + sys.argv[iii])
argument = sys.argv[iii]
optionList = argument.split("=")
debug.verbose(str(optionList))
if type(optionList) == type(str()):
option = optionList
else:
option = optionList[0]
optionParam = argument[len(option)+1:]
debug.verbose(option)
argumentFound=False;
if option[:2]=="--":
# big argument
for prop in self.list_properties:
if prop.get_option_big()=="":
continue
if prop.get_option_big() == option[2:]:
# find it
debug.verbose("find argument 2 : " + option[2:])
if prop.need_parameters()==True:
internalSub = option[2+len(prop.get_option_big()):]
if len(internalSub)!=0:
if len(optionParam)!=0:
# wrong argument ...
debug.warning("maybe wrong argument for : '" + prop.get_option_big() + "' cmdLine='" + argument + "'")
prop.display()
continue
optionParam = internalSub
if len(optionParam)==0:
#Get the next parameters
if len(sys.argv) > iii+1:
optionParam = sys.argv[iii+1]
NotparseNextElement=True
else :
# missing arguments
debug.warning("parsing argument error : '" + prop.get_option_big() + "' Missing : subParameters ... cmdLine='" + argument + "'")
prop.display()
exit(-1)
if prop.check_availlable(optionParam)==False:
debug.warning("argument error : '" + prop.get_option_big() + "' SubParameters not availlable ... cmdLine='" + argument + "' option='" + optionParam + "'")
prop.display()
exit(-1)
listArgument.append(ArgElement(prop.get_option_big(),optionParam))
argumentFound = True
else:
if len(optionParam)!=0:
debug.warning("parsing argument error : '" + prop.get_option_big() + "' need no subParameters : '" + optionParam + "' cmdLine='" + argument + "'")
prop.display()
listArgument.append(ArgElement(prop.get_option_big()))
argumentFound = True
break;
if False==argumentFound:
debug.error("UNKNOW argument : '" + argument + "'")
elif option[:1]=="-":
# small argument
for prop in self.list_properties:
if prop.get_option_small()=="":
continue
if prop.get_option_small() == option[1:1+len(prop.get_option_small())]:
# find it
debug.verbose("find argument 1 : " + option[1:1+len(prop.get_option_small())])
if prop.need_parameters()==True:
internalSub = option[1+len(prop.get_option_small()):]
if len(internalSub)!=0:
if len(optionParam)!=0:
# wrong argument ...
debug.warning("maybe wrong argument for : '" + prop.get_option_big() + "' cmdLine='" + argument + "'")
prop.display()
continue
optionParam = internalSub
if len(optionParam)==0:
#Get the next parameters
if len(sys.argv) > iii+1:
optionParam = sys.argv[iii+1]
NotparseNextElement=True
else :
# missing arguments
debug.warning("parsing argument error : '" + prop.get_option_big() + "' Missing : subParameters cmdLine='" + argument + "'")
prop.display()
exit(-1)
if prop.check_availlable(optionParam)==False:
debug.warning("argument error : '" + prop.get_option_big() + "' SubParameters not availlable ... cmdLine='" + argument + "' option='" + optionParam + "'")
prop.display()
exit(-1)
listArgument.append(ArgElement(prop.get_option_big(),optionParam))
argumentFound = True
else:
if len(optionParam)!=0:
debug.warning("parsing argument error : '" + prop.get_option_big() + "' need no subParameters : '" + optionParam + "' cmdLine='" + argument + "'")
prop.display()
listArgument.append(ArgElement(prop.get_option_big()))
argumentFound = True
break;
if argumentFound==False:
#unknow element ... ==> just add in the list ...
debug.verbose("unknow argument : " + argument)
listArgument.append(ArgElement("", argument))
#for argument in listArgument:
# argument.display()
#exit(0)
return listArgument;
##
## @brief Display help on console output
## @param[in] self Class handle
##
def display(self):
print("usage:")
listOfPropertiesArg = "";
for element in self.list_properties :
listOfPropertiesArg += element.get_porperties()
print(" " + sys.argv[0] + listOfPropertiesArg + " ...")
for element in self.list_properties :
element.display()

View File

@@ -13,7 +13,7 @@ import inspect
import fnmatch
import datetime
# Local import
from . import debug
from realog import debug
from . import heritage
from . import env

View File

@@ -1,262 +0,0 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license MPL v2.0 (see license file)
##
import os
import threading
import re
debug_level=3
debug_color=False
color_default= ""
color_red = ""
color_green = ""
color_yellow = ""
color_blue = ""
color_purple = ""
color_cyan = ""
debug_lock = threading.Lock()
##
## @brief Set log level of the console log system
## @param[in] id (int) Value of the log level:
## 0: None
## 1: error
## 2: warning
## 3: info
## 4: debug
## 5: verbose
## 6: extreme_verbose
##
def set_level(id):
global debug_level
debug_level = id
#print "SetDebug level at " + str(debug_level)
##
## @brief Get the current debug leval
## @return The value of the log level. Show: @ref set_level
##
def get_level():
global debug_level
return debug_level
##
## @brief Enable color of the console Log system
##
def enable_color():
global debug_color
debug_color = True
global color_default
color_default= "\033[00m"
global color_red
color_red = "\033[31m"
global color_green
color_green = "\033[32m"
global color_yellow
color_yellow = "\033[33m"
global color_blue
color_blue = "\033[01;34m"
global color_purple
color_purple = "\033[35m"
global color_cyan
color_cyan = "\033[36m"
##
## @brief Disable color of the console Log system
##
def disable_color():
global debug_color
debug_color = True
global color_default
color_default= ""
global color_red
color_red = ""
global color_green
color_green = ""
global color_yellow
color_yellow = ""
global color_blue
color_blue = ""
global color_purple
color_purple = ""
global color_cyan
color_cyan = ""
##
## @brief Print a extreme verbose log
## @param[in] input (string) Value to print if level is enough
## @param[in] force (bool) force display (no check of log level)
##
def extreme_verbose(input, force=False):
global debug_lock
global debug_level
if debug_level >= 6 \
or force == True:
debug_lock.acquire()
print(color_blue + input + color_default)
debug_lock.release()
##
## @brief Print a verbose log
## @param[in] input (string) Value to print if level is enough
## @param[in] force (bool) force display (no check of log level)
##
def verbose(input, force=False):
global debug_lock
global debug_level
if debug_level >= 5 \
or force == True:
debug_lock.acquire()
print(color_blue + input + color_default)
debug_lock.release()
##
## @brief Print a debug log
## @param[in] input (string) Value to print if level is enough
## @param[in] force (bool) force display (no check of log level)
##
def debug(input, force=False):
global debug_lock
global debug_level
if debug_level >= 4 \
or force == True:
debug_lock.acquire()
print(color_green + input + color_default)
debug_lock.release()
##
## @brief Print an info log
## @param[in] input (string) Value to print if level is enough
## @param[in] force (bool) force display (no check of log level)
##
def info(input, force=False):
global debug_lock
global debug_level
if debug_level >= 3 \
or force == True:
debug_lock.acquire()
print(input + color_default)
debug_lock.release()
##
## @brief Print a warning log
## @param[in] input (string) Value to print if level is enough
## @param[in] force (bool) force display (no check of log level)
##
def warning(input, force=False):
global debug_lock
global debug_level
if debug_level >= 2 \
or force == True:
debug_lock.acquire()
print(color_purple + "[WARNING] " + input + color_default)
debug_lock.release()
##
## @brief Print a todo log
## @param[in] input (string) Value to print if level is enough
## @param[in] force (bool) force display (no check of log level)
##
def todo(input, force=False):
global debug_lock
global debug_level
if debug_level >= 3 \
or force == True:
debug_lock.acquire()
print(color_purple + "[TODO] " + input + color_default)
debug_lock.release()
##
## @brief Print an error log
## @param[in] input (string) Value to print if level is enough
## @param[in] thread_id (int) Current thead ID of the builder thread
## @param[in] force (bool) force display (no check of log level)
## @param[in] crash (bool) build error has appear ==> request stop of all builds
##
def error(input, thread_id=-1, force=False, crash=True):
global debug_lock
global debug_level
if debug_level >= 1 \
or force == True:
debug_lock.acquire()
print(color_red + "[ERROR] " + input + color_default)
debug_lock.release()
if crash == True:
from . import multiprocess
multiprocess.set_error_occured()
if thread_id != -1:
threading.interrupt_main()
exit(-1)
#os_exit(-1)
#raise "error happend"
##
## @brief Print a log for a specific element action like generateing .so or binary ...
## @param[in] type (string) type of action. Like: "copy file", "StaticLib", "Prebuild", "Library" ...
## @param[in] lib (string) Name of the library/binary/package that action is done
## @param[in] dir (string) build direction. ex: "<==", "==>" ...
## @param[in] name (string) Destination of the data
## @param[in] force (bool) force display (no check of log level)
##
def print_element(type, lib, dir, name, force=False):
global debug_lock
global debug_level
if debug_level >= 3 \
or force == True:
debug_lock.acquire()
print(color_cyan + type + color_default + " : " + color_yellow + lib + color_default + " " + dir + " " + color_blue + name + color_default)
debug_lock.release()
##
## @brief Print a compilation return (output)
## @param[in] my_string (string) Std-error/std-info that is generate by the build system
##
def print_compilator(my_string):
global debug_color
global debug_lock
if debug_color == True:
my_string = my_string.replace('\\n', '\n')
my_string = my_string.replace('\\t', '\t')
my_string = my_string.replace('error:', color_red+'error:'+color_default)
my_string = my_string.replace('warning:', color_purple+'warning:'+color_default)
my_string = my_string.replace('note:', color_green+'note:'+color_default)
my_string = re.sub(r'([/\w_-]+\.\w+):', r'-COLORIN-\1-COLOROUT-:', my_string)
my_string = my_string.replace('-COLORIN-', color_yellow)
my_string = my_string.replace('-COLOROUT-', color_default)
debug_lock.acquire()
print(my_string)
debug_lock.release()
##
## @brief Get the list of default color
## @return A map with keys: "default","red","green","yellow","blue","purple","cyan"
##
def get_color_set() :
global color_default
global color_red
global color_green
global color_yellow
global color_blue
global color_purple
global color_cyan
return {
"default": color_default,
"red": color_red,
"green": color_green,
"yellow": color_yellow,
"blue": color_blue,
"purple": color_purple,
"cyan": color_cyan,
}

View File

@@ -9,7 +9,7 @@
##
import os
# Local import
from . import debug
from realog import debug
from . import env
def _create_directory_of_file(file):

View File

@@ -9,7 +9,7 @@
##
# Local import
from . import debug
from realog import debug
@@ -112,6 +112,17 @@ def get_warning_mode():
global store_warning
return store_warning
ccache=False
def set_ccache(val):
global ccache
if val == True:
ccache = True
else:
ccache = False
def get_ccache():
global ccache
return ccache
def end_with(name, list):
for appl in list:

View File

@@ -10,7 +10,7 @@
import sys
import copy
# Local import
from . import debug
from realog import debug
def append_to_list(list_out, elem):

View File

@@ -10,7 +10,7 @@
import platform
import sys
# Local import
from . import debug
from realog import debug
# print os.name # ==> 'posix'
if platform.system() == "Linux":

View File

@@ -10,7 +10,7 @@
import platform
import os
# Local import
from . import debug
from realog import debug
from . import tools
from . import multiprocess
from . import depend

View File

@@ -14,7 +14,7 @@ import inspect
import fnmatch
import datetime
# Local import
from . import debug
from realog import debug
from . import tools
from . import env

View File

@@ -16,7 +16,7 @@ import fnmatch
# Local import
from . import host
from . import tools
from . import debug
from realog import debug
from . import heritage
from . import builder
from . import multiprocess
@@ -626,6 +626,7 @@ class Module:
self._files.append([os.path.join(generate_path, elem_generate["filename"]), elem_generate["filename"]])
else:
# add file to compile
debug.warning("Add file to build : " + os.path.join(generate_path, elem_generate["filename"]) )
self.add_src_file(os.path.join(generate_path, elem_generate["filename"]))
if have_only_generate_file == True:
self._add_path(generate_path)
@@ -1021,13 +1022,13 @@ class Module:
if len(elem) > 1 \
and elem[0] == '/':
# unix case
debug.warning(" add_path(" + list + ")")
debug.warning(" add_path(" + str(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(" + list + ")")
debug.warning(" add_path(" + str(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 == ".":
@@ -1038,13 +1039,13 @@ class Module:
if len(list) > 1 \
and list[0] == '/':
# unix case
debug.warning(" add_path(" + list + ")")
debug.warning(" add_path(" + str(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(" + list + ")")
debug.warning(" add_path(" + str(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 == ".":
@@ -1094,7 +1095,7 @@ class Module:
def compile_version(self, compilator_type, version, same_as_api=True, gnu=False):
if compilator_type == "c++" \
or compilator_type == "C++":
cpp_version_list = [1999, 2003, 2011, 2014, 2017]
cpp_version_list = [1999, 2003, 2011, 2014, 2017, 2020]
if version not in cpp_version_list:
debug.error("[" + self._name + "] Can not select CPP version : " + str(version) + " not in " + str(cpp_version_list))
# select API version:
@@ -1109,7 +1110,7 @@ class Module:
debug.debug("[" + self._name + "] Can not propagate the gnu extention of the CPP vesion for API");
elif compilator_type == "c" \
or compilator_type == "C":
c_version_list = [1989, 1990, 1999, 2011]
c_version_list = [1989, 1990, 1999, 2011, 2017, 1018]
if version not in c_version_list:
debug.error("[" + self._name + "] Can not select C version : " + str(version) + " not in " + str(c_version_list))
# select API version:
@@ -1399,7 +1400,7 @@ class Module:
self._print_list('depends',self._depends)
self._print_list('depends_optionnal', self._depends_optionnal)
print(' action count=' + str(self._actions))
print(' action count=' + str(len(self._actions)) + str(self._actions))
for element in self._flags["local"]:
value = self._flags["local"][element]
@@ -1668,6 +1669,14 @@ class Module:
else:
self._package_prop[variable] = [value]
##
## @brief Get the version of the module (getted in the global value)
## @param[in] self (handle) Class handle
## @return the list of version parameters
##
def get_version(self):
return self._package_prop["VERSION"]
__module_list=[]
__start_module_name="_"

View File

@@ -20,7 +20,7 @@ import os
import subprocess
import shlex
# Local import
from . import debug
from realog import debug
from . import tools
from . import env
from . import depend
@@ -212,6 +212,10 @@ def set_error_occured():
global exit_flag
exit_flag = True
# set the debug system call us to stop threading
debug.set_callback_error(set_error_occured)
def set_core_number(number_of_core):
global processor_availlable
processor_availlable = number_of_core

View File

@@ -14,7 +14,7 @@ import inspect
import fnmatch
import datetime
# Local import
from . import debug
from realog import debug
from . import module
from . import tools
from . import env
@@ -283,6 +283,10 @@ def exist(lib_name, list_target_name, target) :
if "System" in dir(the_system):
data["system"] = the_system.System(target)
data["exist"] = data["system"].get_valid()
"""
if data["exist"] == False:
debug.warning("Can not Import: '" + data["name"] + "' ==> disabled")
"""
else:
debug.warning("Not find: '" + data["name"] + "' ==> get exception")
return data["exist"]

View File

@@ -14,7 +14,7 @@ import inspect
import fnmatch
import datetime
# Local import
from . import debug
from realog import debug
from . import heritage
from . import tools
from . import module
@@ -95,6 +95,10 @@ class Target:
self.add_flag("c++", "-Wno-undefined-var-template")
self.add_flag("c", "-nodefaultlibs")
self.add_flag("c++", "-nostdlib")
# this disable the need to have the __cxa_guard_release
self.add_flag("c++", "-fno-threadsafe-statics")
#self.add_flag("c", "-nostdinc") #ignores standard C include directories
#self.add_flag("c++", "-nostdinc++") #ignores standard C++ include directories
self.add_flag("ar", 'rcs')
if self._name == "Windows":
@@ -723,6 +727,11 @@ class Target:
except AttributeError:
debug.error("target have no 'un_install_package' instruction")
elif action_name[:3] == "run":
"""
if mod.get_type() != "BINARY" \
and mod.get_type() != "PACKAGE":
debug.error("Can not run other than 'BINARY' ... pakage='" + mod.get_type() + "' for module='" + module_name + "'")
"""
bin_name = None
if len(action_name) > 3:
if action_name[3] == '%':

View File

@@ -14,7 +14,7 @@ import errno
import fnmatch
import stat
# Local import
from . import debug
from realog import debug
from . import depend
from . import env
@@ -61,6 +61,7 @@ def file_size(path):
return statinfo.st_size
def file_read_data(path, binary=False):
debug.verbose("path= " + path)
if not os.path.isfile(path):
return ""
if binary == True:

View File

@@ -13,7 +13,7 @@
##
from lutin import multiprocess
from lutin import tools
from lutin import debug
from realog import debug
from lutin import depend
from lutin import env
import os
@@ -83,8 +83,12 @@ def link(file, binary, target, depancy, flags, name, basic_path, static = False)
lib_name = elem[:-len(target.suffix_lib_static)] + target.suffix_lib_dynamic
if lib_name not in depancy.src['dynamic']:
list_static.append(elem)
# set ccache interface:
compilator_ccache = ""
if env.get_ccache() == True:
compilator_ccache = "ccache"
#create comand line:
cmd = []
cmd = [compilator_ccache]
# a specific case to not depend on the libstdc++ automaticly added by the G++ or clang++ compilator ==> then need to compile with GCC or CLANG if use libcxx from llvm or other ...
if "need-libstdc++" in depancy.flags \
and depancy.flags["need-libstdc++"] == True:

View File

@@ -13,8 +13,9 @@
##
from lutin import multiprocess
from lutin import tools
from lutin import debug
from realog import debug
from lutin import depend
from lutin import env
# C version:
default_version = 1989
@@ -65,8 +66,13 @@ def compile(file, binary, target, depancy, flags, path, name, basic_path, module
file_depend = target.get_full_dependency(name, basic_path, file)
file_warning = target.get_full_name_warning(name, basic_path, file)
# set ccache interface:
compilator_ccache = ""
if env.get_ccache() == True:
compilator_ccache = "ccache"
# create the command line befor requesting start:
cmd = [
compilator_ccache,
target.cc,
"-o", file_dst,
target.arch,
@@ -140,21 +146,31 @@ def get_version_compilation_flags(flags, dependency_flags):
is_gnu = default_version_gnu
version = max(version_local, dependency_version)
if version == 2011:
if version == 2018:
if is_gnu ==True:
out = ["-std=gnu18", "-D__C_VERSION__=2018"]
else:
out = ["-std=c18", "-D__C_VERSION__=2018"]
elif version == 2017:
if is_gnu ==True:
out = ["-std=gnu17", "-D__C_VERSION__=2017"]
else:
out = ["-std=c17", "-D__C_VERSION__=2017"]
elif version == 2011:
if is_gnu ==True:
out = ["-std=gnu11", "-D__C_VERSION__=2011"]
else:
out = ["-std=c11", "-D__C_VERSION__=1989"]
out = ["-std=c11", "-D__C_VERSION__=2011"]
elif version == 1999:
if is_gnu ==True:
out = ["-std=gnu99", "-D__C_VERSION__=1999"]
else:
out = ["-std=c99", "-D__C_VERSION__=1989"]
out = ["-std=c99", "-D__C_VERSION__=1999"]
elif version == 1990:
if is_gnu ==True:
out = ["-std=gnu90", "-D__C_VERSION__=1990"]
else:
out = ["-std=c90", "-D__C_VERSION__=1989"]
out = ["-std=c90", "-D__C_VERSION__=1990"]
else:
if is_gnu ==True:
out = ["-std=gnu89", "-D__C_VERSION__=1989"]

View File

@@ -13,8 +13,9 @@
##
from lutin import multiprocess
from lutin import tools
from lutin import debug
from realog import debug
from lutin import depend
from lutin import env
# C++ default version:
default_version = 1999
default_version_gnu = False
@@ -64,8 +65,13 @@ def compile(file, binary, target, depancy, flags, path, name, basic_path, module
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)
# set ccache interface:
compilator_ccache = ""
if env.get_ccache() == True:
compilator_ccache = "ccache"
# create the command line befor requesting start:
cmd = [
compilator_ccache,
target.xx,
"-o", file_dst,
target.arch,
@@ -146,13 +152,17 @@ def get_version_compilation_flags(flags, dependency_flags):
is_gnu = default_version_gnu
version = max(version_local, dependency_version)
if version == 2017:
debug.error("not supported flags for X17 ...");
if version == 2020:
if is_gnu == True:
out = ["-std=gnu++2a", "-D__CPP_VERSION__=2020"]
else:
out = ["-std=c++2a", "-D__CPP_VERSION__=2020"]
elif version == 2017:
if is_gnu == True:
out = ["-std=gnu++17", "-D__CPP_VERSION__=2017"]
else:
out = ["-std=c++17", "-D__CPP_VERSION__=2017"]
if version == 2014:
elif version == 2014:
if is_gnu == True:
out = ["-std=gnu++14", "-D__CPP_VERSION__=2014"]
else:

View File

@@ -13,7 +13,7 @@
##
from lutin import multiprocess
from lutin import tools
from lutin import debug
from realog import debug
from lutin import depend
from lutin import env
import os

View File

@@ -13,7 +13,7 @@
##
from lutin import multiprocess
from lutin import tools
from lutin import debug
from realog import debug
from lutin import depend
##

View File

@@ -13,7 +13,7 @@
##
from lutin import multiprocess
from lutin import tools
from lutin import debug
from realog import debug
from lutin import depend
##

View File

@@ -13,7 +13,7 @@
##
from lutin import multiprocess
from lutin import tools
from lutin import debug
from realog import debug
from lutin import depend
from lutin import env
import os
@@ -86,8 +86,12 @@ def link(file, binary, target, depancy, flags, name, basic_path, static=False):
lib_name = elem[:-len(target.suffix_lib_static)] + target.suffix_lib_dynamic
if lib_name not in depancy.src['dynamic']:
list_static.append(elem)
# set ccache interface:
compilator_ccache = ""
if env.get_ccache() == True:
compilator_ccache = "ccache"
#create command Line
cmd = []
cmd = [compilator_ccache]
# a specific case to not depend on the libstdc++ automaticly added by the G++ or clang++ compilator ==> then need to compile with GCC or CLANG if use libcxx from llvm or other ...
if "need-libstdc++" in depancy.flags \
and depancy.flags["need-libstdc++"] == True:

View File

@@ -13,7 +13,7 @@
##
from lutin import multiprocess
from lutin import tools
from lutin import debug
from realog import debug
from lutin import depend
from lutin import env
import os
@@ -68,7 +68,12 @@ def link(file, binary, target, depancy, flags, name, basic_path):
debug.extreme_verbose("file_cmd = " + file_cmd)
debug.extreme_verbose("file_warning = " + file_warning)
# set ccache interface:
compilator_ccache = ""
if env.get_ccache() == True:
compilator_ccache = "ccache"
cmd = [
compilator_ccache,
target.ar
]
try:

View File

@@ -14,8 +14,9 @@
from lutin import multiprocess
from lutin import tools
from lutin import builder
from lutin import debug
from realog import debug
from lutin import depend
from lutin import env
local_ref_on_builder_c = None
@@ -65,8 +66,13 @@ def compile(file, binary, target, depancy, flags, path, name, basic_path, module
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)
# set ccache interface:
compilator_ccache = ""
if env.get_ccache() == True:
compilator_ccache = "ccache"
# create the command line befor requesting start:
cmd = [
compilator_ccache,
target.cc,
"-o", file_dst ,
target.arch,

View File

@@ -14,8 +14,9 @@
from lutin import multiprocess
from lutin import tools
from lutin import builder
from lutin import debug
from realog import debug
from lutin import depend
from lutin import env
local_ref_on_builder_cpp = None
@@ -65,8 +66,13 @@ def compile(file, binary, target, depancy, flags, path, name, basic_path, module
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)
# set ccache interface:
compilator_ccache = ""
if env.get_ccache() == True:
compilator_ccache = "ccache"
# create the command line befor requesting start:
cmd = [
compilator_ccache,
target.xx,
"-o", file_dst,
target.arch,

View File

@@ -14,6 +14,7 @@
from lutin import multiprocess
from lutin import tools
from lutin import depend
from lutin import env
##
## Initialize the builder, if needed ... to get dependency between builder (for example)
@@ -60,8 +61,13 @@ def compile(file, binary, target, depancy, flags, path, name, basic_path, module
file_depend = target.get_full_dependency(name, basic_path, file)
file_warning = target.get_full_name_warning(name, basic_path, file)
# set ccache interface:
compilator_ccache = ""
if env.get_ccache() == True:
compilator_ccache = "ccache"
# create the command line befor requesting start:
cmd = [
compilator_ccache,
target.cc,
"-o", file_dst,
target.arch,

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env
@@ -31,6 +31,6 @@ class System(system.System):
destination_path="GL",
recursive=True)
"""
self.add_flag('link-lib', "GLESv2")
self.add_flag('link-lib', "GLESv3")

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -7,7 +7,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env
@@ -40,5 +40,7 @@ class System(system.System):
],
destination_path="",
recursive=True)
else:
self.add_path("/usr/include/SDL/")

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env
@@ -22,6 +22,7 @@ class System(system.System):
self.set_valid(True)
if env.get_isolate_system() == False:
# We must have it ... all time
self.add_flag("c-remove", "-nostdinc")
pass
else:
# grep "This file is part of the GNU C Library" /usr/include/*
@@ -149,7 +150,7 @@ class System(system.System):
self.add_header_file([
"/usr/include/linux/*",
],
destination_path="linux",
destination_path="",
recursive=True)
self.add_header_file([
"/usr/include/asm/*",
@@ -171,5 +172,11 @@ class System(system.System):
],
destination_path="net",
recursive=True)
# remove dependency of libc to lib std c++ when compile with g++
#self.add_header_file([
# "stdarg.h",
# ],
# destination_path="",
# recursive=True)
self.add_flag("link", "-B/usr/lib")

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import multiprocess

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -0,0 +1,46 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license MPL v2.0 (see license file)
##
from realog import debug
from lutin import system
from lutin import tools
from lutin import env
import os
class System(system.System):
def __init__(self, target):
system.System.__init__(self)
# create some HELP:
self.set_help("mysql: My sql interface (microsoft) or mariadB interface.")
# check if the library exist:
if not os.path.isfile("/usr/include/mysql/mysql.h"):
# we did not find the library reqiested (just return) (automaticly set at false)
return;
self.set_valid(True)
# todo : create a searcher of the presence of the library:
self.add_flag("link-lib", "mysqlclient")
self.add_flag("link-lib", "ssl")
self.add_depend([
'pthread',
'z',
'm',
#'ssl',
'crypto'
])
if env.get_isolate_system() == True:
self.add_header_file([
"/usr/include/mysql/"
],
clip_path="/usr/include/mysql/")
else:
self.add_path("/usr/include/mysql/");

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env
@@ -25,13 +25,23 @@ class System(system.System):
return;
dst_data = tools.file_read_data("/usr/include/pulse/version.h")
lines = dst_data.split("\n")
patern = "#define pa_get_headers_version() (\""
patern = "#define pa_get_headers_version() (\"" # " #corect edn error parsing
version = None
for line in lines:
if line[:len(patern)] == patern:
#Find the version line
version = line[len(patern)]
version2 = line[len(patern)+2]
offset = len(patern)
version = ""
while offset < len(line) \
and line[offset] != '.':
version += line[offset]
offset += 1
offset += 1
version2 = ""
while offset < len(line) \
and line[offset] != '.':
version2 += line[offset]
offset += 1
debug.verbose("detect version '" + version + "'")
break;
if version == None:
@@ -49,6 +59,11 @@ class System(system.System):
])
else:
# todo : create a searcher of the presence of the library:
"""
self.add_flag("link-lib", [
"-l/lib/pulseaudio/libpulsecommon-" + version + ".0.so"
])
"""
self.add_flag("link-lib", [
"pulsecommon-" + version + ".0",
"pulse-mainloop-glib",
@@ -56,6 +71,7 @@ class System(system.System):
"pulse"
])
self.add_flag("link", "-L/usr/lib/pulseaudio")
self.add_flag("link", "-Wl,-R/usr/lib/pulseaudio")
self.add_header_file([
"/usr/include/pulse/*",
],

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env
@@ -25,7 +25,7 @@ class System(system.System):
'c'
])
# todo : create a searcher of the presence of the library:
self.add_flag("link-lib", "rpcsvc")
#self.add_flag("link-lib", "rpcsvc")
if env.get_isolate_system() == True:
self.add_header_file([
"/usr/include/rpc/*"

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env
@@ -21,4 +21,193 @@ class System(system.System):
self.set_help("C: Generic C library")
self.add_flag("c-remove","-nodefaultlibs")
self.set_valid(True)
if env.get_isolate_system() == False:
# We must have it ... all time
pass
else:
# 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*',
'/usr/include/Availability*',
'/usr/include/_types.h*',
'/usr/include/_wctype.h*',
'/usr/include/runetype.h*',
'/usr/include/_locale.h*',
'/usr/include/_xlocale.h*',
'/usr/include/gethostuuid.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/machine/*",
],
destination_path="machine",
recursive=True)
self.add_header_file([
"/usr/include/xlocale/*",
],
destination_path="xlocale",
recursive=True)
self.add_header_file([
"/usr/include/i386/*",
],
destination_path="i386",
recursive=True)
self.add_header_file([
"/usr/include/_types/*",
],
destination_path="_types",
recursive=True)
self.add_header_file([
"/usr/include/libkern/*",
],
destination_path="libkern",
recursive=True)
self.add_header_file([
"/usr/include/mach/*",
],
destination_path="mach",
recursive=True)
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_flag("link", "-B/usr/lib")

View File

@@ -8,10 +8,11 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env
from lutin import multiprocess
import os
class System(system.System):
@@ -22,8 +23,24 @@ class System(system.System):
self.set_valid(True)
# no check needed ==> just add this:
self.add_depend("c")
self.add_flag("c++","-D__STDCPP_LLVM__")
self.add_flag("c++-remove","-nostdlib")
self.add_flag("need-libstdc++", True)
self.add_flag("c++", "-D__STDCPP_LLVM__")
if env.get_isolate_system() == False:
self.add_flag("c++-remove", "-nostdlib")
self.add_flag("need-libstdc++", True)
else:
self.add_flag("link-lib", "stdc++")
compilator_gcc = "g++"
if target.config["compilator-version"] != "":
compilator_gcc = compilator_gcc + "-" + target.config["compilator-version"]
#get g++ compilation version :
version_cpp = multiprocess.run_command_direct(compilator_gcc + " -dumpversion");
if version_cpp == False:
debug.error("Can not get the g++ version ...")
self.add_header_file([
"/usr/include/c++/" + version_cpp + "/*"
],
recursive=True)

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env
@@ -23,5 +23,14 @@ class System(system.System):
self.set_valid(True)
# todo : create a searcher of the presence of the library:
self.add_flag("link-lib", "m")
self.add_depend([
'c'
])
if env.get_isolate_system() == True:
self.add_header_file([
"/usr/include/math.h"
],
clip_path="/usr/include",
recursive=False)

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env
@@ -31,14 +31,22 @@ class System(system.System):
self.add_depend([
'c'
])
"""
if env.get_isolate_system() == True:
self.add_header_file([
"/usr/include/sched.h",
"/usr/include/pthread.h"
],
clip_path="/usr/include/")
"""
self.add_header_file([
"/usr/include/pthread/*",
],
destination_path="pthread",
recursive=True)
self.add_header_file([
"/usr/include/pthread/*",
],
destination_path="",
recursive=True)

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

View File

@@ -8,7 +8,7 @@
## @license MPL v2.0 (see license file)
##
from lutin import debug
from realog import debug
from lutin import system
from lutin import tools
from lutin import env

Some files were not shown because too many files have changed in this diff Show More