Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
8c85a2ea09 | |||
082556e591 | |||
604078f1c0 | |||
40d2e8eac1 | |||
2ebe27a5a4 | |||
dff87a00ee | |||
9fc593fb59 | |||
dc42a8e14b | |||
97f7566a7e |
34
.gitlab-ci.yml
Normal file
34
.gitlab-ci.yml
Normal file
@@ -0,0 +1,34 @@
|
||||
# This file is a template, and might need editing before it works on your project.
|
||||
# use the official gcc image, based on debian
|
||||
# can use verions as well, like gcc:5.2
|
||||
# see https://hub.docker.com/_/gcc/
|
||||
image: gcc
|
||||
|
||||
before_script:
|
||||
- pwd
|
||||
- git clone --depth 1 --branch master https://gitlab.com/atria-soft/ci.git
|
||||
- ls -l *
|
||||
- ls -l ..
|
||||
- apt-get update -qy
|
||||
- apt-get install -y python-dev python-pip
|
||||
#- pip install setuptools
|
||||
- ./setup.py install
|
||||
#- export PYTHONPATH=$PYTHONPATH:./lutin/build/lib.linux-x86_64-2.7/:./lutin/build/lib.linux-x86_64-2.7/lutin/:./lutin/build/lib:./lutin/build/lib/lutin/
|
||||
# - ./ci/build_send.py --tag=$TAG --status=START;
|
||||
|
||||
|
||||
build:
|
||||
stage: build
|
||||
# instead of calling g++ directly you can also use some build toolkit like make
|
||||
# install the necessary build tools when needed
|
||||
# before_script:
|
||||
# - apt update && apt -y install make autoconf
|
||||
script:
|
||||
- export TARGET=-tLinux
|
||||
- export CONF=-mdebug
|
||||
- export BUILDER=-cgcc
|
||||
- lutin -w -j4 -C -P $TARGET $BUILDER $COMPILATOR_OPTION $BUS $CONF $GCOV $DISABLE_PACKAGE test-c; STATUS=$?
|
||||
# - ./ci/build_send.py --tag=$TAG --status="$STATUS";
|
||||
# artifacts:
|
||||
# paths:
|
||||
# - mybinary
|
29
README.rst
29
README.rst
@@ -14,19 +14,6 @@ Release (master)
|
||||
:target: https://travis-ci.org/HeeroYui/lutin
|
||||
|
||||
|
||||
.. image:: http://atria-soft.com/ci/build/HeeroYui/lutin.svg?branch=master&tag=Linux
|
||||
:target: http://atria-soft.com/ci/HeeroYui/lutin
|
||||
.. image:: http://atria-soft.com/ci/build/HeeroYui/lutin.svg?branch=master&tag=MacOs
|
||||
:target: http://atria-soft.com/ci/HeeroYui/lutin
|
||||
.. image:: http://atria-soft.com/ci/build/HeeroYui/lutin.svg?branch=master&tag=Mingw
|
||||
:target: http://atria-soft.com/ci/HeeroYui/lutin
|
||||
|
||||
|
||||
.. image:: http://atria-soft.com/ci/build/HeeroYui/lutin.svg?branch=master&tag=Android
|
||||
:target: http://atria-soft.com/ci/HeeroYui/lutin
|
||||
.. image:: http://atria-soft.com/ci/build/HeeroYui/lutin.svg?branch=master&tag=IOs
|
||||
:target: http://atria-soft.com/ci/HeeroYui/lutin
|
||||
|
||||
|
||||
Developement (dev)
|
||||
------------------
|
||||
@@ -35,20 +22,6 @@ Developement (dev)
|
||||
:target: https://travis-ci.org/HeeroYui/lutin
|
||||
|
||||
|
||||
.. image:: http://atria-soft.com/ci/build/HeeroYui/lutin.svg?branch=dev&tag=Linux
|
||||
:target: http://atria-soft.com/ci/HeeroYui/lutin
|
||||
.. image:: http://atria-soft.com/ci/build/HeeroYui/lutin.svg?branch=dev&tag=MacOs
|
||||
:target: http://atria-soft.com/ci/HeeroYui/lutin
|
||||
.. image:: http://atria-soft.com/ci/build/HeeroYui/lutin.svg?branch=dev&tag=Mingw
|
||||
:target: http://atria-soft.com/ci/HeeroYui/lutin
|
||||
|
||||
|
||||
.. image:: http://atria-soft.com/ci/build/HeeroYui/lutin.svg?branch=dev&tag=Android
|
||||
:target: http://atria-soft.com/ci/HeeroYui/lutin
|
||||
.. image:: http://atria-soft.com/ci/build/HeeroYui/lutin.svg?branch=dev&tag=IOs
|
||||
:target: http://atria-soft.com/ci/HeeroYui/lutin
|
||||
|
||||
|
||||
Instructions
|
||||
------------
|
||||
|
||||
@@ -70,7 +43,7 @@ http://github.com/HeeroYui/lutin/
|
||||
Documentation
|
||||
-------------
|
||||
|
||||
http://github.io/HeeroYui/lutin/
|
||||
http://HeeroYui.github.io/lutin/
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
72
bin/lutin
72
bin/lutin
@@ -25,31 +25,32 @@ import lutin.host as lutinHost
|
||||
import lutin.tools as lutinTools
|
||||
|
||||
myArgs = arguments.LutinArg()
|
||||
myArgs.add(arguments.ArgDefine("h", "help", desc="Display this help"))
|
||||
myArgs.add(arguments.ArgDefine("H", "HELP", desc="Display this help (with all compleate information)"))
|
||||
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")
|
||||
myArgs.add(arguments.ArgDefine("v", "verbose", list=[["0","None"],["1","error"],["2","warning"],["3","info"],["4","debug"],["5","verbose"],["6","extreme_verbose"]], desc="display makefile debug level (verbose) default =2"))
|
||||
myArgs.add(arguments.ArgDefine("C", "color", desc="Display makefile output in color"))
|
||||
myArgs.add(arguments.ArgDefine("B", "force-build", desc="Force the rebuild without checking the dependency"))
|
||||
myArgs.add(arguments.ArgDefine("P", "pretty", desc="Print the debug has pretty display"))
|
||||
myArgs.add(arguments.ArgDefine("j", "jobs", haveParam=True, desc="Specifies the number of jobs (commands) to run simultaneously"))
|
||||
myArgs.add(arguments.ArgDefine("d", "depth", haveParam=True, desc="Depth of the search of sub element lutin_*.py (default=" + str(env.get_parse_depth()) + ")"))
|
||||
myArgs.add(arguments.ArgDefine("s", "force-strip", desc="Force the stripping of the compile elements"))
|
||||
myArgs.add(arguments.ArgDefine("o", "force-optimisation", desc="Force optimisation of the build"))
|
||||
myArgs.add(arguments.ArgDefine("w", "warning", desc="Store warning in a file build file"))
|
||||
myArgs.add("v", "verbose", list=[["0","None"],["1","error"],["2","warning"],["3","info"],["4","debug"],["5","verbose"],["6","extreme_verbose"]], desc="display makefile debug level (verbose) default =2")
|
||||
myArgs.add("C", "color", desc="Display makefile output in color")
|
||||
myArgs.add("B", "force-build", desc="Force the rebuild without checking the dependency")
|
||||
myArgs.add("P", "pretty", desc="Print the debug has pretty display")
|
||||
myArgs.add("j", "jobs", haveParam=True, desc="Specifies the number of jobs (commands) to run simultaneously")
|
||||
myArgs.add("d", "depth", haveParam=True, desc="Depth of the search of sub element lutin_*.py (default=" + str(env.get_parse_depth()) + ")")
|
||||
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_section("properties", "keep in the sequency of the cible")
|
||||
myArgs.add(arguments.ArgDefine("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'"))
|
||||
myArgs.add(arguments.ArgDefine("c", "compilator", list=[["clang",""],["gcc",""]], desc="Compile with clang or Gcc mode (by default gcc will be used)"))
|
||||
myArgs.add(arguments.ArgDefine("", "compilator-version", haveParam=True, desc="With travis we need to specify the name of the version if we want to compile with gcc 4.9 ==> --compilator-version=4.9"))
|
||||
myArgs.add(arguments.ArgDefine("m", "mode", list=[["debug",""],["release",""]], desc="Compile in release or debug mode (default release)"))
|
||||
myArgs.add(arguments.ArgDefine("a", "arch", list=[["auto","Automatic choice"],["arm","Arm processer"],["x86","Generic PC : AMD/Intel"],["ppc","Power PC"]], desc="Architecture to compile"))
|
||||
myArgs.add(arguments.ArgDefine("b", "bus", list=[["auto","Automatic choice"],["32","32 bits"],["64","64 bits"]], desc="Adressing size (Bus size)"))
|
||||
myArgs.add(arguments.ArgDefine("p", "package", desc="Disable the package generation (usefull when just compile for test on linux ...)"))
|
||||
myArgs.add(arguments.ArgDefine("g", "gcov", desc="Enable code coverage intrusion in code"))
|
||||
myArgs.add(arguments.ArgDefine("", "simulation", desc="Simulater mode (availlable only for IOS)"))
|
||||
myArgs.add(arguments.ArgDefine("", "list-target", desc="List all availlables targets ==> for auto completion"))
|
||||
myArgs.add(arguments.ArgDefine("", "list-module", desc="List all availlables module ==> for auto completion"))
|
||||
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'")
|
||||
myArgs.add("c", "compilator", list=[["clang",""],["gcc",""]], desc="Compile with clang or Gcc mode (by default gcc will be used)")
|
||||
myArgs.add("", "compilator-version", haveParam=True, desc="With travis we need to specify the name of the version if we want to compile with gcc 4.9 ==> --compilator-version=4.9")
|
||||
myArgs.add("m", "mode", list=[["debug",""],["release",""]], desc="Compile in release or debug mode (default release)")
|
||||
myArgs.add("a", "arch", list=[["auto","Automatic choice"],["arm","Arm processer"],["x86","Generic PC : AMD/Intel"],["ppc","Power PC"]], desc="Architecture to compile")
|
||||
myArgs.add("b", "bus", list=[["auto","Automatic choice"],["32","32 bits"],["64","64 bits"]], desc="Adressing size (Bus size)")
|
||||
myArgs.add("p", "package", desc="Disable the package generation (usefull when just compile for test on linux ...)")
|
||||
myArgs.add("g", "gcov", desc="Enable code coverage intrusion in code")
|
||||
myArgs.add("", "simulation", desc="Simulater mode (availlable only for IOS)")
|
||||
myArgs.add("", "list-target", desc="List all availlables targets ==> for auto completion")
|
||||
myArgs.add("", "list-module", desc="List all availlables module ==> for auto completion")
|
||||
|
||||
myArgs.add_section("cible", "generate in order set")
|
||||
localArgument = myArgs.parse()
|
||||
@@ -237,6 +238,13 @@ def parseGenericArg(argument, active):
|
||||
else:
|
||||
env.set_force_optimisation(False)
|
||||
return True
|
||||
elif argument.get_option_name() == "isolate-system":
|
||||
if active==True:
|
||||
if check_boolean(argument.get_arg()) == True:
|
||||
env.set_isolate_system(True)
|
||||
else:
|
||||
env.set_isolate_system(False)
|
||||
return True
|
||||
elif argument.get_option_name() == "force-strip":
|
||||
if active==True:
|
||||
if check_boolean(argument.get_arg()) == True:
|
||||
@@ -262,34 +270,46 @@ if os.path.isfile(config_file) == True:
|
||||
debug.debug("Find basic configuration file: '" + config_file + "'")
|
||||
# the file exist, we can open it and get the initial configuration:
|
||||
configuration_file = __import__(config_file_name[:-3])
|
||||
|
||||
if "get_exclude_path" in dir(configuration_file):
|
||||
data = configuration_file.get_exclude_path()
|
||||
debug.debug(" get default config 'get_exclude_path' val='" + str(data) + "'")
|
||||
env.set_exclude_search_path(data)
|
||||
|
||||
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)
|
||||
|
||||
|
||||
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)
|
||||
|
||||
|
||||
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)
|
||||
|
||||
|
||||
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)
|
||||
|
||||
|
||||
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)
|
||||
|
||||
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)
|
||||
|
||||
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)
|
||||
|
||||
|
||||
|
||||
|
@@ -1,59 +0,0 @@
|
||||
=?= [center]Basic concept[/center] =?=
|
||||
___________________________________________
|
||||
|
||||
Lutin is a compleate builder system. It is designed to answers all the application problems.
|
||||
The library and the distribution problem are partially manage (no real use-case)
|
||||
|
||||
==Technologie==
|
||||
|
||||
Lutin is designed in Python 2.X or 3.X to answers at the multiplatform problesm. On Linux or MacOs, it is really easy to compile with Makefile, cmake, but on Windows it is an other problem.
|
||||
The first version of Lutin has been designed in Makefile, but we need to wait 20 minutes before the first build. In Pytho it is fast as Linux.
|
||||
|
||||
Lutin is not based over an other builder, but request compilation itself.
|
||||
|
||||
==Features==
|
||||
|
||||
Lutin is designed to:
|
||||
:** support many hardware platform (X86/X64/ARM...);
|
||||
:** support many operation system (windows, Ios, Android ...);
|
||||
:** support complex worktree and depedency;
|
||||
:** build only when needed;
|
||||
:** create platform specific packages (application bundle);
|
||||
:**
|
||||
|
||||
|
||||
==global overview==
|
||||
|
||||
Every build system is based on multiple concept depending of their own designed.
|
||||
|
||||
For lutin we can différentiate 4 basics concepts:
|
||||
:** Mudule: Interface to create a part of an application, that contain binary, scipt, datas ...
|
||||
:** Target: methode to creata an application or a library (may be internal: medium level)
|
||||
:** Builder: Methode to transform element in other, for example: compile a cpp in object file, or object files in binary.
|
||||
:** System: Many OS manage basic element contain in the OS, This part permit to find generic module availlable in the system.
|
||||
|
||||
===Module===
|
||||
|
||||
When you use lutin, you migth first create a module, This is the basis of the framework. It permit to describe your "module", all it contain, and the deendency.
|
||||
|
||||
We can separate a module in some part:
|
||||
:** Binary:
|
||||
:: A binary is an end point element.
|
||||
:: It can be transform in a complete standalone bundle, or in an part instalable.
|
||||
:** Library:
|
||||
:: This represent an element that is used by other application
|
||||
:** Package:
|
||||
:: To Be Define.
|
||||
|
||||
|
||||
===Target===
|
||||
|
||||
|
||||
|
||||
===Builder===
|
||||
|
||||
|
||||
===System===
|
||||
|
||||
|
||||
|
80
doc/010_basic_concept.md
Normal file
80
doc/010_basic_concept.md
Normal file
@@ -0,0 +1,80 @@
|
||||
Basic concept {#lutin_concept}
|
||||
=============
|
||||
|
||||
@tableofcontents
|
||||
|
||||
Lutin is a compleate builder system. It is designed to answers all the application problems.
|
||||
The library and the distribution problem are partially manage (no real use-case)
|
||||
|
||||
Technologie:
|
||||
============
|
||||
|
||||
Lutin is designed in Python 2.X or 3.X to answers at the multiplatform problems.
|
||||
On Linux or MacOs, it is really easy to compile with Makefile, cmake, but on Windows it is an other problem.
|
||||
The first version of Lutin has been designed in Makefile, but we need to wait 20 minutes before the first build on Windows. In Python it is fast as Linux.
|
||||
|
||||
Lutin is not based over an other builder, but compile code itself.
|
||||
|
||||
Features:
|
||||
=========
|
||||
|
||||
Lutin is designed to:
|
||||
- support many hardware platform (X86/X64/ARM...);
|
||||
- support many operation system (windows, Ios, Android ...);
|
||||
- support complex worktree and depedency;
|
||||
- build only when needed;
|
||||
- create platform specific packages (application bundle);
|
||||
|
||||
|
||||
global overview:
|
||||
================
|
||||
|
||||
Every build system is based on multiple concept depending of their own designed.
|
||||
|
||||
For lutin we can différentiate 4 basics concepts:
|
||||
- Mudule: Interface to create a part of an application, that contain binary, scipt, datas ...
|
||||
- Target: methode to creata an application or a library (may be internal: medium level)
|
||||
- Builder: Methode to transform element in other, for example: compile a cpp in object file, or object files in binary.
|
||||
- System: Many OS manage basic element contain in the OS, This part permit to find generic module availlable in the system.
|
||||
|
||||
Module:
|
||||
=======
|
||||
|
||||
When you use lutin, you migth first create a module, This is the basis of the framework. It permit to describe your "module", all it contain, and the deendency.
|
||||
|
||||
We can separate a module in some part:
|
||||
- Binary:
|
||||
* A binary is an end point element.
|
||||
* It can be transform in a complete standalone bundle, or in an part installable.
|
||||
- Library:
|
||||
* This represent an element that is used by other application
|
||||
|
||||
|
||||
Target:
|
||||
=======
|
||||
|
||||
A target represent the "board" to build the module, we can separate MacOs, IOs, Linux ... and all platform that exist
|
||||
|
||||
You can generate a new one or use satandard that are provided
|
||||
|
||||
|
||||
Builder:
|
||||
========
|
||||
|
||||
By default lustin manage many methode to build element like cpp, java, asm files ...
|
||||
|
||||
|
||||
System:
|
||||
=======
|
||||
|
||||
This element provide all elements availlable in the Linux distribution.
|
||||
|
||||
|
||||
|
||||
|
||||
**Index:**
|
||||
- @ref mainpage
|
||||
- @ref lutin_concept
|
||||
- @ref lutin_use
|
||||
- @ref lutin_module
|
||||
|
@@ -1,153 +0,0 @@
|
||||
=?= [center]Basic concept[/center] =?=
|
||||
___________________________________________
|
||||
|
||||
Lutin permit simply to compile applications and library.
|
||||
|
||||
To simply understand the use, we will use a simple library:
|
||||
|
||||
[code style=bash]
|
||||
git clone http://github.con/atria-soft/etk.git
|
||||
[/code]
|
||||
|
||||
etk is a basic library that have drive the lutin project.
|
||||
|
||||
|
||||
== compile a module ==
|
||||
|
||||
It is really simple:
|
||||
|
||||
[code style=bash]
|
||||
lutin yourModuleName
|
||||
#example:
|
||||
lutin etk
|
||||
[/code]
|
||||
|
||||
|
||||
|
||||
== Option working ==
|
||||
|
||||
Lutin have a complex option methodologie. We can consider 3 part of the option:
|
||||
:** Global option
|
||||
:** target option
|
||||
:** modules
|
||||
|
||||
|
||||
|
||||
|
||||
== Generic options ==
|
||||
|
||||
=== Display help ===
|
||||
|
||||
Availlable everywhere ...
|
||||
|
||||
[code style=bash]
|
||||
lutin -h
|
||||
lutin --help
|
||||
[/code]
|
||||
|
||||
You can see in this help that it take a litle time to react.
|
||||
The first time you run lutin, it parse all the file in your sub-directory.
|
||||
But the system keep the data in cash, then the next time it is faster.
|
||||
|
||||
At the end of the help you an see an help about the etk librery with the associated help.
|
||||
|
||||
=== Build in color ===
|
||||
|
||||
[code style=bash]
|
||||
lutin -C
|
||||
lutin --color
|
||||
[/code]
|
||||
|
||||
=== Display build line in pretty print mode ===
|
||||
|
||||
when an error apear, the gcc or clang compile line can be really unreadable:
|
||||
[code]
|
||||
g++ -o /home/heero/dev/plop/out/Linux_x86_64/release/build/gcc/etk/obj/etk/Color.cpp.o -I/home/heero/dev/plop/etk -std=c++11 -D__CPP_VERSION__=2011 -D__TARGET_OS__Linux -D__TARGET_ARCH__x86 -D__TARGET_ADDR__64BITS -D_REENTRANT -DNDEBUG -O3 -fpic -D__STDCPP_GNU__ -Wall -Wsign-compare -Wreturn-type -Wno-write-strings -Woverloaded-virtual -Wnon-virtual-dtor -Wno-unused-variable -DMODE_RELEASE -c -MMD -MP /home/heero/dev/plop/etk/etk/Color.cpp
|
||||
[/code]
|
||||
|
||||
whith this option you can transform this not obvious line in a readable line:
|
||||
|
||||
[code style=bash]
|
||||
lutin -P
|
||||
lutin --pretty
|
||||
[/code]
|
||||
|
||||
result:
|
||||
[code]
|
||||
g++ \
|
||||
-o /home/XXX/dev/out/Linux_x86_64/release/build/gcc/etk/obj/etk/Color.cpp.o \
|
||||
-I/home/XXX/dev/etk \
|
||||
-std=c++11 \
|
||||
-D__CPP_VERSION__=2011 \
|
||||
-D__TARGET_OS__Linux \
|
||||
-D__TARGET_ARCH__x86 \
|
||||
-D__TARGET_ADDR__64BITS \
|
||||
-D_REENTRANT \
|
||||
-DNDEBUG \
|
||||
-O3 \
|
||||
-fpic \
|
||||
-D__STDCPP_GNU__ \
|
||||
-Wall \
|
||||
-Wsign-compare \
|
||||
-Wreturn-type \
|
||||
-Wno-write-strings \
|
||||
-Woverloaded-virtual \
|
||||
-Wnon-virtual-dtor \
|
||||
-Wno-unused-variable \
|
||||
-DMODE_RELEASE \
|
||||
-c \
|
||||
-MMD \
|
||||
-MP \
|
||||
/home/XXX/dev/etk/etk/Color.cpp
|
||||
[/code]
|
||||
|
||||
=== lutin log ===
|
||||
|
||||
Lutin have an internal log system. To enable or disable it just select your debug level with the option:
|
||||
|
||||
[code style=bash]
|
||||
lutin -v4
|
||||
lutin --verbose 4
|
||||
[/code]
|
||||
|
||||
The level availlables are:
|
||||
:** 0: None
|
||||
:** 1: error
|
||||
:** 2: warning (default)
|
||||
:** 3: info
|
||||
:** 4: debug
|
||||
:** 5: verbose
|
||||
:** 6: extreme_verbose
|
||||
|
||||
=== select the number of CPU core used ===
|
||||
|
||||
By default lutin manage only 1 CPU core (faster to debug) but for speed requirement you can use use multiple core:
|
||||
|
||||
[code style=bash]
|
||||
#for 5 core
|
||||
lutin -j5
|
||||
lutin --jobs 5
|
||||
[/code]
|
||||
|
||||
=== Force rebuild all ===
|
||||
|
||||
Sometime it is needed to rebuild all the program, just do :
|
||||
|
||||
[code style=bash]
|
||||
lutin -B
|
||||
lutin --force-build
|
||||
[/code]
|
||||
|
||||
=== Force rebuild all ===
|
||||
|
||||
Force strip of output binary (remove symboles)
|
||||
|
||||
[code style=bash]
|
||||
lutin -s
|
||||
lutin --force-strip
|
||||
[/code]
|
||||
|
||||
|
||||
|
||||
-w / --warning
|
||||
Store warning in a file build file
|
229
doc/020_Compile_a_module.md
Normal file
229
doc/020_Compile_a_module.md
Normal file
@@ -0,0 +1,229 @@
|
||||
How to use lutin {#lutin_use}
|
||||
================
|
||||
|
||||
@tableofcontents
|
||||
|
||||
Lutin permit simply to compile applications and library.
|
||||
|
||||
To simply understand the use, we will use a simple library:
|
||||
|
||||
```bash
|
||||
git clone http://github.con/atria-soft/etk.git
|
||||
```
|
||||
|
||||
|
||||
compile a module: {#lutin_use_compile}
|
||||
=================
|
||||
|
||||
It is really simple:
|
||||
|
||||
```bash
|
||||
lutin yourModuleName
|
||||
#example:
|
||||
lutin etk
|
||||
```
|
||||
|
||||
|
||||
|
||||
Option working: {#lutin_use_options}
|
||||
===============
|
||||
|
||||
Lutin have a complex option methodologie. We can consider 3 part of the option:
|
||||
- global option
|
||||
- target option
|
||||
- modules
|
||||
|
||||
|
||||
Global options: {#lutin_use_options_global}
|
||||
---------------
|
||||
|
||||
Globals option is parse first and manage global setting of the build (not specific of a target)
|
||||
|
||||
this keep the last value config set
|
||||
|
||||
|
||||
Display help: {#lutin_use_options_help}
|
||||
-------------
|
||||
|
||||
Availlable everywhere ...
|
||||
|
||||
```bash
|
||||
lutin -h
|
||||
lutin --help
|
||||
```
|
||||
|
||||
You can see in this help that it take a litle time to react.
|
||||
The first time you run lutin, it parse all the file in your sub-directory.
|
||||
But the system(OS) keep the data in cash, then the next time it is faster.
|
||||
|
||||
At the end of the help you an see an help about the etk librery with the associated help.
|
||||
|
||||
Build in color: {#lutin_use_options_color}
|
||||
---------------
|
||||
|
||||
```bash
|
||||
lutin -C
|
||||
lutin --color
|
||||
```
|
||||
|
||||
Display build line in pretty print mode: {#lutin_use_options_pretty}
|
||||
----------------------------------------
|
||||
|
||||
when an error apear, the gcc or clang compile line can be really unreadable:
|
||||
```bash
|
||||
g++ -o /home/heero/dev/plop/out/Linux_x86_64/release/build/gcc/etk/obj/etk/Color.cpp.o -I/home/heero/dev/plop/etk -std=c++11 -D__CPP_VERSION__=2011 -D__TARGET_OS__Linux -D__TARGET_ARCH__x86 -D__TARGET_ADDR__64BITS -D_REENTRANT -DNDEBUG -O3 -fpic -D__STDCPP_GNU__ -Wall -Wsign-compare -Wreturn-type -Wno-write-strings -Woverloaded-virtual -Wnon-virtual-dtor -Wno-unused-variable -DMODE_RELEASE -c -MMD -MP /home/heero/dev/plop/etk/etk/Color.cpp
|
||||
```
|
||||
|
||||
whith this option you can transform this not obvious line in a readable line:
|
||||
|
||||
```bash
|
||||
lutin -P
|
||||
lutin --pretty
|
||||
```
|
||||
|
||||
result:
|
||||
```bash
|
||||
g++ \
|
||||
-o /home/XXX/dev/out/Linux_x86_64/release/build/gcc/etk/obj/etk/Color.cpp.o \
|
||||
-I/home/XXX/dev/etk \
|
||||
-std=c++11 \
|
||||
-D__CPP_VERSION__=2011 \
|
||||
-D__TARGET_OS__Linux \
|
||||
-D__TARGET_ARCH__x86 \
|
||||
-D__TARGET_ADDR__64BITS \
|
||||
-D_REENTRANT \
|
||||
-DNDEBUG \
|
||||
-O3 \
|
||||
-fpic \
|
||||
-D__STDCPP_GNU__ \
|
||||
-Wall \
|
||||
-Wsign-compare \
|
||||
-Wreturn-type \
|
||||
-Wno-write-strings \
|
||||
-Woverloaded-virtual \
|
||||
-Wnon-virtual-dtor \
|
||||
-Wno-unused-variable \
|
||||
-DMODE_RELEASE \
|
||||
-c \
|
||||
-MMD \
|
||||
-MP \
|
||||
/home/XXX/dev/etk/etk/Color.cpp
|
||||
```
|
||||
|
||||
lutin log: {#lutin_use_options_log}
|
||||
----------
|
||||
|
||||
Lutin have an internal log system. To enable or disable it just select your debug level with the option:
|
||||
|
||||
```bash
|
||||
lutin -v4
|
||||
lutin --verbose 4
|
||||
```
|
||||
|
||||
The level availlables are:
|
||||
- 0: None
|
||||
- 1: error
|
||||
- 2: warning (default)
|
||||
- 3: info
|
||||
- 4: debug
|
||||
- 5: verbose
|
||||
- 6: extreme_verbose
|
||||
|
||||
Select the number of CPU core used: {#lutin_use_options_cpu}
|
||||
-----------------------------------
|
||||
|
||||
By default lutin manage only 1 CPU core (faster to debug) but for speed requirement you can use use multiple core:
|
||||
|
||||
```bash
|
||||
#for 5 core
|
||||
lutin -j5
|
||||
lutin --jobs 5
|
||||
```
|
||||
|
||||
Force rebuild all: {#lutin_use_options_rebuild_force}
|
||||
------------------
|
||||
|
||||
Sometime it is needed to rebuild all the program, just do:
|
||||
|
||||
```bash
|
||||
lutin -B
|
||||
lutin --force-build
|
||||
# or remove the build directory
|
||||
rm -rf out/
|
||||
```
|
||||
|
||||
Force strip all library and programs: {#lutin_use_options_strip}
|
||||
-------------------------------------
|
||||
|
||||
Force strip of output binary (remove symboles)
|
||||
|
||||
```bash
|
||||
lutin -s
|
||||
lutin --force-strip
|
||||
```
|
||||
|
||||
Manage Cross compilation: {#lutin_use_options_cross_compile}
|
||||
=========================
|
||||
|
||||
The main objective of lutin is managing the cross compilation to build from linux to other platform:
|
||||
|
||||
For android you can use:
|
||||
|
||||
```bash
|
||||
lutin -t Android your-module
|
||||
lutin -t Windows your-module
|
||||
```
|
||||
|
||||
Build in debug mode: {#lutin_use_options_debug_release}
|
||||
====================
|
||||
|
||||
To developp it is fasted with debug tools
|
||||
|
||||
```bash
|
||||
lutin -m debug your-module
|
||||
lutin -m release your-module
|
||||
```
|
||||
|
||||
You can desire to have compilation optimisation when you build in debug mode:
|
||||
|
||||
```bash
|
||||
lutin -m debug --force-optimisation your-module
|
||||
```
|
||||
|
||||
Execute your program after building it: {#lutin_use_options_execute}
|
||||
=======================================
|
||||
|
||||
You can execute some action in a single line for a module:
|
||||
|
||||
```bash
|
||||
lutin -m debug your-module?clean?build?run:--run-option1:--run-option2
|
||||
```
|
||||
|
||||
Why use ```?run``` istead of direct calling the binary?
|
||||
|
||||
This is simple: you does nok knoww where the binary is installed... when you build for linux in debug it will be set in ```out/Linux_x86_64/debug/staging/clang/edn/edn.app/``` for edn application.
|
||||
Note that the path is distinct for gcc/clang, debug/release, Linux/windows/Android/..., 64/32 bits, and for every applications ...
|
||||
|
||||
Then it is really easy to run the wrong binary.
|
||||
|
||||
|
||||
Install your program after building it: {#lutin_use_options_install}
|
||||
=======================================
|
||||
|
||||
You can install your build module:
|
||||
|
||||
```bash
|
||||
lutin -m debug your-module?build?install
|
||||
```
|
||||
|
||||
This option is not availlablke on all platform ...
|
||||
|
||||
|
||||
|
||||
|
||||
**Index:**
|
||||
- @ref mainpage
|
||||
- @ref lutin_concept
|
||||
- @ref lutin_use
|
||||
- @ref lutin_module
|
||||
|
497
doc/030_Create_a_new_module.md
Normal file
497
doc/030_Create_a_new_module.md
Normal file
@@ -0,0 +1,497 @@
|
||||
Create a new Module: {#lutin_module}
|
||||
====================
|
||||
|
||||
@tableofcontents
|
||||
|
||||
|
||||
Base of the module file: {#lutin_module_base_file}
|
||||
========================
|
||||
|
||||
To create a new module you will use a generic naming:
|
||||
|
||||
```
|
||||
lutin_module-name.py
|
||||
```
|
||||
|
||||
Replace your ``module-name`` with the delivery you want. The name can contain [a-zA-Z0-9\-_] values.
|
||||
|
||||
In the module name you must define some values:
|
||||
|
||||
```python
|
||||
#!/usr/bin/python
|
||||
import lutin.module as module
|
||||
import lutin.tools as tools
|
||||
|
||||
# A simple list of type:
|
||||
# - BINARY
|
||||
# - BINARY_SHARED
|
||||
# - BINARY_STAND_ALONE
|
||||
# - LIBRARY
|
||||
# - LIBRARY_DYNAMIC
|
||||
# - LIBRARY_STATIC
|
||||
# - PACKAGE
|
||||
# - PREBUILD
|
||||
# - DATA
|
||||
def get_type():
|
||||
return "LIBRARY"
|
||||
|
||||
# simple description of the module that appear in the 'lutin -h'
|
||||
# Note: this fucntion is optionnal.
|
||||
def get_desc():
|
||||
return "Ewol tool kit"
|
||||
|
||||
# type of licence:
|
||||
# "APACHE-2"
|
||||
# "BSD-1" / "BSD-2" / "BSD-3" / "BSD-4"
|
||||
# "GPL-1" / "GPL-2" / "GPL-3"
|
||||
# "LGPL-1" / "LGPL-2" / "LGPL-3"
|
||||
# PROPRIETARY
|
||||
# ...
|
||||
# Note: this fucntion is optionnal.
|
||||
def get_licence():
|
||||
return "APACHE-2"
|
||||
|
||||
# type of compagny that provide the software:
|
||||
# com : Commercial
|
||||
# net : Network??
|
||||
# org : Organisation
|
||||
# gov : Governement
|
||||
# mil : Military
|
||||
# edu : Education
|
||||
# pri : Private
|
||||
# museum : ...
|
||||
# ...
|
||||
# Note: this fucntion is optionnal.
|
||||
def get_compagny_type():
|
||||
return "com"
|
||||
|
||||
# Name of the compagny
|
||||
# Note: this fucntion is optionnal.
|
||||
def get_compagny_name():
|
||||
return "hello-compagny"
|
||||
|
||||
# People to contact if a problem appear in the build system / library
|
||||
# Note: this fucntion is optionnal.
|
||||
def get_maintainer():
|
||||
return ["Mr NAME SurName <my-email@group.com>"]
|
||||
|
||||
# Version of the library
|
||||
# Note: this fucntion is optionnal.
|
||||
def get_version():
|
||||
return [0,9,"dev"]
|
||||
|
||||
# create the module
|
||||
# @param[in] target reference on the Target that is currently build
|
||||
# @param[in] module_name Name of the module that is extract from the file name (to be generic)
|
||||
def create(target, module_name):
|
||||
my_module = module.Module(__file__, module_name, get_type())
|
||||
...
|
||||
return my_module
|
||||
```
|
||||
|
||||
Thes it is simple to specify build for:
|
||||
|
||||
Create a new Module (LIBRARY): {#lutin_module_library}
|
||||
==============================
|
||||
|
||||
What to change:
|
||||
```python
|
||||
def get_type():
|
||||
return "LIBRARY"
|
||||
```
|
||||
|
||||
By default the library is compile in shared and static. The binary select the mode it prefer...
|
||||
|
||||
You can force the library to be compile as a dll/so: ```LIBRARY_DYNAMIC``` or a basic include lib: .a ```LIBRARY_STATIC```
|
||||
|
||||
|
||||
Create a new Module (BINARY): {#lutin_module_binary}
|
||||
=============================
|
||||
|
||||
Generic Binary: {#lutin_module_binary_base}
|
||||
---------------
|
||||
|
||||
What to change:
|
||||
```python
|
||||
def get_type():
|
||||
return "BINARY"
|
||||
```
|
||||
The Binay is compile by default target mode (note that the IOs target generate a single .so with all the library inside)
|
||||
|
||||
You can force the Binary to be use dynamic library when possible: ```BINARY_SHARED``` or create a single binary with no .so depenency: ```BINARY_STAND_ALONE```
|
||||
|
||||
Create a new Module (TEST-BINARY / TOOL-BINARY): {#lutin_module_binary_tools}
|
||||
------------------------------------------------
|
||||
|
||||
Two binary are really usefull in developpement, the tools and the test-unit, This is the reason why we specify for this 2 cases.
|
||||
|
||||
Add the subElement description:
|
||||
```python
|
||||
def get_type():
|
||||
return "BINARY"
|
||||
|
||||
def get_sub_type():
|
||||
return "TEST"
|
||||
```
|
||||
or:
|
||||
```python
|
||||
def get_type():
|
||||
return "BINARY"
|
||||
|
||||
def get_sub_type():
|
||||
return "TOOL"
|
||||
```
|
||||
|
||||
|
||||
Create a new Module (DATA): {#lutin_module_data}
|
||||
===========================
|
||||
|
||||
This pode permit to only copy data and no dependency with compilling system
|
||||
|
||||
What to change:
|
||||
```python
|
||||
def get_type():
|
||||
return "DATA"
|
||||
```
|
||||
|
||||
|
||||
Module internal specifications: {#lutin_module_internal}
|
||||
===============================
|
||||
|
||||
Add file to compile: {#lutin_module_internal_compile}
|
||||
--------------------
|
||||
|
||||
This is simple: (you just need to specify all the file to compile)
|
||||
|
||||
```python
|
||||
def create(target, module_name):
|
||||
...
|
||||
|
||||
# add the file to compile:
|
||||
my_module.add_src_file([
|
||||
'module-name/file1.cpp',
|
||||
'module-name/file2.cpp',
|
||||
'module-name/file3.S'
|
||||
])
|
||||
|
||||
...
|
||||
```
|
||||
|
||||
Include directory & install header: {#lutin_module_internal_header}
|
||||
-----------------------------------
|
||||
|
||||
A big point to understand is that your library will be used by an other module, then it need to use headers.
|
||||
|
||||
The developper must isolate the external include and internal include, then lutin "install" the header and add the "install" header path to build the local library.
|
||||
This permit to check error inclusion directly in developpement and separate the ```#include "XXX.h"``` and the ```#include <lib-xxx/XXX.h>```
|
||||
|
||||
Add file to external include:
|
||||
```python
|
||||
def create(target, module_name):
|
||||
...
|
||||
|
||||
my_module.add_header_file([
|
||||
'module-name/file1.h',
|
||||
'module-name/file2.h'
|
||||
])
|
||||
|
||||
...
|
||||
```
|
||||
|
||||
You can add a path to your local include:
|
||||
```python
|
||||
def create(target, module_name):
|
||||
...
|
||||
|
||||
my_module.add_path(os.path.join(tools.get_current_path(__file__), "lib-name"))
|
||||
|
||||
...
|
||||
```
|
||||
|
||||
|
||||
Add Sub-dependency: {#lutin_module_internal_depend}
|
||||
-------------------
|
||||
|
||||
All library need to add at minimum of a simple library (C lib) and other if needed. To do it jus call:
|
||||
```python
|
||||
def create(target, module_name):
|
||||
...
|
||||
|
||||
# add dependency of the generic C library:
|
||||
my_module.add_module_depend('c')
|
||||
# add dependency of the generic C++ library:
|
||||
my_module.add_module_depend('cxx')
|
||||
# add dependency of the generic math library:
|
||||
my_module.add_module_depend('m')
|
||||
# or other user lib:
|
||||
my_module.add_module_depend('lib-name')
|
||||
|
||||
...
|
||||
```
|
||||
|
||||
The system can have optinnal sub-library, then if you just want to add an optionnal dependency:
|
||||
```python
|
||||
def create(target, module_name):
|
||||
...
|
||||
|
||||
# Add an optionnal dependency (set flag in CPP build if the subLib exist) ==> flag is locally set
|
||||
my_module.add_optionnal_module_depend('z', ["c++", "-DLIB_NAME_BUILD_ZLIB"])
|
||||
|
||||
# Add an optionnal dependency (set flag in CPP build if the subLib exist) ==> flag is exported in external upper build
|
||||
my_module.add_optionnal_module_depend('z', ["c++", "-DLIB_NAME_BUILD_ZLIB"], export=True)
|
||||
|
||||
...
|
||||
```
|
||||
|
||||
Compilation adn link flags/libs: {#lutin_module_internal_flag}
|
||||
--------------------------------
|
||||
|
||||
It is possible to define local and external flags (external are set internal too):
|
||||
```python
|
||||
def create(target, module_name):
|
||||
...
|
||||
# external flags:
|
||||
my_module.add_flag('link-lib', "pthread", export=True)
|
||||
my_module.add_flag('c++', "-DHELLO_FLAG=\"kljlkj\"", export=True)
|
||||
# internal flags:
|
||||
my_module.add_flag('c', "-DMODE_RELEASE")
|
||||
|
||||
...
|
||||
```
|
||||
|
||||
build mode (release/debug): {#lutin_module_internal_target_mode}
|
||||
---------------------------
|
||||
|
||||
To add somes element dependent of the build mode:
|
||||
```python
|
||||
def create(target, module_name):
|
||||
...
|
||||
|
||||
if target.get_mode() == "release":
|
||||
pass
|
||||
else:
|
||||
pass
|
||||
|
||||
...
|
||||
```
|
||||
|
||||
build type target: {#lutin_module_internal_target_type}
|
||||
------------------
|
||||
|
||||
To add somes element dependent of the target type:
|
||||
|
||||
```python
|
||||
def create(target, module_name):
|
||||
...
|
||||
|
||||
if "Windows" in target.get_type():
|
||||
pass
|
||||
elif "MacOs" in target.get_type():
|
||||
pass
|
||||
elif "IOs" in target.get_type():
|
||||
pass
|
||||
elif "Linux" in target.get_type():
|
||||
pass
|
||||
elif "Android" in target.get_type():
|
||||
pass
|
||||
...
|
||||
```
|
||||
|
||||
The target get_type return a list of type that represent the hiararchy dependency, a simple example:
|
||||
|
||||
A "Debian" herited of a "Linux" then it will return ["Linux", "Debian"]
|
||||
|
||||
|
||||
|
||||
Add some data in the install path (share path): {#lutin_module_internal_data}
|
||||
-----------------------------------------------
|
||||
|
||||
You can install a simple file:
|
||||
|
||||
```python
|
||||
def create(target, module_name):
|
||||
...
|
||||
|
||||
# copy file in the share/binanyName/ path (no sub path)
|
||||
my_module.copy_path('data/icon.svg')
|
||||
|
||||
...
|
||||
```
|
||||
|
||||
Copy multiple files (change path)
|
||||
|
||||
```python
|
||||
def create(target, module_name):
|
||||
...
|
||||
|
||||
my_module.copy_path('data/*', 'destinationPath')
|
||||
|
||||
...
|
||||
```
|
||||
|
||||
display some debug to help writing code: {#lutin_module_internal_write_log}
|
||||
----------------------------------------
|
||||
|
||||
|
||||
```python
|
||||
import lutin.debug as debug
|
||||
|
||||
def function(...):
|
||||
|
||||
debug.error("comment that stop the build")
|
||||
debug.warning("comment that print a simple warning")
|
||||
debug.info("comment that print a simple information")
|
||||
debug.debug("comment that print a simple debug")
|
||||
debug.verbose("comment that print a simple verbose")
|
||||
|
||||
```
|
||||
|
||||
A Full template: {#lutin_module_full_template}
|
||||
================
|
||||
|
||||
Create the file:
|
||||
```
|
||||
lutin_module-name.py
|
||||
```
|
||||
|
||||
With:
|
||||
```python
|
||||
#!/usr/bin/python
|
||||
import lutin.module as module
|
||||
import lutin.tools as tools
|
||||
import lutin.debug as debug
|
||||
import os
|
||||
|
||||
# A simple list of type:
|
||||
# - BINARY
|
||||
# - BINARY_SHARED
|
||||
# - BINARY_STAND_ALONE
|
||||
# - LIBRARY
|
||||
# - LIBRARY_DYNAMIC
|
||||
# - LIBRARY_STATIC
|
||||
# - PACKAGE
|
||||
# - PREBUILD
|
||||
# - DATA
|
||||
def get_type():
|
||||
return "LIBRARY"
|
||||
|
||||
# simple description of the module that appear in the 'lutin -h'
|
||||
# Note: this fucntion is optionnal.
|
||||
def get_desc():
|
||||
return "Descriptiuon of the PROGRAMM"
|
||||
|
||||
# type of licence:
|
||||
# "APACHE-2"
|
||||
# "BSD-1" / "BSD-2" / "BSD-3" / "BSD-4"
|
||||
# "GPL-1" / "GPL-2" / "GPL-3"
|
||||
# "LGPL-1" / "LGPL-2" / "LGPL-3"
|
||||
# PROPRIETARY
|
||||
# ...
|
||||
# Note: this fucntion is optionnal.
|
||||
def get_licence():
|
||||
return "PROPRIETARY"
|
||||
|
||||
# type of compagny that provide the software:
|
||||
# com : Commercial
|
||||
# net : Network??
|
||||
# org : Organisation
|
||||
# gov : Governement
|
||||
# mil : Military
|
||||
# edu : Education
|
||||
# pri : Private
|
||||
# museum : ...
|
||||
# ...
|
||||
# Note: this fucntion is optionnal.
|
||||
def get_compagny_type():
|
||||
return "com"
|
||||
|
||||
# Name of the compagny
|
||||
# Note: this fucntion is optionnal.
|
||||
def get_compagny_name():
|
||||
return "hello-compagny"
|
||||
|
||||
# People to contact if a problem appear in the build system / library
|
||||
# Note: this fucntion is optionnal.
|
||||
def get_maintainer():
|
||||
return ["Mr NAME SurName <my-email@group.com>"]
|
||||
|
||||
# Version of the library
|
||||
# Note: this fucntion is optionnal.
|
||||
def get_version():
|
||||
return [0,1,"dev"]
|
||||
|
||||
# create the module
|
||||
# @param[in] target reference on the Target that is currently build
|
||||
# @param[in] module_name Name of the module that is extract from the file name (to be generic)
|
||||
def create(target, module_name):
|
||||
my_module = module.Module(__file__, module_name, get_type())
|
||||
|
||||
# add the file to compile:
|
||||
my_module.add_src_file([
|
||||
'module-name/file1.cpp',
|
||||
'module-name/file2.cpp',
|
||||
'module-name/file3.S'
|
||||
])
|
||||
|
||||
my_module.add_header_file([
|
||||
'module-name/file1.h',
|
||||
'module-name/file2.h'
|
||||
])
|
||||
|
||||
my_module.add_path(os.path.join(tools.get_current_path(__file__), "lib-name"))
|
||||
|
||||
# add dependency of the generic C library:
|
||||
my_module.add_module_depend('c')
|
||||
# add dependency of the generic C++ library:
|
||||
my_module.add_module_depend('cxx')
|
||||
# add dependency of the generic math library:
|
||||
my_module.add_module_depend('m')
|
||||
# or other user lib:
|
||||
my_module.add_module_depend([
|
||||
'lib-name1',
|
||||
'lib-name2'
|
||||
])
|
||||
|
||||
# Add an optionnal dependency (set flag in CPP build if the subLib exist) ==> flag is locally set
|
||||
my_module.add_optionnal_module_depend('z', ["c++", "-DLIB_NAME_BUILD_ZLIB"])
|
||||
|
||||
# Add an optionnal dependency (set flag in CPP build if the subLib exist) ==> flag is exported in external upper build
|
||||
my_module.add_optionnal_module_depend('z', ["c++", "-DLIB_NAME_BUILD_ZLIB"], export=True)
|
||||
|
||||
# external flags:
|
||||
my_module.add_flag('link-lib', "pthread", export=True)
|
||||
my_module.add_flag('c++', "-DHELLO_FLAG=\"kljlkj\"", export=True)
|
||||
# internal flags:
|
||||
my_module.add_flags('c', "-DMODE_RELEASE")
|
||||
|
||||
if target.get_mode() == "release":
|
||||
pass
|
||||
else:
|
||||
pass
|
||||
|
||||
if "Windows" in target.get_type():
|
||||
pass
|
||||
elif "MacOs" in target.get_type():
|
||||
pass
|
||||
elif "IOs" in target.get_type():
|
||||
pass
|
||||
elif "Linux" in target.get_type():
|
||||
pass
|
||||
elif "Android" in target.get_type():
|
||||
pass
|
||||
|
||||
# copy file in the share/binanyName/ path (no sub path)
|
||||
my_module.copy_path('data/icon.svg')
|
||||
|
||||
my_module.copy_path('data/*', 'destinationPath')
|
||||
|
||||
return my_module
|
||||
```
|
||||
|
||||
|
||||
**Index:**
|
||||
- @ref mainpage
|
||||
- @ref lutin_concept
|
||||
- @ref lutin_use
|
||||
- @ref lutin_module
|
||||
|
100
doc/index.bb
100
doc/index.bb
@@ -1,100 +0,0 @@
|
||||
=?= [center]Lutin Build system[/center] =?=
|
||||
___________________________________________
|
||||
|
||||
===What is Lutin, and how can I use it?===
|
||||
|
||||
Lutin is an application/library builder, it is designed to concurence CMake, Makefile, Ant, graddle ...
|
||||
|
||||
Lutin is deveopped in Python 2.x and 3.x to permit many user to play with it.
|
||||
|
||||
Python permit to Lutin to be used in many environement in a fast way.
|
||||
|
||||
Lutin support can compile every thing you want, just add a builder that you need (not in the common way). Basicly Lutin support languages:
|
||||
:** C (ainsi/89/99) ==> .o;
|
||||
:** C++ (98/99/03/11/14/...) ==> .o;
|
||||
:** .S (assembleur) ==> .o;
|
||||
:** .java ==> .class;
|
||||
:** .class ==> jar;
|
||||
:** .o ==> .a;
|
||||
:** .o ==> .so;
|
||||
:** .o/.a ==> binary.
|
||||
|
||||
Some packege can be generate for some platform:
|
||||
:** debian package;
|
||||
:** windows application zip;
|
||||
:** MacOs application .app;
|
||||
:** iOs package;
|
||||
:** Android Package .apk.
|
||||
|
||||
Compilation is availlable for:
|
||||
:** gcc/g++;
|
||||
:** clang/clang++.
|
||||
|
||||
Manage [b]workspace build[/b] (in oposition of CMake/make/...)
|
||||
|
||||
|
||||
=== Install: ===
|
||||
|
||||
Requirements: ``Python >= 2.7`` and ``pip``
|
||||
|
||||
==== Install lutin: ===
|
||||
Just run:
|
||||
[code style=bash]
|
||||
pip install lutin
|
||||
[/code]
|
||||
|
||||
==== Install pip ====
|
||||
Install pip on debian/ubuntu:
|
||||
[code style=bash]
|
||||
sudo apt-get install pip
|
||||
[/code]
|
||||
|
||||
Install pip on ARCH-linux:
|
||||
[code style=bash]
|
||||
sudo pacman -S pip
|
||||
[/code]
|
||||
|
||||
Install pip on MacOs:
|
||||
[code style=bash]
|
||||
sudo easy_install pip
|
||||
[/code]
|
||||
|
||||
==== Install from sources ====
|
||||
|
||||
[code style=bash]
|
||||
git clone http://github.com/HeeroYui/lutin.git
|
||||
cd lutin
|
||||
sudo ./setup.py install
|
||||
[/code]
|
||||
|
||||
=== License (APACHE v2.0) ===
|
||||
|
||||
Copyright lutin Edouard DUPIN
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
|
||||
=== History: ===
|
||||
|
||||
I work with some builder, Every one have theire own adventages, and their problems.
|
||||
The main point I see, is that the polimorphisme of the worktree is really hard.
|
||||
The second point is the generation on different platforms is hard too.
|
||||
|
||||
Some other problem example:
|
||||
:** Makefile is too slow on windows mingw;
|
||||
:** Cmake does not create end point package;
|
||||
:** none is really simple to write.
|
||||
|
||||
Then I create a simple interface that manage all I need. and written in python to permit to be faster on every platform.
|
||||
|
||||
[tutorial[000_Build | Tutorials]]
|
140
doc/mainpage.md
Normal file
140
doc/mainpage.md
Normal file
@@ -0,0 +1,140 @@
|
||||
Lutin Build system {#mainpage}
|
||||
==================
|
||||
|
||||
@tableofcontents
|
||||
|
||||
`lutin` is a generic builder and package maker is a FREE software tool.
|
||||
|
||||
|
||||
 https://pypi.python.org/pypi/lutin
|
||||
|
||||
|
||||
Release (master) {#lutin_mainpage_build_master}
|
||||
================
|
||||
|
||||
 https://travis-ci.org/HeeroYui/lutin
|
||||
|
||||
|
||||
Developement (dev) {#lutin_mainpage_build_dev}
|
||||
==================
|
||||
|
||||
 https://travis-ci.org/HeeroYui/lutin
|
||||
|
||||
|
||||
What is Lutin? {#lutin_mainpage_intro}
|
||||
==============
|
||||
|
||||
Lutin is an application/library builder, it is designed to concurence CMake, Makefile, Ant, graddle ...
|
||||
|
||||
Lutin is deveopped in Python 2.x and 3.x to permit many user to play with it.
|
||||
|
||||
Python permit to Lutin to be used in many environement in a fast way.
|
||||
|
||||
Lutin support can compile every thing you want, just add a builder that you need (not in the common way). Basicly Lutin support languages:
|
||||
- C (ainsi/89/99) ==> .o;
|
||||
- C++ (98/99/03/11/14/...) ==> .o;
|
||||
- .S (assembleur) ==> .o;
|
||||
- .java ==> .class;
|
||||
- .class ==> jar;
|
||||
- .o ==> .a;
|
||||
- .o ==> .so;
|
||||
- .o/.a ==> binary.
|
||||
|
||||
Some packege can be generate for some platform:
|
||||
- debian package;
|
||||
- windows application zip;
|
||||
- MacOs application .app;
|
||||
- iOs package;
|
||||
- Android Package .apk.
|
||||
|
||||
Compilation is availlable for:
|
||||
- gcc/g++;
|
||||
- clang/clang++.
|
||||
|
||||
Manage **workspace build** (in oposition of CMake/make/...)
|
||||
|
||||
|
||||
Install: {#lutin_mainpage_installation}
|
||||
========
|
||||
|
||||
Requirements: ``Python >= 2.7`` and ``pip``
|
||||
|
||||
Install lutin:
|
||||
--------------
|
||||
|
||||
Just run:
|
||||
```bash
|
||||
pip install lutin
|
||||
```
|
||||
|
||||
Install pip:
|
||||
------------
|
||||
|
||||
Install pip on debian/ubuntu:
|
||||
```bash
|
||||
sudo apt-get install pip
|
||||
```
|
||||
|
||||
Install pip on ARCH-linux:
|
||||
```bash
|
||||
sudo pacman -S pip
|
||||
```
|
||||
|
||||
Install pip on MacOs:
|
||||
```bash
|
||||
sudo easy_install pip
|
||||
```
|
||||
|
||||
Install from sources:
|
||||
---------------------
|
||||
|
||||
```bash
|
||||
git clone http://github.com/HeeroYui/lutin.git
|
||||
cd lutin
|
||||
sudo ./setup.py install
|
||||
```
|
||||
|
||||
git repository {#lutin_mainpage_repository}
|
||||
==============
|
||||
|
||||
http://github.com/HeeroYui/lutin/
|
||||
|
||||
Tutorals: {#lutin_mainpage_tutorial}
|
||||
=========
|
||||
|
||||
- @ref lutin_concept
|
||||
- @ref lutin_use
|
||||
- @ref lutin_module
|
||||
|
||||
|
||||
License (APACHE v2.0) {#lutin_mainpage_licence}
|
||||
=====================
|
||||
|
||||
Copyright lutin Edouard DUPIN
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
|
||||
History: {#lutin_mainpage_history}
|
||||
========
|
||||
|
||||
I work with some builder, Every one have theire own adventages, and their problems.
|
||||
The main point I see, is that the polimorphisme of the worktree is really hard.
|
||||
The second point is the generation on different platforms is hard too.
|
||||
|
||||
Some other problem example:
|
||||
- Makefile is too slow on windows mingw;
|
||||
- Cmake does not create end point package;
|
||||
- none is really simple to write.
|
||||
|
||||
Then I create a simple interface that manage all I need. and written in python to permit to be faster on every platform.
|
35
doxy_lutin.py
Normal file
35
doxy_lutin.py
Normal file
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/python
|
||||
import os
|
||||
import doxy.module as module
|
||||
import doxy.debug as debug
|
||||
import doxy.tools as tools
|
||||
|
||||
def create(target, module_name):
|
||||
my_module = module.Module(__file__, module_name)
|
||||
my_module.set_version([2.0.0])
|
||||
my_module.set_title("lutin: build system and packager")
|
||||
my_module.set_website("http://HeeroYui.github.io/" + module_name)
|
||||
my_module.set_website_sources("http://github.com/HeeroYui/" + module_name)
|
||||
my_module.add_path([
|
||||
module_name,
|
||||
"doc"
|
||||
])
|
||||
my_module.add_exclude_symbols([
|
||||
'_*',
|
||||
'lutinTarget_*',
|
||||
'lutinSystem_*',
|
||||
'lutinBuilder_*',
|
||||
])
|
||||
my_module.add_file_patterns([
|
||||
#'*.py',
|
||||
'builder.py',
|
||||
'debug.py',
|
||||
'env.py',
|
||||
'host.py',
|
||||
'module.py',
|
||||
'system.py',
|
||||
'target.py',
|
||||
'*.md',
|
||||
])
|
||||
|
||||
return my_module
|
164
lutin/arg.py
164
lutin/arg.py
@@ -8,30 +8,63 @@
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
import sys
|
||||
# Local import
|
||||
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:
|
||||
if len(self.arg) == 0:
|
||||
debug.info("option : " + self.option)
|
||||
elif len(self.option)==0:
|
||||
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
|
||||
@@ -50,18 +83,46 @@ class ArgDefine:
|
||||
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
|
||||
@@ -70,6 +131,10 @@ class ArgDefine:
|
||||
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 != "":
|
||||
@@ -98,46 +163,94 @@ class ArgDefine:
|
||||
tmpElementPrint += " / "
|
||||
tmpElementPrint += val
|
||||
print(" { " + tmpElementPrint + " }")
|
||||
|
||||
def parse(self, argList, currentID):
|
||||
return currentID;
|
||||
|
||||
|
||||
##
|
||||
## @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)
|
||||
|
||||
def parse(self, argList, currentID):
|
||||
return currentID;
|
||||
|
||||
|
||||
##
|
||||
## @brief Class to define the agmument list availlable for a program
|
||||
##
|
||||
class LutinArg:
|
||||
##
|
||||
## @brief Constructor.
|
||||
## @param[in] self Class handle
|
||||
##
|
||||
def __init__(self):
|
||||
self.listProperties = []
|
||||
self.list_properties = []
|
||||
|
||||
def add(self, argument):
|
||||
self.listProperties.append(argument) #ArgDefine(smallOption, bigOption, haveParameter, parameterList, description));
|
||||
##
|
||||
## @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.listProperties.append(ArgSection(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
|
||||
@@ -159,7 +272,7 @@ class LutinArg:
|
||||
argumentFound=False;
|
||||
if option[:2]=="--":
|
||||
# big argument
|
||||
for prop in self.listProperties:
|
||||
for prop in self.list_properties:
|
||||
if prop.get_option_big()=="":
|
||||
continue
|
||||
if prop.get_option_big() == option[2:]:
|
||||
@@ -201,7 +314,7 @@ class LutinArg:
|
||||
debug.error("UNKNOW argument : '" + argument + "'")
|
||||
elif option[:1]=="-":
|
||||
# small argument
|
||||
for prop in self.listProperties:
|
||||
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())]:
|
||||
@@ -250,13 +363,16 @@ class LutinArg:
|
||||
#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.listProperties :
|
||||
for element in self.list_properties :
|
||||
listOfPropertiesArg += element.get_porperties()
|
||||
print(" " + sys.argv[0] + listOfPropertiesArg + " ...")
|
||||
for element in self.listProperties :
|
||||
element.display()
|
||||
for element in self.list_properties :
|
||||
element.display()
|
||||
|
||||
|
@@ -27,7 +27,10 @@ from . import env
|
||||
builder_list=[]
|
||||
__start_builder_name="Builder_"
|
||||
|
||||
|
||||
##
|
||||
## @brief Import all File that start with env.get_build_system_base_name() + __start_builder_name + XXX and register in the list of Builder
|
||||
## @param[in] path_list ([string,...]) List of file that start with env.get_build_system_base_name() in the running worktree (Parse one time ==> faster)
|
||||
##
|
||||
def import_path(path_list):
|
||||
global builder_list
|
||||
global_base = env.get_build_system_base_name()
|
||||
@@ -57,7 +60,10 @@ def import_path(path_list):
|
||||
for elem in builder_list:
|
||||
debug.verbose(" " + str(elem["name"]))
|
||||
|
||||
# we must have call all import before ...
|
||||
|
||||
##
|
||||
## @brief All builder are common (no target or comilator dependency). We need to load all of them when start lutin
|
||||
##
|
||||
def init():
|
||||
global builder_list
|
||||
debug.debug('BUILDER: Initialize all ...')
|
||||
@@ -65,6 +71,10 @@ def init():
|
||||
if element["element"] != None:
|
||||
element["element"].init()
|
||||
|
||||
##
|
||||
## @brief Get a builder tool with specifiying the input type (like cpp, S ...)
|
||||
## @param[in] input_type (string) extention file that can be compile
|
||||
##
|
||||
def get_builder(input_type):
|
||||
global builder_list
|
||||
for element in builder_list:
|
||||
@@ -75,13 +85,16 @@ def get_builder(input_type):
|
||||
debug.error("Can not find builder for type : '" + str(input_type) + "'")
|
||||
raise ValueError('type error :' + str(input_type))
|
||||
|
||||
|
||||
def get_builder_with_output(input_type):
|
||||
##
|
||||
## @brief Get a builder tool with specifiying the output type (like .exe, .jar ...)
|
||||
## @param[in] input_type (string) extention file that can be generated
|
||||
##
|
||||
def get_builder_with_output(output_type):
|
||||
global builder_list
|
||||
for element in builder_list:
|
||||
if element["element"] != None:
|
||||
if input_type in element["element"].get_output_type():
|
||||
if output_type in element["element"].get_output_type():
|
||||
return element["element"]
|
||||
# we can not find the builder ...
|
||||
debug.error("Can not find builder for type : '" + str(input_type) + "'")
|
||||
raise ValueError('type error :' + str(input_type))
|
||||
debug.error("Can not find builder for type : '" + str(output_type) + "'")
|
||||
raise ValueError('type error :' + str(output_type))
|
||||
|
@@ -26,15 +26,33 @@ 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
|
||||
@@ -53,6 +71,9 @@ def enable_color():
|
||||
global color_cyan
|
||||
color_cyan = "\033[36m"
|
||||
|
||||
##
|
||||
## @brief Disable color of the console Log system
|
||||
##
|
||||
def disable_color():
|
||||
global debug_color
|
||||
debug_color = True
|
||||
@@ -71,6 +92,11 @@ def disable_color():
|
||||
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
|
||||
@@ -80,6 +106,11 @@ def extreme_verbose(input, force=False):
|
||||
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
|
||||
@@ -89,6 +120,11 @@ def verbose(input, force=False):
|
||||
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
|
||||
@@ -98,6 +134,11 @@ def debug(input, force=False):
|
||||
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
|
||||
@@ -107,6 +148,11 @@ def info(input, force=False):
|
||||
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
|
||||
@@ -116,6 +162,11 @@ def warning(input, force=False):
|
||||
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
|
||||
@@ -125,6 +176,13 @@ def todo(input, force=False):
|
||||
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
|
||||
@@ -142,6 +200,15 @@ def error(input, thread_id=-1, force=False, crash=True):
|
||||
#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
|
||||
@@ -151,23 +218,31 @@ def print_element(type, lib, dir, name, force=False):
|
||||
print(color_cyan + type + color_default + " : " + color_yellow + lib + color_default + " " + dir + " " + color_blue + name + color_default)
|
||||
debug_lock.release()
|
||||
|
||||
def print_compilator(myString):
|
||||
##
|
||||
## @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:
|
||||
myString = myString.replace('\\n', '\n')
|
||||
myString = myString.replace('\\t', '\t')
|
||||
myString = myString.replace('error:', color_red+'error:'+color_default)
|
||||
myString = myString.replace('warning:', color_purple+'warning:'+color_default)
|
||||
myString = myString.replace('note:', color_green+'note:'+color_default)
|
||||
myString = re.sub(r'([/\w_-]+\.\w+):', r'-COLORIN-\1-COLOROUT-:', myString)
|
||||
myString = myString.replace('-COLORIN-', color_yellow)
|
||||
myString = myString.replace('-COLOROUT-', color_default)
|
||||
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(myString)
|
||||
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
|
||||
|
@@ -41,6 +41,11 @@ def _file_read_data(path, binary=False):
|
||||
file.close()
|
||||
return data_file
|
||||
|
||||
##
|
||||
## @brief Creata a dependency file with a list of files
|
||||
## @param[in] depend_file (string) filename to store a dependency data
|
||||
## @param[in] list_files ([string,...]) List of file that depend the current element
|
||||
##
|
||||
def create_dependency_file(depend_file, list_files):
|
||||
data = ""
|
||||
for elem in list_files:
|
||||
@@ -48,6 +53,16 @@ def create_dependency_file(depend_file, list_files):
|
||||
_create_directory_of_file(depend_file)
|
||||
_file_write_data(depend_file, data)
|
||||
|
||||
##
|
||||
## @brief Check if all dependency of a file and dependency file is correct or not
|
||||
## @param[in] dst (string) File that will be generated
|
||||
## @param[in] src (string) Source File needed to generate the 'dst'
|
||||
## @param[in] depend_file (string) Dependency file that contain all file that the src depending
|
||||
## @param[in] file_cmd (string) Filename of where is store the cmdline to generate the 'dst'
|
||||
## @param[in] cmd_line (string) Command line that will be use to generate the 'dst'
|
||||
## @param[in] force_identical (string) for copy file this check if the src and dst are identical
|
||||
## @return (bool) True: something change ==> need to rebuild, False otherwise
|
||||
##
|
||||
def need_re_build(dst, src, depend_file=None, file_cmd="", cmd_line="", force_identical=False):
|
||||
debug.extreme_verbose("Request check of dependency of :")
|
||||
debug.extreme_verbose(" dst='" + str(dst) + "'")
|
||||
@@ -142,7 +157,7 @@ def need_re_build(dst, src, depend_file=None, file_cmd="", cmd_line="", force_id
|
||||
file.close()
|
||||
# check the 2 files are identical:
|
||||
if force_identical == True:
|
||||
# check if the 2 cmd_line are similar :
|
||||
# check if the 2 cmd_line are similar:
|
||||
size_src = _file_size(src)
|
||||
size_dst = _file_size(dst)
|
||||
if size_src != size_dst:
|
||||
@@ -157,8 +172,15 @@ def need_re_build(dst, src, depend_file=None, file_cmd="", cmd_line="", force_id
|
||||
debug.extreme_verbose(" ==> Not rebuild (all dependency is OK)")
|
||||
return False
|
||||
|
||||
|
||||
|
||||
##
|
||||
## @brief
|
||||
## @param[in] dst (string) File that will be generated
|
||||
## @param[in] src_list ([string,...]) Source file list needed to generate the 'dst'
|
||||
## @param[in] must_have_src (bool) All sources must be present
|
||||
## @param[in] file_cmd (string) Filename of where is store the cmdline to generate the 'dst'
|
||||
## @param[in] cmd_line (string) Command line that will be use to generate the 'dst'
|
||||
## @return (bool) True: Need to regenerate the package, False otherwise
|
||||
##
|
||||
def need_re_package(dst, src_list, must_have_src, file_cmd="", cmd_line=""):
|
||||
debug.extreme_verbose("Request check of dependency of :")
|
||||
debug.extreme_verbose(" dst='" + str(dst) + "'")
|
||||
|
13
lutin/env.py
13
lutin/env.py
@@ -39,6 +39,19 @@ def get_force_optimisation():
|
||||
global force_optimisation
|
||||
return force_optimisation
|
||||
|
||||
isolate_system=False
|
||||
|
||||
def set_isolate_system(val):
|
||||
global isolate_system
|
||||
if val==1:
|
||||
isolate_system = 1
|
||||
else:
|
||||
isolate_system = 0
|
||||
|
||||
def get_isolate_system():
|
||||
global isolate_system
|
||||
return isolate_system
|
||||
|
||||
parse_depth = 9999999
|
||||
|
||||
def set_parse_depth(val):
|
||||
|
@@ -151,6 +151,11 @@ class HeritageList:
|
||||
self.path[ppp].append(iii)
|
||||
debug.extreme_verbose("Path : " + str(self.path))
|
||||
|
||||
##
|
||||
## @brief Generate a string representing the class (for str(xxx))
|
||||
## @param[in] self (handle) Class handle
|
||||
## @return (string) string of str() convertion
|
||||
##
|
||||
def __repr__(self):
|
||||
return "{HeritageList:" + str(self.list_heritage) + "}"
|
||||
|
||||
@@ -169,19 +174,19 @@ class heritage:
|
||||
self.path = {}
|
||||
self.include = ""
|
||||
# update is set at true when data are newly created ==> force upper element to update
|
||||
self.hasBeenUpdated=False
|
||||
self.has_been_updated=False
|
||||
|
||||
if type(module) != type(None):
|
||||
# all the parameter that the upper classe need when build
|
||||
self.name = module.name
|
||||
self.depends = copy.deepcopy(module.depends)
|
||||
self.name = module.get_name()
|
||||
self.depends = copy.deepcopy(module.get_depends())
|
||||
# keep reference because the flags can change in time
|
||||
self.flags = module.flags["export"] # have no deep copy here is a feature ...
|
||||
self.path = copy.deepcopy(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:
|
||||
self.include = target.get_build_path_include(module.name)
|
||||
if len(module._header) > 0:
|
||||
self.include = target.get_build_path_include(module.get_name())
|
||||
|
||||
def add_depends(self, elements):
|
||||
self.depends.append(elements)
|
||||
@@ -218,14 +223,14 @@ class heritage:
|
||||
self.path['c'].append(self.include)
|
||||
|
||||
def need_update(self, list):
|
||||
self.hasBeenUpdated=True
|
||||
self.has_been_updated=True
|
||||
|
||||
def add_sub(self, other):
|
||||
if type(other) == type(None):
|
||||
debug.verbose("input of the heriatege class is None !!!")
|
||||
return
|
||||
if other.hasBeenUpdated == True:
|
||||
self.hasBeenUpdated = True
|
||||
if other.has_been_updated == True:
|
||||
self.has_been_updated = True
|
||||
for flags in other.flags:
|
||||
value = other.flags[flags]
|
||||
if flags not in self.flags:
|
||||
@@ -247,6 +252,11 @@ class heritage:
|
||||
ver = self.flags["c++-version"]
|
||||
self.flags["c++-version"] = ver
|
||||
|
||||
##
|
||||
## @brief Generate a string representing the class (for str(xxx))
|
||||
## @param[in] self (handle) Class handle
|
||||
## @return (string) string of str() convertion
|
||||
##
|
||||
def __repr__(self):
|
||||
return "{Heritage:" + str(self.name) + " ... }"
|
||||
|
||||
|
@@ -25,12 +25,25 @@ except:
|
||||
enable_resize_image = False
|
||||
debug.warning("Missing python tools : CoreGraphics (MacOs) or PIL")
|
||||
|
||||
##
|
||||
## @brief Generate the upper pow 2 of the size in parameter
|
||||
## @param[in] size (int) Size that might heve the upper pow(2)
|
||||
## @return the new size in pow(2)
|
||||
##
|
||||
def get_pow_2_multiple(size):
|
||||
base = 2
|
||||
while size>base:
|
||||
base = base * 2
|
||||
return base
|
||||
|
||||
##
|
||||
## @brief Resize an image
|
||||
## @param[in] src_file (string) Path of the source image file
|
||||
## @param[in] dest_file (string) Path out the destination image file
|
||||
## @param[in] x (int) Width of the image
|
||||
## @param[in] y (int) Height of the image
|
||||
## @param[in] cmd_file (string) Filename of where is store the cmdline to generate the 'dst'
|
||||
##
|
||||
# TODO : 3 things to do :
|
||||
# check if force requested
|
||||
# check if time change
|
||||
|
1065
lutin/module.py
1065
lutin/module.py
File diff suppressed because it is too large
Load Diff
261
lutin/system.py
261
lutin/system.py
@@ -18,88 +18,187 @@ from . import debug
|
||||
from . import module
|
||||
from . import tools
|
||||
from . import env
|
||||
|
||||
##
|
||||
## @brief System class represent the pre-build Module that are already install and accessible in the system environment
|
||||
##
|
||||
class System:
|
||||
##
|
||||
## @brief Constructor
|
||||
## @param[in] self (handle) Class handle
|
||||
## @return None
|
||||
##
|
||||
def __init__(self):
|
||||
self.valid=False;
|
||||
self.help="";
|
||||
self.export_depends=[]
|
||||
self.export_flags={}
|
||||
self.export_src=[]
|
||||
self.export_path=[]
|
||||
self.action_on_state={}
|
||||
self.headers=[]
|
||||
self.version=None
|
||||
self._valid=False;
|
||||
self._help="";
|
||||
self._export_depends=[]
|
||||
self._export_flags={}
|
||||
self._export_src=[]
|
||||
self._export_path=[]
|
||||
self._action_on_state={}
|
||||
self._headers=[]
|
||||
self._version=None
|
||||
|
||||
def add_export_sources(self, list):
|
||||
tools.list_append_to(self.export_src, list)
|
||||
##
|
||||
## @brief Set the help of this system Module
|
||||
## @param[in] self (handle) Class handle
|
||||
## @param[in] help (string) Help for the user
|
||||
## @return None
|
||||
##
|
||||
def set_help(self, help):
|
||||
self._help = help;
|
||||
|
||||
##
|
||||
## @brief Get the help of this system Module
|
||||
## @param[in] self (handle) Class handle
|
||||
## @return (string) Help for the user
|
||||
##
|
||||
def get_help(self):
|
||||
return self._help;
|
||||
|
||||
##
|
||||
## @brief Set validity state of the system Module
|
||||
## @param[in] self (handle) Class handle
|
||||
## @param[in] state (bool) New valididty state of the system module
|
||||
## @return None
|
||||
##
|
||||
def set_valid(self, state):
|
||||
self._valid = state
|
||||
|
||||
##
|
||||
## @brief Get validity state of the system Module
|
||||
## @param[in] self (handle) Class handle
|
||||
## @return (bool) New valididty state of the system module
|
||||
##
|
||||
def get_valid(self):
|
||||
return self._valid
|
||||
|
||||
##
|
||||
## @brief Add source element
|
||||
## @param[in] self (handle) Class handle
|
||||
## @param[in] list ([string,...]) List of all Files to add. ex: *.a, *.so ...
|
||||
## @return None
|
||||
##
|
||||
def add_sources(self, list):
|
||||
tools.list_append_to(self._export_src, list)
|
||||
|
||||
##
|
||||
## @brief Add include path of the sources
|
||||
## @param[in] self (handle) Class handle
|
||||
## @param[in] list ([string,...]) List of all path to add in the -I include element
|
||||
## @return None
|
||||
##
|
||||
# todo : add other than C ...
|
||||
def add_export_path(self, list):
|
||||
tools.list_append_to(self.export_path, list)
|
||||
def add_path(self, list):
|
||||
tools.list_append_to(self._export_path, list)
|
||||
|
||||
def add_module_depend(self, list):
|
||||
tools.list_append_to(self.export_depends, list, True)
|
||||
##
|
||||
## @brief Add a dependency on this module
|
||||
## @param[in] self (handle) Class handle
|
||||
## @param[in] list ([string,...] or string) Name(s) of the modules dependency
|
||||
## @return None
|
||||
##
|
||||
def add_depend(self, list):
|
||||
tools.list_append_to(self._export_depends, list, True)
|
||||
|
||||
def add_export_flag(self, type, list):
|
||||
tools.list_append_to_2(self.export_flags, type, list)
|
||||
##
|
||||
## @brief Add compilation flags
|
||||
## @param[in] self (handle) Class handle
|
||||
## @param[in] type (string) inclusion group name 'c', 'c++', 'java' ...
|
||||
## @param[in] list ([string,...] or string) List of path to include
|
||||
## @return None
|
||||
##
|
||||
def add_flag(self, type, list):
|
||||
tools.list_append_to_2(self._export_flags, type, list)
|
||||
|
||||
##
|
||||
## @brief Set version of the module
|
||||
## @param[in] self (handle) Class handle
|
||||
## @param[in] version_list ([int,...]) Ids of the version. ex: [1,2,5] or [0,8,"dev"]
|
||||
## @return None
|
||||
##
|
||||
def set_version(self, version_list):
|
||||
self.version = version_list
|
||||
self._version = version_list
|
||||
|
||||
## @copydoc lutin.module.Target.add_action
|
||||
def add_action(self, name_of_state="PACKAGE", level=5, name="no-name", action=None):
|
||||
if name_of_state not in self.action_on_add_src_filestate:
|
||||
self.action_on_state[name_of_state] = [[level, name, action]]
|
||||
if name_of_state not in self._action_on_state:
|
||||
self._action_on_state[name_of_state] = [[level, name, action]]
|
||||
else:
|
||||
self.action_on_state[name_of_state].append([level, name, action])
|
||||
self._action_on_state[name_of_state].append([level, name, action])
|
||||
|
||||
## @copydoc lutin.module.Module.add_header_file
|
||||
def add_header_file(self, list, destination_path=None, clip_path=None, recursive=False):
|
||||
self.headers.append({
|
||||
self._headers.append({
|
||||
"list":list,
|
||||
"dst":destination_path,
|
||||
"clip":clip_path,
|
||||
"recursive":recursive
|
||||
})
|
||||
##
|
||||
## @brief Generate a string representing the class (for str(xxx))
|
||||
## @param[in] self (handle) Class handle
|
||||
## @return (string) string of str() convertion
|
||||
##
|
||||
def __repr__(self):
|
||||
return "{lutin.System}"
|
||||
|
||||
##
|
||||
## @brief Configure a module with internal datas
|
||||
## @param[in] self (handle) Class handle
|
||||
## @param[in] target (handle) @ref lutin.module.Target handle
|
||||
## @param[in] module (handle) @ref lutin.module.Module handle
|
||||
## @return None
|
||||
##
|
||||
def configure_module(self, target, module):
|
||||
# add element flags to export
|
||||
for elem in self._export_flags:
|
||||
debug.verbose("add element :" + str(elem) + " elems=" + str(self._export_flags[elem]))
|
||||
module.add_flag(elem, self._export_flags[elem], export=True)
|
||||
# add module dependency
|
||||
module.add_depend(self._export_depends)
|
||||
# add exporting sources
|
||||
module.add_src_file(self._export_src)
|
||||
# add export path
|
||||
module.add_path(self._export_path, export=True)
|
||||
# Export all actions ...
|
||||
for elem in self._action_on_state:
|
||||
level, name, action = self._action_on_state[elem]
|
||||
target.add_action(elem, level, name, action)
|
||||
for elem in self._headers:
|
||||
module.add_header_file(
|
||||
elem["list"],
|
||||
destination_path=elem["dst"],
|
||||
clip_path=elem["clip"],
|
||||
recursive=elem["recursive"])
|
||||
if self._version != None:
|
||||
module.set_pkg("VERSION", self._version);
|
||||
|
||||
|
||||
|
||||
|
||||
##
|
||||
## @brief Create a @ref lutin.module.Module for the system list elements
|
||||
## @param[in] target (handle) @ref lutin.target.Target handle
|
||||
## @param[in] name (string) Name of the system module
|
||||
##
|
||||
def create_module_from_system(target, dict):
|
||||
myModule = module.Module(dict["path"], dict["name"], 'PREBUILD')
|
||||
# add element flags to export
|
||||
for elem in dict["system"].export_flags:
|
||||
debug.verbose("add element :" + str(elem) + " elems=" + str(dict["system"].export_flags[elem]))
|
||||
myModule.add_export_flag(elem, dict["system"].export_flags[elem])
|
||||
# add module dependency
|
||||
myModule.add_module_depend(dict["system"].export_depends)
|
||||
# add exporting sources
|
||||
myModule.add_src_file(dict["system"].export_src)
|
||||
# add export path
|
||||
myModule.add_export_path(dict["system"].export_path)
|
||||
# Export all actions ...
|
||||
for elem in dict["system"].action_on_state:
|
||||
level, name, action = dict["system"].action_on_state[elem]
|
||||
target.add_action(elem, level, name, action)
|
||||
for elem in dict["system"].headers:
|
||||
myModule.add_header_file(
|
||||
elem["list"],
|
||||
destination_path=elem["dst"],
|
||||
clip_path=elem["clip"],
|
||||
recursive=elem["recursive"])
|
||||
if dict["system"].version != None:
|
||||
myModule.package_prop["VERSION"] = dict["system"].version
|
||||
return myModule
|
||||
my_module = module.Module(dict["path"], dict["name"], 'PREBUILD')
|
||||
dict["system"].configure_module(target, my_module)
|
||||
return my_module
|
||||
|
||||
|
||||
|
||||
|
||||
# Dictionnaire of Target name
|
||||
# inside table of ["Name of the lib", "path of the lib", boolean loaded, module loaded]
|
||||
system_list={}
|
||||
__system_list={}
|
||||
__start_system_name="System_"
|
||||
|
||||
##
|
||||
## @brief Import all File that start with env.get_build_system_base_name() + __start_system_name + XXX and register in the list of System
|
||||
## @param[in] path_list ([string,...]) List of file that start with env.get_build_system_base_name() in the running worktree (Parse one time ==> faster)
|
||||
##
|
||||
def import_path(path_list):
|
||||
global system_list
|
||||
global __system_list
|
||||
global_base = env.get_build_system_base_name()
|
||||
debug.debug("SYSTEM: Init with Files list:")
|
||||
for elem in path_list:
|
||||
@@ -118,40 +217,49 @@ def import_path(path_list):
|
||||
system_name = filename[len(__start_system_name):]
|
||||
system_type, system_name = system_name.split('_')
|
||||
debug.verbose("SYSTEM: Integrate: '" + system_type + "':'" + system_name + "' from '" + elem + "'")
|
||||
if system_type in system_list:
|
||||
system_list[system_type].append({"name":system_name,
|
||||
if system_type in __system_list:
|
||||
__system_list[system_type].append({"name":system_name,
|
||||
"path":elem,
|
||||
"system":None,
|
||||
"loaded":False,
|
||||
"exist":False,
|
||||
"module":None})
|
||||
else:
|
||||
__system_list[system_type] = [{"name":system_name,
|
||||
"path":elem,
|
||||
"system":None,
|
||||
"loaded":False,
|
||||
"exist":False,
|
||||
"module":None})
|
||||
else:
|
||||
system_list[system_type] = [{"name":system_name,
|
||||
"path":elem,
|
||||
"system":None,
|
||||
"loaded":False,
|
||||
"exist":False,
|
||||
"module":None}]
|
||||
"module":None}]
|
||||
debug.verbose("New list system: ")
|
||||
for elem in system_list:
|
||||
for elem in __system_list:
|
||||
debug.verbose(" " + str(elem))
|
||||
for val in system_list[elem]:
|
||||
for val in __system_list[elem]:
|
||||
debug.verbose(" " + str(val["name"]))
|
||||
|
||||
|
||||
##
|
||||
## @brief Display all the system binary that can be used
|
||||
##
|
||||
def display():
|
||||
global system_list
|
||||
for elementName in system_list:
|
||||
global __system_list
|
||||
for elementName in __system_list:
|
||||
debug.info("SYSTEM: Integrate system: '" + elementName +"'")
|
||||
for data in system_list[elementName]:
|
||||
for data in __system_list[elementName]:
|
||||
debug.info("SYSTEM: '" + data["name"] +"' in " + data["path"])
|
||||
|
||||
##
|
||||
## @brief Check if a system Module is availlable for a specific target
|
||||
## @param[in] lib_name (string) Name of the Library
|
||||
## @param[in] target_name (string) Name of the target
|
||||
## @param[in] target (handle) Handle on the @ref Target build engine
|
||||
## @return (bool) find the system lib or not
|
||||
##
|
||||
def exist(lib_name, target_name, target) :
|
||||
global system_list
|
||||
global __system_list
|
||||
debug.verbose("exist= " + lib_name + " in " + target_name)
|
||||
if target_name not in system_list:
|
||||
if target_name not in __system_list:
|
||||
return False
|
||||
for data in system_list[target_name]:
|
||||
for data in __system_list[target_name]:
|
||||
if data["name"] == lib_name:
|
||||
# we find it in the List ==> need to check if it is present in the system :
|
||||
if data["loaded"] == False:
|
||||
@@ -163,17 +271,24 @@ def exist(lib_name, target_name, 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
|
||||
data["exist"] = data["system"].get_valid()
|
||||
else:
|
||||
debug.warning("Not find: '" + data["name"] + "' ==> get exception")
|
||||
return data["exist"]
|
||||
return False
|
||||
|
||||
##
|
||||
## @brief Load a system Module for a specific target
|
||||
## @param[in] target (handle) Handle on the @ref Target build engine
|
||||
## @param[in] lib_name (string) Name of the Library
|
||||
## @param[in] target_name (string) Name of the target
|
||||
## @return None
|
||||
##
|
||||
def load(target, lib_name, target_name):
|
||||
global system_list
|
||||
if target_name not in system_list:
|
||||
global __system_list
|
||||
if target_name not in __system_list:
|
||||
debug.error("you must call this function after checking of the system exist() !1!")
|
||||
for data in system_list[target_name]:
|
||||
for data in __system_list[target_name]:
|
||||
if data["name"] == lib_name:
|
||||
if data["exist"] == False:
|
||||
debug.error("you must call this function after checking of the system exist() !2!")
|
||||
|
526
lutin/target.py
526
lutin/target.py
@@ -21,19 +21,23 @@ from . import module
|
||||
from . import system
|
||||
from . import multiprocess
|
||||
from . import env
|
||||
|
||||
##
|
||||
## @brief Target class represent the buyild environement for a specific platform like Linux, or Android ....
|
||||
##
|
||||
class Target:
|
||||
##
|
||||
## @brief contructor
|
||||
## @param[in] name (string) Name of the target
|
||||
## @param[in] config (dict) User configuration
|
||||
## @param[in] arch (string) specific parameter for gcc -arch element
|
||||
##
|
||||
def __init__(self, name, config, arch):
|
||||
## configuration of the build
|
||||
self.config = config
|
||||
|
||||
#processor type selection (auto/arm/ppc/x86)
|
||||
self.select_arch = config["arch"]; # TODO : Remove THIS ...
|
||||
#bus size selection (auto/32/64)
|
||||
self.select_bus = config["bus-size"]; # TODO : Remove THIS ...
|
||||
|
||||
if config["bus-size"] == "auto":
|
||||
if self.config["bus-size"] == "auto":
|
||||
debug.error("system error ==> must generate the default 'bus-size' config")
|
||||
if config["arch"] == "auto":
|
||||
if self.config["arch"] == "auto":
|
||||
debug.error("system error ==> must generate the default 'bus-size' config")
|
||||
|
||||
debug.debug("config=" + str(config))
|
||||
@@ -42,13 +46,12 @@ class Target:
|
||||
else:
|
||||
self.arch = ""
|
||||
|
||||
# todo : remove this :
|
||||
self.sumulator = config["simulation"]
|
||||
self.name = name
|
||||
self.config_based_on = name
|
||||
self.end_generate_package = config["generate-package"]
|
||||
# todo : remove this :
|
||||
self._name = name
|
||||
self._config_based_on = [name]
|
||||
debug.info("=================================");
|
||||
debug.info("== Target='" + self.name + "' " + config["bus-size"] + " bits for arch '" + config["arch"] + "'");
|
||||
debug.info("== Target='" + self._name + "' " + self.config["bus-size"] + " bits for arch '" + self.config["arch"] + "'");
|
||||
debug.info("=================================");
|
||||
|
||||
self.set_cross_base()
|
||||
@@ -57,28 +60,11 @@ class Target:
|
||||
# Target global variables.
|
||||
###############################################################################
|
||||
self.global_include_cc=[]
|
||||
"""
|
||||
self.global_flags_cc=['-D__TARGET_OS__'+self.name,
|
||||
'-D__TARGET_ARCH__'+self.select_arch,
|
||||
'-D__TARGET_ADDR__'+self.select_bus + 'BITS',
|
||||
'-D_REENTRANT']
|
||||
self.global_flags_xx=[]
|
||||
self.global_flags_mm=[]
|
||||
if self.name == "Windows":
|
||||
self.global_flags_xx=['-static-libgcc', '-static-libstdc++']
|
||||
self.global_flags_mm=[]
|
||||
self.global_flags_m=[]
|
||||
self.global_flags_ar=['rcs']
|
||||
self.global_flags_ld=[]
|
||||
self.global_flags_ld_shared=[]
|
||||
"""
|
||||
self.global_flags={}
|
||||
|
||||
self.global_libs_ld=[]
|
||||
self.global_libs_ld_shared=[]
|
||||
|
||||
self.global_sysroot=""
|
||||
|
||||
self.suffix_cmd_line='.cmd'
|
||||
self.suffix_warning='.warning'
|
||||
self.suffix_dependence='.d'
|
||||
@@ -90,21 +76,23 @@ class Target:
|
||||
self.suffix_package='.deb'
|
||||
|
||||
self.path_generate_code="/generate_header"
|
||||
self.path_arch="/" + self.name
|
||||
self.path_arch = "/" + self._name
|
||||
|
||||
self.add_flag("c", [
|
||||
'-D__TARGET_OS__' + self.name,
|
||||
'-D__TARGET_ARCH__' + self.select_arch,
|
||||
'-D__TARGET_ADDR__' + self.select_bus + 'BITS',
|
||||
'-D__TARGET_OS__' + self._name,
|
||||
'-D__TARGET_ARCH__' + self.config["arch"],
|
||||
'-D__TARGET_ADDR__' + self.config["bus-size"] + 'BITS',
|
||||
'-D_REENTRANT'
|
||||
])
|
||||
self.add_flag("c", "-nodefaultlibs")
|
||||
self.add_flag("c++", "-nostdlib")
|
||||
self.add_flag("ar", 'rcs')
|
||||
|
||||
if self.name == "Windows":
|
||||
self.add_flag("c++", ['-static-libgcc', '-static-libstdc++'])
|
||||
|
||||
if self._name == "Windows":
|
||||
self.add_flag("c++", [
|
||||
'-static-libgcc',
|
||||
'-static-libstdc++'
|
||||
])
|
||||
if "debug" == self.config["mode"]:
|
||||
self.add_flag("c", [
|
||||
"-g",
|
||||
@@ -139,7 +127,7 @@ class Target:
|
||||
"--coverage"
|
||||
])
|
||||
|
||||
self.update_path_tree()
|
||||
self._update_path_tree()
|
||||
self.path_bin="bin"
|
||||
self.path_lib="lib"
|
||||
self.path_data="share"
|
||||
@@ -170,18 +158,82 @@ class Target:
|
||||
# special case for IOS (example) no build dynamicly ...
|
||||
self.support_dynamic_link = True
|
||||
|
||||
##
|
||||
## @brief Generate a string representing the class (for str(xxx))
|
||||
## @param[in] self (handle) Class handle
|
||||
## @return (string) string of str() convertion
|
||||
##
|
||||
def __repr__(self):
|
||||
return "{lutin.Target}"
|
||||
|
||||
##
|
||||
## @brief Get the type of the target: ["Linux, ...]
|
||||
## @param[in] self (handle) Class handle
|
||||
## @return ([string,...]) The current target name and other sub name type (ubuntu ...)
|
||||
##
|
||||
def get_type(self):
|
||||
return self._config_based_on
|
||||
|
||||
##
|
||||
## @brief Add a type that the model is based on
|
||||
## @param[in] self (handle) Class handle
|
||||
## @param[in] name (string) Name of that the element is based on ...
|
||||
##
|
||||
def add_type(self, name):
|
||||
self._config_based_on.append(name)
|
||||
|
||||
##
|
||||
## @brief Get the name of the target: Linux, Windows, ...
|
||||
## @param[in] self (handle) Class handle
|
||||
## @return (string) Name of the target
|
||||
##
|
||||
def get_name(self):
|
||||
return self._name
|
||||
|
||||
##
|
||||
## @brief Get build mode of the target: ["debug", "release"]
|
||||
## @param[in] self (handle) Class handle
|
||||
## @return (string) The current target build mode.
|
||||
##
|
||||
def get_mode(self):
|
||||
return self.config["mode"]
|
||||
|
||||
##
|
||||
## @brief Get build for a simulator (Ios and Android for example)
|
||||
## @param[in] self (handle) Class handle
|
||||
## @return (bool) sumulation requested
|
||||
##
|
||||
def get_simulation(self):
|
||||
return self.config["simulation"]
|
||||
|
||||
##
|
||||
## @brief Add global target flags
|
||||
## @param[in] self (handle) Class handle
|
||||
## @param[in] type (string) inclusion group name 'c', 'c++', 'java' ...
|
||||
## @param[in] list ([string,...] or string) List of path to include
|
||||
## @return None
|
||||
##
|
||||
def add_flag(self, type, list):
|
||||
tools.list_append_to_2(self.global_flags, type, list)
|
||||
|
||||
def update_path_tree(self):
|
||||
self.path_out = os.path.join("out", self.name + "_" + self.config["arch"] + "_" + self.config["bus-size"], self.config["mode"])
|
||||
##
|
||||
## @brief Update basic tree path positions on the build tree
|
||||
## @param[in] self (handle) Class handle
|
||||
## @return None
|
||||
##
|
||||
def _update_path_tree(self):
|
||||
self.path_out = os.path.join("out", self._name + "_" + self.config["arch"] + "_" + self.config["bus-size"], self.config["mode"])
|
||||
self.path_final = os.path.join("final", self.config["compilator"])
|
||||
self.path_staging = os.path.join("staging", self.config["compilator"])
|
||||
self.path_build = os.path.join("build", self.config["compilator"])
|
||||
|
||||
# TODO: Remove this from here ==> this is a tools
|
||||
##
|
||||
## @brief create a string version number with the associated list values
|
||||
## @param[in] self (handle) Class handle
|
||||
## @param[in] data ([int|string,...]) version basic number
|
||||
## @return (string) version number
|
||||
##
|
||||
def create_number_from_version_string(self, data):
|
||||
tmp_data = data.split("-")
|
||||
if len(tmp_data) > 1:
|
||||
@@ -201,6 +253,12 @@ class Target:
|
||||
offset /= 1000
|
||||
return out
|
||||
|
||||
##
|
||||
## @brief Configure the cross toolchain
|
||||
## @param[in] self (handle) Class handle
|
||||
## @param[in] cross (string) Path of the cross toolchain
|
||||
## @return None
|
||||
##
|
||||
def set_cross_base(self, cross=""):
|
||||
self.cross = cross
|
||||
debug.debug("== Target='" + self.cross + "'");
|
||||
@@ -234,7 +292,7 @@ class Target:
|
||||
self.nm = self.cross + "nm"
|
||||
self.strip = self.cross + "strip"
|
||||
self.dlltool = self.cross + "dlltool"
|
||||
self.update_path_tree()
|
||||
self._update_path_tree()
|
||||
|
||||
#some static libraries that is sometime needed when not use stdlib ...
|
||||
ret = multiprocess.run_command_direct(self.xx + " -print-file-name=libgcc.a");
|
||||
@@ -246,13 +304,14 @@ class Target:
|
||||
debug.error("Can not get the g++/clang++ libsupc++.a ...")
|
||||
self.stdlib_name_libsupc = ret;
|
||||
|
||||
##
|
||||
## @brief Get the current build mode
|
||||
## @param[in] self (handle) Class handle
|
||||
## @return Build mode value [debug,release]
|
||||
##
|
||||
def get_build_mode(self):
|
||||
return self.config["mode"]
|
||||
|
||||
def clean_module_tree(self):
|
||||
self.build_tree_done = []
|
||||
self.list_final_file = []
|
||||
|
||||
def get_full_name_source(self, basePath, file):
|
||||
if file[0] == '/':
|
||||
if tools.os.path.isfile(file):
|
||||
@@ -288,120 +347,153 @@ class Target:
|
||||
def get_full_dependency(self, module_name, basePath, file):
|
||||
return self.get_build_path_object(module_name) + "/" + file + self.suffix_dependence
|
||||
|
||||
"""
|
||||
return a list of 3 elements :
|
||||
0 : sources files (can be a list)
|
||||
1 : destination file
|
||||
2 : dependence files module (*.d)
|
||||
"""
|
||||
# TODO : Remove this it is urgent ...
|
||||
def generate_file(self,
|
||||
binary_name,
|
||||
module_name,
|
||||
basePath,
|
||||
file,
|
||||
type):
|
||||
#debug.warning("genrate_file(" + str(binary_name) + "," + str(module_name) + "," + str(basePath) + "," + str(file) + "," + str(type) + ")")
|
||||
list=[]
|
||||
if (type=="bin"):
|
||||
list.append(file)
|
||||
list.append(self.get_build_file_bin(binary_name))
|
||||
list.append(os.path.join(self.get_build_path(module_name), module_name + self.suffix_dependence))
|
||||
list.append(self.get_build_file_bin(binary_name) + self.suffix_cmd_line)
|
||||
list.append(self.get_build_file_bin(binary_name) + self.suffix_warning)
|
||||
elif (type=="lib-shared"):
|
||||
list.append(file)
|
||||
list.append(self.get_build_file_dynamic(module_name))
|
||||
list.append(os.path.join(self.get_build_path(module_name), self.path_lib, module_name + self.suffix_dependence))
|
||||
list.append(self.get_build_file_dynamic(module_name) + self.suffix_cmd_line)
|
||||
list.append(self.get_build_file_dynamic(module_name) + self.suffix_warning)
|
||||
elif (type=="lib-static"):
|
||||
list.append(file)
|
||||
list.append(self.get_build_file_static(module_name))
|
||||
list.append(os.path.join(self.get_build_path(module_name), self.path_lib, module_name + self.suffix_dependence))
|
||||
list.append(self.get_build_file_static(module_name) + self.suffix_cmd_line)
|
||||
list.append(self.get_build_file_static(module_name) + self.suffix_warning)
|
||||
elif (type=="jar"):
|
||||
list.append(file)
|
||||
list.append(os.path.join(self.get_build_path(module_name), module_name + ".jar"))
|
||||
list.append(os.path.join(self.get_build_path(module_name), module_name + ".jar" + self.suffix_dependence))
|
||||
list.append(os.path.join(self.get_build_path(module_name), module_name + ".jar" + self.suffix_cmd_line))
|
||||
list.append(os.path.join(self.get_build_path(module_name), module_name + ".jar" + self.suffix_warning))
|
||||
elif (type=="image"):
|
||||
list.append(os.path.join(self.get_build_path(binary_name), "data", file + self.suffix_cmd_line))
|
||||
else:
|
||||
debug.error("unknow type : " + type)
|
||||
return list
|
||||
|
||||
##
|
||||
## @brief Get the fianal path ==> contain all the generated packages
|
||||
## @return The path of the pa
|
||||
## @brief Get the final path ==> contain all the generated packages
|
||||
## @param[in] self (handle) Class handle
|
||||
## @return (string) The path
|
||||
##
|
||||
def get_final_path(self):
|
||||
return os.path.join(tools.get_run_path(), self.path_out, self.path_final)
|
||||
|
||||
def get_staging_path(self, binary_name):
|
||||
return os.path.join(tools.get_run_path(), self.path_out, self.path_staging, binary_name)
|
||||
##
|
||||
## @brief Get the staging path ==> all install stangalone package (no dependency file, no object files, no cmdlines files
|
||||
## @param[in] self (handle) Class handle
|
||||
## @param[in] name (string) Name of the module
|
||||
## @return (string) The path
|
||||
##
|
||||
def get_staging_path(self, name):
|
||||
return os.path.join(tools.get_run_path(), self.path_out, self.path_staging, name)
|
||||
|
||||
def get_build_path(self, module_name):
|
||||
#debug.warning("A=" + str(tools.get_run_path()) + " " + str(self.path_out) + " " + str(self.path_build) + " " + str(module_name))
|
||||
return os.path.join(tools.get_run_path(), self.path_out, self.path_build, module_name)
|
||||
##
|
||||
## @brief Get the build path ==> dependency file, object files, cmdlines files, generate files, local install headers ...
|
||||
## @param[in] self (handle) Class handle
|
||||
## @param[in] name (string) Name of the module
|
||||
## @return (string) The path
|
||||
##
|
||||
def get_build_path(self, name):
|
||||
return os.path.join(tools.get_run_path(), self.path_out, self.path_build, name)
|
||||
|
||||
##
|
||||
## @brief Get the build object path where write .o files
|
||||
## @param[in] self (handle) Class handle
|
||||
## @param[in] name (string) Name of the module
|
||||
## @return (string) The path
|
||||
##
|
||||
def get_build_path_object(self, name):
|
||||
return os.path.join(self.get_build_path(name), self.path_object)
|
||||
|
||||
##
|
||||
## @brief Get the build binary path where write .bin, .exe ... files
|
||||
## @param[in] self (handle) Class handle
|
||||
## @param[in] name (string) Name of the module
|
||||
## @return (string) The path
|
||||
##
|
||||
def get_build_path_bin(self, name):
|
||||
return os.path.join(self.get_build_path(name), self.path_bin)
|
||||
|
||||
##
|
||||
## @brief Get the shared/static library object path where write .a / .so files
|
||||
## @param[in] self (handle) Class handle
|
||||
## @param[in] name (string) Name of the module
|
||||
## @return (string) The path
|
||||
##
|
||||
def get_build_path_lib(self, name):
|
||||
return os.path.join(self.get_build_path(name), self.path_lib)
|
||||
|
||||
##
|
||||
## @brief Get the data path where pre-write the install "data" files
|
||||
## @param[in] self (handle) Class handle
|
||||
## @param[in] name (string) Name of the module
|
||||
## @return (string) The path
|
||||
##
|
||||
def get_build_path_data(self, name):
|
||||
return os.path.join(self.get_build_path(name), self.path_data, name)
|
||||
|
||||
##
|
||||
## @brief Get the include path where pre-install "include" headers files
|
||||
## @param[in] self (handle) Class handle
|
||||
## @param[in] name (string) Name of the module
|
||||
## @return (string) The path
|
||||
##
|
||||
def get_build_path_include(self, name):
|
||||
return os.path.join(self.get_build_path(name), self.path_include)
|
||||
|
||||
##
|
||||
## @brief Get the path where to generate files when needed (before compiling / installing it)
|
||||
## @param[in] self (handle) Class handle
|
||||
## @param[in] name (string) Name of the module
|
||||
## @return (string) The path
|
||||
##
|
||||
def get_build_path_temporary_generate(self, name):
|
||||
return os.path.join(self.get_build_path(name), self.path_temporary_generate)
|
||||
|
||||
##
|
||||
## @brief Get the path filename of the build binary name
|
||||
## @param[in] self (handle) Class handle
|
||||
## @param[in] name (string) Name of the module
|
||||
## @return (string) The path
|
||||
##
|
||||
def get_build_file_bin(self, name):
|
||||
return os.path.join(self.get_build_path_bin(name), name + self.suffix_binary)
|
||||
|
||||
##
|
||||
## @brief Get the path filename of the build static library name
|
||||
## @param[in] self (handle) Class handle
|
||||
## @param[in] name (string) Name of the module
|
||||
## @return (string) The path
|
||||
##
|
||||
def get_build_file_static(self, name):
|
||||
return os.path.join(self.get_build_path_lib(name), self.prefix_lib + name + self.suffix_lib_static)
|
||||
|
||||
##
|
||||
## @brief Get the path filename of the build shared library name
|
||||
## @param[in] self (handle) Class handle
|
||||
## @param[in] name (string) Name of the module
|
||||
## @return (string) The path
|
||||
##
|
||||
def get_build_file_dynamic(self, name):
|
||||
return os.path.join(self.get_build_path_lib(name), self.prefix_lib + name + self.suffix_lib_dynamic)
|
||||
|
||||
|
||||
def get_build_path_object(self, binary_name):
|
||||
return os.path.join(self.get_build_path(binary_name), self.path_object)
|
||||
##
|
||||
## @brief Get the bin path for staging step
|
||||
## @param[in] self (handle) Class handle
|
||||
## @param[in] name (string) Name of the package
|
||||
## @return (string) The path
|
||||
##
|
||||
def get_staging_path_bin(self, name):
|
||||
return os.path.join(self.get_staging_path(name), self.path_bin)
|
||||
|
||||
def get_build_path_bin(self, binary_name):
|
||||
return os.path.join(self.get_build_path(binary_name), self.path_bin)
|
||||
|
||||
def get_build_path_lib(self, binary_name):
|
||||
return os.path.join(self.get_build_path(binary_name), self.path_lib)
|
||||
|
||||
def get_build_path_data(self, binary_name):
|
||||
return os.path.join(self.get_build_path(binary_name), self.path_data, binary_name)
|
||||
|
||||
def get_build_path_include(self, binary_name):
|
||||
return os.path.join(self.get_build_path(binary_name), self.path_include)
|
||||
|
||||
def get_build_path_temporary_generate(self, binary_name):
|
||||
return os.path.join(self.get_build_path(binary_name), self.path_temporary_generate)
|
||||
|
||||
|
||||
def get_build_file_bin(self, binary_name):
|
||||
return os.path.join(self.get_build_path_bin(binary_name), binary_name + self.suffix_binary)
|
||||
|
||||
def get_build_file_static(self, binary_name):
|
||||
return os.path.join(self.get_build_path_lib(binary_name), self.prefix_lib + binary_name + self.suffix_lib_static)
|
||||
|
||||
def get_build_file_dynamic(self, binary_name):
|
||||
return os.path.join(self.get_build_path_lib(binary_name), self.prefix_lib + binary_name + self.suffix_lib_dynamic)
|
||||
|
||||
|
||||
|
||||
|
||||
def get_staging_path_bin(self, package_name):
|
||||
return os.path.join(self.get_staging_path(package_name), self.path_bin)
|
||||
|
||||
def get_staging_path_lib(self, package_name):
|
||||
return os.path.join(self.get_staging_path(package_name), self.path_lib, package_name)
|
||||
|
||||
def get_staging_path_data(self, package_name):
|
||||
return os.path.join(self.get_staging_path(package_name), self.path_data, package_name)
|
||||
|
||||
def get_staging_path_include(self, package_name):
|
||||
return os.path.join(self.get_staging_path(package_name), self.path_include)
|
||||
|
||||
"""
|
||||
def get_staging_file_bin(self, package_name, binary_name):
|
||||
return os.path.join(self.get_staging_path_bin(package_name), binary_name + self.suffix_binary)
|
||||
"""
|
||||
##
|
||||
## @brief Get the lib path for staging step
|
||||
## @param[in] self (handle) Class handle
|
||||
## @param[in] name (string) Name of the package
|
||||
## @return (string) The path
|
||||
##
|
||||
def get_staging_path_lib(self, name):
|
||||
return os.path.join(self.get_staging_path(name), self.path_lib, name)
|
||||
|
||||
##
|
||||
## @brief Get the data path for staging step
|
||||
## @param[in] self (handle) Class handle
|
||||
## @param[in] name (string) Name of the package
|
||||
## @return (string) The path
|
||||
##
|
||||
def get_staging_path_data(self, name):
|
||||
return os.path.join(self.get_staging_path(name), self.path_data, name)
|
||||
|
||||
##
|
||||
## @brief Get the include path for staging step
|
||||
## @param[in] self (handle) Class handle
|
||||
## @param[in] name (string) Name of the package
|
||||
## @return (string) The path
|
||||
##
|
||||
def get_staging_path_include(self, name):
|
||||
return os.path.join(self.get_staging_path(name), self.path_include)
|
||||
|
||||
def get_doc_path(self, module_name):
|
||||
return os.path.join(tools.get_run_path(), self.path_out, self.path_doc, module_name)
|
||||
|
||||
|
||||
def is_module_build(self, my_module):
|
||||
for mod in self.build_done:
|
||||
if mod == my_module:
|
||||
@@ -416,43 +508,66 @@ class Target:
|
||||
self.build_tree_done.append(my_module)
|
||||
return False
|
||||
|
||||
def add_module(self, newModule):
|
||||
debug.debug("Add nodule for Taget : " + newModule.name)
|
||||
self.module_list.append(newModule)
|
||||
##
|
||||
## @brief Add new loaded module
|
||||
## @param[in] self (handle) Class handle
|
||||
## @param[in] new_module (handle) pointer on the module instance
|
||||
## @return None
|
||||
##
|
||||
def add_module(self, new_module):
|
||||
debug.debug("Add nodule for Taget : " + new_module.get_name())
|
||||
self.module_list.append(new_module)
|
||||
|
||||
##
|
||||
## @brief Get a module handle that is used in this target
|
||||
## @param[in] self (handle) Class handle
|
||||
## @param[in] name (string) Name of the module
|
||||
## @return (handle|None) @ref lutin.module.Module pointer on the module requested or None
|
||||
##
|
||||
def get_module(self, name):
|
||||
for mod in self.module_list:
|
||||
if mod.name == name:
|
||||
if mod.get_name() == name:
|
||||
return mod
|
||||
debug.error("the module '" + str(name) + "'does not exist/already build")
|
||||
return None
|
||||
|
||||
# return inherit packages ...
|
||||
"""
|
||||
def build(self, name, packagesName):
|
||||
for module in self.module_list:
|
||||
if module.name == name:
|
||||
return module.build(self, packagesName)
|
||||
debug.error("request to build an un-existant module name : '" + name + "'")
|
||||
"""
|
||||
|
||||
def build_tree(self, name, packagesName):
|
||||
##
|
||||
## @brief Build data associated at the module name in a specific package
|
||||
## @param[in] self (handle) Class handle
|
||||
## @param[in] name (string) Name of the module
|
||||
## @param[in] package_name (string) Name of the package
|
||||
## @return None
|
||||
##
|
||||
def build_tree(self, name, package_name):
|
||||
for mod in self.module_list:
|
||||
if mod.name == name:
|
||||
mod.build_tree(self, packagesName)
|
||||
if mod.get_name() == name:
|
||||
mod.build_tree(self, package_name)
|
||||
return
|
||||
debug.error("request to build tree on un-existant module name : '" + name + "'")
|
||||
|
||||
##
|
||||
## @brief Clean a specific module for this target (clean all data in the "out" path)
|
||||
## @param[in] self (handle) Class handle
|
||||
## @param[in] name (string) Name of the module
|
||||
## @return None
|
||||
##
|
||||
def clean(self, name):
|
||||
for mod in self.module_list:
|
||||
if mod.name == name:
|
||||
if mod.get_name() == name:
|
||||
mod.clean(self)
|
||||
return
|
||||
debug.error("request to clean an un-existant module name : '" + name + "'")
|
||||
|
||||
##
|
||||
## @brief Load a specific module if it accessible
|
||||
## @param[in] self (handle) Class handle
|
||||
## @param[in] name (string) Name of the module to load
|
||||
## @param[in] optionnal (bool) not create an error if the module does not exist.
|
||||
## @return (bool) module loading status
|
||||
##
|
||||
def load_if_needed(self, name, optionnal=False):
|
||||
for elem in self.module_list:
|
||||
if elem.name == name:
|
||||
if elem.get_name() == name:
|
||||
return True
|
||||
# try to find in the local Modules:
|
||||
exist = module.exist(self, name)
|
||||
@@ -460,26 +575,33 @@ class Target:
|
||||
module.load_module(self, name)
|
||||
return True;
|
||||
# need to import the module (or the system module ...)
|
||||
exist = system.exist(name, self.name, self)
|
||||
exist = system.exist(name, self._name, self)
|
||||
if exist == True:
|
||||
system.load(self, name, self.name)
|
||||
system.load(self, name, self._name)
|
||||
return True;
|
||||
# we did not find the module ...
|
||||
return False;
|
||||
|
||||
##
|
||||
## @brief Load all module that are accessible in the worktree
|
||||
## @param[in] self (handle) Class handle
|
||||
## @return None
|
||||
##
|
||||
def load_all(self):
|
||||
listOfAllTheModule = module.list_all_module()
|
||||
for modName in listOfAllTheModule:
|
||||
self.load_if_needed(modName)
|
||||
|
||||
def project_add_module(self, name, projectMng, addedModule):
|
||||
for mod in self.module_list:
|
||||
if mod.name == name:
|
||||
mod.ext_project_add_module(self, projectMng, addedModule)
|
||||
return
|
||||
|
||||
|
||||
def build(self, name, packagesName=None, optionnal=False, actions=[]):
|
||||
##
|
||||
## @brief Build action on the target (execute specific actions on the modules...)
|
||||
## @note Recursive call ...
|
||||
## @param[in] self (handle) Class handle
|
||||
## @param[in] name (string) Module to build
|
||||
## @param[in] optionnal (bool) If the module is not accessible, this is not a probleme ==> optionnal dependency requested
|
||||
## @param[in] actions ([string,...]) list of action to do. ex: build, gcov, dump, all, clean, install, uninstall, run, log
|
||||
## @return (None|Module handle| ...) complicated return ...
|
||||
##
|
||||
def build(self, name, optionnal=False, actions=[]):
|
||||
if len(name.split("?")) != 1\
|
||||
or len(name.split("@")) != 1:
|
||||
debug.error("need update")
|
||||
@@ -502,12 +624,12 @@ class Target:
|
||||
debug.info("build all")
|
||||
self.load_all()
|
||||
for mod in self.module_list:
|
||||
if self.name=="Android":
|
||||
if mod.type == "PACKAGE":
|
||||
if self._name=="Android":
|
||||
if mod.get_type() == "PACKAGE":
|
||||
mod.build(self, None)
|
||||
else:
|
||||
if mod.type == "BINARY" \
|
||||
or mod.type == "PACKAGE":
|
||||
if mod.get_type() == "BINARY" \
|
||||
or mod.get_type() == "PACKAGE":
|
||||
mod.build(self, None)
|
||||
elif name == "clean":
|
||||
debug.info("clean all")
|
||||
@@ -561,7 +683,8 @@ class Target:
|
||||
ret = [heritage.HeritageList(), False]
|
||||
else:
|
||||
for mod in self.module_list:
|
||||
if mod.name == module_name:
|
||||
debug.verbose("compare " + mod.get_name() + " == " + module_name)
|
||||
if mod.get_name() == module_name:
|
||||
if action_name[:4] == "dump":
|
||||
debug.info("dump module '" + module_name + "'")
|
||||
if len(action_name) > 4:
|
||||
@@ -610,6 +733,23 @@ class Target:
|
||||
if len(action_list) == 1:
|
||||
return ret
|
||||
|
||||
##
|
||||
## @brief Add action to do for package specific part when build upper element
|
||||
## @param[in] name_of_state (string) a state to call action
|
||||
## - BINARY
|
||||
## - BINARY_SHARED
|
||||
## - BINARY_STAND_ALONE
|
||||
## - LIBRARY
|
||||
## - LIBRARY_DYNAMIC
|
||||
## - LIBRARY_STATIC
|
||||
## - PACKAGE
|
||||
## - PREBUILD
|
||||
## - DATA
|
||||
## @param[in] level (int) Value order to apply action
|
||||
## @param[in] name (string) Name of the action
|
||||
## @param[in] action (function handle) Function to call to execure action
|
||||
## @return None
|
||||
##
|
||||
def add_action(self, name_of_state="PACKAGE", level=5, name="no-name", action=None):
|
||||
debug.verbose("add action : " + name)
|
||||
if name_of_state not in self.action_on_state:
|
||||
@@ -843,12 +983,15 @@ class Target:
|
||||
return result
|
||||
|
||||
|
||||
target_list=[]
|
||||
__target_list=[]
|
||||
__start_target_name="Target_"
|
||||
|
||||
|
||||
##
|
||||
## @brief Import all File that start with env.get_build_system_base_name() + __start_target_name + XXX and register in the list of Target
|
||||
## @param[in] path_list ([string,...]) List of file that start with env.get_build_system_base_name() in the running worktree (Parse one time ==> faster)
|
||||
##
|
||||
def import_path(path_list):
|
||||
global target_list
|
||||
global __target_list
|
||||
global_base = env.get_build_system_base_name()
|
||||
debug.debug("TARGET: Init with Files list:")
|
||||
for elem in path_list:
|
||||
@@ -866,18 +1009,21 @@ def import_path(path_list):
|
||||
# Remove local patern
|
||||
target_name = filename[len(__start_target_name):]
|
||||
debug.verbose("TARGET: Integrate: '" + target_name + "' from '" + elem + "'")
|
||||
target_list.append([target_name, elem])
|
||||
__target_list.append([target_name, elem])
|
||||
debug.verbose("New list TARGET: ")
|
||||
for elem in target_list:
|
||||
for elem in __target_list:
|
||||
debug.verbose(" " + str(elem[0]))
|
||||
|
||||
##
|
||||
## @brief Load a specific target
|
||||
##
|
||||
def load_target(name, config):
|
||||
global target_list
|
||||
global __target_list
|
||||
debug.debug("load target: " + name)
|
||||
if len(target_list) == 0:
|
||||
if len(__target_list) == 0:
|
||||
debug.error("No target to compile !!!")
|
||||
debug.debug("list target: " + str(target_list))
|
||||
for mod in target_list:
|
||||
debug.debug("list target: " + str(__target_list))
|
||||
for mod in __target_list:
|
||||
if mod[0] == name:
|
||||
debug.verbose("add to path: '" + os.path.dirname(mod[1]) + "'")
|
||||
sys.path.append(os.path.dirname(mod[1]))
|
||||
@@ -889,16 +1035,16 @@ def load_target(name, config):
|
||||
raise KeyError("No entry for : " + name)
|
||||
|
||||
def list_all_target():
|
||||
global target_list
|
||||
global __target_list
|
||||
tmpListName = []
|
||||
for mod in target_list:
|
||||
for mod in __target_list:
|
||||
tmpListName.append(mod[0])
|
||||
return tmpListName
|
||||
|
||||
def list_all_target_with_desc():
|
||||
global target_list
|
||||
global __target_list
|
||||
tmpList = []
|
||||
for mod in target_list:
|
||||
for mod in __target_list:
|
||||
sys.path.append(os.path.dirname(mod[1]))
|
||||
theTarget = __import__(env.get_build_system_base_name() + __start_target_name + mod[0])
|
||||
try:
|
||||
|
@@ -58,7 +58,12 @@ def get_support_multithreading():
|
||||
## @brief Commands for running gcc to link an executable.
|
||||
##
|
||||
def link(file, binary, target, depancy, flags, name, basic_path, static = False):
|
||||
file_src, file_dst, file_depend, file_cmd, file_warning = target.generate_file(binary, name, basic_path, file, "bin")
|
||||
file_src = file
|
||||
file_dst = target.get_build_file_bin(binary)
|
||||
file_depend = file_dst + target.suffix_dependence
|
||||
file_cmd = file_dst + target.suffix_cmd_line
|
||||
file_warning = file_dst + target.suffix_warning
|
||||
|
||||
debug.extreme_verbose("list files = " + str(depancy.src))
|
||||
list_static = []
|
||||
list_dynamic = []
|
||||
@@ -95,10 +100,6 @@ def link(file, binary, target, depancy, flags, name, basic_path, static = False)
|
||||
cmd.append(target.sysroot)
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
cmd.append(target.global_sysroot)
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
cmd.append(["-o", file_dst])
|
||||
except:
|
||||
|
@@ -57,7 +57,12 @@ def get_support_multithreading():
|
||||
## @brief Commands for running gcc to link a shared library.
|
||||
##
|
||||
def link(file, binary, target, depancy, flags, name, basic_path):
|
||||
file_src, file_dst, file_depend, file_cmd, file_warning = target.generate_file(binary, name, basic_path, file, "jar")
|
||||
file_src = file
|
||||
file_dst = os.path.join(target.get_build_path(name), name + ".jar")
|
||||
file_depend = file_dst + target.suffix_dependence
|
||||
file_cmd = file_dst + target.suffix_cmd_line
|
||||
file_warning = file_dst + target.suffix_warning
|
||||
|
||||
#create command Line
|
||||
cmd = [
|
||||
target.jar,
|
||||
|
@@ -57,7 +57,17 @@ def get_support_multithreading():
|
||||
## @brief Commands for running gcc to link a shared library.
|
||||
##
|
||||
def link(file, binary, target, depancy, flags, name, basic_path, static=False):
|
||||
file_src, file_dst, file_depend, file_cmd, file_warning = target.generate_file(binary, name, basic_path, file, "lib-shared")
|
||||
file_src = file
|
||||
file_dst = target.get_build_file_dynamic(name)
|
||||
file_depend = file_dst + target.suffix_dependence
|
||||
file_cmd = file_dst + target.suffix_cmd_line
|
||||
file_warning = file_dst + target.suffix_warning
|
||||
|
||||
debug.extreme_verbose("file_dst = " + file_dst)
|
||||
debug.extreme_verbose("file_depend = " + file_depend)
|
||||
debug.extreme_verbose("file_cmd = " + file_cmd)
|
||||
debug.extreme_verbose("file_warning = " + file_warning)
|
||||
|
||||
list_static = []
|
||||
list_dynamic = []
|
||||
if static == True:
|
||||
@@ -87,7 +97,7 @@ def link(file, binary, target, depancy, flags, name, basic_path, static=False):
|
||||
|
||||
cmd.append(["-o", file_dst])
|
||||
try:
|
||||
cmd.append(target.global_sysroot)
|
||||
cmd.append(target.sysroot)
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
|
@@ -57,8 +57,17 @@ def get_support_multithreading():
|
||||
## @brief Commands for running ar.
|
||||
##
|
||||
def link(file, binary, target, depancy, flags, name, basic_path):
|
||||
file_src, file_dst, file_depend, file_cmd, file_warning = target.generate_file(binary, name, basic_path, file, "lib-static")
|
||||
#$(Q)$(TARGET_AR) $(TARGET_GLOBAL_ARFLAGS) $(PRIVATE_ARFLAGS) $@ $(PRIVATE_ALL_OBJECTS)
|
||||
file_src = file
|
||||
file_dst = target.get_build_file_static(name)
|
||||
file_depend = file_dst + target.suffix_dependence
|
||||
file_cmd = file_dst + target.suffix_cmd_line
|
||||
file_warning = file_dst + target.suffix_warning
|
||||
|
||||
debug.extreme_verbose("file_dst = " + file_dst)
|
||||
debug.extreme_verbose("file_depend = " + file_depend)
|
||||
debug.extreme_verbose("file_cmd = " + file_cmd)
|
||||
debug.extreme_verbose("file_warning = " + file_warning)
|
||||
|
||||
cmd = [
|
||||
target.ar
|
||||
]
|
||||
|
@@ -11,17 +11,18 @@
|
||||
from lutin 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.help="ADMOD: Android SDK ad-mod interface (auto-create interface for admod)\n"
|
||||
self.set_help("ADMOD: Android SDK ad-mod interface (auto-create interface for admod)\n")
|
||||
# todo : Check if present ...
|
||||
self.valid = True
|
||||
self.set_valid(True)
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_export_sources(target.path_sdk + "/extras/google/google_play_services/libproject/google-play-services_lib/libs/google-play-services.jar")
|
||||
self.add_sources(target.path_sdk + "/extras/google/google_play_services/libproject/google-play-services_lib/libs/google-play-services.jar")
|
||||
self.add_action("PACKAGE", 10, "admod-auto-wrapper", tool_generate_main_java_class)
|
||||
|
||||
|
||||
|
@@ -11,21 +11,22 @@
|
||||
from lutin 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.help="SDK: Android SDK basic interface java\n"
|
||||
self.set_help("SDK: Android SDK basic interface java")
|
||||
# jar file:
|
||||
jar_file_path=os.path.join(target.path_sdk, "platforms", "android-" + str(target.board_id), "android.jar")
|
||||
# TODO : Check if the android sdk android.jar is present ...
|
||||
self.valid = True
|
||||
self.set_valid(True)
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_export_sources(jar_file_path)
|
||||
self.add_export_flag("link-lib", "dl")
|
||||
self.add_export_flag("link-lib", "log")
|
||||
self.add_export_flag("link-lib", "android")
|
||||
self.add_sources(jar_file_path)
|
||||
self.add_flag("link-lib", "dl")
|
||||
self.add_flag("link-lib", "log")
|
||||
self.add_flag("link-lib", "android")
|
||||
|
||||
|
||||
|
@@ -11,12 +11,13 @@
|
||||
from lutin 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.help = "C: Generic C library"
|
||||
self.valid = True
|
||||
self.set_help("C: Generic C library")
|
||||
self.set_valid(True)
|
||||
|
||||
|
@@ -11,66 +11,67 @@
|
||||
from lutin 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.help = "CXX: Generic C++ library"
|
||||
self.valid = True
|
||||
self.set_help("CXX: Generic C++ library")
|
||||
self.set_valid(True)
|
||||
if target.config["compilator"] == "clang":
|
||||
if target.board_id < 21:
|
||||
debug.error("Clang work only with the board wersion >= 21 : android 5.x.x")
|
||||
self.valid = False
|
||||
return
|
||||
self.add_export_flag("c++", "-D__STDCPP_LLVM__")
|
||||
self.add_flag("c++", "-D__STDCPP_LLVM__")
|
||||
# llvm is BSD-like licence
|
||||
self.add_export_path(os.path.join(target.path_ndk, "sources", "cxx-stl", "llvm-libc++", "libcxx", "include"))
|
||||
self.add_path(os.path.join(target.path_ndk, "sources", "cxx-stl", "llvm-libc++", "libcxx", "include"))
|
||||
if target.type_arch == "armv5":
|
||||
stdCppBasePath = os.path.join(target.path_ndk, "sources", "cxx-stl", "llvm-libc++", "libcxx", "libs", "armeabi")
|
||||
self.add_export_path( os.path.join(stdCppBasePath, "include"))
|
||||
self.add_export_flag("link", os.path.join(stdCppBasePath, "libc++_static.a"))
|
||||
self.add_path( os.path.join(stdCppBasePath, "include"))
|
||||
self.add_flag("link", os.path.join(stdCppBasePath, "libc++_static.a"))
|
||||
elif target.type_arch == "armv7":
|
||||
stdCppBasePath = os.path.join(target.path_ndk, "sources", "cxx-stl", "llvm-libc++", "libs", "armeabi-v7a")
|
||||
self.add_export_path( os.path.join(stdCppBasePath + "include"))
|
||||
self.add_export_flag("link", os.path.join(stdCppBasePath, "thumb", "libc++_static.a"))
|
||||
self.add_path( os.path.join(stdCppBasePath + "include"))
|
||||
self.add_flag("link", os.path.join(stdCppBasePath, "thumb", "libc++_static.a"))
|
||||
elif target.type_arch == "mips":
|
||||
stdCppBasePath = os.path.join(target.path_ndk, "sources", "cxx-stl", "llvm-libc++", "libcxx", "libs", "mips")
|
||||
self.add_export_path( os.path.join(stdCppBasePath + "include"))
|
||||
self.add_export_flag("link", os.path.join(stdCppBasePath + "libc++_static.a"))
|
||||
self.add_path( os.path.join(stdCppBasePath + "include"))
|
||||
self.add_flag("link", os.path.join(stdCppBasePath + "libc++_static.a"))
|
||||
elif target.type_arch == "x86":
|
||||
stdCppBasePath = os.path.join(target.path_ndk, "sources", "cxx-stl", "llvm-libc++", "libcxx", "libs", "x86")
|
||||
self.add_export_path( os.path.join(stdCppBasePath, "include"))
|
||||
self.add_export_flag("link", os.path.join(stdCppBasePath, "libc++_static.a"))
|
||||
self.add_path( os.path.join(stdCppBasePath, "include"))
|
||||
self.add_flag("link", os.path.join(stdCppBasePath, "libc++_static.a"))
|
||||
else:
|
||||
debug.warning("unknow architecture: '" + str(target.arch) + "'");
|
||||
else:
|
||||
self.add_export_flag("c++", "-D__STDCPP_GNU__")
|
||||
self.add_export_flag("c++-remove","-nostdlib")
|
||||
self.add_export_flag("need-libstdc++", True)
|
||||
self.add_flag("c++", "-D__STDCPP_GNU__")
|
||||
self.add_flag("c++-remove","-nostdlib")
|
||||
self.add_flag("need-libstdc++", True)
|
||||
# GPL v3 (+ exception link for gcc compilator)
|
||||
self.add_export_path(os.path.join(target.path_ndk, "sources", "cxx-stl", "gnu-libstdc++", target.compilator_version, "include"))
|
||||
self.add_path(os.path.join(target.path_ndk, "sources", "cxx-stl", "gnu-libstdc++", target.compilator_version, "include"))
|
||||
if target.type_arch == "armv5":
|
||||
stdCppBasePath = os.path.join(target.path_ndk, "sources", "cxx-stl", "gnu-libstdc++", target.compilator_version, "libs", "armeabi")
|
||||
self.add_export_path( os.path.join(stdCppBasePath, "include"))
|
||||
self.add_export_flag("link", os.path.join(stdCppBasePath, "thumb", "libgnustl_static.a"))
|
||||
self.add_export_flag("link", os.path.join(stdCppBasePath, "thumb", "libsupc++.a"))
|
||||
self.add_path( os.path.join(stdCppBasePath, "include"))
|
||||
self.add_flag("link", os.path.join(stdCppBasePath, "thumb", "libgnustl_static.a"))
|
||||
self.add_flag("link", os.path.join(stdCppBasePath, "thumb", "libsupc++.a"))
|
||||
elif target.type_arch == "armv7":
|
||||
stdCppBasePath = os.path.join(target.path_ndk, "sources", "cxx-stl", "gnu-libstdc++", target.compilator_version, "libs", "armeabi-v7a")
|
||||
self.add_export_path( os.path.join(stdCppBasePath, "include"))
|
||||
self.add_export_flag("link", os.path.join(stdCppBasePath, "thumb", "libgnustl_static.a"))
|
||||
self.add_export_flag("link", os.path.join(stdCppBasePath, "thumb", "libsupc++.a"))
|
||||
self.add_path( os.path.join(stdCppBasePath, "include"))
|
||||
self.add_flag("link", os.path.join(stdCppBasePath, "thumb", "libgnustl_static.a"))
|
||||
self.add_flag("link", os.path.join(stdCppBasePath, "thumb", "libsupc++.a"))
|
||||
elif target.type_arch == "mips":
|
||||
stdCppBasePath = os.path.join(target.path_ndk, "sources", "cxx-stl", "gnu-libstdc++", target.compilator_version, "libs", "mips")
|
||||
self.add_export_path( os.path.join(stdCppBasePath, "include/"))
|
||||
self.add_export_flag("link", os.path.join(stdCppBasePath, "libgnustl_static.a"))
|
||||
self.add_export_flag("link", os.path.join(stdCppBasePath, "libsupc++.a"))
|
||||
self.add_path( os.path.join(stdCppBasePath, "include/"))
|
||||
self.add_flag("link", os.path.join(stdCppBasePath, "libgnustl_static.a"))
|
||||
self.add_flag("link", os.path.join(stdCppBasePath, "libsupc++.a"))
|
||||
elif target.type_arch == "x86":
|
||||
stdCppBasePath = os.path.join(target.path_ndk, "sources", "cxx-stl", "gnu-libstdc++", target.compilator_version, "libs", "x86")
|
||||
self.add_export_path( os.path.join(stdCppBasePath, "include"))
|
||||
self.add_export_flag("link", os.path.join(stdCppBasePath, "libgnustl_static.a"))
|
||||
self.add_export_flag("link", os.path.join(stdCppBasePath, "libsupc++.a"))
|
||||
self.add_path( os.path.join(stdCppBasePath, "include"))
|
||||
self.add_flag("link", os.path.join(stdCppBasePath, "libgnustl_static.a"))
|
||||
self.add_flag("link", os.path.join(stdCppBasePath, "libsupc++.a"))
|
||||
else:
|
||||
debug.warning("unknow architecture: '" + str(target.arch) + "'");
|
||||
debug.warning("plop")
|
@@ -11,16 +11,17 @@
|
||||
from lutin 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.help="M : m library \n base of std libs (availlagle in GNU C lib and bionic"
|
||||
self.set_help("M : m library \n base of std libs (availlagle in GNU C lib and bionic")
|
||||
# No check ==> on the basic std libs:
|
||||
self.valid = True
|
||||
self.set_valid(True)
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_export_flag("link-lib", "m")
|
||||
self.add_flag("link-lib", "m")
|
||||
|
||||
|
||||
|
@@ -11,16 +11,17 @@
|
||||
from lutin 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.help = "OpenGL: Generic graphic library"
|
||||
self.valid = True
|
||||
self.set_help("OpenGL: Generic graphic library")
|
||||
self.set_valid(True)
|
||||
# no check needed ==> just add this:
|
||||
self.add_module_depend([
|
||||
self.add_depend([
|
||||
'c',
|
||||
])
|
||||
"""
|
||||
@@ -30,6 +31,6 @@ class System(system.System):
|
||||
destination_path="GL",
|
||||
recursive=True)
|
||||
"""
|
||||
self.add_export_flag('link-lib', "GLESv2")
|
||||
self.add_flag('link-lib', "GLESv2")
|
||||
|
||||
|
||||
|
@@ -11,23 +11,24 @@
|
||||
from lutin 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.help="pthread : Generic multithreading system\n Can be install with the package:\n - pthread-dev"
|
||||
self.set_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
|
||||
self.set_valid(True)
|
||||
# todo : create a searcher of the presence of the library:
|
||||
#self.add_export_flag("link-lib", "pthread")
|
||||
self.add_module_depend([
|
||||
#self.add_flag("link-lib", "pthread")
|
||||
self.add_depend([
|
||||
'c'
|
||||
])
|
||||
|
||||
|
@@ -10,19 +10,20 @@
|
||||
from lutin 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.help="Z : z library \n Can be install with the package:\n - zlib1g-dev"
|
||||
self.set_help("Z : z library \n Can be install with the package:\n - zlib1g-dev")
|
||||
# check if the library exist:
|
||||
if not os.path.isfile("/usr/include/zlib.h"):
|
||||
# we did not find the library reqiested (just return) (automaticly set at false)
|
||||
return;
|
||||
self.valid = True
|
||||
self.set_valid(True)
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_export_flag("link-lib", "z")
|
||||
self.add_flag("link-lib", "z")
|
||||
|
||||
|
||||
|
@@ -11,16 +11,17 @@
|
||||
from lutin 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.help="CoreAudio : Ios interface for audio (all time present, just system interface)"
|
||||
self.valid = True
|
||||
self.set_help("CoreAudio : Ios interface for audio (all time present, just system interface)")
|
||||
self.set_valid(True)
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_export_flag("link", "-framework CoreAudio")
|
||||
self.add_export_flag("link", "-framework AudioToolbox")
|
||||
self.add_flag("link", "-framework CoreAudio")
|
||||
self.add_flag("link", "-framework AudioToolbox")
|
||||
|
||||
|
||||
|
@@ -11,17 +11,18 @@
|
||||
from lutin 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.help = "CXX: Generic C++ library"
|
||||
self.valid = True
|
||||
self.set_help("CXX: Generic C++ library")
|
||||
self.set_valid(True)
|
||||
# no check needed ==> just add this:
|
||||
self.add_export_flag("c++", "-D__STDCPP_LLVM__")
|
||||
self.add_export_flag("c++-remove", "-nostdlib")
|
||||
self.add_export_flag("need-libstdc++", True)
|
||||
self.add_flag("c++", "-D__STDCPP_LLVM__")
|
||||
self.add_flag("c++-remove", "-nostdlib")
|
||||
self.add_flag("need-libstdc++", True)
|
||||
|
||||
|
||||
|
@@ -11,16 +11,17 @@
|
||||
from lutin 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.help="M : m library \n base of std libs (availlagle in GNU C lib and bionic"
|
||||
self.set_help("M : m library \n base of std libs (availlagle in GNU C lib and bionic")
|
||||
# No check ==> on the basic std libs:
|
||||
self.valid = True
|
||||
self.set_valid(True)
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_export_flag("link-lib", "m")
|
||||
self.add_flag("link-lib", "m")
|
||||
|
||||
|
||||
|
@@ -11,23 +11,23 @@
|
||||
from lutin 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.help = "X11: Basic interface of Linux Graphic interface"
|
||||
self.valid = True
|
||||
self.set_help("X11: Basic interface of Linux Graphic interface")
|
||||
self.set_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')
|
||||
self.add_depend(['c'])
|
||||
self.add_flag('link-lib', 'X11')
|
||||
if env.get_isolate_system() == True:
|
||||
self.add_header_file([
|
||||
"/usr/include/X11/*"
|
||||
],
|
||||
destination_path="X11",
|
||||
recursive=True)
|
||||
|
||||
|
||||
|
@@ -11,33 +11,36 @@
|
||||
from lutin 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.help="ALSA : Advanced Linux Sound Architecture\n Can be install with the package:\n - libasound2-dev"
|
||||
self.set_help("ALSA : Advanced Linux Sound Architecture\n Can be install with the package:\n - libasound2-dev")
|
||||
# check if the library exist:
|
||||
if not os.path.isfile("/usr/include/alsa/asoundlib.h") \
|
||||
and not os.path.isfile("/usr/include/dssi/alsa/asoundlib.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", "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'
|
||||
])
|
||||
self.set_valid(True)
|
||||
if env.get_isolate_system() == False:
|
||||
self.add_flag("link-lib", "asound")
|
||||
else:
|
||||
self.add_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_depend([
|
||||
'c'
|
||||
])
|
||||
|
||||
|
||||
|
@@ -11,25 +11,30 @@
|
||||
from lutin 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.help="rpc : generic RPC library (developed by oracle)"
|
||||
self.set_help("rpc : generic RPC library (developed by oracle)")
|
||||
# check if the library exist:
|
||||
if not os.path.isfile("/usr/include/arpa/ftp.h"):
|
||||
# we did not find the library reqiested (just return) (automaticly set at false)
|
||||
return;
|
||||
# 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'
|
||||
])
|
||||
self.set_valid(True)
|
||||
if env.get_isolate_system() == True:
|
||||
#self.add_flag("link-lib", "xns")
|
||||
self.add_header_file([
|
||||
"/usr/include/arpa/*"
|
||||
],
|
||||
destination_path="arpa",
|
||||
recursive=True)
|
||||
self.add_depend([
|
||||
'c'
|
||||
])
|
||||
|
||||
|
||||
|
||||
|
@@ -11,24 +11,35 @@
|
||||
from lutin 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.help="BOOST : Boost interface (need when we have not all c++ feature\n Can be install with the package:\n - libboost-all-dev"
|
||||
self.set_help("BOOST : Boost interface (need when we have not all c++ feature\n Can be install with the package:\n - libboost-all-dev")
|
||||
# check if the library exist:
|
||||
if not os.path.isfile("/usr/include/boost/chrono.hpp"):
|
||||
# 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", [
|
||||
"boost_system",
|
||||
"boost_thread",
|
||||
"boost_chrono"
|
||||
])
|
||||
self.set_valid(True)
|
||||
if env.get_isolate_system() == False:
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_flag("link-lib", [
|
||||
"boost_system",
|
||||
"boost_thread",
|
||||
"boost_chrono"
|
||||
])
|
||||
else:
|
||||
self.add_header_file([
|
||||
"/usr/include/boost/*"
|
||||
],
|
||||
destination_path="boost",
|
||||
recursive=True)
|
||||
self.add_depend([
|
||||
'cxx'
|
||||
])
|
||||
|
||||
|
||||
|
||||
|
@@ -11,163 +11,165 @@
|
||||
from lutin 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.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")
|
||||
self.set_help("C: Generic C library")
|
||||
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*',
|
||||
],
|
||||
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_flag("link", "-B/usr/lib")
|
||||
|
||||
|
@@ -11,27 +11,40 @@
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import multiprocess
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.help = "CXX: Generic C++ library"
|
||||
self.valid = True
|
||||
self.set_help("CXX: Generic C++ library")
|
||||
self.set_valid(True)
|
||||
# no check needed ==> just add this:
|
||||
self.add_module_depend([
|
||||
self.add_depend([
|
||||
'c',
|
||||
'm',
|
||||
'pthread'
|
||||
])
|
||||
self.add_export_flag("c++", "-D__STDCPP_GNU__")
|
||||
#self.add_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)
|
||||
self.add_flag("c++", "-D__STDCPP_GNU__")
|
||||
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)
|
||||
|
||||
|
||||
|
@@ -11,28 +11,29 @@
|
||||
from lutin 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.help="JACK : Jack Low-Latency Audio Server\n Can be install with the package:\n - libjack-jackd2-dev (new)\n - libjack-dev (old)"
|
||||
self.set_help("JACK : Jack Low-Latency Audio Server\n Can be install with the package:\n - libjack-jackd2-dev (new)\n - libjack-dev (old)")
|
||||
# check if the library exist:
|
||||
if not os.path.isfile("/usr/include/jack/jack.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", "jack")
|
||||
self.add_module_depend([
|
||||
self.set_valid(True)
|
||||
self.add_depend([
|
||||
'uuid',
|
||||
'c'
|
||||
])
|
||||
self.add_header_file([
|
||||
"/usr/include/jack/*",
|
||||
],
|
||||
destination_path="jack",
|
||||
recursive=True)
|
||||
self.add_flag("link-lib", "jack")
|
||||
if env.get_isolate_system() == True:
|
||||
self.add_header_file([
|
||||
"/usr/include/jack/*",
|
||||
],
|
||||
destination_path="jack",
|
||||
recursive=True)
|
||||
|
||||
|
||||
|
@@ -11,25 +11,27 @@
|
||||
from lutin 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.help="M : m library \n base of std libs (availlagle in GNU C lib and bionic"
|
||||
self.set_help("M : m library \n base of std libs (availlagle in GNU C lib and bionic")
|
||||
# No check ==> on the basic std libs:
|
||||
self.valid = True
|
||||
self.set_valid(True)
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_export_flag("link-lib", "m")
|
||||
self.add_module_depend([
|
||||
self.add_flag("link-lib", "m")
|
||||
self.add_depend([
|
||||
'c'
|
||||
])
|
||||
self.add_header_file([
|
||||
"/usr/include/math.h"
|
||||
],
|
||||
clip_path="/usr/include",
|
||||
recursive=False)
|
||||
if env.get_isolate_system() == True:
|
||||
self.add_header_file([
|
||||
"/usr/include/math.h"
|
||||
],
|
||||
clip_path="/usr/include",
|
||||
recursive=False)
|
||||
|
||||
|
||||
|
||||
|
@@ -11,41 +11,42 @@
|
||||
from lutin 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.help = "OpenGL: Generic graphic library"
|
||||
self.valid = True
|
||||
self.set_help("OpenGL: Generic graphic library")
|
||||
self.set_valid(True)
|
||||
# no check needed ==> just add this:
|
||||
self.add_module_depend([
|
||||
self.add_depend([
|
||||
'c',
|
||||
'X11'
|
||||
])
|
||||
self.add_flag('link-lib', 'GL')
|
||||
if env.get_isolate_system() == True:
|
||||
self.add_header_file([
|
||||
"/usr/include/GL/*"
|
||||
],
|
||||
destination_path="GL",
|
||||
recursive=True)
|
||||
|
||||
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")
|
||||
my_module.add_flag('link-lib', "GLESv2")
|
||||
elif target.name=="Windows":
|
||||
my_module.add_module_depend([
|
||||
my_module.add_depend([
|
||||
"glew"
|
||||
])
|
||||
elif target.name=="MacOs":
|
||||
my_module.add_export_flag('link', [
|
||||
my_module.add_flag('link', [
|
||||
"-framework OpenGL"])
|
||||
elif target.name=="IOs":
|
||||
my_module.add_export_flag('link', [
|
||||
my_module.add_flag('link', [
|
||||
"-framework OpenGLES"
|
||||
])
|
||||
"""
|
||||
|
@@ -11,21 +11,22 @@
|
||||
from lutin 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.help="OSS : Linux Open Sound System\n Can be install with the package:\n - ... TODO ..."
|
||||
self.set_help("OSS : Linux Open Sound System\n Can be install with the package:\n - ... TODO ...")
|
||||
# check if the library exist:
|
||||
"""
|
||||
if not os.path.isfile("/usr/include/jack/jack.h"):
|
||||
# we did not find the library reqiested (just return) (automaticly set at false)
|
||||
return;
|
||||
self.valid = True
|
||||
self.set_valid(True)
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_export_flag("link-lib", "oss")
|
||||
self.add_flag("link-lib", "oss")
|
||||
"""
|
||||
|
||||
|
||||
|
@@ -11,27 +11,29 @@
|
||||
from lutin 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.help="pthread : Generic multithreading system\n Can be install with the package:\n - pthread-dev"
|
||||
self.set_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
|
||||
self.set_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([
|
||||
self.add_flag("link-lib", "pthread")
|
||||
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/")
|
||||
|
||||
|
||||
|
@@ -11,13 +11,14 @@
|
||||
from lutin 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.help="PULSE : The Linux PulseAudio\n Can be install with the package:\n - libpulse-dev"
|
||||
self.set_help("PULSE : The Linux PulseAudio\n Can be install with the package:\n - libpulse-dev")
|
||||
# check if the library exist:
|
||||
if not os.path.isfile("/usr/include/pulse/pulseaudio.h"):
|
||||
# we did not find the library reqiested (just return) (automaticly set at false)
|
||||
@@ -37,22 +38,28 @@ class System(system.System):
|
||||
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([
|
||||
self.set_valid(True)
|
||||
self.add_depend([
|
||||
'c'
|
||||
])
|
||||
# todo : create a searcher of the presence of the library:
|
||||
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)
|
||||
if env.get_isolate_system() == False:
|
||||
self.add_flag("link-lib", [
|
||||
"pulse-simple",
|
||||
"pulse"
|
||||
])
|
||||
else:
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_flag("link-lib", [
|
||||
"pulsecommon-" + version + ".0",
|
||||
"pulse-mainloop-glib",
|
||||
"pulse-simple",
|
||||
"pulse"
|
||||
])
|
||||
self.add_flag("link", "-L/usr/lib/pulseaudio")
|
||||
self.add_header_file([
|
||||
"/usr/include/pulse/*",
|
||||
],
|
||||
destination_path="pulse",
|
||||
recursive=True)
|
||||
|
||||
|
||||
|
@@ -11,25 +11,27 @@
|
||||
from lutin 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.help="rpc : generic RPC library (developed by oracle)"
|
||||
self.set_help("rpc : generic RPC library (developed by oracle)")
|
||||
# No check ==> on the basic std libs:
|
||||
self.valid = True
|
||||
self.add_module_depend([
|
||||
self.set_valid(True)
|
||||
self.add_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)
|
||||
self.add_flag("link-lib", "rpcsvc")
|
||||
if env.get_isolate_system() == True:
|
||||
self.add_header_file([
|
||||
"/usr/include/rpc/*"
|
||||
],
|
||||
destination_path="rpc",
|
||||
recursive=True)
|
||||
|
||||
|
||||
|
||||
|
@@ -11,27 +11,29 @@
|
||||
from lutin 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.help="uuid: Unique ID library"
|
||||
self.set_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([
|
||||
self.set_valid(True)
|
||||
self.add_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)
|
||||
self.add_flag("link-lib", "uuid")
|
||||
if env.get_isolate_system() == True:
|
||||
self.add_header_file([
|
||||
"/usr/include/uuid/*",
|
||||
],
|
||||
destination_path="uuid",
|
||||
recursive=True)
|
||||
|
||||
|
||||
|
@@ -11,26 +11,29 @@
|
||||
from lutin 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.help="Z : z library \n Can be install with the package:\n - zlib1g-dev"
|
||||
self.set_help("Z : z library \n Can be install with the package:\n - zlib1g-dev")
|
||||
# check if the library exist:
|
||||
if not os.path.isfile("/usr/include/zlib.h"):
|
||||
# we did not find the library reqiested (just return) (automaticly set at false)
|
||||
return;
|
||||
self.valid = True
|
||||
self.set_valid(True)
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_export_flag("link-lib", "z")
|
||||
self.add_module_depend([
|
||||
self.add_flag("link-lib", "z")
|
||||
self.add_depend([
|
||||
'c'
|
||||
])
|
||||
self.add_header_file([
|
||||
"/usr/include/zlib.h"
|
||||
],
|
||||
destination_path="")
|
||||
|
||||
if env.get_isolate_system() == True:
|
||||
self.add_header_file([
|
||||
"/usr/include/zlib.h"
|
||||
],
|
||||
destination_path="")
|
||||
|
||||
|
||||
|
@@ -11,15 +11,16 @@
|
||||
from lutin 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.help="CoreAudio : MacOs interface for audio (all time present, just system interface)"
|
||||
self.valid = True
|
||||
self.set_help("CoreAudio : MacOs interface for audio (all time present, just system interface)")
|
||||
self.set_valid(True)
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_export_flag("link", "-framework CoreAudio")
|
||||
self.add_export_flag("link", "-framework CoreFoundation")
|
||||
self.add_flag("link", "-framework CoreAudio")
|
||||
self.add_flag("link", "-framework CoreFoundation")
|
||||
|
||||
|
@@ -11,17 +11,18 @@
|
||||
from lutin 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.help = "CXX: Generic C++ library"
|
||||
self.valid = True
|
||||
self.set_help("CXX: Generic C++ library")
|
||||
self.set_valid(True)
|
||||
# no check needed ==> just add this:
|
||||
self.add_export_flag("c++","-D__STDCPP_LLVM__")
|
||||
self.add_export_flag("c++-remove","-nostdlib")
|
||||
self.add_export_flag("need-libstdc++", True)
|
||||
self.add_flag("c++","-D__STDCPP_LLVM__")
|
||||
self.add_flag("c++-remove","-nostdlib")
|
||||
self.add_flag("need-libstdc++", True)
|
||||
|
||||
|
||||
|
@@ -11,16 +11,17 @@
|
||||
from lutin 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.help="M : m library \n base of std libs (availlagle in GNU C lib and bionic"
|
||||
self.set_help("M : m library \n base of std libs (availlagle in GNU C lib and bionic")
|
||||
# No check ==> on the basic std libs:
|
||||
self.valid = True
|
||||
self.set_valid(True)
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_export_flag("link-lib", "m")
|
||||
self.add_flag("link-lib", "m")
|
||||
|
||||
|
||||
|
@@ -11,23 +11,24 @@
|
||||
from lutin 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.help = "CXX: Generic C++ library"
|
||||
self.valid = True
|
||||
self.set_help("CXX: Generic C++ library")
|
||||
self.set_valid(True)
|
||||
# no check needed ==> just add this:
|
||||
self.add_export_flag("c++","-D__STDCPP_GNU__")
|
||||
self.add_export_flag("c++-remove","-nostdlib")
|
||||
self.add_flag("c++","-D__STDCPP_GNU__")
|
||||
self.add_flag("c++-remove","-nostdlib")
|
||||
# force static link to prenvent many errors ...
|
||||
self.add_export_flag("link", [
|
||||
self.add_flag("link", [
|
||||
"-static-libgcc",
|
||||
"-static-libstdc++",
|
||||
"-static"
|
||||
])
|
||||
self.add_export_flag("need-libstdc++", True)
|
||||
self.add_flag("need-libstdc++", True)
|
||||
|
||||
|
||||
|
@@ -11,20 +11,21 @@
|
||||
from lutin 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.help="DirectSound : Direct sound API for windows audio interface"
|
||||
self.set_help("DirectSound : Direct sound API for windows audio interface")
|
||||
# check if the library exist:
|
||||
if not os.path.isfile("/usr/i686-w64-mingw32/include/dsound.h"):
|
||||
# we did not find the library reqiested (just return) (automaticly set at false)
|
||||
return;
|
||||
self.valid = True
|
||||
self.set_valid(True)
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_export_flag("link-lib",[
|
||||
self.add_flag("link-lib",[
|
||||
"dsound",
|
||||
"winmm",
|
||||
"ole32"
|
||||
|
@@ -11,16 +11,17 @@
|
||||
from lutin 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.help="M : m library \n base of std libs (availlagle in GNU C lib and bionic"
|
||||
self.set_help("M : m library \n base of std libs (availlagle in GNU C lib and bionic")
|
||||
# No check ==> on the basic std libs:
|
||||
self.valid = True
|
||||
self.set_valid(True)
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_export_flag("link-lib", "m")
|
||||
self.add_flag("link-lib", "m")
|
||||
|
||||
|
||||
|
@@ -151,7 +151,7 @@ class Target(target.Target):
|
||||
elif self.type_arch == "x86":
|
||||
pass
|
||||
|
||||
self.global_sysroot = "--sysroot=" + os.path.join(self.path_ndk, "platforms", "android-" + str(self.board_id), "arch-arm")
|
||||
self.sysroot = "--sysroot=" + os.path.join(self.path_ndk, "platforms", "android-" + str(self.board_id), "arch-arm")
|
||||
|
||||
self.add_flag("c", [
|
||||
"-D__ARM_ARCH_5__",
|
||||
@@ -207,12 +207,6 @@ class Target(target.Target):
|
||||
"-Wa,--noexecstack"
|
||||
])
|
||||
|
||||
def check_right_package(self, pkg_properties, value):
|
||||
for val in pkg_properties["RIGHT"]:
|
||||
if value == val:
|
||||
return True
|
||||
return False
|
||||
|
||||
def convert_name_application(self, pkg_name):
|
||||
value = pkg_name.lower()
|
||||
value = value.replace(' ', '')
|
||||
|
@@ -353,7 +353,7 @@ class Target(target.Target):
|
||||
cmdLine += ' ' + self.get_staging_path(pkg_name)
|
||||
multiprocess.run_command(cmdLine)
|
||||
|
||||
def createRandomNumber(self, len):
|
||||
def create_random_number(self, len):
|
||||
out = ""
|
||||
for iii in range(0,len):
|
||||
out += random.choice(["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"])
|
||||
@@ -378,15 +378,15 @@ class Target(target.Target):
|
||||
if tools.file_size(simulatorIdFile) < 10:
|
||||
#create the file:
|
||||
tmpFile = open(simulatorIdFile, 'w')
|
||||
tmpFile.write(self.createRandomNumber(8))
|
||||
tmpFile.write(self.create_random_number(8))
|
||||
tmpFile.write("-")
|
||||
tmpFile.write(self.createRandomNumber(4))
|
||||
tmpFile.write(self.create_random_number(4))
|
||||
tmpFile.write("-")
|
||||
tmpFile.write(self.createRandomNumber(4))
|
||||
tmpFile.write(self.create_random_number(4))
|
||||
tmpFile.write("-")
|
||||
tmpFile.write(self.createRandomNumber(4))
|
||||
tmpFile.write(self.create_random_number(4))
|
||||
tmpFile.write("-")
|
||||
tmpFile.write(self.createRandomNumber(12))
|
||||
tmpFile.write(self.create_random_number(12))
|
||||
tmpFile.flush()
|
||||
tmpFile.close()
|
||||
simulatorId = tools.file_read_data(simulatorIdFile)
|
||||
|
@@ -11,6 +11,7 @@
|
||||
from lutin import debug
|
||||
from lutin import target
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
import stat
|
||||
import re
|
||||
@@ -41,8 +42,9 @@ class Target(target.Target):
|
||||
self.pkg_path_bin = "bin"
|
||||
self.pkg_path_lib = "lib"
|
||||
self.pkg_path_license = "license"
|
||||
|
||||
self.sysroot = "--sysroot=/aDirectoryThatDoesNotExist/"
|
||||
# disable sysroot when generate build in isolated mode
|
||||
if env.get_isolate_system() == True:
|
||||
self.sysroot = "--sysroot=/aDirectoryThatDoesNotExist/"
|
||||
|
||||
|
||||
"""
|
||||
|
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.4',
|
||||
version='2.0.0',
|
||||
description='Lutin generic builder (might replace makefile, CMake ...)',
|
||||
long_description=readme(),
|
||||
url='http://github.com/HeeroYui/lutin',
|
||||
|
Reference in New Issue
Block a user