Compare commits
119 Commits
Author | SHA1 | Date | |
---|---|---|---|
f2060d4c97 | |||
cfde4a549f | |||
72e956f06a | |||
058c425feb | |||
7e6f391dbf | |||
e25ceee5a8 | |||
42e3deed44 | |||
f0690cd75a | |||
acc69912a0 | |||
73a230826b | |||
da8233d34e | |||
27f6a95d41 | |||
71e0f242bf | |||
092843cd02 | |||
3b37e78dd3 | |||
94d8b82321 | |||
4c883f177c | |||
b6a5f7e539 | |||
fb4b03a441 | |||
ed3a26a638 | |||
2a9f3feed7 | |||
e148a7e204 | |||
13e6d98ac4 | |||
45bd6e6213 | |||
82e8946227 | |||
aa96a415b5 | |||
52729c3c71 | |||
62d084b351 | |||
1c76227b27 | |||
f46c5116b1 | |||
1cf731910d | |||
a2fdd6eef9 | |||
9c9809c359 | |||
3bea09cfc2 | |||
cc397679bb | |||
33688801bb | |||
6440dc6309 | |||
e1e896fcc1 | |||
8c85a2ea09 | |||
082556e591 | |||
604078f1c0 | |||
40d2e8eac1 | |||
2ebe27a5a4 | |||
dff87a00ee | |||
9fc593fb59 | |||
dc42a8e14b | |||
97f7566a7e | |||
bf6fde3770 | |||
97db63bcfd | |||
43c7947b95 | |||
1c32b7089a | |||
760a589cbe | |||
d38ecf5432 | |||
7e44373f79 | |||
3804de2078 | |||
8fa25bb8ec | |||
beb97f4bed | |||
47dcca5578 | |||
dde9c9c280 | |||
598d301284 | |||
520f97c7f6 | |||
e4b69d17f4 | |||
42be4afd0a | |||
1fa860e5b3 | |||
87a4106101 | |||
1ec07b9446 | |||
5995effd9e | |||
43c0ec2535 | |||
31fb9818ff | |||
83d7154254 | |||
55609b904c | |||
4beda0dd23 | |||
236f19bf36 | |||
fe75da7ef9 | |||
e1728a4d8d | |||
c6ea16d046 | |||
b645f087f3 | |||
6e69681480 | |||
14114158aa | |||
618825ac76 | |||
2a0bdd9e90 | |||
3b2c888fad | |||
77358efa48 | |||
f069299a53 | |||
c962b4fb9f | |||
5d92a27738 | |||
c35e1d3a24 | |||
7c664f156d | |||
198513660e | |||
61db92894a | |||
a9dd50575a | |||
d21217bfc4 | |||
9b9c65d036 | |||
055a37bcd5 | |||
6c3f96c2a9 | |||
1200434b97 | |||
6c431ad300 | |||
8a72df67c6 | |||
7360adce0b | |||
5065c7b6ee | |||
b497e09dd0 | |||
75d1490a59 | |||
ddff6f82b9 | |||
4067d6266e | |||
fcd357e452 | |||
3c186dc92e | |||
0b33c94680 | |||
6c416c9fef | |||
fc6493f441 | |||
16c019ac5b | |||
328681d44b | |||
fbf7d2dbad | |||
5f008a153e | |||
4d82e31d40 | |||
c913e19ccf | |||
62ac51e78b | |||
ce407605c9 | |||
8336411ec2 | |||
fd58b31c26 |
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
|
69
.travis.yml
Normal file
69
.travis.yml
Normal file
@@ -0,0 +1,69 @@
|
||||
#language: python
|
||||
|
||||
sudo: false
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- dev
|
||||
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- g++-4.9
|
||||
- expect
|
||||
- binutils-mingw-w64-i686 # 32bit MinGW
|
||||
- gcc-mingw-w64-i686
|
||||
- g++-mingw-w64-i686
|
||||
- binutils-mingw-w64-x86-64 # 64bit MinGW
|
||||
- gcc-mingw-w64-x86-64
|
||||
- g++-mingw-w64-x86-64
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- os: linux
|
||||
env: CONF=release BUILDER=gcc TARGET=Linux TAG=Linux
|
||||
compiler: gcc
|
||||
- os: linux
|
||||
env: CONF=debug BUILDER=clang TARGET=Linux
|
||||
compiler: clang
|
||||
- os: linux
|
||||
env: CONF=release BUILDER=gcc TARGET=Windows TAG=Mingw
|
||||
compiler: gcc
|
||||
- os: linux
|
||||
env: CONF=release BUILDER=gcc TARGET=Android TAG=Android DISABLE_PACKAGE=-p
|
||||
compiler: gcc
|
||||
- os: osx
|
||||
env: CONF=release BUILDER=clang TARGET=MacOs TAG=MacOs
|
||||
compiler: clang
|
||||
- os: osx
|
||||
env: CONF=release BUILDER=clang TARGET=IOs TAG=IOs
|
||||
compiler: clang
|
||||
|
||||
install:
|
||||
- cd ..
|
||||
# download NDK
|
||||
- if [ "$TAG" == "Android" ]; then
|
||||
git clone --depth 1 --branch master https://github.com/HeeroYui/android-download-tool;
|
||||
./android-download-tool/dl-android.sh;
|
||||
fi
|
||||
- git clone --depth 1 --branch master https://github.com/atria-soft/ci.git
|
||||
- cd -
|
||||
|
||||
before_script:
|
||||
- ./setup.py build
|
||||
- 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/
|
||||
- cd ..
|
||||
- pwd
|
||||
- ls -l *
|
||||
- ./ci/build_send.py --tag=$TAG --status=START;
|
||||
|
||||
script:
|
||||
- ./lutin/build/scripts-2.7/lutin -w -j4 -C -P -t$TARGET -c $BUILDER $COMPILATOR_OPTION $BUS -m $CONF $GCOV $DISABLE_PACKAGE test-c; STATUS=$?
|
||||
- ./ci/build_send.py --tag=$TAG --status="$STATUS";
|
||||
|
||||
notifications:
|
||||
email:
|
||||
- yui.heero@gmail.com
|
18
README.rst
18
README.rst
@@ -3,9 +3,25 @@ Lutin
|
||||
|
||||
`lutin` is a generic builder and package maker is a FREE software tool.
|
||||
|
||||
|
||||
.. image:: https://badge.fury.io/py/lutin.png
|
||||
:target: https://pypi.python.org/pypi/lutin
|
||||
|
||||
Release (master)
|
||||
----------------
|
||||
|
||||
.. image:: https://travis-ci.org/HeeroYui/lutin.svg?branch=master
|
||||
:target: https://travis-ci.org/HeeroYui/lutin
|
||||
|
||||
|
||||
|
||||
Developement (dev)
|
||||
------------------
|
||||
|
||||
.. image:: https://travis-ci.org/HeeroYui/lutin.svg?branch=dev
|
||||
:target: https://travis-ci.org/HeeroYui/lutin
|
||||
|
||||
|
||||
Instructions
|
||||
------------
|
||||
|
||||
@@ -27,7 +43,7 @@ http://github.com/HeeroYui/lutin/
|
||||
Documentation
|
||||
-------------
|
||||
|
||||
http://github.io/HeeroYui/lutin/
|
||||
http://HeeroYui.github.io/lutin/
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
231
bin/lutin
231
bin/lutin
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
@@ -10,6 +11,8 @@
|
||||
# for path inspection:
|
||||
import sys
|
||||
import os
|
||||
import copy
|
||||
import lutin
|
||||
import lutin.debug as debug
|
||||
import lutin.arg as arguments
|
||||
import lutin.host as host
|
||||
@@ -17,31 +20,37 @@ import lutin.module as module
|
||||
import lutin.target as target
|
||||
import lutin.env as env
|
||||
import lutin.multiprocess as multiprocess
|
||||
import lutin.tools as tools
|
||||
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("s", "force-strip", desc="Force the stripping of the compile elements"))
|
||||
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 " + lutinHost.HOST_DEFAULT_COMPILATOR + " 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()
|
||||
@@ -66,7 +75,8 @@ def usage(full=False):
|
||||
for mod in listOfAllModule:
|
||||
data_print = " "
|
||||
if full == False:
|
||||
if mod["type"][:6] == "BINARY":
|
||||
if mod["type"] != None \
|
||||
and mod["type"][:6] == "BINARY":
|
||||
data_print += color['blue']
|
||||
if mod["sub-type"] == "":
|
||||
data_print += "* "
|
||||
@@ -78,9 +88,11 @@ def usage(full=False):
|
||||
data_print += "S "
|
||||
else:
|
||||
data_print += " "
|
||||
elif mod["type"] == "PACKAGE":
|
||||
elif mod["type"] != None \
|
||||
and mod["type"] == "PACKAGE":
|
||||
data_print += color['red'] + "# "
|
||||
elif mod["type"][:7] == "LIBRARY":
|
||||
elif mod["type"] != None \
|
||||
and mod["type"][:7] == "LIBRARY":
|
||||
data_print += color['yellow'] + " "
|
||||
else:
|
||||
data_print += color['default'] + " "
|
||||
@@ -89,9 +101,11 @@ def usage(full=False):
|
||||
data_print += mod["name"] + color['default']
|
||||
if full == False:
|
||||
data_print += "\r\t\t\t\t\t\t\t"
|
||||
if mod["license"] != "":
|
||||
if mod["license"] != None \
|
||||
and mod["license"] != "":
|
||||
data_print += color['yellow'] + " [" + mod["license"] + "]" + color['default']
|
||||
if mod["version"] != []:
|
||||
if mod["version"] != None \
|
||||
and mod["version"] != []:
|
||||
version_ID = tools.version_to_string(mod["version"])
|
||||
data_print += color['blue'] + " (" + version_ID + ")" + color['default']
|
||||
"""
|
||||
@@ -106,11 +120,14 @@ def usage(full=False):
|
||||
if mod["description"] != "":
|
||||
print(" " + mod["description"])
|
||||
if full == True:
|
||||
if mod["type"] != "":
|
||||
if mod["type"] != None \
|
||||
and mod["type"] != "":
|
||||
print(" Type: " + mod["type"])
|
||||
if mod["sub-type"] != "":
|
||||
if mod["sub-type"] != None \
|
||||
and mod["sub-type"] != "":
|
||||
print(" Sub-Type: " + mod["sub-type"])
|
||||
if mod["version"] != []:
|
||||
if mod["version"] != None \
|
||||
and mod["version"] != []:
|
||||
version_ID = ""
|
||||
for id in mod["version"]:
|
||||
if len(version_ID) != 0:
|
||||
@@ -120,22 +137,37 @@ def usage(full=False):
|
||||
version_ID+="."
|
||||
version_ID += str(id)
|
||||
print(" version: " + color['blue'] + version_ID + color['default'])
|
||||
if mod["compagny-type"] != "" \
|
||||
if mod["compagny-type"] != None \
|
||||
and mod["compagny-name"] != None \
|
||||
and mod["compagny-type"] != "" \
|
||||
and mod["compagny-name"] != "":
|
||||
print(" compagny: " + color['purple'] + mod["compagny-type"] + "/" + mod["compagny-name"] + color['default'])
|
||||
elif mod["compagny-name"] != "":
|
||||
elif mod["compagny-name"] != None \
|
||||
and mod["compagny-name"] != "":
|
||||
print(" compagny: " + color['purple'] + mod["compagny-name"] + color['default'])
|
||||
if mod["license"] != "":
|
||||
if mod["license"] != None \
|
||||
and mod["license"] != "":
|
||||
print(" license: " + color['yellow'] + mod["license"] + color['default'])
|
||||
if mod["maintainer"] != []:
|
||||
if mod["maintainer"] != None \
|
||||
and mod["maintainer"] != []:
|
||||
print(" maintainers:")
|
||||
for elem in mod["maintainer"]:
|
||||
print(" " + str(elem))
|
||||
print(" ex: " + sys.argv[0] + " all --target=Android all -t Windows -m debug all")
|
||||
exit(0)
|
||||
|
||||
def check_boolean(value):
|
||||
if value == "" \
|
||||
or value == "1" \
|
||||
or value == "true" \
|
||||
or value == "True" \
|
||||
or value == True:
|
||||
return True
|
||||
return False
|
||||
|
||||
# preparse the argument to get the verbose element for debug mode
|
||||
def parseGenericArg(argument, active):
|
||||
debug.extreme_verbose("parse arg : " + argument.get_option_name() + " " + argument.get_arg() + " active=" + str(active))
|
||||
if argument.get_option_name() == "help":
|
||||
if active==False:
|
||||
usage()
|
||||
@@ -170,47 +202,128 @@ def parseGenericArg(argument, active):
|
||||
if active==True:
|
||||
multiprocess.set_core_number(int(argument.get_arg()))
|
||||
return True
|
||||
elif argument.get_option_name()=="depth":
|
||||
if active==True:
|
||||
env.set_parse_depth(int(argument.get_arg()))
|
||||
return True
|
||||
elif argument.get_option_name() == "verbose":
|
||||
if active==True:
|
||||
debug.set_level(int(argument.get_arg()))
|
||||
return True
|
||||
elif argument.get_option_name() == "color":
|
||||
if active==True:
|
||||
debug.enable_color()
|
||||
if check_boolean(argument.get_arg()) == True:
|
||||
debug.enable_color()
|
||||
else:
|
||||
debug.disable_color()
|
||||
return True
|
||||
elif argument.get_option_name() == "force":
|
||||
elif argument.get_option_name() == "force-build":
|
||||
if active==True:
|
||||
env.set_force_mode(True)
|
||||
if check_boolean(argument.get_arg()) == True:
|
||||
env.set_force_mode(True)
|
||||
else:
|
||||
env.set_force_mode(False)
|
||||
return True
|
||||
elif argument.get_option_name() == "pretty":
|
||||
if active==True:
|
||||
env.set_print_pretty_mode(True)
|
||||
if check_boolean(argument.get_arg()) == True:
|
||||
env.set_print_pretty_mode(True)
|
||||
else:
|
||||
env.set_print_pretty_mode(False)
|
||||
return True
|
||||
elif argument.get_option_name() == "force-optimisation":
|
||||
if active==True:
|
||||
if check_boolean(argument.get_arg()) == True:
|
||||
env.set_force_optimisation(True)
|
||||
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:
|
||||
env.set_force_strip_mode(True)
|
||||
if check_boolean(argument.get_arg()) == True:
|
||||
env.set_force_strip_mode(True)
|
||||
else:
|
||||
env.set_force_strip_mode(False)
|
||||
return True
|
||||
elif argument.get_option_name() == "warning":
|
||||
if active==True:
|
||||
env.set_warning_mode(True)
|
||||
if check_boolean(argument.get_arg()) == True:
|
||||
env.set_warning_mode(True)
|
||||
else:
|
||||
env.set_warning_mode(False)
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
# open configuration of lutin:
|
||||
config_file_name = "lutinConfig.py"
|
||||
config_file = os.path.join(tools.get_run_path(), config_file_name)
|
||||
if os.path.isfile(config_file) == True:
|
||||
sys.path.append(os.path.dirname(config_file))
|
||||
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)
|
||||
|
||||
|
||||
|
||||
# parse default unique argument:
|
||||
for argument in localArgument:
|
||||
parseGenericArg(argument, True)
|
||||
|
||||
|
||||
import lutin
|
||||
|
||||
|
||||
import lutin.host as lutinHost
|
||||
import lutin.tools as lutinTools
|
||||
# initialize the system ...
|
||||
lutin.init()
|
||||
|
||||
#available target : Linux / MacOs / Windows / Android ...
|
||||
targetName = host.OS
|
||||
config = {
|
||||
"compilator":"gcc",
|
||||
"compilator":lutinHost.HOST_DEFAULT_COMPILATOR,
|
||||
"mode":"release",
|
||||
"bus-size":"auto",
|
||||
"arch":"auto",
|
||||
@@ -251,7 +364,7 @@ for argument in localArgument:
|
||||
debug.debug("change target ==> '" + targetName + "' & reset mode : gcc&release")
|
||||
#reset properties by defauult:
|
||||
config = {
|
||||
"compilator":"gcc",
|
||||
"compilator":lutinHost.HOST_DEFAULT_COMPILATOR,
|
||||
"mode":"release",
|
||||
"bus-size":"auto",
|
||||
"arch":"auto",
|
||||
@@ -269,14 +382,34 @@ for argument in localArgument:
|
||||
#remove previous target
|
||||
my_target = None
|
||||
else:
|
||||
argument_value = argument.get_arg()
|
||||
debug.debug("something request : '" + argument_value + "'")
|
||||
if argument.get_option_name() != "":
|
||||
debug.warning("Can not understand argument : '" + argument.get_option_nName() + "'")
|
||||
debug.warning("Can not understand argument : '" + argument.get_option_name() + "'")
|
||||
usage()
|
||||
break;
|
||||
name2 = argument_value.replace("@", "?")
|
||||
gettedElement = name2.split("?")
|
||||
module_name = gettedElement[0]
|
||||
action_list = gettedElement[1:]
|
||||
if len(action_list) == 0:
|
||||
action_list = "build"
|
||||
debug.debug("requested: '" + module_name + "' ? actions:'" + str(action_list) + "'")
|
||||
multiple_module_list = []
|
||||
if module_name[-1] == "*":
|
||||
base_name = module_name[:-1]
|
||||
for mod in module.list_all_module():
|
||||
if mod[:len(base_name)] == base_name:
|
||||
debug.verbose("need do it for: " + mod);
|
||||
multiple_module_list.append(mod)
|
||||
else:
|
||||
multiple_module_list.append(module_name)
|
||||
debug.debug("Will do: '" + str(multiple_module_list) + "' ? actions:'" + str(action_list) + "'")
|
||||
for module_name in multiple_module_list:
|
||||
#load the target if needed :
|
||||
if my_target == None:
|
||||
my_target = target.load_target(targetName, config)
|
||||
my_target.build(argument.get_arg())
|
||||
my_target = target.load_target(targetName, copy.deepcopy(config))
|
||||
my_target.build(module_name, actions=action_list)
|
||||
actionDone=True
|
||||
|
||||
# if no action done : we do "all" ...
|
||||
|
@@ -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:
|
||||
|
||||
```{.sh}
|
||||
git clone http://github.con/atria-soft/etk.git
|
||||
```
|
||||
|
||||
|
||||
compile a module: {#lutin_use_compile}
|
||||
=================
|
||||
|
||||
It is really simple:
|
||||
|
||||
```{.sh}
|
||||
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 ...
|
||||
|
||||
```{.sh}
|
||||
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}
|
||||
---------------
|
||||
|
||||
```{.sh}
|
||||
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:
|
||||
```{.sh}
|
||||
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:
|
||||
|
||||
```{.sh}
|
||||
lutin -P
|
||||
lutin --pretty
|
||||
```
|
||||
|
||||
result:
|
||||
```{.sh}
|
||||
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:
|
||||
|
||||
```{.sh}
|
||||
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:
|
||||
|
||||
```{.sh}
|
||||
#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:
|
||||
|
||||
```{.sh}
|
||||
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)
|
||||
|
||||
```{.sh}
|
||||
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:
|
||||
|
||||
```{.sh}
|
||||
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
|
||||
|
||||
```{.sh}
|
||||
lutin -m debug your-module
|
||||
lutin -m release your-module
|
||||
```
|
||||
|
||||
You can desire to have compilation optimisation when you build in debug mode:
|
||||
|
||||
```{.sh}
|
||||
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:
|
||||
|
||||
```{.sh}
|
||||
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
|
||||
|
502
doc/030_Create_a_new_module.md
Normal file
502
doc/030_Create_a_new_module.md
Normal file
@@ -0,0 +1,502 @@
|
||||
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:
|
||||
|
||||
```{.sh}
|
||||
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:
|
||||
|
||||
```{.py}
|
||||
#!/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] my_module Module handle that migh be configured
|
||||
# @return True The module is welled configure
|
||||
# @return False The module is Not availlable (for this target or ...)
|
||||
def configure(target, my_module):
|
||||
...
|
||||
return True
|
||||
```
|
||||
|
||||
Thes it is simple to specify build for:
|
||||
|
||||
Create a new Module (LIBRARY): {#lutin_module_library}
|
||||
==============================
|
||||
|
||||
What to change:
|
||||
```{.py}
|
||||
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:
|
||||
```{.py}
|
||||
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:
|
||||
```{.py}
|
||||
def get_type():
|
||||
return "BINARY"
|
||||
|
||||
def get_sub_type():
|
||||
return "TEST"
|
||||
```
|
||||
or:
|
||||
```{.py}
|
||||
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:
|
||||
```{.py}
|
||||
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)
|
||||
|
||||
```{.py}
|
||||
def configure(target, my_module):
|
||||
...
|
||||
|
||||
# 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:
|
||||
```{.py}
|
||||
def configure(target, my_module):
|
||||
...
|
||||
|
||||
my_module.add_header_file([
|
||||
'module-name/file1.h',
|
||||
'module-name/file2.h'
|
||||
])
|
||||
|
||||
...
|
||||
```
|
||||
|
||||
You can add a path to your local include:
|
||||
```{.py}
|
||||
def configure(target, my_module):
|
||||
...
|
||||
|
||||
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:
|
||||
```{.py}
|
||||
def configure(target, my_module):
|
||||
...
|
||||
|
||||
# add dependency of the generic C library:
|
||||
my_module.add_depend('c')
|
||||
# add dependency of the generic C++ library:
|
||||
my_module.add_depend('cxx')
|
||||
# add dependency of the generic math library:
|
||||
my_module.add_depend('m')
|
||||
# or other user lib:
|
||||
my_module.add_depend('lib-name')
|
||||
|
||||
...
|
||||
```
|
||||
|
||||
The system can have optinnal sub-library, then if you just want to add an optionnal dependency:
|
||||
```{.py}
|
||||
def configure(target, my_module):
|
||||
...
|
||||
|
||||
# Add an optionnal dependency (set flag in CPP build if the subLib exist) ==> flag is locally set
|
||||
my_module.add_optionnal_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_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):
|
||||
```{.py}
|
||||
def configure(target, my_module):
|
||||
...
|
||||
# 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:
|
||||
```{.py}
|
||||
def configure(target, my_module):
|
||||
...
|
||||
|
||||
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:
|
||||
|
||||
```{.py}
|
||||
def configure(target, my_module):
|
||||
...
|
||||
|
||||
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:
|
||||
|
||||
```{.py}
|
||||
def configure(target, my_module):
|
||||
...
|
||||
|
||||
# copy file in the share/binanyName/ path (no sub path)
|
||||
my_module.copy_path('data/icon.svg')
|
||||
|
||||
...
|
||||
```
|
||||
|
||||
Copy multiple files (change path)
|
||||
|
||||
```{.py}
|
||||
def configure(target, my_module):
|
||||
...
|
||||
|
||||
my_module.copy_path('data/*', 'destinationPath')
|
||||
|
||||
...
|
||||
```
|
||||
|
||||
display some debug to help writing code: {#lutin_module_internal_write_log}
|
||||
----------------------------------------
|
||||
|
||||
|
||||
```{.py}
|
||||
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:
|
||||
```{.sh}
|
||||
lutin_module-name.py
|
||||
```
|
||||
|
||||
With:
|
||||
```{.py}
|
||||
#!/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>"]
|
||||
# return "authors.txt"
|
||||
|
||||
# Version of the library
|
||||
# Note: this fucntion is optionnal.
|
||||
def get_version():
|
||||
return [0,1,"dev"]
|
||||
# return "version.txt"
|
||||
|
||||
# create the module
|
||||
# @param[in] target reference on the Target that is currently build
|
||||
# @param[in] my_module Module handle that migh be configured
|
||||
# @return True The module is welled configure
|
||||
# @return False The module is Not availlable (for this target or ...)
|
||||
def configure(target, my_module):
|
||||
|
||||
# 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_depend('c')
|
||||
# add dependency of the generic C++ library:
|
||||
my_module.add_depend('cxx')
|
||||
# add dependency of the generic math library:
|
||||
my_module.add_depend('m')
|
||||
# or other user lib:
|
||||
my_module.add_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_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_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_flag('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 True if the module is compatible with the target or ...
|
||||
return True
|
||||
```
|
||||
|
||||
|
||||
**Index:**
|
||||
- @ref mainpage
|
||||
- @ref lutin_concept
|
||||
- @ref lutin_use
|
||||
- @ref lutin_module
|
||||
|
112
doc/100_Use_on_Ios.md
Normal file
112
doc/100_Use_on_Ios.md
Normal file
@@ -0,0 +1,112 @@
|
||||
Build and deploy for IOS {#lutin_ios}
|
||||
========================
|
||||
|
||||
@tableofcontents
|
||||
|
||||
Deploy on IOs is a little complicated, due to the fact Apple demand a developper licence.
|
||||
|
||||
To deploy you need to buy a [developper licence](https://developer.apple.com/account) nearly 99€ / year
|
||||
|
||||
Step 1: deploy your application with Xcode {#lutin_ios_xcode}
|
||||
==========================================
|
||||
|
||||
it can be conplicated to do the first deploy (register tablette:watch ... or user ...)
|
||||
Then the best way is now to create your first game sample application with XCode and deploy it on your device ...
|
||||
|
||||
|
||||
when all your problem are solved, I can help you...
|
||||
|
||||
**Note:**
|
||||
|
||||
```
|
||||
To add a device, in xcode select your top project, and in the section "signing" select "automatic manage signing", select your team and activate your device ...
|
||||
```
|
||||
|
||||
|
||||
step 2: Build for IOs {#lutin_ios_build}
|
||||
=====================
|
||||
|
||||
This step is simpliest... All is integrated:
|
||||
|
||||
Select the target IOs
|
||||
|
||||
```{.sh}
|
||||
lutin -C -D -tIOs yourApplication?build
|
||||
```
|
||||
|
||||
This is done .... now deploy ...
|
||||
|
||||
|
||||
|
||||
step 3: Deploy {#lutin_ios_deploy}
|
||||
==============
|
||||
|
||||
Do it ... it does not work ...
|
||||
|
||||
```{.sh}
|
||||
lutin -C -D -tIOs yourApplication?install
|
||||
```
|
||||
|
||||
Appliocation ID
|
||||
---------------
|
||||
|
||||
It miss some things to do:
|
||||
|
||||
create a reference of you application in [apple interface](https://developer.apple.com/account/ios/identifier/bundle/create)
|
||||
|
||||
|
||||
your application id is:
|
||||
|
||||
```{.py}
|
||||
get_compagny_type() + "." + get_compagny_name() + "." + module.get_name()
|
||||
```
|
||||
|
||||
For example if you module is named: ```lutin_application.py```
|
||||
|
||||
And you set description:
|
||||
|
||||
```{.py}
|
||||
def get_compagny_type():
|
||||
return "com"
|
||||
|
||||
def get_compagny_name():
|
||||
return "compagny NAME"
|
||||
|
||||
```
|
||||
|
||||
your id is: ```com.compagnyname.application```
|
||||
|
||||
|
||||
When you have create the application, it will generate for you a unique ID, you can see it on the webpage, it is like: ```DFGDSFGSDFGS.com.compagnyname.application```
|
||||
|
||||
In your module definition you need to add:
|
||||
```{.py}
|
||||
my_module.set_pkg("APPLE_APPLICATION_IOS_ID", "DFGDSFGSDFGS");
|
||||
```
|
||||
|
||||
Team signing ID
|
||||
---------------
|
||||
|
||||
the second point to do is creating the file: ```.iosKey.txt``` in you root path of your workspace (where you execute lutin)
|
||||
|
||||
it will contain sothing like:
|
||||
```
|
||||
'iPhone Developer: Francis DUGENOUX (YRRQE5KGTH)'
|
||||
|
||||
```
|
||||
|
||||
you can optain it with executing:
|
||||
```{.sh}
|
||||
certtool y | grep "Developer"
|
||||
```
|
||||
|
||||
|
||||
|
||||
Install:
|
||||
--------
|
||||
|
||||
Now it works ...
|
||||
|
||||
```{.sh}
|
||||
lutin -C -D -tIOs yourApplication?build
|
||||
```
|
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]]
|
144
doc/mainpage.md
Normal file
144
doc/mainpage.md
Normal file
@@ -0,0 +1,144 @@
|
||||
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:
|
||||
```{.sh}
|
||||
pip install lutin
|
||||
```
|
||||
|
||||
Install pip:
|
||||
------------
|
||||
|
||||
Install pip on debian/ubuntu:
|
||||
```{.sh}
|
||||
sudo apt-get install pip
|
||||
```
|
||||
|
||||
Install pip on ARCH-linux:
|
||||
```{.sh}
|
||||
sudo pacman -S pip
|
||||
```
|
||||
|
||||
Install pip on MacOs:
|
||||
```{.sh}
|
||||
sudo easy_install pip
|
||||
```
|
||||
|
||||
Install from sources:
|
||||
---------------------
|
||||
|
||||
```{.sh}
|
||||
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
|
||||
- @ref lutin_ios
|
||||
|
||||
|
||||
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.
|
||||
|
||||
|
||||
[link macos account developper](https://developer.apple.com/library/content/documentation/IDEs/Conceptual/AppStoreDistributionTutorial/AddingYourAccounttoXcode/AddingYourAccounttoXcode.html)
|
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,2,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
|
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
@@ -8,6 +9,7 @@
|
||||
##
|
||||
import os
|
||||
import sys
|
||||
import fnmatch
|
||||
# Local import
|
||||
from . import target
|
||||
from . import builder
|
||||
@@ -16,32 +18,138 @@ from . import host
|
||||
from . import tools
|
||||
from . import debug
|
||||
from . import module
|
||||
|
||||
from . import env
|
||||
is_init = False
|
||||
|
||||
if is_init == False:
|
||||
|
||||
def filter_name_and_file(root, list_files, filter):
|
||||
# filter elements:
|
||||
tmp_list = fnmatch.filter(list_files, filter)
|
||||
out = []
|
||||
for elem in tmp_list:
|
||||
if os.path.isfile(os.path.join(root, elem)) == True:
|
||||
out.append(elem);
|
||||
return out;
|
||||
|
||||
def filter_path(root, list_files):
|
||||
out = []
|
||||
for elem in list_files:
|
||||
if len(elem) == 0 \
|
||||
or elem[0] == '.':
|
||||
continue
|
||||
if os.path.isdir(os.path.join(root, elem)) == True:
|
||||
out.append(elem);
|
||||
return out;
|
||||
|
||||
def import_path_local(path, limit_sub_folder, exclude_path = [], base_name = ""):
|
||||
out = []
|
||||
debug.verbose("lutin files: " + str(path) + " [START]")
|
||||
if limit_sub_folder == 0:
|
||||
debug.debug("Subparsing limitation append ...")
|
||||
return []
|
||||
try:
|
||||
list_files = os.listdir(path)
|
||||
except:
|
||||
# an error occure, maybe read error ...
|
||||
debug.warning("error when getting subdirectory of '" + str(path) + "'")
|
||||
return []
|
||||
if path in exclude_path:
|
||||
debug.debug("find '" + str(path) + "' in exclude_path=" + str(exclude_path))
|
||||
return []
|
||||
# filter elements:
|
||||
tmp_list_lutin_file = filter_name_and_file(path, list_files, base_name + "*.py")
|
||||
debug.verbose("lutin files: " + str(path) + " : " + str(tmp_list_lutin_file))
|
||||
# Import the module:
|
||||
for filename in tmp_list_lutin_file:
|
||||
out.append(os.path.join(path, filename))
|
||||
debug.extreme_verbose(" Find a file : '" + str(out[-1]) + "'")
|
||||
need_parse_sub_folder = True
|
||||
rm_value = -1
|
||||
# check if we need to parse sub_folder
|
||||
if len(tmp_list_lutin_file) != 0:
|
||||
need_parse_sub_folder = False
|
||||
# check if the file "lutin_parse_sub.py" is present ==> parse SubFolder (force and add +1 in the resursing
|
||||
if base_name + "ParseSubFolders.txt" in list_files:
|
||||
debug.debug("find SubParser ... " + str(base_name + "ParseSubFolders.txt") + " " + path)
|
||||
data_file_sub = tools.file_read_data(os.path.join(path, base_name + "ParseSubFolders.txt"))
|
||||
if data_file_sub == "":
|
||||
debug.debug(" Empty file Load all subfolder in the worktree in '" + str(path) + "'")
|
||||
need_parse_sub_folder = True
|
||||
rm_value = 0
|
||||
else:
|
||||
list_sub = data_file_sub.split("\n")
|
||||
debug.debug(" Parse selected folders " + str(list_sub) + " no parse local folder directory")
|
||||
need_parse_sub_folder = False
|
||||
for folder in list_sub:
|
||||
if folder == "" \
|
||||
or folder == "/":
|
||||
continue;
|
||||
tmp_out = import_path_local(os.path.join(path, folder),
|
||||
1,
|
||||
exclude_path,
|
||||
base_name)
|
||||
# add all the elements:
|
||||
for elem in tmp_out:
|
||||
out.append(elem)
|
||||
if need_parse_sub_folder == True:
|
||||
list_folders = filter_path(path, list_files)
|
||||
for folder in list_folders:
|
||||
tmp_out = import_path_local(os.path.join(path, folder),
|
||||
limit_sub_folder - rm_value,
|
||||
exclude_path,
|
||||
base_name)
|
||||
# add all the elements:
|
||||
for elem in tmp_out:
|
||||
out.append(elem)
|
||||
return out
|
||||
|
||||
|
||||
def init():
|
||||
global is_init;
|
||||
if is_init == True:
|
||||
return
|
||||
debug.verbose("Use Make as a make stadard")
|
||||
sys.path.append(tools.get_run_path())
|
||||
builder.import_path(tools.get_current_path(__file__))
|
||||
module.import_path(tools.get_current_path(__file__))
|
||||
system.import_path(tools.get_current_path(__file__))
|
||||
target.import_path(tools.get_current_path(__file__))
|
||||
|
||||
debug.debug("missing file lutinBase.py ==> loading subPath...");
|
||||
# create the list of basic folder:
|
||||
basic_folder_list = []
|
||||
basic_folder_list.append([tools.get_current_path(__file__), True])
|
||||
# Import all sub path without out and archive
|
||||
for path in os.listdir("."):
|
||||
if os.path.isdir(path)==True:
|
||||
if path.lower()!="android" \
|
||||
and path.lower()!="archive" \
|
||||
and path.lower()!="out" :
|
||||
debug.debug("Automatic load path: '" + path + "'")
|
||||
builder.import_path(path)
|
||||
module.import_path(path)
|
||||
system.import_path(path)
|
||||
target.import_path(path)
|
||||
for elem_path in os.listdir("."):
|
||||
if os.path.isdir(elem_path) == False:
|
||||
continue
|
||||
if elem_path.lower() == "android" \
|
||||
or elem_path == "out" :
|
||||
continue
|
||||
debug.debug("Automatic load path: '" + elem_path + "'")
|
||||
basic_folder_list.append([elem_path, False])
|
||||
|
||||
# create in a single path the basic list of lutin files (all start with lutin and end with .py)
|
||||
exclude_path = env.get_exclude_search_path()
|
||||
limit_sub_folder = env.get_parse_depth()
|
||||
list_of_lutin_files = []
|
||||
for elem_path, is_system in basic_folder_list:
|
||||
if is_system == True:
|
||||
limit_sub_folder_tmp = 999999
|
||||
else:
|
||||
limit_sub_folder_tmp = limit_sub_folder
|
||||
tmp_out = import_path_local(elem_path,
|
||||
limit_sub_folder_tmp,
|
||||
exclude_path,
|
||||
env.get_build_system_base_name())
|
||||
# add all the elements:
|
||||
for elem in tmp_out:
|
||||
list_of_lutin_files.append(elem)
|
||||
|
||||
debug.debug("Files specific lutin: ")
|
||||
for elem_path in list_of_lutin_files:
|
||||
debug.debug(" " + elem_path)
|
||||
# simply import element from the basic list of files (single parse ...)
|
||||
builder.import_path(list_of_lutin_files)
|
||||
module.import_path(list_of_lutin_files)
|
||||
system.import_path(list_of_lutin_files)
|
||||
target.import_path(list_of_lutin_files)
|
||||
|
||||
builder.init()
|
||||
|
||||
is_init = True
|
||||
|
||||
|
||||
|
165
lutin/arg.py
165
lutin/arg.py
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
@@ -7,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
|
||||
@@ -49,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
|
||||
@@ -69,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 != "":
|
||||
@@ -97,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
|
||||
@@ -158,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:]:
|
||||
@@ -200,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())]:
|
||||
@@ -249,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()
|
||||
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
@@ -14,6 +15,7 @@ import datetime
|
||||
# Local import
|
||||
from . import debug
|
||||
from . import heritage
|
||||
from . import env
|
||||
|
||||
##
|
||||
## constitution of dictionnary:
|
||||
@@ -23,28 +25,45 @@ from . import heritage
|
||||
## - "builder": pointer on the element
|
||||
##
|
||||
builder_list=[]
|
||||
__start_builder_name="lutinBuilder_"
|
||||
__start_builder_name="Builder_"
|
||||
|
||||
|
||||
def import_path(path):
|
||||
##
|
||||
## @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
|
||||
matches = []
|
||||
debug.debug('BUILDER: Start find sub File : "%s"' %path)
|
||||
for root, dirnames, filenames in os.walk(path):
|
||||
tmpList = fnmatch.filter(filenames, __start_builder_name + "*.py")
|
||||
# Import the module :
|
||||
for filename in tmpList:
|
||||
debug.debug('BUILDER: Find a file : "%s"' %os.path.join(root, filename))
|
||||
#matches.append(os.path.join(root, filename))
|
||||
sys.path.append(os.path.dirname(os.path.join(root, filename)) )
|
||||
builder_name = filename.replace('.py', '')
|
||||
the_builder = __import__(builder_name)
|
||||
builder_list.append({"name":builder_name,
|
||||
"element":the_builder
|
||||
})
|
||||
debug.debug('BUILDER: type=' + the_builder.get_type() + " in=" + str(the_builder.get_input_type()) + " out=" + str(the_builder.get_output_type()))
|
||||
global_base = env.get_build_system_base_name()
|
||||
debug.debug("BUILDER: Init with Files list:")
|
||||
for elem in path_list:
|
||||
sys.path.append(os.path.dirname(elem))
|
||||
# Get file name:
|
||||
filename = os.path.basename(elem)
|
||||
# Remove .py at the end:
|
||||
filename = filename[:-3]
|
||||
base_file_name = filename
|
||||
# Remove global base name:
|
||||
filename = filename[len(global_base):]
|
||||
# Check if it start with the local patern:
|
||||
if filename[:len(__start_builder_name)] != __start_builder_name:
|
||||
debug.extreme_verbose("BUILDER: Integrate: '" + filename + "' from '" + elem + "' ==> rejected")
|
||||
continue
|
||||
# Remove local patern
|
||||
builder_name = filename[len(__start_builder_name):]
|
||||
debug.verbose("BUILDER: Integrate: '" + builder_name + "' from '" + elem + "'")
|
||||
the_builder = __import__(base_file_name)
|
||||
builder_list.append({"name":builder_name,
|
||||
"element":the_builder
|
||||
})
|
||||
debug.debug('BUILDER: type=' + the_builder.get_type() + " in=" + str(the_builder.get_input_type()) + " out=" + str(the_builder.get_output_type()))
|
||||
debug.verbose("List of BUILDER: ")
|
||||
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 ...')
|
||||
@@ -52,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:
|
||||
@@ -62,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))
|
||||
|
231
lutin/debug.py
231
lutin/debug.py
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
@@ -11,8 +12,8 @@ import os
|
||||
import threading
|
||||
import re
|
||||
|
||||
debugLevel=3
|
||||
debugColor=False
|
||||
debug_level=3
|
||||
debug_color=False
|
||||
|
||||
color_default= ""
|
||||
color_red = ""
|
||||
@@ -23,20 +24,38 @@ color_purple = ""
|
||||
color_cyan = ""
|
||||
|
||||
|
||||
debugLock = threading.Lock()
|
||||
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 debugLevel
|
||||
debugLevel = id
|
||||
#print "SetDebug level at " + str(debugLevel)
|
||||
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 debugLevel
|
||||
return debugLevel
|
||||
global debug_level
|
||||
return debug_level
|
||||
|
||||
##
|
||||
## @brief Enable color of the console Log system
|
||||
##
|
||||
def enable_color():
|
||||
global debugColor
|
||||
debugColor = True
|
||||
global debug_color
|
||||
debug_color = True
|
||||
global color_default
|
||||
color_default= "\033[00m"
|
||||
global color_red
|
||||
@@ -52,94 +71,178 @@ 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
|
||||
global color_default
|
||||
color_default= ""
|
||||
global color_red
|
||||
color_red = ""
|
||||
global color_green
|
||||
color_green = ""
|
||||
global color_yellow
|
||||
color_yellow = ""
|
||||
global color_blue
|
||||
color_blue = ""
|
||||
global color_purple
|
||||
color_purple = ""
|
||||
global color_cyan
|
||||
color_cyan = ""
|
||||
|
||||
##
|
||||
## @brief Print a extreme verbose log
|
||||
## @param[in] input (string) Value to print if level is enough
|
||||
## @param[in] force (bool) force display (no check of log level)
|
||||
##
|
||||
def extreme_verbose(input, force=False):
|
||||
global debugLock
|
||||
global debugLevel
|
||||
if debugLevel >= 6 \
|
||||
global debug_lock
|
||||
global debug_level
|
||||
if debug_level >= 6 \
|
||||
or force == True:
|
||||
debugLock.acquire()
|
||||
debug_lock.acquire()
|
||||
print(color_blue + input + color_default)
|
||||
debugLock.release()
|
||||
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 debugLock
|
||||
global debugLevel
|
||||
if debugLevel >= 5 \
|
||||
global debug_lock
|
||||
global debug_level
|
||||
if debug_level >= 5 \
|
||||
or force == True:
|
||||
debugLock.acquire()
|
||||
debug_lock.acquire()
|
||||
print(color_blue + input + color_default)
|
||||
debugLock.release()
|
||||
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 debugLock
|
||||
global debugLevel
|
||||
if debugLevel >= 4 \
|
||||
global debug_lock
|
||||
global debug_level
|
||||
if debug_level >= 4 \
|
||||
or force == True:
|
||||
debugLock.acquire()
|
||||
debug_lock.acquire()
|
||||
print(color_green + input + color_default)
|
||||
debugLock.release()
|
||||
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 debugLock
|
||||
global debugLevel
|
||||
if debugLevel >= 3 \
|
||||
global debug_lock
|
||||
global debug_level
|
||||
if debug_level >= 3 \
|
||||
or force == True:
|
||||
debugLock.acquire()
|
||||
debug_lock.acquire()
|
||||
print(input + color_default)
|
||||
debugLock.release()
|
||||
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 debugLock
|
||||
global debugLevel
|
||||
if debugLevel >= 2 \
|
||||
global debug_lock
|
||||
global debug_level
|
||||
if debug_level >= 2 \
|
||||
or force == True:
|
||||
debugLock.acquire()
|
||||
debug_lock.acquire()
|
||||
print(color_purple + "[WARNING] " + input + color_default)
|
||||
debugLock.release()
|
||||
debug_lock.release()
|
||||
|
||||
def error(input, threadID=-1, force=False, crash=True):
|
||||
global debugLock
|
||||
global debugLevel
|
||||
if debugLevel >= 1 \
|
||||
##
|
||||
## @brief Print a todo log
|
||||
## @param[in] input (string) Value to print if level is enough
|
||||
## @param[in] force (bool) force display (no check of log level)
|
||||
##
|
||||
def todo(input, force=False):
|
||||
global debug_lock
|
||||
global debug_level
|
||||
if debug_level >= 3 \
|
||||
or force == True:
|
||||
debugLock.acquire()
|
||||
debug_lock.acquire()
|
||||
print(color_purple + "[TODO] " + input + color_default)
|
||||
debug_lock.release()
|
||||
|
||||
##
|
||||
## @brief Print an error log
|
||||
## @param[in] input (string) Value to print if level is enough
|
||||
## @param[in] thread_id (int) Current thead ID of the builder thread
|
||||
## @param[in] force (bool) force display (no check of log level)
|
||||
## @param[in] crash (bool) build error has appear ==> request stop of all builds
|
||||
##
|
||||
def error(input, thread_id=-1, force=False, crash=True):
|
||||
global debug_lock
|
||||
global debug_level
|
||||
if debug_level >= 1 \
|
||||
or force == True:
|
||||
debug_lock.acquire()
|
||||
print(color_red + "[ERROR] " + input + color_default)
|
||||
debugLock.release()
|
||||
if crash==True:
|
||||
debug_lock.release()
|
||||
if crash == True:
|
||||
from . import multiprocess
|
||||
multiprocess.error_occured()
|
||||
if threadID != -1:
|
||||
multiprocess.set_error_occured()
|
||||
if thread_id != -1:
|
||||
threading.interrupt_main()
|
||||
exit(-1)
|
||||
#os_exit(-1)
|
||||
#raise "error happend"
|
||||
|
||||
|
||||
##
|
||||
## @brief Print a log for a specific element action like generateing .so or binary ...
|
||||
## @param[in] type (string) type of action. Like: "copy file", "StaticLib", "Prebuild", "Library" ...
|
||||
## @param[in] lib (string) Name of the library/binary/package that action is done
|
||||
## @param[in] dir (string) build direction. ex: "<==", "==>" ...
|
||||
## @param[in] name (string) Destination of the data
|
||||
## @param[in] force (bool) force display (no check of log level)
|
||||
##
|
||||
def print_element(type, lib, dir, name, force=False):
|
||||
global debugLock
|
||||
global debugLevel
|
||||
if debugLevel >= 3 \
|
||||
global debug_lock
|
||||
global debug_level
|
||||
if debug_level >= 3 \
|
||||
or force == True:
|
||||
debugLock.acquire()
|
||||
debug_lock.acquire()
|
||||
print(color_cyan + type + color_default + " : " + color_yellow + lib + color_default + " " + dir + " " + color_blue + name + color_default)
|
||||
debugLock.release()
|
||||
debug_lock.release()
|
||||
|
||||
def print_compilator(myString):
|
||||
global debugColor
|
||||
global debugLock
|
||||
if debugColor == 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)
|
||||
##
|
||||
## @brief Print a compilation return (output)
|
||||
## @param[in] my_string (string) Std-error/std-info that is generate by the build system
|
||||
##
|
||||
def print_compilator(my_string):
|
||||
global debug_color
|
||||
global debug_lock
|
||||
if debug_color == True:
|
||||
my_string = my_string.replace('\\n', '\n')
|
||||
my_string = my_string.replace('\\t', '\t')
|
||||
my_string = my_string.replace('error:', color_red+'error:'+color_default)
|
||||
my_string = my_string.replace('warning:', color_purple+'warning:'+color_default)
|
||||
my_string = my_string.replace('note:', color_green+'note:'+color_default)
|
||||
my_string = re.sub(r'([/\w_-]+\.\w+):', r'-COLORIN-\1-COLOROUT-:', my_string)
|
||||
my_string = my_string.replace('-COLORIN-', color_yellow)
|
||||
my_string = my_string.replace('-COLOROUT-', color_default)
|
||||
|
||||
debugLock.acquire()
|
||||
print(myString)
|
||||
debugLock.release()
|
||||
debug_lock.acquire()
|
||||
print(my_string)
|
||||
debug_lock.release()
|
||||
|
||||
##
|
||||
## @brief Get the list of default color
|
||||
## @return A map with keys: "default","red","green","yellow","blue","purple","cyan"
|
||||
##
|
||||
def get_color_set() :
|
||||
global color_default
|
||||
global color_red
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
@@ -40,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:
|
||||
@@ -47,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) + "'")
|
||||
@@ -141,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:
|
||||
@@ -156,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) + "'")
|
||||
|
130
lutin/env.py
130
lutin/env.py
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
@@ -25,6 +26,66 @@ def get_force_mode():
|
||||
global force_mode
|
||||
return force_mode
|
||||
|
||||
force_optimisation=False
|
||||
|
||||
def set_force_optimisation(val):
|
||||
global force_optimisation
|
||||
if val==1:
|
||||
force_optimisation = 1
|
||||
else:
|
||||
force_optimisation = 0
|
||||
|
||||
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):
|
||||
global parse_depth
|
||||
parse_depth = val
|
||||
debug.debug("Set depth search element: " + str(parse_depth))
|
||||
|
||||
def get_parse_depth():
|
||||
global parse_depth
|
||||
return parse_depth
|
||||
|
||||
exclude_search_path = []
|
||||
|
||||
def set_exclude_search_path(val):
|
||||
global exclude_search_path
|
||||
exclude_search_path = val
|
||||
debug.debug("Set depth search element: " + str(exclude_search_path))
|
||||
|
||||
def get_exclude_search_path():
|
||||
global exclude_search_path
|
||||
return exclude_search_path
|
||||
|
||||
|
||||
build_system_base_name = "lutin"
|
||||
|
||||
def set_build_system_base_name(val):
|
||||
global build_system_base_name
|
||||
build_system_base_name = val
|
||||
debug.debug("Set basename: '" + str(build_system_base_name) + "'")
|
||||
|
||||
def get_build_system_base_name():
|
||||
global build_system_base_name
|
||||
return build_system_base_name
|
||||
|
||||
|
||||
print_pretty_mode=False
|
||||
|
||||
@@ -76,38 +137,55 @@ def print_pretty(my_string, force=False):
|
||||
baseElementList = []
|
||||
if end_with(cmdApplication, ["javac"]) == True:
|
||||
baseElementList = [
|
||||
"-d",
|
||||
"-D",
|
||||
"-classpath",
|
||||
"-sourcepath"
|
||||
]
|
||||
"-d",
|
||||
"-D",
|
||||
"-classpath",
|
||||
"-sourcepath"
|
||||
]
|
||||
elif end_with(cmdApplication, ["java"]) == True:
|
||||
baseElementList = [
|
||||
"-z",
|
||||
"-f",
|
||||
"-rf"
|
||||
]
|
||||
elif end_with(cmdApplication, ["jarsigner"]) == True:
|
||||
baseElementList = [
|
||||
"-sigalg",
|
||||
"-digestalg",
|
||||
"-storepass",
|
||||
"-keypass"
|
||||
]
|
||||
elif end_with(cmdApplication, ["jar"]) == True:
|
||||
baseElementList = [
|
||||
"cf",
|
||||
"-C"
|
||||
]
|
||||
"cf",
|
||||
"-C"
|
||||
]
|
||||
elif end_with(cmdApplication, ["aapt"]) == True:
|
||||
baseElementList = [
|
||||
"-M",
|
||||
"-F",
|
||||
"-I",
|
||||
"-S",
|
||||
"-J"
|
||||
]
|
||||
"-M",
|
||||
"-F",
|
||||
"-I",
|
||||
"-S",
|
||||
"-J"
|
||||
]
|
||||
elif end_with(cmdApplication, ["g++", "gcc", "clang", "clang++", "ar", "ld", "ranlib"]) == True:
|
||||
baseElementList = [
|
||||
"-o",
|
||||
"-D",
|
||||
"-I",
|
||||
"-L",
|
||||
"-framework",
|
||||
"-isysroot",
|
||||
"-arch",
|
||||
"-keystore",
|
||||
"-sigalg",
|
||||
"-digestalg",
|
||||
"-target",
|
||||
"-gcc-toolchain"]
|
||||
"-o",
|
||||
"-D",
|
||||
"-I",
|
||||
"-L",
|
||||
"-framework",
|
||||
"-isysroot",
|
||||
"-arch",
|
||||
"-keystore",
|
||||
"-sigalg",
|
||||
"-digestalg",
|
||||
"-target",
|
||||
"-gcc-toolchain",
|
||||
"-current_version",
|
||||
"-compatibility_version"
|
||||
]
|
||||
|
||||
for element in baseElementList:
|
||||
tmpcmdLine = tmpcmdLine.replace(element+'\n\t', element+' ')
|
||||
for element in ["<", "<<", ">", ">>"]:
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
@@ -15,12 +16,12 @@ from . import debug
|
||||
def append_to_list(list_out, elem):
|
||||
if type(elem) == str:
|
||||
if elem not in list_out:
|
||||
list_out.append(elem)
|
||||
list_out.append(copy.deepcopy(elem))
|
||||
else:
|
||||
# mulyiple imput in the list ...
|
||||
for element in elem:
|
||||
if element not in list_out:
|
||||
list_out.append(element)
|
||||
list_out.append(copy.deepcopy(element))
|
||||
|
||||
|
||||
|
||||
@@ -60,6 +61,7 @@ class HeritageList:
|
||||
self.regenerate_tree()
|
||||
|
||||
def regenerate_tree(self):
|
||||
debug.verbose("Regenerate heritage list:")
|
||||
self.flags = {}
|
||||
# sources list:
|
||||
self.src = { 'src':[],
|
||||
@@ -71,61 +73,91 @@ class HeritageList:
|
||||
listHeritage = self.list_heritage
|
||||
self.list_heritage = []
|
||||
# first step : add all lib with no dependency:
|
||||
debug.extreme_verbose(" add element with no dependency:")
|
||||
for herit in listHeritage:
|
||||
if len(herit.depends) == 0:
|
||||
self.list_heritage.append(herit)
|
||||
debug.extreme_verbose(" add: " + str(herit.name))
|
||||
self.list_heritage.append(copy.deepcopy(herit))
|
||||
listHeritage.remove(herit)
|
||||
debug.extreme_verbose(" add element with dependency:")
|
||||
while len(listHeritage) > 0:
|
||||
currentHeritageSize = len(listHeritage)
|
||||
debug.verbose("list heritage = " + str([[x.name, x.depends] for x in listHeritage]))
|
||||
debug.verbose(" list heritage = " + str([[x.name, x.depends] for x in listHeritage]))
|
||||
debug.extreme_verbose(" list heritage (rest):")
|
||||
for tmppp_herit in listHeritage:
|
||||
debug.extreme_verbose(" elem= " + str(tmppp_herit.name) + " : " + str(tmppp_herit.depends))
|
||||
# Add element only when all dependence are resolved
|
||||
for herit in listHeritage:
|
||||
listDependsName = [y.name for y in self.list_heritage]
|
||||
if all(x in listDependsName for x in herit.depends) == True:
|
||||
debug.extreme_verbose(" add: " + str(herit.name))
|
||||
listHeritage.remove(herit)
|
||||
self.list_heritage.append(herit)
|
||||
self.list_heritage.append(copy.deepcopy(herit))
|
||||
if currentHeritageSize == len(listHeritage):
|
||||
debug.warning("Not resolve dependency between the library ==> can be a cyclic dependency !!!")
|
||||
for herit in listHeritage:
|
||||
self.list_heritage.append(herit)
|
||||
self.list_heritage.append(copy.deepcopy(herit))
|
||||
listHeritage = []
|
||||
debug.warning("new heritage list:")
|
||||
for element in self.list_heritage:
|
||||
debug.warning(" " + element.name + " " + str(element.depends))
|
||||
debug.verbose("new heritage list:")
|
||||
debug.extreme_verbose("new heritage list:")
|
||||
for element in self.list_heritage:
|
||||
debug.verbose(" " + element.name + " " + str(element.depends))
|
||||
debug.extreme_verbose(" " + element.name + " " + str(element.depends))
|
||||
for element in reversed(self.list_heritage):
|
||||
for flags in element.flags:
|
||||
if flags in ["c-version", "c++-version"]:
|
||||
continue
|
||||
# get value
|
||||
value = element.flags[flags]
|
||||
if flags not in self.flags:
|
||||
self.flags[flags] = value
|
||||
else:
|
||||
append_to_list(self.flags[flags], value)
|
||||
# if it is a list, simply add element on the previous one
|
||||
if type(value) == list:
|
||||
if flags not in self.flags:
|
||||
self.flags[flags] = value
|
||||
else:
|
||||
append_to_list(self.flags[flags], value)
|
||||
elif type(value) == bool:
|
||||
if flags not in self.flags:
|
||||
self.flags[flags] = value
|
||||
else:
|
||||
# keep only true, if false ==> bad case ...
|
||||
if self.flags[flags] == True \
|
||||
or value == True:
|
||||
self.flags[flags] = True
|
||||
elif type(value) == int:
|
||||
# case of "c-version", "c++-version"
|
||||
if flags not in self.flags:
|
||||
self.flags[flags] = value
|
||||
else:
|
||||
# keep only true, if false ==> bad case ...
|
||||
if self.flags[flags] < value:
|
||||
self.flags[flags] = value
|
||||
append_to_list(self.src['src'], element.src['src'])
|
||||
append_to_list(self.src['dynamic'], element.src['dynamic'])
|
||||
append_to_list(self.src['static'], element.src['static'])
|
||||
for element in self.list_heritage:
|
||||
debug.extreme_verbose(" elem: " + str(element.name))
|
||||
debug.extreme_verbose(" Path (base): " + str(self.path))
|
||||
debug.extreme_verbose(" inside: " + str(element.path))
|
||||
for ppp in element.path:
|
||||
value = element.path[ppp]
|
||||
value = copy.deepcopy(element.path[ppp])
|
||||
if ppp not in self.path:
|
||||
self.path[ppp] = value
|
||||
else:
|
||||
append_to_list(self.path[ppp], value)
|
||||
append_to_list(self.src['src'], element.src['src'])
|
||||
append_to_list(self.src['dynamic'], element.src['dynamic'])
|
||||
append_to_list(self.src['static'], element.src['static'])
|
||||
if "c-version" in element.flags:
|
||||
ver = element.flags["c-version"]
|
||||
if "c-version" in self.flags:
|
||||
if self.flags["c-version"] > ver:
|
||||
ver = self.flags["c-version"]
|
||||
self.flags["c-version"] = ver
|
||||
if "c++-version" in element.flags:
|
||||
ver = element.flags["c++-version"]
|
||||
if "c++-version" in self.flags:
|
||||
if self.flags["c++-version"] > ver:
|
||||
ver = self.flags["c++-version"]
|
||||
self.flags["c++-version"] = ver
|
||||
|
||||
debug.extreme_verbose("Path : " + str(self.path))
|
||||
for ppp in self.path:
|
||||
tmp = self.path[ppp]
|
||||
self.path[ppp] = []
|
||||
for iii in reversed(tmp):
|
||||
self.path[ppp].append(iii)
|
||||
debug.extreme_verbose("Path : " + str(self.path))
|
||||
|
||||
##
|
||||
## @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) + "}"
|
||||
|
||||
class heritage:
|
||||
def __init__(self, module, target):
|
||||
@@ -142,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"]
|
||||
self.path = module.path["export"]
|
||||
self.flags = module._flags["export"] # have no deep copy here is a feature ...
|
||||
self.path = copy.deepcopy(module._path["export"])
|
||||
# if the user install some header ==> they will ba autoamaticaly exported ...
|
||||
if target != None:
|
||||
if len(module.header) > 0:
|
||||
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)
|
||||
@@ -191,18 +223,18 @@ 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:
|
||||
self.flags[flags] = value
|
||||
self.flags[flags] = copy.deepcopy(value)
|
||||
else:
|
||||
append_to_list(self.flags[flags], value)
|
||||
self.add_import_path(other.path)
|
||||
@@ -219,5 +251,13 @@ class heritage:
|
||||
if self.flags["c++-version"] > ver:
|
||||
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) + " ... }"
|
||||
|
||||
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
@@ -14,10 +15,13 @@ from . import debug
|
||||
# print os.name # ==> 'posix'
|
||||
if platform.system() == "Linux":
|
||||
OS = "Linux"
|
||||
HOST_DEFAULT_COMPILATOR = "gcc"
|
||||
elif platform.system() == "Windows":
|
||||
OS = "Windows"
|
||||
HOST_DEFAULT_COMPILATOR = "gcc"
|
||||
elif platform.system() == "Darwin":
|
||||
OS = "MacOs"
|
||||
HOST_DEFAULT_COMPILATOR = "clang"
|
||||
else:
|
||||
debug.error("Unknow the Host OS ... '" + platform.system() + "'")
|
||||
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
@@ -24,23 +25,39 @@ 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
|
||||
# check if command line change
|
||||
def resize(src_file, dest_file, x, y, cmd_file=None):
|
||||
if enable_resize_image == False:
|
||||
return
|
||||
if os.path.exists(src_file) == False:
|
||||
debug.error("Request a resize an image that does not existed : '" + src_file + "'")
|
||||
return
|
||||
if enable_resize_image == False:
|
||||
debug.warning("Can not resize image missing pillow or CoreGraphics : '" + src_file + "' (just copy)")
|
||||
tools.copy_file(src_file, dest_file)
|
||||
return
|
||||
cmd_line = "resize Image : " + src_file + " ==> " + dest_file + " newSize=(" + str(x) + "x" + str(y) + ")"
|
||||
if False==depend.need_re_build(dest_file, src_file, file_cmd=cmd_file , cmd_line=cmd_line):
|
||||
if depend.need_re_build(dest_file, src_file, file_cmd=cmd_file , cmd_line=cmd_line) == False:
|
||||
return
|
||||
# add cmdLine ...
|
||||
x = get_pow_2_multiple(x)
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
|
1567
lutin/module.py
1567
lutin/module.py
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
@@ -24,13 +25,13 @@ from . import tools
|
||||
from . import env
|
||||
from . import depend
|
||||
|
||||
queueLock = threading.Lock()
|
||||
workQueue = queue.Queue()
|
||||
currentThreadWorking = 0
|
||||
queue_lock = threading.Lock()
|
||||
work_queue = queue.Queue()
|
||||
current_thread_working = 0
|
||||
threads = []
|
||||
# To know the first error arrive in the pool ==> to display all the time the same error file when multiple compilation
|
||||
currentIdExecution = 0
|
||||
errorExecution = {
|
||||
current_id_execution = 0
|
||||
error_execution = {
|
||||
"id":-1,
|
||||
"cmd":"",
|
||||
"return":0,
|
||||
@@ -38,10 +39,27 @@ errorExecution = {
|
||||
"out":"",
|
||||
}
|
||||
|
||||
exitFlag = False # resuest stop of the thread
|
||||
isinit = False # the thread are initialized
|
||||
errorOccured = False # a thread have an error
|
||||
processorAvaillable = 1 # number of CPU core availlable
|
||||
exit_flag = False # resuest stop of the thread
|
||||
is_init = False # the thread are initialized
|
||||
error_occured = False # a thread have an error
|
||||
processor_availlable = 1 # number of CPU core availlable
|
||||
##
|
||||
## @brief Execute the command with no get of output
|
||||
##
|
||||
def run_command_no_lock_out(cmd_line):
|
||||
# prepare command line:
|
||||
args = shlex.split(cmd_line)
|
||||
debug.info("cmd = " + str(args))
|
||||
try:
|
||||
# create the subprocess
|
||||
p = subprocess.Popen(args)
|
||||
except subprocess.CalledProcessError as e:
|
||||
debug.error("subprocess.CalledProcessError : " + str(args))
|
||||
return
|
||||
#except:
|
||||
# debug.error("Exception on : " + str(args))
|
||||
# launch the subprocess:
|
||||
p.communicate()
|
||||
|
||||
##
|
||||
## @brief Execute the command and ruturn generate data
|
||||
@@ -72,9 +90,10 @@ def run_command_direct(cmd_line):
|
||||
|
||||
|
||||
def run_command(cmd_line, store_cmd_line="", build_id=-1, file="", store_output_file="", depend_data=None):
|
||||
global errorOccured
|
||||
global exitFlag
|
||||
global currentIdExecution
|
||||
global error_occured
|
||||
global exit_flag
|
||||
global current_id_execution
|
||||
global error_execution
|
||||
# prepare command line:
|
||||
args = shlex.split(cmd_line)
|
||||
debug.verbose("cmd = " + str(args))
|
||||
@@ -95,7 +114,7 @@ def run_command(cmd_line, store_cmd_line="", build_id=-1, file="", store_output_
|
||||
# Check error :
|
||||
if p.returncode == 0:
|
||||
debug.debug(env.print_pretty(cmd_line))
|
||||
queueLock.acquire()
|
||||
queue_lock.acquire()
|
||||
if depend_data != None:
|
||||
depend.create_dependency_file(depend_data['file'], depend_data['data'])
|
||||
# TODO : Print the output all the time .... ==> to show warnings ...
|
||||
@@ -105,10 +124,10 @@ def run_command(cmd_line, store_cmd_line="", build_id=-1, file="", store_output_
|
||||
debug.print_compilator(output)
|
||||
if err != "":
|
||||
debug.print_compilator(err)
|
||||
queueLock.release()
|
||||
queue_lock.release()
|
||||
else:
|
||||
errorOccured = True
|
||||
exitFlag = True
|
||||
error_occured = True
|
||||
exit_flag = True
|
||||
# if No ID : Not in a multiprocess mode ==> just stop here
|
||||
if build_id < 0:
|
||||
debug.debug(env.print_pretty(cmd_line), force=True)
|
||||
@@ -120,18 +139,18 @@ def run_command(cmd_line, store_cmd_line="", build_id=-1, file="", store_output_
|
||||
debug.error("can not compile file ... ret : " + str(p.returncode))
|
||||
else:
|
||||
# in multiprocess interface
|
||||
queueLock.acquire()
|
||||
queue_lock.acquire()
|
||||
# if an other write an error before, check if the current process is started before ==> then is the first error
|
||||
if errorExecution["id"] >= build_id:
|
||||
if error_execution["id"] >= build_id:
|
||||
# nothing to do ...
|
||||
queueLock.release()
|
||||
queue_lock.release()
|
||||
return;
|
||||
errorExecution["id"] = build_id
|
||||
errorExecution["cmd"] = cmd_line
|
||||
errorExecution["return"] = p.returncode
|
||||
errorExecution["err"] = err,
|
||||
errorExecution["out"] = output,
|
||||
queueLock.release()
|
||||
error_execution["id"] = build_id
|
||||
error_execution["cmd"] = cmd_line
|
||||
error_execution["return"] = p.returncode
|
||||
error_execution["err"] = err,
|
||||
error_execution["out"] = output,
|
||||
queue_lock.release()
|
||||
# not write the command file...
|
||||
return
|
||||
debug.verbose("done 3")
|
||||
@@ -141,38 +160,46 @@ def run_command(cmd_line, store_cmd_line="", build_id=-1, file="", store_output_
|
||||
|
||||
|
||||
class myThread(threading.Thread):
|
||||
def __init__(self, threadID, lock, queue):
|
||||
def __init__(self, thread_id, lock, queue):
|
||||
threading.Thread.__init__(self)
|
||||
self.thread_id = threadID
|
||||
self.name = "Thread " + str(threadID)
|
||||
self.thread_id = thread_id
|
||||
self.name = "Thread " + str(thread_id)
|
||||
self.queue = queue
|
||||
self.lock = lock
|
||||
def run(self):
|
||||
debug.verbose("Starting " + self.name)
|
||||
global exitFlag
|
||||
global currentThreadWorking
|
||||
workingSet = False
|
||||
while exitFlag == False:
|
||||
global exit_flag
|
||||
global current_thread_working
|
||||
working_set = False
|
||||
while exit_flag == False:
|
||||
self.lock.acquire()
|
||||
if not self.queue.empty():
|
||||
if workingSet==False:
|
||||
currentThreadWorking += 1
|
||||
workingSet = True
|
||||
if working_set == False:
|
||||
current_thread_working += 1
|
||||
working_set = True
|
||||
data = self.queue.get()
|
||||
self.lock.release()
|
||||
debug.verbose(self.name + " processing '" + data[0] + "'")
|
||||
if data[0]=="cmdLine":
|
||||
if data[0]=="cmd_line":
|
||||
comment = data[2]
|
||||
cmdLine = data[1]
|
||||
cmdStoreFile = data[3]
|
||||
debug.print_element( "[" + str(data[4]) + "][" + str(self.thread_id) + "] " + comment[0], comment[1], comment[2], comment[3])
|
||||
run_command(cmdLine, cmdStoreFile, build_id=data[4], file=comment[3], store_output_file=data[5], depend_data=data[6])
|
||||
cmd_line = data[1]
|
||||
cmd_store_file = data[3]
|
||||
debug.print_element("[" + str(data[4]) + "][" + str(self.thread_id) + "] " + comment[0],
|
||||
comment[1],
|
||||
comment[2],
|
||||
comment[3])
|
||||
run_command(cmd_line,
|
||||
cmd_store_file,
|
||||
build_id=data[4],
|
||||
file=comment[3],
|
||||
store_output_file=data[5],
|
||||
depend_data=data[6])
|
||||
else:
|
||||
debug.warning("unknow request command : " + data[0])
|
||||
else:
|
||||
if workingSet==True:
|
||||
currentThreadWorking -= 1
|
||||
workingSet=False
|
||||
if working_set==True:
|
||||
current_thread_working -= 1
|
||||
working_set=False
|
||||
# no element to parse, just wait ...
|
||||
self.lock.release()
|
||||
time.sleep(0.2)
|
||||
@@ -180,39 +207,41 @@ class myThread(threading.Thread):
|
||||
debug.verbose("Exiting " + self.name)
|
||||
|
||||
|
||||
def error_occured():
|
||||
global exitFlag
|
||||
exitFlag = True
|
||||
def set_error_occured():
|
||||
global exit_flag
|
||||
exit_flag = True
|
||||
|
||||
def set_core_number(numberOfcore):
|
||||
global processorAvaillable
|
||||
processorAvaillable = numberOfcore
|
||||
debug.debug(" set number of core for multi process compilation : " + str(processorAvaillable))
|
||||
def set_core_number(number_of_core):
|
||||
global processor_availlable
|
||||
processor_availlable = number_of_core
|
||||
debug.debug(" set number of core for multi process compilation : " + str(processor_availlable))
|
||||
# nothing else to do
|
||||
|
||||
def init():
|
||||
global exitFlag
|
||||
global isinit
|
||||
if isinit==False:
|
||||
isinit=True
|
||||
global error_occured
|
||||
global exit_flag
|
||||
global is_init
|
||||
if is_init == False:
|
||||
is_init = True
|
||||
error_occured = False
|
||||
global threads
|
||||
global queueLock
|
||||
global workQueue
|
||||
global queue_lock
|
||||
global work_queue
|
||||
# Create all the new threads
|
||||
threadID = 0
|
||||
while threadID < processorAvaillable:
|
||||
thread = myThread(threadID, queueLock, workQueue)
|
||||
thread_id = 0
|
||||
while thread_id < processor_availlable:
|
||||
thread = myThread(thread_id, queue_lock, work_queue)
|
||||
thread.start()
|
||||
threads.append(thread)
|
||||
threadID += 1
|
||||
thread_id += 1
|
||||
|
||||
|
||||
|
||||
def un_init():
|
||||
global exitFlag
|
||||
global exit_flag
|
||||
# Notify threads it's time to exit
|
||||
exitFlag = True
|
||||
if processorAvaillable > 1:
|
||||
exit_flag = True
|
||||
if processor_availlable > 1:
|
||||
# Wait for all threads to complete
|
||||
for tmp in threads:
|
||||
debug.verbose("join thread ...")
|
||||
@@ -222,53 +251,53 @@ def un_init():
|
||||
|
||||
|
||||
def run_in_pool(cmd_line, comment, store_cmd_line="", store_output_file="", depend_data=None):
|
||||
global currentIdExecution
|
||||
if processorAvaillable <= 1:
|
||||
global current_id_execution
|
||||
if processor_availlable <= 1:
|
||||
debug.print_element(comment[0], comment[1], comment[2], comment[3])
|
||||
run_command(cmd_line, store_cmd_line, file=comment[3], store_output_file=store_output_file, depend_data=depend_data)
|
||||
return
|
||||
# multithreaded mode
|
||||
init()
|
||||
# Fill the queue
|
||||
queueLock.acquire()
|
||||
debug.verbose("add : in pool cmdLine")
|
||||
workQueue.put(["cmdLine", cmd_line, comment, store_cmd_line, currentIdExecution, store_output_file, depend_data])
|
||||
currentIdExecution +=1;
|
||||
queueLock.release()
|
||||
queue_lock.acquire()
|
||||
debug.verbose("add : in pool cmd_line")
|
||||
work_queue.put(["cmd_line", cmd_line, comment, store_cmd_line, current_id_execution, store_output_file, depend_data])
|
||||
current_id_execution +=1;
|
||||
queue_lock.release()
|
||||
|
||||
|
||||
def pool_synchrosize():
|
||||
global errorOccured
|
||||
global errorExecution
|
||||
if processorAvaillable <= 1:
|
||||
global error_occured
|
||||
global error_execution
|
||||
if processor_availlable <= 1:
|
||||
#in this case : nothing to synchronise
|
||||
return
|
||||
|
||||
debug.verbose("wait queue process ended\n")
|
||||
# Wait for queue to empty
|
||||
while not workQueue.empty() \
|
||||
and False==errorOccured:
|
||||
while not work_queue.empty() \
|
||||
and error_occured == False:
|
||||
time.sleep(0.2)
|
||||
pass
|
||||
# Wait all thread have ended their current process
|
||||
while currentThreadWorking != 0 \
|
||||
and False==errorOccured:
|
||||
while current_thread_working != 0 \
|
||||
and error_occured == False:
|
||||
time.sleep(0.2)
|
||||
pass
|
||||
if False==errorOccured:
|
||||
if error_occured == False:
|
||||
debug.verbose("queue is empty")
|
||||
else:
|
||||
un_init()
|
||||
debug.debug("Thread return with error ... ==> stop all the pool")
|
||||
if errorExecution["id"] == -1:
|
||||
if error_execution["id"] == -1:
|
||||
debug.error("Pool error occured ... (No return information on Pool)")
|
||||
return
|
||||
debug.error("Error in an pool element : [" + str(errorExecution["id"]) + "]", crash=False)
|
||||
debug.debug(env.print_pretty(errorExecution["cmd"]), force=True)
|
||||
debug.print_compilator(str(errorExecution["out"][0]))
|
||||
debug.print_compilator(str(errorExecution["err"][0]))
|
||||
if errorExecution["return"] == 2:
|
||||
debug.error("Error in an pool element : [" + str(error_execution["id"]) + "]", crash=False)
|
||||
debug.debug(env.print_pretty(error_execution["cmd"]), force=True)
|
||||
debug.print_compilator(str(error_execution["out"][0]))
|
||||
debug.print_compilator(str(error_execution["err"][0]))
|
||||
if error_execution["return"] == 2:
|
||||
debug.error("can not compile file ... [keyboard interrrupt]")
|
||||
else:
|
||||
debug.error("can not compile file ... return value : " + str(errorExecution["return"]))
|
||||
debug.error("can not compile file ... return value : " + str(error_execution["return"]))
|
||||
|
||||
|
405
lutin/system.py
405
lutin/system.py
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
@@ -15,165 +16,305 @@ import datetime
|
||||
# Local import
|
||||
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.include_cc=[]
|
||||
self.export_flags_cc=[]
|
||||
self.export_flags_xx=[]
|
||||
self.export_flags_mm=[]
|
||||
self.export_flags_m=[]
|
||||
self.export_flags_ar=[]
|
||||
self.export_flags_ld=[]
|
||||
self.export_flags_ld_shared=[]
|
||||
self.export_libs_ld=[]
|
||||
self.export_libs_ld_shared=[]
|
||||
self.export_src=[]
|
||||
self.action_on_state={}
|
||||
|
||||
def append_and_check(self, listout, newElement, order):
|
||||
for element in listout:
|
||||
if element==newElement:
|
||||
return
|
||||
listout.append(newElement)
|
||||
if True==order:
|
||||
listout.sort()
|
||||
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 append_to_internal_list(self, listout, list, order=False):
|
||||
if type(list) == type(str()):
|
||||
self.append_and_check(listout, list, order)
|
||||
else:
|
||||
# mulyiple imput in the list ...
|
||||
for elem in list:
|
||||
self.append_and_check(listout, elem, order)
|
||||
##
|
||||
## @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;
|
||||
|
||||
def add_export_flag_LD(self, list):
|
||||
self.append_to_internal_list(self.export_flags_ld, list)
|
||||
##
|
||||
## @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;
|
||||
|
||||
def add_export_flag_CC(self, list):
|
||||
self.append_to_internal_list(self.export_flags_cc, list)
|
||||
##
|
||||
## @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
|
||||
|
||||
def add_export_flag_XX(self, list):
|
||||
self.append_to_internal_list(self.export_flags_xx, list)
|
||||
##
|
||||
## @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
|
||||
|
||||
def add_export_flag_M(self, list):
|
||||
self.append_to_internal_list(self.export_flags_m, list)
|
||||
##
|
||||
## @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)
|
||||
|
||||
def add_export_flag_MM(self, list):
|
||||
self.append_to_internal_list(self.export_flags_mm, 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_path(self, list):
|
||||
tools.list_append_to(self._export_path, list)
|
||||
|
||||
def add_export_SRC(self, list):
|
||||
self.append_to_internal_list(self.export_src, list)
|
||||
##
|
||||
## @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)
|
||||
|
||||
##
|
||||
## @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
|
||||
|
||||
## @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_state:
|
||||
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({
|
||||
"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
|
||||
if self._export_depends != []:
|
||||
module.add_depend(self._export_depends)
|
||||
# add exporting sources
|
||||
if self._export_src != []:
|
||||
module.add_src_file(self._export_src)
|
||||
# add export path
|
||||
if self._export_path != []:
|
||||
# no control on API
|
||||
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);
|
||||
|
||||
|
||||
|
||||
|
||||
def createModuleFromSystem(target, dict):
|
||||
myModule = module.Module(dict["path"], dict["name"], 'PREBUILD')
|
||||
|
||||
myModule.add_export_flag('c', dict["system"].export_flags_cc)
|
||||
myModule.add_export_flag('link', dict["system"].export_flags_ld)
|
||||
myModule.add_export_flag('c++', dict["system"].export_flags_xx)
|
||||
myModule.add_export_flag('m', dict["system"].export_flags_m)
|
||||
myModule.add_export_flag('mm', dict["system"].export_flags_mm)
|
||||
myModule.add_src_file(dict["system"].export_src)
|
||||
|
||||
for elem in dict["system"].action_on_state:
|
||||
level, name, action = dict["system"].action_on_state[elem]
|
||||
target.add_action(elem, level, name, action)
|
||||
|
||||
return myModule
|
||||
##
|
||||
## @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):
|
||||
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]
|
||||
systemList={}
|
||||
__start_system_name="lutinSystem_"
|
||||
__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_base = env.get_build_system_base_name()
|
||||
debug.debug("SYSTEM: Init with Files list:")
|
||||
for elem in path_list:
|
||||
sys.path.append(os.path.dirname(elem))
|
||||
# Get file name:
|
||||
filename = os.path.basename(elem)
|
||||
# Remove .py at the end:
|
||||
filename = filename[:-3]
|
||||
# Remove global base name:
|
||||
filename = filename[len(global_base):]
|
||||
# Check if it start with the local patern:
|
||||
if filename[:len(__start_system_name)] != __start_system_name:
|
||||
debug.extreme_verbose("SYSTEM: NOT-Integrate: '" + filename + "' from '" + elem + "' ==> rejected")
|
||||
continue
|
||||
# Remove local patern
|
||||
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,
|
||||
"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}]
|
||||
debug.verbose("New list system: ")
|
||||
for elem in __system_list:
|
||||
debug.verbose(" " + str(elem))
|
||||
for val in __system_list[elem]:
|
||||
debug.verbose(" " + str(val["name"]))
|
||||
|
||||
def import_path(path):
|
||||
global targetList
|
||||
matches = []
|
||||
debug.debug('Start find sub File : "%s"' %path)
|
||||
for root, dirnames, filenames in os.walk(path):
|
||||
tmpList = fnmatch.filter(filenames, __start_system_name + "*.py")
|
||||
# Import the module :
|
||||
for filename in tmpList:
|
||||
debug.verbose(' Find a file : "%s"' %os.path.join(root, filename))
|
||||
sys.path.append(os.path.dirname(os.path.join(root, filename)) )
|
||||
systemName = filename.replace('.py', '')
|
||||
systemName = systemName.replace(__start_system_name, '')
|
||||
targetType, systemName = systemName.split('_')
|
||||
debug.debug("integrate system: '" + targetType + "':'" + systemName + "' from '" + os.path.join(root, filename) + "'")
|
||||
if targetType in systemList:
|
||||
systemList[targetType].append({"name":systemName,
|
||||
"path":os.path.join(root, filename),
|
||||
"system":None,
|
||||
"loaded":False,
|
||||
"exist":False,
|
||||
"module":None})
|
||||
else:
|
||||
systemList[targetType] = [{"name":systemName,
|
||||
"path":os.path.join(root, filename),
|
||||
"system":None,
|
||||
"loaded":False,
|
||||
"exist":False,
|
||||
"module":None}]
|
||||
debug.debug("list system=" + str(systemList))
|
||||
|
||||
##
|
||||
## @brief Display all the system binary that can be used
|
||||
##
|
||||
def display():
|
||||
global systemList
|
||||
for elementName in systemList:
|
||||
debug.info("integrate system: '" + elementName +"'")
|
||||
for data in systemList[elementName]:
|
||||
debug.info(" '" + data["name"] +"' in " + data["path"])
|
||||
global __system_list
|
||||
for elementName in __system_list:
|
||||
debug.info("SYSTEM: Integrate system: '" + elementName +"'")
|
||||
for data in __system_list[elementName]:
|
||||
debug.info("SYSTEM: '" + data["name"] +"' in " + data["path"])
|
||||
|
||||
|
||||
def exist(lib_name, target_name, target) :
|
||||
global systemList
|
||||
debug.verbose("exist= " + lib_name + " in " + target_name)
|
||||
if target_name not in systemList:
|
||||
##
|
||||
## @brief Check if a system Module is availlable for a specific target
|
||||
## @param[in] lib_name (string) Name of the Library
|
||||
## @param[in] list_target_name ([string,...]) list of name of the target (ordered by request order)
|
||||
## @param[in] target (handle) Handle on the @ref Target build engine
|
||||
## @return (bool) find the system lib or not
|
||||
##
|
||||
def exist(lib_name, list_target_name, target) :
|
||||
global __system_list
|
||||
debug.verbose("exist= " + lib_name + " in " + str(list_target_name))
|
||||
find_target = False
|
||||
for target_name in list_target_name:
|
||||
if target_name in __system_list:
|
||||
find_target = True
|
||||
if find_target == False:
|
||||
return False
|
||||
for data in systemList[target_name]:
|
||||
if data["name"] == lib_name:
|
||||
# we find it in the List ==> need to check if it is present in the system :
|
||||
if data["loaded"] == False:
|
||||
debug.verbose("add to path: '" + os.path.dirname(data["path"]) + "'")
|
||||
sys.path.append(os.path.dirname(data["path"]))
|
||||
debug.verbose("import system : '" + data["name"] + "'")
|
||||
theSystem = __import__(__start_system_name + target_name + "_" + data["name"])
|
||||
#create the system module
|
||||
try:
|
||||
debug.info("call : " + data["name"])
|
||||
data["system"] = theSystem.System(target)
|
||||
data["exist"] = data["system"].valid
|
||||
except:
|
||||
debug.warning("Not find: '" + data["name"] + "' ==> get exception")
|
||||
return data["exist"]
|
||||
for target_name in reversed(list_target_name):
|
||||
if target_name not in __system_list:
|
||||
continue
|
||||
for data in __system_list[target_name]:
|
||||
if data["name"] == lib_name:
|
||||
# we find it in the List ==> need to check if it is present in the system :
|
||||
if data["loaded"] == False:
|
||||
debug.verbose("add to path: '" + os.path.dirname(data["path"]) + "'")
|
||||
sys.path.append(os.path.dirname(data["path"]))
|
||||
debug.verbose("import system : '" + data["name"] + "'")
|
||||
the_system = __import__(env.get_build_system_base_name() + __start_system_name + target_name + "_" + data["name"])
|
||||
#create the system module
|
||||
debug.verbose("SYSTEM: request: " + str(data["name"]))
|
||||
if "System" in dir(the_system):
|
||||
data["system"] = the_system.System(target)
|
||||
data["exist"] = data["system"].get_valid()
|
||||
else:
|
||||
debug.warning("Not find: '" + data["name"] + "' ==> get exception")
|
||||
return data["exist"]
|
||||
return False
|
||||
|
||||
def load(target, lib_name, target_name):
|
||||
global systemList
|
||||
if target_name not in systemList:
|
||||
##
|
||||
## @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] list_target_name ([string,...]) list of name of the target (ordered by request order)
|
||||
## @return None
|
||||
##
|
||||
def load(target, lib_name, list_target_name):
|
||||
global __system_list
|
||||
find_target = False
|
||||
for target_name in list_target_name:
|
||||
if target_name in __system_list:
|
||||
find_target = True
|
||||
if find_target == False:
|
||||
debug.error("you must call this function after checking of the system exist() !1!")
|
||||
for data in systemList[target_name]:
|
||||
if data["name"] == lib_name:
|
||||
if data["exist"] == False:
|
||||
debug.error("you must call this function after checking of the system exist() !2!")
|
||||
if data["module"] == None:
|
||||
# create a module from the system interface...
|
||||
data["module"] = createModuleFromSystem(target, data)
|
||||
data["loaded"] = True
|
||||
target.add_module(data["module"])
|
||||
return
|
||||
return
|
||||
for target_name in reversed(list_target_name):
|
||||
if target_name not in __system_list:
|
||||
continue
|
||||
for data in __system_list[target_name]:
|
||||
if data["name"] == lib_name:
|
||||
if data["exist"] == False:
|
||||
debug.error("you must call this function after checking of the system exist() !2!")
|
||||
if data["module"] == None:
|
||||
# create a module from the system interface...
|
||||
data["module"] = create_module_from_system(target, data)
|
||||
data["loaded"] = True
|
||||
target.add_module(data["module"])
|
||||
return
|
||||
|
||||
|
938
lutin/target.py
938
lutin/target.py
File diff suppressed because it is too large
Load Diff
156
lutin/tools.py
156
lutin/tools.py
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
@@ -50,6 +51,8 @@ def remove_path_and_sub_path(path):
|
||||
def remove_file(path):
|
||||
if os.path.isfile(path):
|
||||
os.remove(path)
|
||||
elif os.path.islink(path):
|
||||
os.remove(path)
|
||||
|
||||
def file_size(path):
|
||||
if not os.path.isfile(path):
|
||||
@@ -84,16 +87,20 @@ def version_to_string(version):
|
||||
## @param[in] path Path of the data might be written.
|
||||
## @param[in] data Data To write in the file.
|
||||
## @param[in] only_if_new (default: False) Write data only if data is different.
|
||||
## @return True Something has been copied
|
||||
## @return False Nothing has been copied
|
||||
##
|
||||
def file_write_data(path, data, only_if_new=False):
|
||||
if only_if_new == True:
|
||||
old_data = file_read_data(path)
|
||||
if old_data == data:
|
||||
return
|
||||
return False
|
||||
#real write of data:
|
||||
create_directory_of_file(path)
|
||||
file = open(path, "w")
|
||||
file.write(data)
|
||||
file.close()
|
||||
return True
|
||||
|
||||
def list_to_str(list):
|
||||
if type(list) == type(str()):
|
||||
@@ -127,6 +134,8 @@ def add_prefix(prefix,list):
|
||||
## @param[in] force (default False) Force copy of the file
|
||||
## @param[in] force_identical (default False) Force file to be identical (read it in binary)
|
||||
## @param[in,out] in_list (default None) Not real copy: set the request copy in the input list
|
||||
## @return True Something has/must been copied
|
||||
## @return False Nothing has/myst been copied
|
||||
##
|
||||
def copy_file(src, dst, cmd_file=None, force=False, force_identical=False, in_list=None):
|
||||
if os.path.exists(src) == False:
|
||||
@@ -134,7 +143,7 @@ def copy_file(src, dst, cmd_file=None, force=False, force_identical=False, in_li
|
||||
cmd_line = "copy \"" + src + "\" \"" + dst + "\""
|
||||
if force == False \
|
||||
and depend.need_re_build(dst, src, file_cmd=cmd_file , cmd_line=cmd_line, force_identical=force_identical) == False:
|
||||
debug.verbose ("no need to copy ...")
|
||||
debug.verbose("no need to copy ...")
|
||||
if in_list != None:
|
||||
if dst in in_list:
|
||||
debug.verbose("replace copy file " + os.path.relpath(src) + " ==> " + os.path.relpath(dst))
|
||||
@@ -144,7 +153,7 @@ def copy_file(src, dst, cmd_file=None, force=False, force_identical=False, in_li
|
||||
in_list[dst] = {"src":src,
|
||||
"cmd_file":cmd_file,
|
||||
"need_copy":False}
|
||||
return
|
||||
return False
|
||||
if in_list == None:
|
||||
debug.print_element("copy file ", os.path.relpath(src), "==>", os.path.relpath(dst))
|
||||
create_directory_of_file(dst)
|
||||
@@ -159,6 +168,7 @@ def copy_file(src, dst, cmd_file=None, force=False, force_identical=False, in_li
|
||||
in_list[dst] = {"src":src,
|
||||
"cmd_file":cmd_file,
|
||||
"need_copy":True}
|
||||
return True
|
||||
|
||||
##
|
||||
## @brief Copy a compleate directory in a specific folder
|
||||
@@ -206,20 +216,28 @@ def copy_anything(src, dst, recursive = False, force_identical=False, in_list=No
|
||||
##
|
||||
## @brief real copy of files in a specific dictionnary list
|
||||
## @param[in] in_list Dictionnary of file to copy
|
||||
## @return True Something has been copied
|
||||
## @return False Nothing has been copied
|
||||
##
|
||||
def copy_list(in_list):
|
||||
has_file_copied = False
|
||||
for dst in in_list:
|
||||
if in_list[dst]["need_copy"] == False:
|
||||
continue
|
||||
# note we force the copy to disable the check of needed of copy (already done)
|
||||
copy_file(in_list[dst]["src"], dst, cmd_file=in_list[dst]["cmd_file"], force=True)
|
||||
has_file_copied = True
|
||||
return has_file_copied
|
||||
|
||||
##
|
||||
## @brief Clean a path from all un-needed element in a directory
|
||||
## @param[in] path Path to clean
|
||||
## @param[in] normal_list List of all files/path in the path
|
||||
## @return True Something has been removed
|
||||
## @return False Nothing has been removed
|
||||
##
|
||||
def clean_directory(path, normal_list):
|
||||
has_file_removed = False
|
||||
# get a list of all element in the path:
|
||||
for root, dirnames, filenames in os.walk(path):
|
||||
for file in filenames:
|
||||
@@ -227,6 +245,8 @@ def clean_directory(path, normal_list):
|
||||
if file_name not in normal_list:
|
||||
debug.print_element("remove file ", os.path.relpath(file_name), "==>", "---")
|
||||
os.remove(file_name)
|
||||
has_file_removed = True
|
||||
return has_file_removed
|
||||
|
||||
def filter_extention(list_files, extentions, invert=False):
|
||||
out = []
|
||||
@@ -296,4 +316,134 @@ def store_warning(file, output, err):
|
||||
file2.flush()
|
||||
file2.close()
|
||||
|
||||
def get_type_string(in_type):
|
||||
if type(in_type) == str:
|
||||
return "string"
|
||||
elif type(in_type) == list:
|
||||
return "list"
|
||||
elif type(in_type) == dict:
|
||||
return "dict"
|
||||
return "unknow"
|
||||
|
||||
## List tools:
|
||||
def list_append_and_check(listout, newElement, order):
|
||||
for element in listout:
|
||||
if element==newElement:
|
||||
return
|
||||
listout.append(newElement)
|
||||
if order == True:
|
||||
if type(newElement) is not dict:
|
||||
listout.sort()
|
||||
|
||||
def list_append_to(out_list, in_list, order=False):
|
||||
if type(in_list) == str:
|
||||
list_append_and_check(out_list, in_list, order)
|
||||
elif type(in_list) == list:
|
||||
# mulyiple imput in the list ...
|
||||
for elem in in_list:
|
||||
list_append_and_check(out_list, elem, order)
|
||||
elif type(in_list) == dict:
|
||||
list_append_and_check(out_list, in_list, order)
|
||||
else:
|
||||
debug.warning("can not add in list other than {list/dict/str} : " + str(type(in_list)))
|
||||
|
||||
def list_append_to_2(listout, module, in_list, order=False):
|
||||
# sepcial cse of bool
|
||||
if type(in_list) == bool:
|
||||
listout[module] = in_list
|
||||
return
|
||||
# add list in the Map
|
||||
if module not in listout:
|
||||
listout[module] = []
|
||||
# add elements...
|
||||
list_append_to(listout[module], in_list, order)
|
||||
|
||||
|
||||
##
|
||||
## @brief The vertion number can be set in an external file to permit to have a singe position to change when create a vew version
|
||||
## @param[in] path_module (string) Path of the module position
|
||||
## @param[in] filename_or_version (string or list) Path of the version or the real version lint parameter
|
||||
## @return (list) List of version number
|
||||
##
|
||||
def get_version_from_file_or_direct(path_module, filename_or_version):
|
||||
# check case of iser set the version directly
|
||||
if type(filename_or_version) == list:
|
||||
return filename_or_version
|
||||
# this use a version file
|
||||
file_data = file_read_data(os.path.join(path_module, filename_or_version))
|
||||
if len(file_data) == 0:
|
||||
debug.warning("not enought data in the file version size=0 " + path_module + " / " + filename_or_version)
|
||||
return [0,0,0]
|
||||
lines = file_data.split("\n")
|
||||
if len(lines) != 1:
|
||||
debug.warning("More thatn one line in the file version ==> bas case use mode: 'XX', XX.YYY', 'XX.Y.ZZZ' or 'XX.Y-dev' : " + path_module + " / " + filename_or_version)
|
||||
return [0,0,0]
|
||||
line = lines[0]
|
||||
debug.debug("Parse line: '" + line + "'")
|
||||
#check if we have "-dev"
|
||||
dev_mode = ""
|
||||
list_tiret = line.split('-')
|
||||
if len(list_tiret) > 2:
|
||||
debug.warning("more than one '-' in version file " + str(filename_or_version) + " : '" + str(list_tiret) + "' in '" + path_module + "'")
|
||||
if len(list_tiret) >= 2:
|
||||
dev_mode = list_tiret[1]
|
||||
line = list_tiret[0]
|
||||
out = []
|
||||
list_elem = line.split('.')
|
||||
for elem in list_elem:
|
||||
out.append(int(elem))
|
||||
if dev_mode != "":
|
||||
out.append(dev_mode)
|
||||
debug.debug(" ==> " + str(out))
|
||||
return out
|
||||
|
||||
##
|
||||
## @brief Get the list of the authors frim an input list or a file
|
||||
## @param[in] path_module (string) Path of the module position
|
||||
## @param[in] filename_or_version (string or list) Path of the author file or the real list of authors
|
||||
## @return (list) List of authors
|
||||
##
|
||||
def get_maintainer_from_file_or_direct(path_module, filename_or_author):
|
||||
# check case of iser set the version directly
|
||||
if type(filename_or_author) == list:
|
||||
return filename_or_author
|
||||
# this use a version file
|
||||
file_data = file_read_data(os.path.join(path_module, filename_or_author))
|
||||
if len(file_data) == 0:
|
||||
debug.warning("not enought data in the file author size=0 " + path_module + " / " + filename_or_author)
|
||||
return []
|
||||
# One user by line and # for comment line
|
||||
out = []
|
||||
for elem in file_data.split('\n'):
|
||||
if len(elem) == 0:
|
||||
continue
|
||||
if elem[0] == "#":
|
||||
# comment ...
|
||||
continue
|
||||
out.append(elem)
|
||||
return out
|
||||
|
||||
|
||||
|
||||
def remove_element(data, to_remove):
|
||||
base_data = []
|
||||
for elem in data:
|
||||
if type(elem) == list:
|
||||
for elem2 in elem:
|
||||
base_data.append(elem2)
|
||||
else:
|
||||
base_data.append(elem)
|
||||
base_remove = []
|
||||
for elem in to_remove:
|
||||
if type(elem) == list:
|
||||
for elem2 in elem:
|
||||
base_remove.append(elem2)
|
||||
else:
|
||||
base_remove.append(elem)
|
||||
out = []
|
||||
for elem in base_data:
|
||||
if elem not in base_remove:
|
||||
out.append(elem)
|
||||
return out;
|
||||
|
||||
|
||||
|
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
@@ -1,3 +1,13 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
##
|
||||
## Executable/binary builder
|
||||
##
|
||||
@@ -36,12 +46,24 @@ def get_input_type():
|
||||
def get_output_type():
|
||||
return ["", "exe", "bin"]
|
||||
|
||||
##
|
||||
## @brief Get builder support multi-threading or not
|
||||
## @return True Multithreading supported
|
||||
## @return False Multithreading NOT supported
|
||||
##
|
||||
def get_support_multithreading():
|
||||
return False
|
||||
|
||||
##
|
||||
## @brief Commands for running gcc to link an executable.
|
||||
##
|
||||
def link(file, binary, target, depancy, name, basic_path, static = False):
|
||||
file_src, file_dst, file_depend, file_cmd, file_warning = target.generate_file(binary, name, basic_path, file, "bin")
|
||||
def link(file, binary, target, depancy, flags, name, basic_path, static = False):
|
||||
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 = []
|
||||
@@ -62,9 +84,14 @@ def link(file, binary, target, depancy, name, basic_path, static = False):
|
||||
if lib_name not in depancy.src['dynamic']:
|
||||
list_static.append(elem)
|
||||
#create comand line:
|
||||
cmd = [
|
||||
target.xx
|
||||
]
|
||||
cmd = []
|
||||
# a specific case to not depend on the libstdc++ automaticly added by the G++ or clang++ compilator ==> then need to compile with GCC or CLANG if use libcxx from llvm or other ...
|
||||
if "need-libstdc++" in depancy.flags \
|
||||
and depancy.flags["need-libstdc++"] == True:
|
||||
cmd.append(target.xx)
|
||||
else:
|
||||
cmd.append(target.cc)
|
||||
|
||||
try:
|
||||
cmd.append(target.arch)
|
||||
except:
|
||||
@@ -73,10 +100,6 @@ def link(file, binary, target, depancy, 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:
|
||||
@@ -105,6 +128,7 @@ def link(file, binary, target, depancy, name, basic_path, static = False):
|
||||
cmd.append("-Wl,-R$ORIGIN/../lib/")
|
||||
except:
|
||||
pass
|
||||
cmd.append("-Wl,-rpath,\"\$ORIGIN/../lib\"")
|
||||
try:
|
||||
cmd.append(flags["local"]["link"])
|
||||
except:
|
||||
@@ -114,9 +138,29 @@ def link(file, binary, target, depancy, name, basic_path, static = False):
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
cmd.append(target.global_flags_ld)
|
||||
cmd.append(target.global_flags["link"])
|
||||
except:
|
||||
pass
|
||||
for view in ["local", "export"]:
|
||||
if view not in flags:
|
||||
continue
|
||||
for type in ["link-lib"]:
|
||||
if type in flags[view]:
|
||||
cmd.append([("-l" + sss).replace("-l/", "/") for sss in flags[view][type] ])
|
||||
for type in ["link-bin"]:
|
||||
if type in flags[view]:
|
||||
cmd.append(flags[view][type])
|
||||
for type in ["link-lib"]:
|
||||
if type in depancy.flags:
|
||||
cmd.append([("-l" + sss).replace("-l/", "/") for sss in depancy.flags[type] ])
|
||||
for type in ["link-lib"]:
|
||||
if type in target.global_flags:
|
||||
cmd.append([("-l" + sss).replace("-l/", "/") for sss in target.global_flags[type] ])
|
||||
for type in ["link-bin"]:
|
||||
if type in target.global_flags:
|
||||
cmd.append(target.global_flags[type])
|
||||
if type in depancy.flags:
|
||||
cmd.append(depancy.flags[type])
|
||||
cmd_line = tools.list_to_str(cmd)
|
||||
# check the dependency for this file :
|
||||
if depend.need_re_package(file_dst, file_src, True, file_cmd=file_cmd, cmd_line=cmd_line) == False \
|
||||
|
@@ -1,3 +1,13 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
##
|
||||
## C builder
|
||||
##
|
||||
@@ -37,6 +47,14 @@ def get_input_type():
|
||||
def get_output_type():
|
||||
return ["o"]
|
||||
|
||||
##
|
||||
## @brief Get builder support multi-threading or not
|
||||
## @return True Multithreading supported
|
||||
## @return False Multithreading NOT supported
|
||||
##
|
||||
def get_support_multithreading():
|
||||
return True
|
||||
|
||||
##
|
||||
## @brief Commands for running gcc to compile a C file in object file.
|
||||
##
|
||||
@@ -52,8 +70,7 @@ def compile(file, binary, target, depancy, flags, path, name, basic_path, module
|
||||
target.cc,
|
||||
"-o", file_dst,
|
||||
target.arch,
|
||||
target.sysroot,
|
||||
target.global_include_cc]
|
||||
target.sysroot]
|
||||
for view in ["export", "local"]:
|
||||
try:
|
||||
cmd.append(tools.add_prefix("-I", path[view]["c"]))
|
||||
@@ -63,23 +80,35 @@ def compile(file, binary, target, depancy, flags, path, name, basic_path, module
|
||||
cmd.append(tools.add_prefix("-I", depancy.path["c"]))
|
||||
except:
|
||||
pass
|
||||
cmd.append(target.global_include_cc)
|
||||
try:
|
||||
cmd.append(get_version_compilation_flags(flags, depancy.flags))
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
cmd.append(target.global_flags_cc)
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
cmd.append(depancy.flags["c"])
|
||||
except:
|
||||
pass
|
||||
list_flags = [];
|
||||
if "c" in target.global_flags:
|
||||
list_flags.append(target.global_flags["c"])
|
||||
if "c" in depancy.flags:
|
||||
list_flags.append(depancy.flags["c"])
|
||||
for view in ["local", "export"]:
|
||||
try:
|
||||
cmd.append(flags[view]["c"])
|
||||
except:
|
||||
pass
|
||||
if view in flags:
|
||||
if "c" in flags[view]:
|
||||
list_flags.append(flags[view]["c"])
|
||||
# get blacklist of flags
|
||||
list_flags_blacklist = [];
|
||||
if "c-remove" in target.global_flags:
|
||||
list_flags_blacklist.append(target.global_flags["c-remove"])
|
||||
if "c-remove" in depancy.flags:
|
||||
list_flags_blacklist.append(depancy.flags["c-remove"])
|
||||
for view in ["local", "export"]:
|
||||
if view in flags:
|
||||
if "c-remove" in flags[view]:
|
||||
list_flags_blacklist.append(flags[view]["c-remove"])
|
||||
# apply blacklisting of data and add it on the cmdLine
|
||||
clean_flags = tools.remove_element(list_flags, list_flags_blacklist)
|
||||
#debug.warning("plop " + str(list_flags_blacklist) + " " + str(list_flags) + " --> " + str(clean_flags) )
|
||||
cmd.append(clean_flags);
|
||||
|
||||
cmd.append("-c")
|
||||
cmd.append("-MMD")
|
||||
cmd.append("-MP")
|
||||
|
@@ -1,3 +1,13 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
##
|
||||
## C++ builder
|
||||
##
|
||||
@@ -36,6 +46,15 @@ def get_input_type():
|
||||
def get_output_type():
|
||||
return ["o"]
|
||||
|
||||
##
|
||||
## @brief Get builder support multi-threading or not
|
||||
## @return True Multithreading supported
|
||||
## @return False Multithreading NOT supported
|
||||
##
|
||||
def get_support_multithreading():
|
||||
return True
|
||||
|
||||
|
||||
##
|
||||
## @brief Commands for running gcc to compile a C++ file in object file.
|
||||
##
|
||||
@@ -50,8 +69,7 @@ def compile(file, binary, target, depancy, flags, path, name, basic_path, module
|
||||
target.xx,
|
||||
"-o", file_dst,
|
||||
target.arch,
|
||||
target.sysroot,
|
||||
target.global_include_cc
|
||||
target.sysroot
|
||||
]
|
||||
for view in ["export", "local"]:
|
||||
for type in ["c", "c++"]:
|
||||
@@ -64,33 +82,46 @@ def compile(file, binary, target, depancy, flags, path, name, basic_path, module
|
||||
cmd.append(tools.add_prefix("-I",depancy.path[type]))
|
||||
except:
|
||||
pass
|
||||
cmd.append(target.global_include_cc)
|
||||
try:
|
||||
cmd.append(get_version_compilation_flags(flags, depancy.flags))
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
cmd.append(target.global_flags_cc)
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
cmd.append(target.global_flags_xx)
|
||||
except:
|
||||
pass
|
||||
list_flags = [];
|
||||
if "c" in target.global_flags:
|
||||
list_flags.append(target.global_flags["c"])
|
||||
if "c++" in target.global_flags:
|
||||
list_flags.append(target.global_flags["c++"])
|
||||
for type in ["c", "c++"]:
|
||||
try:
|
||||
cmd.append(depancy.flags[type])
|
||||
except:
|
||||
pass
|
||||
if type in depancy.flags:
|
||||
list_flags.append(depancy.flags[type])
|
||||
for view in ["local", "export"]:
|
||||
for type in ["c", "c++"]:
|
||||
try:
|
||||
cmd.append(flags[view][type])
|
||||
except:
|
||||
pass
|
||||
if view in flags:
|
||||
for type in ["c", "c++"]:
|
||||
if type in flags[view]:
|
||||
list_flags.append(flags[view][type])
|
||||
# get blacklist of flags
|
||||
list_flags_blacklist = [];
|
||||
if "c-remove" in target.global_flags:
|
||||
list_flags_blacklist.append(target.global_flags["c-remove"])
|
||||
if "c++-remove" in target.global_flags:
|
||||
list_flags_blacklist.append(target.global_flags["c++-remove"])
|
||||
for type in ["c-remove", "c++-remove"]:
|
||||
if type in depancy.flags:
|
||||
list_flags_blacklist.append(depancy.flags[type])
|
||||
for view in ["local", "export"]:
|
||||
if view in flags:
|
||||
for type in ["c-remove", "c++-remove"]:
|
||||
if type in flags[view]:
|
||||
list_flags_blacklist.append(flags[view][type])
|
||||
# apply blacklisting of data and add it on the cmdLine
|
||||
clean_flags = tools.remove_element(list_flags, list_flags_blacklist)
|
||||
#debug.warning("plop " + str(list_flags_blacklist) + " " + str(list_flags) + " --> " + str(clean_flags) )
|
||||
cmd.append(clean_flags);
|
||||
cmd.append(["-c", "-MMD", "-MP"])
|
||||
cmd.append(file_src)
|
||||
# Create cmd line
|
||||
cmdLine=tools.list_to_str(cmd)
|
||||
cmdLine = tools.list_to_str(cmd)
|
||||
# check the dependency for this file :
|
||||
if depend.need_re_build(file_dst, file_src, file_depend, file_cmd, cmdLine) == False:
|
||||
return {"action":"add", "file":file_dst}
|
||||
|
@@ -1,3 +1,13 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
##
|
||||
## Dynamic library builder
|
||||
##
|
||||
@@ -35,11 +45,24 @@ def get_input_type():
|
||||
def get_output_type():
|
||||
return ["jar"]
|
||||
|
||||
##
|
||||
## @brief Get builder support multi-threading or not
|
||||
## @return True Multithreading supported
|
||||
## @return False Multithreading NOT supported
|
||||
##
|
||||
def get_support_multithreading():
|
||||
return False
|
||||
|
||||
##
|
||||
## @brief Commands for running gcc to link a shared library.
|
||||
##
|
||||
def link(file, binary, target, depancy, name, basic_path):
|
||||
file_src, file_dst, file_depend, file_cmd, file_warning = target.generate_file(binary, name, basic_path, file, "jar")
|
||||
def link(file, binary, target, depancy, flags, name, basic_path):
|
||||
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,
|
||||
|
@@ -1,3 +1,13 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
##
|
||||
## Java builder
|
||||
##
|
||||
@@ -33,6 +43,14 @@ def get_input_type():
|
||||
def get_output_type():
|
||||
return ["class"]
|
||||
|
||||
##
|
||||
## @brief Get builder support multi-threading or not
|
||||
## @return True Multithreading supported
|
||||
## @return False Multithreading NOT supported
|
||||
##
|
||||
def get_support_multithreading():
|
||||
return False
|
||||
|
||||
def create_dependency_files(target, src, heritage_src, basic_path):
|
||||
depend = []
|
||||
for elem in src:
|
||||
|
@@ -1,3 +1,13 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
##
|
||||
## Java builder
|
||||
##
|
||||
@@ -33,6 +43,14 @@ def get_input_type():
|
||||
def get_output_type():
|
||||
return ["h"]
|
||||
|
||||
##
|
||||
## @brief Get builder support multi-threading or not
|
||||
## @return True Multithreading supported
|
||||
## @return False Multithreading NOT supported
|
||||
##
|
||||
def get_support_multithreading():
|
||||
return False
|
||||
|
||||
def create_dependency_files(target, src, heritage_src, basic_path):
|
||||
depend = []
|
||||
for elem in src:
|
||||
|
@@ -1,3 +1,13 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
##
|
||||
## Dynamic library builder
|
||||
##
|
||||
@@ -35,11 +45,29 @@ def get_input_type():
|
||||
def get_output_type():
|
||||
return ["so", "dynlib", "dll"]
|
||||
|
||||
##
|
||||
## @brief Get builder support multi-threading or not
|
||||
## @return True Multithreading supported
|
||||
## @return False Multithreading NOT supported
|
||||
##
|
||||
def get_support_multithreading():
|
||||
return False
|
||||
|
||||
##
|
||||
## @brief Commands for running gcc to link a shared library.
|
||||
##
|
||||
def link(file, binary, target, depancy, 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")
|
||||
def link(file, binary, target, depancy, flags, name, basic_path, static=False):
|
||||
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:
|
||||
@@ -59,12 +87,17 @@ def link(file, binary, target, depancy, name, basic_path, static=False):
|
||||
if lib_name not in depancy.src['dynamic']:
|
||||
list_static.append(elem)
|
||||
#create command Line
|
||||
cmd = [
|
||||
target.xx,
|
||||
"-o", file_dst
|
||||
]
|
||||
cmd = []
|
||||
# a specific case to not depend on the libstdc++ automaticly added by the G++ or clang++ compilator ==> then need to compile with GCC or CLANG if use libcxx from llvm or other ...
|
||||
if "need-libstdc++" in depancy.flags \
|
||||
and depancy.flags["need-libstdc++"] == True:
|
||||
cmd.append(target.xx)
|
||||
else:
|
||||
cmd.append(target.cc)
|
||||
|
||||
cmd.append(["-o", file_dst])
|
||||
try:
|
||||
cmd.append(target.global_sysroot)
|
||||
cmd.append(target.sysroot)
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
@@ -76,15 +109,24 @@ def link(file, binary, target, depancy, name, basic_path, static=False):
|
||||
cmd.append(file_src)
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
# keep only compilated files ...
|
||||
cmd.append(tools.filter_extention(depancy.src['src'], get_input_type()))
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
cmd.append(list_static)
|
||||
except:
|
||||
pass
|
||||
for view in ["local", "export"]:
|
||||
if view not in flags:
|
||||
continue
|
||||
for type in ["link", "link-dynamic"]:
|
||||
if type in flags[view]:
|
||||
cmd.append(flags[view][type])
|
||||
for type in ["link", "link-dynamic"]:
|
||||
if type in depancy.flags:
|
||||
cmd.append(depancy.flags[type])
|
||||
for type in ["link", "link-dynamic"]:
|
||||
if type in target.global_flags:
|
||||
cmd.append(target.global_flags[type])
|
||||
if 'src' in depancy.src:
|
||||
cmd.append(tools.filter_extention(depancy.src['src'], get_input_type()))
|
||||
try:
|
||||
for elem in list_dynamic:
|
||||
lib_path = os.path.dirname(elem)
|
||||
@@ -97,18 +139,18 @@ def link(file, binary, target, depancy, name, basic_path, static=False):
|
||||
cmd.append("-Wl,-R$ORIGIN/../lib/")
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
cmd.append(flags["local"]["link"])
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
cmd.append(depancy.flags["link"])
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
cmd.append(target.global_flags_ld)
|
||||
except:
|
||||
pass
|
||||
for view in ["local", "export"]:
|
||||
if view not in flags:
|
||||
continue
|
||||
for type in ["link-lib"]:
|
||||
if type in flags[view]:
|
||||
cmd.append([("-l" + sss).replace("-l/", "/") for sss in flags[view][type] ])
|
||||
for type in ["link-lib"]:
|
||||
if type in depancy.flags:
|
||||
cmd.append([("-l" + sss).replace("-l/", "/") for sss in depancy.flags[type] ])
|
||||
for type in ["link-lib"]:
|
||||
if type in target.global_flags:
|
||||
cmd.append([("-l" + sss).replace("-l/", "/") for sss in target.global_flags[type] ])
|
||||
cmdLine=tools.list_to_str(cmd)
|
||||
# check the dependency for this file :
|
||||
if depend.need_re_package(file_dst, file_src, True, file_cmd, cmdLine) == False \
|
||||
@@ -123,9 +165,15 @@ def link(file, binary, target, depancy, name, basic_path, static=False):
|
||||
# get the file size of the non strip file
|
||||
originSize = tools.file_size(file_dst);
|
||||
debug.print_element("SharedLib(strip)", name, "", "")
|
||||
cmdLineStrip=tools.list_to_str([
|
||||
target.strip,
|
||||
file_dst])
|
||||
if "MacOs" in target.get_type():
|
||||
cmdLineStrip=tools.list_to_str([
|
||||
target.strip,
|
||||
"-u",
|
||||
file_dst])
|
||||
else:
|
||||
cmdLineStrip=tools.list_to_str([
|
||||
target.strip,
|
||||
file_dst])
|
||||
multiprocess.run_command(cmdLineStrip, store_output_file=file_warning)
|
||||
# get the stip size of the binary
|
||||
stripSize = tools.file_size(file_dst)
|
||||
|
@@ -1,3 +1,13 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
##
|
||||
## Static library builder
|
||||
##
|
||||
@@ -35,17 +45,34 @@ def get_input_type():
|
||||
def get_output_type():
|
||||
return ["a"]
|
||||
|
||||
##
|
||||
## @brief Get builder support multi-threading or not
|
||||
## @return True Multithreading supported
|
||||
## @return False Multithreading NOT supported
|
||||
##
|
||||
def get_support_multithreading():
|
||||
return False
|
||||
|
||||
##
|
||||
## @brief Commands for running ar.
|
||||
##
|
||||
def link(file, binary, target, depancy, 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)
|
||||
def link(file, binary, target, depancy, flags, name, basic_path):
|
||||
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
|
||||
]
|
||||
try:
|
||||
cmd.append(target.global_flags_ar)
|
||||
cmd.append(target.global_flags["ar"])
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
|
@@ -1,3 +1,13 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
##
|
||||
## Objective-C builder
|
||||
##
|
||||
@@ -38,6 +48,14 @@ def get_input_type():
|
||||
def get_output_type():
|
||||
return ["o"]
|
||||
|
||||
##
|
||||
## @brief Get builder support multi-threading or not
|
||||
## @return True Multithreading supported
|
||||
## @return False Multithreading NOT supported
|
||||
##
|
||||
def get_support_multithreading():
|
||||
return True
|
||||
|
||||
##
|
||||
## @brief Commands for running gcc to compile a m file in object file.
|
||||
##
|
||||
@@ -69,32 +87,44 @@ def compile(file, binary, target, depancy, flags, path, name, basic_path, module
|
||||
cmd.append(local_ref_on_builder_c.get_version_compilation_flags(flags, depancy.flags))
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
cmd.append(target.global_flags_cc)
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
cmd.append(target.global_flags_m)
|
||||
except:
|
||||
pass
|
||||
list_flags = [];
|
||||
if "c" in target.global_flags:
|
||||
list_flags.append(target.global_flags["c"])
|
||||
if "m" in target.global_flags:
|
||||
list_flags.append(target.global_flags["m"])
|
||||
for type in ["c", "m"]:
|
||||
try:
|
||||
cmd.append(depancy.flags[type])
|
||||
except:
|
||||
pass
|
||||
if type in depancy.flags:
|
||||
list_flags.append(depancy.flags[type])
|
||||
for view in ["local", "export"]:
|
||||
for type in ["c", "m"]:
|
||||
try:
|
||||
cmd.append(flags[view][type])
|
||||
except:
|
||||
pass
|
||||
if view in flags:
|
||||
for type in ["c", "m"]:
|
||||
if type in flags[view]:
|
||||
list_flags.append(flags[view][type])
|
||||
# get blacklist of flags
|
||||
list_flags_blacklist = [];
|
||||
if "c-remove" in target.global_flags:
|
||||
list_flags_blacklist.append(target.global_flags["c-remove"])
|
||||
if "m-remove" in target.global_flags:
|
||||
list_flags_blacklist.append(target.global_flags["m-remove"])
|
||||
for type in ["c-remove", "m-remove"]:
|
||||
if type in depancy.flags:
|
||||
list_flags_blacklist.append(depancy.flags[type])
|
||||
for view in ["local", "export"]:
|
||||
if view in flags:
|
||||
for type in ["c-remove", "m-remove"]:
|
||||
if type in flags[view]:
|
||||
list_flags_blacklist.append(flags[view][type])
|
||||
# apply blacklisting of data and add it on the cmdLine
|
||||
clean_flags = tools.remove_element(list_flags, list_flags_blacklist)
|
||||
#debug.warning("plop " + str(list_flags_blacklist) + " " + str(list_flags) + " --> " + str(clean_flags) )
|
||||
cmd.append(clean_flags);
|
||||
cmd.append("-c -MMD -MP")
|
||||
cmd.append("-x objective-c")
|
||||
cmd.append(file_src)
|
||||
# Create cmd line
|
||||
cmdLine=tools.list_to_str(cmd)
|
||||
# check the dependency for this file :
|
||||
if False==depend.need_re_build(file_dst, file_src, file_depend, file_cmd, cmdLine):
|
||||
if depend.need_re_build(file_dst, file_src, file_depend, file_cmd, cmdLine) == False:
|
||||
return {"action":"add", "file":file_dst}
|
||||
tools.create_directory_of_file(file_dst)
|
||||
comment = ["m", name, "<==", file]
|
||||
|
@@ -1,3 +1,13 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
##
|
||||
## Objective C++ builder
|
||||
##
|
||||
@@ -38,6 +48,14 @@ def get_input_type():
|
||||
def get_output_type():
|
||||
return ["o"]
|
||||
|
||||
##
|
||||
## @brief Get builder support multi-threading or not
|
||||
## @return True Multithreading supported
|
||||
## @return False Multithreading NOT supported
|
||||
##
|
||||
def get_support_multithreading():
|
||||
return True
|
||||
|
||||
##
|
||||
## @brief Commands for running gcc to compile a m++ file in object file.
|
||||
##
|
||||
@@ -69,25 +87,45 @@ def compile(file, binary, target, depancy, flags, path, name, basic_path, module
|
||||
cmd.append(local_ref_on_builder_cpp.get_version_compilation_flags(flags, depancy.flags))
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
cmd.append(target.global_flags_cc)
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
cmd.append(target.global_flags_mm)
|
||||
except:
|
||||
pass
|
||||
list_flags = [];
|
||||
if "c" in target.global_flags:
|
||||
list_flags.append(target.global_flags["c"])
|
||||
if "c++" in target.global_flags:
|
||||
list_flags.append(target.global_flags["c++"])
|
||||
if "m" in target.global_flags:
|
||||
list_flags.append(target.global_flags["m"])
|
||||
if "mm" in target.global_flags:
|
||||
list_flags.append(target.global_flags["mm"])
|
||||
for type in ["c", "c++", "m", "mm"]:
|
||||
try:
|
||||
cmd.append(depancy.flags[type])
|
||||
except:
|
||||
pass
|
||||
for view in ["export", "local"]:
|
||||
for type in ["c", "c++", "m", "mm"]:
|
||||
try:
|
||||
cmd.append(flags[view][type])
|
||||
except:
|
||||
pass
|
||||
if type in depancy.flags:
|
||||
list_flags.append(depancy.flags[type])
|
||||
for view in ["local", "export"]:
|
||||
if view in flags:
|
||||
for type in ["c", "c++", "m", "mm"]:
|
||||
if type in flags[view]:
|
||||
list_flags.append(flags[view][type])
|
||||
# get blacklist of flags
|
||||
list_flags_blacklist = [];
|
||||
if "c-remove" in target.global_flags:
|
||||
list_flags_blacklist.append(target.global_flags["c-remove"])
|
||||
if "c++-remove" in target.global_flags:
|
||||
list_flags_blacklist.append(target.global_flags["c++-remove"])
|
||||
if "m-remove" in target.global_flags:
|
||||
list_flags_blacklist.append(target.global_flags["m-remove"])
|
||||
if "mm-remove" in target.global_flags:
|
||||
list_flags_blacklist.append(target.global_flags["mm-remove"])
|
||||
for type in ["c-remove", "c++-remove","m-remove", "mm-remove"]:
|
||||
if type in depancy.flags:
|
||||
list_flags_blacklist.append(depancy.flags[type])
|
||||
for view in ["local", "export"]:
|
||||
if view in flags:
|
||||
for type in ["c-remove", "c++-remove","m-remove", "mm-remove"]:
|
||||
if type in flags[view]:
|
||||
list_flags_blacklist.append(flags[view][type])
|
||||
# apply blacklisting of data and add it on the cmdLine
|
||||
clean_flags = tools.remove_element(list_flags, list_flags_blacklist)
|
||||
#debug.warning("plop " + str(list_flags_blacklist) + " " + str(list_flags) + " --> " + str(clean_flags) )
|
||||
cmd.append(clean_flags);
|
||||
cmd.append("-c -MMD -MP")
|
||||
cmd.append("-x objective-c++")
|
||||
cmd.append(file_src)
|
||||
|
@@ -1,3 +1,13 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
##
|
||||
## ASM builder
|
||||
##
|
||||
@@ -31,3 +41,65 @@ def get_input_type():
|
||||
##
|
||||
def get_output_type():
|
||||
return ["o"]
|
||||
|
||||
##
|
||||
## @brief Get builder support multi-threading or not
|
||||
## @return True Multithreading supported
|
||||
## @return False Multithreading NOT supported
|
||||
##
|
||||
def get_support_multithreading():
|
||||
return True
|
||||
|
||||
##
|
||||
## @brief Commands for running gcc to compile a C file in object file.
|
||||
##
|
||||
def compile(file, binary, target, depancy, flags, path, name, basic_path, module_src):
|
||||
file_src = target.get_full_name_source(basic_path, file)
|
||||
file_cmd = target.get_full_name_cmd(name, basic_path, file)
|
||||
file_dst = target.get_full_name_destination(name, basic_path, file, get_output_type())
|
||||
file_depend = target.get_full_dependency(name, basic_path, file)
|
||||
file_warning = target.get_full_name_warning(name, basic_path, file)
|
||||
|
||||
# create the command line befor requesting start:
|
||||
cmd = [
|
||||
target.cc,
|
||||
"-o", file_dst,
|
||||
target.arch,
|
||||
target.sysroot]
|
||||
for view in ["export", "local"]:
|
||||
try:
|
||||
cmd.append(tools.add_prefix("-I", path[view]["c"]))
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
cmd.append(tools.add_prefix("-I", depancy.path["c"]))
|
||||
except:
|
||||
pass
|
||||
cmd.append(target.global_include_cc)
|
||||
try:
|
||||
cmd.append(target.global_flags["c"])
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
cmd.append(depancy.flags["c"])
|
||||
except:
|
||||
pass
|
||||
for view in ["local", "export"]:
|
||||
try:
|
||||
cmd.append(flags[view]["c"])
|
||||
except:
|
||||
pass
|
||||
cmd.append("-c")
|
||||
cmd.append("-MMD")
|
||||
cmd.append("-MP")
|
||||
cmd.append(file_src)
|
||||
# Create cmd line
|
||||
cmdLine=tools.list_to_str(cmd)
|
||||
# check the dependency for this file :
|
||||
if depend.need_re_build(file_dst, file_src, file_depend, file_cmd, cmdLine) == False:
|
||||
return {"action":"add", "file":file_dst}
|
||||
tools.create_directory_of_file(file_dst)
|
||||
comment = ["s", name, "<==", file]
|
||||
# process element
|
||||
multiprocess.run_in_pool(cmdLine, comment, file_cmd, store_output_file=file_warning)
|
||||
return {"action":"add", "file":file_dst}
|
||||
|
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
@@ -10,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_SRC(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)
|
||||
|
||||
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
@@ -10,19 +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_SRC(target.path_sdk + "/platforms/android-" + str(target.boardId) + "/android.jar")
|
||||
self.add_export_flag_LD("-ldl")
|
||||
self.add_export_flag_LD("-llog")
|
||||
self.add_export_flag_LD("-landroid")
|
||||
self.add_sources(jar_file_path)
|
||||
self.add_flag("link-lib", "dl")
|
||||
self.add_flag("link-lib", "log")
|
||||
self.add_flag("link-lib", "android")
|
||||
|
||||
|
||||
|
23
lutin/z_system/lutinSystem_Android_c.py
Normal file
23
lutin/z_system/lutinSystem_Android_c.py
Normal file
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("C: Generic C library")
|
||||
self.set_valid(True)
|
||||
|
77
lutin/z_system/lutinSystem_Android_cxx.py
Normal file
77
lutin/z_system/lutinSystem_Android_cxx.py
Normal file
@@ -0,0 +1,77 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
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_flag("c++", "-D__STDCPP_LLVM__")
|
||||
# llvm is BSD-like licence
|
||||
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_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_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_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_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_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_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_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_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_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_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")
|
27
lutin/z_system/lutinSystem_Android_m.py
Normal file
27
lutin/z_system/lutinSystem_Android_m.py
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
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.set_valid(True)
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_flag("link-lib", "m")
|
||||
|
||||
|
36
lutin/z_system/lutinSystem_Android_opengl.py
Normal file
36
lutin/z_system/lutinSystem_Android_opengl.py
Normal file
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("OpenGL: Generic graphic library")
|
||||
self.set_valid(True)
|
||||
# no check needed ==> just add this:
|
||||
self.add_depend([
|
||||
'c',
|
||||
])
|
||||
"""
|
||||
self.add_header_file([
|
||||
"/usr/include/GL/*"
|
||||
],
|
||||
destination_path="GL",
|
||||
recursive=True)
|
||||
"""
|
||||
self.add_flag('link-lib', "GLESv2")
|
||||
|
||||
|
35
lutin/z_system/lutinSystem_Android_pthread.py
Normal file
35
lutin/z_system/lutinSystem_Android_pthread.py
Normal file
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
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.set_valid(True)
|
||||
# todo : create a searcher of the presence of the library:
|
||||
#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="PULSE : The Linux PulseAudio\n Can be install with the package:\n - libpulse-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/pulse/pulseaudio.h"):
|
||||
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_LD(["-lpulse-simple", "-lpulse"])
|
||||
self.add_flag("link-lib", "z")
|
||||
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
@@ -10,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_LD("-framework CoreAudio")
|
||||
self.add_export_flag_LD("-framework AudioToolbox")
|
||||
self.add_flag("link", "-framework CoreAudio")
|
||||
self.add_flag("link", "-framework AudioToolbox")
|
||||
|
||||
|
||||
|
27
lutin/z_system/lutinSystem_IOs_CoreGraphics.py
Normal file
27
lutin/z_system/lutinSystem_IOs_CoreGraphics.py
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("CoreAudio : Ios interface for core graphic (all time present, just system interface)")
|
||||
self.set_valid(True)
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_flag("link", "-framework CoreGraphics")
|
||||
self.add_depend("UIKit")
|
||||
|
||||
|
27
lutin/z_system/lutinSystem_IOs_Foundation.py
Normal file
27
lutin/z_system/lutinSystem_IOs_Foundation.py
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("CoreAudio : Ios interface for fundation (all time present, just system interface)")
|
||||
self.set_valid(True)
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_flag("link", "-framework Foundation")
|
||||
self.add_depend("QuartzCore")
|
||||
|
||||
|
27
lutin/z_system/lutinSystem_IOs_GLKit.py
Normal file
27
lutin/z_system/lutinSystem_IOs_GLKit.py
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("CoreAudio : Ios interface for openGL (all time present, just system interface)")
|
||||
self.set_valid(True)
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_flag("link", "-framework GLKit")
|
||||
self.add_depend("Foundation")
|
||||
|
||||
|
26
lutin/z_system/lutinSystem_IOs_QuartzCore.py
Normal file
26
lutin/z_system/lutinSystem_IOs_QuartzCore.py
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("CoreAudio : Ios interface for core application (all time present, just system interface)")
|
||||
self.set_valid(True)
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_flag("link", "-framework QuartzCore")
|
||||
|
||||
|
27
lutin/z_system/lutinSystem_IOs_UIKit.py
Normal file
27
lutin/z_system/lutinSystem_IOs_UIKit.py
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("CoreAudio : Ios interface for graphic UX (all time present, just system interface)")
|
||||
self.set_valid(True)
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_flag("link", "-framework UIKit")
|
||||
self.add_depend("GLKit")
|
||||
|
||||
|
24
lutin/z_system/lutinSystem_IOs_c.py
Normal file
24
lutin/z_system/lutinSystem_IOs_c.py
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("C: Generic C library")
|
||||
self.add_flag("c-remove","-nodefaultlibs")
|
||||
self.set_valid(True)
|
||||
|
28
lutin/z_system/lutinSystem_IOs_cxx.py
Normal file
28
lutin/z_system/lutinSystem_IOs_cxx.py
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("CXX: Generic C++ library")
|
||||
self.set_valid(True)
|
||||
# no check needed ==> just add this:
|
||||
self.add_flag("c++", "-D__STDCPP_LLVM__")
|
||||
self.add_flag("c++-remove", "-nostdlib")
|
||||
self.add_flag("need-libstdc++", True)
|
||||
|
||||
|
27
lutin/z_system/lutinSystem_IOs_m.py
Normal file
27
lutin/z_system/lutinSystem_IOs_m.py
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
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.set_valid(True)
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_flag("link-lib", "m")
|
||||
|
||||
|
30
lutin/z_system/lutinSystem_IOs_opengl.py
Normal file
30
lutin/z_system/lutinSystem_IOs_opengl.py
Normal file
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("OpenGL: Generic graphic library")
|
||||
self.set_valid(True)
|
||||
# no check needed ==> just add this:
|
||||
self.add_depend([
|
||||
'c'
|
||||
])
|
||||
self.add_flag('link', [
|
||||
"-framework OpenGLES"])
|
||||
|
||||
|
44
lutin/z_system/lutinSystem_IOs_pthread.py
Normal file
44
lutin/z_system/lutinSystem_IOs_pthread.py
Normal file
@@ -0,0 +1,44 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
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.set_valid(True)
|
||||
# todo : create a searcher of the presence of the library:
|
||||
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/")
|
||||
"""
|
||||
|
||||
|
||||
|
44
lutin/z_system/lutinSystem_Linux_SDL.py
Normal file
44
lutin/z_system/lutinSystem_Linux_SDL.py
Normal file
@@ -0,0 +1,44 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("SDL: SDL Gui abstraction")
|
||||
# check if the library exist:
|
||||
if not os.path.isfile("/usr/include/SDL/SDL.h"):
|
||||
# we did not find the library reqiested (just return) (automaticly set at false)
|
||||
return;
|
||||
self.set_valid(True)
|
||||
self.add_depend([
|
||||
'opengl',
|
||||
'c'
|
||||
])
|
||||
self.add_flag("link-lib", "SDL")
|
||||
if env.get_isolate_system() == True:
|
||||
self.add_header_file([
|
||||
"/usr/include/SDL/*",
|
||||
],
|
||||
destination_path="SDL",
|
||||
recursive=True)
|
||||
self.add_header_file([
|
||||
"/usr/include/SDL/*",
|
||||
],
|
||||
destination_path="",
|
||||
recursive=True)
|
||||
|
||||
|
33
lutin/z_system/lutinSystem_Linux_X11.py
Normal file
33
lutin/z_system/lutinSystem_Linux_X11.py
Normal file
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("X11: Basic interface of Linux Graphic interface")
|
||||
self.set_valid(True)
|
||||
# no check needed ==> just add this:
|
||||
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)
|
||||
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
@@ -10,20 +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_LD("-lasound")
|
||||
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'
|
||||
])
|
||||
|
||||
|
||||
|
41
lutin/z_system/lutinSystem_Linux_arpa.py
Normal file
41
lutin/z_system/lutinSystem_Linux_arpa.py
Normal file
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
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.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'
|
||||
])
|
||||
|
||||
|
||||
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
@@ -10,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_LD([
|
||||
"-lboost_system",
|
||||
"-lboost_thread",
|
||||
"-lboost_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'
|
||||
])
|
||||
|
||||
|
||||
|
||||
|
175
lutin/z_system/lutinSystem_Linux_c.py
Normal file
175
lutin/z_system/lutinSystem_Linux_c.py
Normal file
@@ -0,0 +1,175 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
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")
|
||||
|
50
lutin/z_system/lutinSystem_Linux_cxx.py
Normal file
50
lutin/z_system/lutinSystem_Linux_cxx.py
Normal file
@@ -0,0 +1,50 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
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.set_help("CXX: Generic C++ library")
|
||||
self.set_valid(True)
|
||||
# no check needed ==> just add this:
|
||||
self.add_depend([
|
||||
'c',
|
||||
'm',
|
||||
'pthread'
|
||||
])
|
||||
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)
|
||||
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
@@ -10,19 +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_LD("-ljack")
|
||||
self.set_valid(True)
|
||||
self.add_depend([
|
||||
'uuid',
|
||||
'c'
|
||||
])
|
||||
self.add_flag("link-lib", "jack")
|
||||
if env.get_isolate_system() == True:
|
||||
self.add_header_file([
|
||||
"/usr/include/jack/*",
|
||||
],
|
||||
destination_path="jack",
|
||||
recursive=True)
|
||||
|
||||
|
||||
|
37
lutin/z_system/lutinSystem_Linux_m.py
Normal file
37
lutin/z_system/lutinSystem_Linux_m.py
Normal file
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
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.set_valid(True)
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_flag("link-lib", "m")
|
||||
self.add_depend([
|
||||
'c'
|
||||
])
|
||||
if env.get_isolate_system() == True:
|
||||
self.add_header_file([
|
||||
"/usr/include/math.h"
|
||||
],
|
||||
clip_path="/usr/include",
|
||||
recursive=False)
|
||||
|
||||
|
||||
|
37
lutin/z_system/lutinSystem_Linux_opengl.py
Normal file
37
lutin/z_system/lutinSystem_Linux_opengl.py
Normal file
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("OpenGL: Generic graphic library")
|
||||
self.set_valid(True)
|
||||
# no check needed ==> just add this:
|
||||
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)
|
||||
|
||||
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
@@ -10,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_CC("-ljack")
|
||||
self.add_flag("link-lib", "oss")
|
||||
"""
|
||||
|
||||
|
||||
|
39
lutin/z_system/lutinSystem_Linux_pthread.py
Normal file
39
lutin/z_system/lutinSystem_Linux_pthread.py
Normal file
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
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.set_valid(True)
|
||||
# todo : create a searcher of the presence of the library:
|
||||
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/")
|
||||
|
||||
|
65
lutin/z_system/lutinSystem_Linux_pulse.py_
Normal file
65
lutin/z_system/lutinSystem_Linux_pulse.py_
Normal file
@@ -0,0 +1,65 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
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)
|
||||
return;
|
||||
dst_data = tools.file_read_data("/usr/include/pulse/version.h")
|
||||
lines = dst_data.split("\n")
|
||||
patern = "#define pa_get_headers_version() (\""
|
||||
version = None
|
||||
for line in lines:
|
||||
if line[:len(patern)] == patern:
|
||||
#Find the version line
|
||||
version = line[len(patern)]
|
||||
version2 = line[len(patern)+2]
|
||||
debug.verbose("detect version '" + version + "'")
|
||||
break;
|
||||
if version == None:
|
||||
debug.warning("Can not det version of Pulseaudio ... ==> remove it")
|
||||
return
|
||||
self.set_version([int(version),int(version2)])
|
||||
self.set_valid(True)
|
||||
self.add_depend([
|
||||
'c'
|
||||
])
|
||||
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)
|
||||
|
||||
|
38
lutin/z_system/lutinSystem_Linux_rpc.py
Normal file
38
lutin/z_system/lutinSystem_Linux_rpc.py
Normal file
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("rpc : generic RPC library (developed by oracle)")
|
||||
# No check ==> on the basic std libs:
|
||||
self.set_valid(True)
|
||||
self.add_depend([
|
||||
'c'
|
||||
])
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_flag("link-lib", "rpcsvc")
|
||||
if env.get_isolate_system() == True:
|
||||
self.add_header_file([
|
||||
"/usr/include/rpc/*"
|
||||
],
|
||||
destination_path="rpc",
|
||||
recursive=True)
|
||||
|
||||
|
||||
|
||||
|
39
lutin/z_system/lutinSystem_Linux_uuid.py
Normal file
39
lutin/z_system/lutinSystem_Linux_uuid.py
Normal file
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
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.set_valid(True)
|
||||
self.add_depend([
|
||||
'c'
|
||||
])
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_flag("link-lib", "uuid")
|
||||
if env.get_isolate_system() == True:
|
||||
self.add_header_file([
|
||||
"/usr/include/uuid/*",
|
||||
],
|
||||
destination_path="uuid",
|
||||
recursive=True)
|
||||
|
||||
|
42
lutin/z_system/lutinSystem_Linux_va.py
Normal file
42
lutin/z_system/lutinSystem_Linux_va.py
Normal file
@@ -0,0 +1,42 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("va : Video Acceleration")
|
||||
# check if the library exist:
|
||||
if not os.path.isfile("/usr/include/va/va.h"):
|
||||
# we did not find the library reqiested (just return) (automaticly set at false)
|
||||
return;
|
||||
# No check ==> on the basic std libs:
|
||||
self.set_valid(True)
|
||||
self.add_depend([
|
||||
'X11'
|
||||
])
|
||||
self.add_flag("link-lib", ["va", "va-drm", "va-x11"])
|
||||
if env.get_isolate_system() == True:
|
||||
#self.add_flag("link-lib", "xns")
|
||||
self.add_header_file([
|
||||
"/usr/include/va/*"
|
||||
],
|
||||
destination_path="va",
|
||||
recursive=True)
|
||||
|
||||
|
||||
|
||||
|
41
lutin/z_system/lutinSystem_Linux_vdpau.py
Normal file
41
lutin/z_system/lutinSystem_Linux_vdpau.py
Normal file
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("vdpau : Video decaudatge hardware Acceleration")
|
||||
# check if the library exist:
|
||||
if not os.path.isfile("/usr/include/vdpau/vdpau.h"):
|
||||
# we did not find the library reqiested (just return) (automaticly set at false)
|
||||
return;
|
||||
# No check ==> on the basic std libs:
|
||||
self.set_valid(True)
|
||||
self.add_flag("link-lib", "vdpau")
|
||||
self.add_depend([
|
||||
'X11'
|
||||
])
|
||||
if env.get_isolate_system() == True:
|
||||
self.add_header_file([
|
||||
"/usr/include/vdpau/*"
|
||||
],
|
||||
destination_path="vdpau",
|
||||
recursive=True)
|
||||
|
||||
|
||||
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
@@ -10,19 +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_LD(["-lz"])
|
||||
self.add_flag("link-lib", "z")
|
||||
self.add_depend([
|
||||
'c'
|
||||
])
|
||||
|
||||
if env.get_isolate_system() == True:
|
||||
self.add_header_file([
|
||||
"/usr/include/zlib.h"
|
||||
],
|
||||
destination_path="")
|
||||
|
||||
|
||||
|
32
lutin/z_system/lutinSystem_MacOs_AVFoundation.py
Normal file
32
lutin/z_system/lutinSystem_MacOs_AVFoundation.py
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("OpenGL: Generic graphic library")
|
||||
self.set_valid(True)
|
||||
# no check needed ==> just add this:
|
||||
self.add_depend([
|
||||
'c'
|
||||
])
|
||||
self.add_flag('link', [
|
||||
"-framework AVFoundation"
|
||||
])
|
||||
|
||||
|
||||
|
25
lutin/z_system/lutinSystem_MacOs_AppKit.py
Normal file
25
lutin/z_system/lutinSystem_MacOs_AppKit.py
Normal file
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("CoreAudio : MacOs interface for application builder kit (all time present, just system interface)")
|
||||
self.set_valid(True)
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_flag("link", "-framework AppKit")
|
||||
|
26
lutin/z_system/lutinSystem_MacOs_Cocoa.py
Normal file
26
lutin/z_system/lutinSystem_MacOs_Cocoa.py
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("CoreAudio : MacOs interface for basic cocoa graphic (all time present, just system interface)")
|
||||
self.set_valid(True)
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_flag("link", "-framework Cocoa")
|
||||
self.add_depend("QuartzCore")
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
@@ -10,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_LD("-framework CoreAudio")
|
||||
self.add_export_flag_LD("-framework CoreFoundation")
|
||||
self.add_flag("link", "-framework CoreAudio")
|
||||
self.add_flag("link", "-framework CoreFoundation")
|
||||
|
||||
|
32
lutin/z_system/lutinSystem_MacOs_CoreGraphics.py
Normal file
32
lutin/z_system/lutinSystem_MacOs_CoreGraphics.py
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("OpenGL: Generic graphic library")
|
||||
self.set_valid(True)
|
||||
# no check needed ==> just add this:
|
||||
self.add_depend([
|
||||
'c'
|
||||
])
|
||||
self.add_flag('link', [
|
||||
"-framework CoreGraphics"
|
||||
])
|
||||
|
||||
|
||||
|
32
lutin/z_system/lutinSystem_MacOs_CoreMedia.py
Normal file
32
lutin/z_system/lutinSystem_MacOs_CoreMedia.py
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("OpenGL: Generic graphic library")
|
||||
self.set_valid(True)
|
||||
# no check needed ==> just add this:
|
||||
self.add_depend([
|
||||
'c'
|
||||
])
|
||||
self.add_flag('link', [
|
||||
"-framework CoreMedia"
|
||||
])
|
||||
|
||||
|
||||
|
32
lutin/z_system/lutinSystem_MacOs_CoreServices.py
Normal file
32
lutin/z_system/lutinSystem_MacOs_CoreServices.py
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("OpenGL: Generic graphic library")
|
||||
self.set_valid(True)
|
||||
# no check needed ==> just add this:
|
||||
self.add_depend([
|
||||
'c'
|
||||
])
|
||||
self.add_flag('link', [
|
||||
"-framework CoreServices"
|
||||
])
|
||||
|
||||
|
||||
|
32
lutin/z_system/lutinSystem_MacOs_CoreVideo.py
Normal file
32
lutin/z_system/lutinSystem_MacOs_CoreVideo.py
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("OpenGL: Generic graphic library")
|
||||
self.set_valid(True)
|
||||
# no check needed ==> just add this:
|
||||
self.add_depend([
|
||||
'c'
|
||||
])
|
||||
self.add_flag('link', [
|
||||
"-framework CoreVideo"
|
||||
])
|
||||
|
||||
|
||||
|
27
lutin/z_system/lutinSystem_MacOs_Foundation.py
Normal file
27
lutin/z_system/lutinSystem_MacOs_Foundation.py
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("CoreAudio : Ios interface for fundation (all time present, just system interface)")
|
||||
self.set_valid(True)
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_flag("link", "-framework Foundation")
|
||||
self.add_depend("QuartzCore")
|
||||
|
||||
|
26
lutin/z_system/lutinSystem_MacOs_QuartzCore.py
Normal file
26
lutin/z_system/lutinSystem_MacOs_QuartzCore.py
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("QuartzCore : MacOs interface for base application (all time present, just system interface)")
|
||||
self.set_valid(True)
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_flag("link", "-framework QuartzCore")
|
||||
self.add_depend("AppKit")
|
||||
|
32
lutin/z_system/lutinSystem_MacOs_VideoDecodeAcceleration.py
Normal file
32
lutin/z_system/lutinSystem_MacOs_VideoDecodeAcceleration.py
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("OpenGL: Generic graphic library")
|
||||
self.set_valid(True)
|
||||
# no check needed ==> just add this:
|
||||
self.add_depend([
|
||||
'c'
|
||||
])
|
||||
self.add_flag('link', [
|
||||
"-framework VideoDecodeAcceleration"
|
||||
])
|
||||
|
||||
|
||||
|
24
lutin/z_system/lutinSystem_MacOs_c.py
Normal file
24
lutin/z_system/lutinSystem_MacOs_c.py
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("C: Generic C library")
|
||||
self.add_flag("c-remove","-nodefaultlibs")
|
||||
self.set_valid(True)
|
||||
|
29
lutin/z_system/lutinSystem_MacOs_cxx.py
Normal file
29
lutin/z_system/lutinSystem_MacOs_cxx.py
Normal file
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("CXX: Generic C++ library")
|
||||
self.set_valid(True)
|
||||
# no check needed ==> just add this:
|
||||
self.add_depend("c")
|
||||
self.add_flag("c++","-D__STDCPP_LLVM__")
|
||||
self.add_flag("c++-remove","-nostdlib")
|
||||
self.add_flag("need-libstdc++", True)
|
||||
|
||||
|
27
lutin/z_system/lutinSystem_MacOs_m.py
Normal file
27
lutin/z_system/lutinSystem_MacOs_m.py
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
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.set_valid(True)
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_flag("link-lib", "m")
|
||||
|
||||
|
32
lutin/z_system/lutinSystem_MacOs_opengl.py
Normal file
32
lutin/z_system/lutinSystem_MacOs_opengl.py
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("OpenGL: Generic graphic library")
|
||||
self.set_valid(True)
|
||||
# no check needed ==> just add this:
|
||||
self.add_depend([
|
||||
'c'
|
||||
])
|
||||
self.add_flag('link', [
|
||||
"-framework OpenGL"
|
||||
])
|
||||
|
||||
|
||||
|
44
lutin/z_system/lutinSystem_MacOs_pthread.py
Normal file
44
lutin/z_system/lutinSystem_MacOs_pthread.py
Normal file
@@ -0,0 +1,44 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
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.set_valid(True)
|
||||
# todo : create a searcher of the presence of the library:
|
||||
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/")
|
||||
"""
|
||||
|
||||
|
||||
|
26
lutin/z_system/lutinSystem_Windows_advapi.py
Normal file
26
lutin/z_system/lutinSystem_Windows_advapi.py
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("advapi interface")
|
||||
self.set_valid(True)
|
||||
self.add_flag('link-lib', 'advapi32')
|
||||
|
||||
|
||||
|
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
26
lutin/z_system/lutinSystem_Windows_avicap.py
Normal file
26
lutin/z_system/lutinSystem_Windows_avicap.py
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("avicap interface")
|
||||
self.set_valid(True)
|
||||
self.add_flag('link-lib', 'avicap32')
|
||||
|
||||
|
||||
|
23
lutin/z_system/lutinSystem_Windows_c.py
Normal file
23
lutin/z_system/lutinSystem_Windows_c.py
Normal file
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("C: Generic C library")
|
||||
self.set_valid(True)
|
||||
|
34
lutin/z_system/lutinSystem_Windows_cxx.py
Normal file
34
lutin/z_system/lutinSystem_Windows_cxx.py
Normal file
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("CXX: Generic C++ library")
|
||||
self.set_valid(True)
|
||||
# no check needed ==> just add this:
|
||||
self.add_flag("c++","-D__STDCPP_GNU__")
|
||||
self.add_flag("c++-remove","-nostdlib")
|
||||
# force static link to prenvent many errors ...
|
||||
self.add_flag("link", [
|
||||
"-static-libgcc",
|
||||
"-static-libstdc++",
|
||||
"-static"
|
||||
])
|
||||
self.add_flag("need-libstdc++", True)
|
||||
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
@@ -10,22 +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="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_LD(["-ldsound",
|
||||
"-lwinmm",
|
||||
"-lole32"
|
||||
])
|
||||
self.add_flag("link-lib",[
|
||||
"dsound",
|
||||
"winmm",
|
||||
"ole32"
|
||||
])
|
||||
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user