Compare commits

...

17 Commits
0.1.0 ... 0.3.0

Author SHA1 Message Date
dd03e46832 [DEV] separate multiprocess log and display it corectly with the compile line 2014-10-17 21:46:31 +02:00
7c72aa8b84 [LOG] change log comment and level for an uncompilable file 2014-10-09 21:23:19 +02:00
0f4349e65a [DEBUG] correction of missing file in dependency 2014-10-08 21:52:22 +02:00
d0fb9045c4 [DEV] error android debug key 2014-10-01 22:12:31 +02:00
0042e68581 [DEV] debug clean 2014-09-17 21:13:35 +02:00
0cb58135fd [DEBUG] android build is back 2014-09-17 00:28:54 +02:00
33dc55d84b [DEV] Add target searching and multi processor compilation 2014-09-16 21:40:07 +02:00
67297b3063 [DEV] start think on multiple architecture type 2014-09-15 22:37:53 +02:00
e46e6add5e [DEBUG] windows compilation (32 bit only) 2014-09-15 21:46:47 +02:00
b1cbee3b4b Merge remote-tracking branch 'origin/dev' 2014-09-11 06:52:47 +02:00
02a72568c9 [DEV] remove resize image when no PIL is found (for TRAVIS building) 2014-09-09 06:40:16 +02:00
dd46d2d7b4 [DEV] remove resize image when no PIL is found (for TRAVIS building) 2014-09-09 06:25:29 +02:00
92c552fd59 [DEV] update android build to new ndk r10 2014-08-28 21:04:03 +02:00
885a60f22c [DEBUG] missing heritage instance on prebuilt element 2014-08-18 22:57:06 +02:00
db4a587a44 [LICENCE] change BSD => apache v2.0 2014-08-09 23:55:31 +02:00
9d6418eed9 [DEV] add autocompletion for lutin.py 2014-08-07 21:00:31 +02:00
ec60375c9f [DEBUG] correct the android path defining 2014-06-18 14:57:24 +02:00
25 changed files with 707 additions and 227 deletions

View File

@@ -22,38 +22,20 @@ you can see exemple for some type in :
edn : package
glew : prebuild
Copyright (c)
=============
License (APACHE v2.0)
=====================
2011, Edouard DUPIN
Copyright lutin Edouard DUPIN
License (DSB)
=============
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
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
http://www.apache.org/licenses/LICENSE-2.0
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
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.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
3. The name of the author may not be used to endorse or promote
products derived from this software without specific prior
written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

90
bash-autocompletion/lutin.py Executable file
View File

@@ -0,0 +1,90 @@
_lutin()
{
local cur prev optshorts opts renameprev listmodule
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
optshorts="-h -v -C -f -P -j -s -t -c -m -r -p"
opts="--help --verbose --color --force --pretty --jobs --force-strip --target --compilator --mode --prj --package --simulation"
renameprev=${prev}
case "${renameprev}" in
-h)
renameprev="--help"
;;
-v)
renameprev="--verbose"
;;
-C)
renameprev="--color"
;;
-f)
renameprev="--force"
;;
-P)
renameprev="--pretty"
;;
-j)
renameprev="--jobs"
;;
-s)
renameprev="--force-strip"
;;
-t)
renameprev="--target"
;;
-c)
renameprev="--compilator"
;;
-m)
renameprev="--mode"
;;
-r)
renameprev="--prj"
;;
-p)
renameprev="--package"
;;
esac
#
# Complete the arguments to some of the basic commands.
#
case "${renameprev}" in
--compilator)
local names="clang gcc"
COMPREPLY=( $(compgen -W "${names}" -- ${cur}) )
return 0
;;
--jobs)
local names="1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20"
COMPREPLY=( $(compgen -W "${names}" -- ${cur}) )
return 0
;;
--target)
local names=`lutin.py --list-target`
COMPREPLY=( $(compgen -W "${names}" -- ${cur}) )
return 0
;;
--mode)
local names="debug release"
COMPREPLY=( $(compgen -W "${names}" -- ${cur}) )
return 0
;;
*)
;;
esac
if [[ ${cur} == --* ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
fi
if [[ ${cur} == -* ]] ; then
COMPREPLY=( $(compgen -W "${optshorts}" -- ${cur}) )
return 0
fi
listmodule=`lutin.py --list-module`
COMPREPLY=( $(compgen -W "${listmodule}" -- ${cur}) )
return 0
}
complete -F _lutin lutin.py

View File

@@ -0,0 +1,6 @@
to install autocompletion for lutin :
sudo cp bash-autocompletion/lutin.py /etc/bash_completion.d
==> and restart bash ...

13
licence.txt Normal file
View File

@@ -0,0 +1,13 @@
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.

View File

@@ -1,32 +0,0 @@
Copyright (c) 2011, Edouard DUPIN
License (DSB)
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
3. The name of the author may not be used to endorse or promote
products derived from this software without specific prior
written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.L

View File

@@ -1,4 +1,12 @@
#!/usr/bin/python
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license APACHE v2.0 (see license file)
##
# for path inspection:
import sys
import os
@@ -21,12 +29,16 @@ myLutinArg.add(lutinArg.ArgDefine("j", "jobs", haveParam=True, desc="Specifies t
myLutinArg.add(lutinArg.ArgDefine("s", "force-strip", desc="Force the stripping of the compile elements"))
myLutinArg.add_section("properties", "keep in the sequency of the cible")
myLutinArg.add(lutinArg.ArgDefine("t", "target", list=[["Android",""],["Linux",""],["MacOs",""],["IOs",""],["Windows",""]], desc="Select a target (by default the platform is the computer that compile this"))
myLutinArg.add(lutinArg.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'"))
myLutinArg.add(lutinArg.ArgDefine("c", "compilator", list=[["clang",""],["gcc",""]], desc="Compile with clang or Gcc mode (by default gcc will be used)"))
myLutinArg.add(lutinArg.ArgDefine("m", "mode", list=[["debug",""],["release",""]], desc="Compile in release or debug mode (default release)"))
myLutinArg.add(lutinArg.ArgDefine("a", "arch", list=[["auto","Automatic choice"],["arm","Arm processer"],["x86","Generic PC : AMD/Intel"],["ppc","Power PC"]], desc="Architecture to compile"))
myLutinArg.add(lutinArg.ArgDefine("b", "bus", list=[["auto","Automatic choice"],["32","32 bits"],["64","64 bits"]], desc="Adressing size (Bus size)"))
myLutinArg.add(lutinArg.ArgDefine("r", "prj", desc="Use external project management (not build with lutin..."))
myLutinArg.add(lutinArg.ArgDefine("p", "package", desc="Disable the package generation (usefull when just compile for test on linux ...)"))
myLutinArg.add(lutinArg.ArgDefine("", "simulation", desc="simulater mode (availlable only for IOS)"))
myLutinArg.add(lutinArg.ArgDefine("", "list-target", desc="list all availlables targets ==> for auto completion"))
myLutinArg.add(lutinArg.ArgDefine("", "list-module", desc="list all availlables module ==> for auto completion"))
myLutinArg.add_section("cible", "generate in order set")
localArgument = myLutinArg.parse()
@@ -58,6 +70,28 @@ def parseGenericArg(argument,active):
if active==False:
usage()
return True
if argument.get_option_nName() == "list-module":
if active==False:
listOfModule = lutinModule.list_all_module()
retValue = ""
for moduleName in listOfModule:
if retValue != "":
retValue += " "
retValue += moduleName
print retValue
exit(0)
return True
if argument.get_option_nName() == "list-target":
if active==False:
listOfTarget = lutinTarget.list_all_target()
retValue = ""
for targetName in listOfTarget:
if retValue != "":
retValue += " "
retValue += targetName
print retValue
exit(0)
return True
elif argument.get_option_nName()=="jobs":
if active==True:
lutinMultiprocess.set_core_number(int(argument.get_arg()))
@@ -100,50 +134,59 @@ import lutinTools
def Start():
#available target : Linux / MacOs / Windows / Android ...
targetName=lutinHost.OS
#compilation base
compilator="gcc"
# build mode
mode="release"
# package generationMode
generatePackage=True
config = {
"compilator":"gcc",
"mode":"release",
"bus-size":"auto",
"arch":"auto",
"generate-package":True,
"simulation":False,
"extern-build":False
}
# load the default target :
target = None
simulationMode=False
actionDone=False
#build with extern tool
externBuild=False
# parse all argument
for argument in localArgument:
if True==parseGenericArg(argument, False):
continue
elif argument.get_option_nName() == "package":
generatePackage=False
config["generate-package"]=False
elif argument.get_option_nName() == "simulation":
simulationMode=True
config["simulation"]=True
elif argument.get_option_nName() == "prj":
externBuild=True
config["extern-build"]=True
elif argument.get_option_nName() == "bus":
config["bus-size"]=argument.get_arg()
elif argument.get_option_nName() == "arch":
config["arch"]=argument.get_arg()
elif argument.get_option_nName() == "compilator":
if compilator!=argument.get_arg():
if config["compilator"] != argument.get_arg():
debug.debug("change compilator ==> " + argument.get_arg())
compilator=argument.get_arg()
config["compilator"] = argument.get_arg()
#remove previous target
target = None
elif argument.get_option_nName() == "target":
# No check input ==> this will be verify automaticly chen the target will be loaded
if targetName!=argument.get_arg():
targetName=argument.get_arg()
debug.debug("change target ==> " + targetName + " & reset mode : gcc&release")
debug.debug("change target ==> '" + targetName + "' & reset mode : gcc&release")
#reset properties by defauult:
compilator="gcc"
mode="release"
generatePackage=True
simulationMode=False
config = {
"compilator":"gcc",
"mode":"release",
"bus-size":"auto",
"arch":"auto",
"generate-package":True,
"simulation":False,
"extern-build":False
}
#remove previous target
target = None
elif argument.get_option_nName() == "mode":
if mode!=argument.get_arg():
mode = argument.get_arg()
debug.debug("change mode ==> " + mode)
if config["mode"]!=argument.get_arg():
config["mode"] = argument.get_arg()
debug.debug("change mode ==> " + config["mode"])
#remove previous target
target = None
else:
@@ -153,14 +196,14 @@ def Start():
else:
#load the target if needed :
if target == None:
target = lutinTarget.target_load(targetName, compilator, mode, generatePackage, externBuild, simulationMode)
target = lutinTarget.load_target(targetName, config)
target.build(argument.get_arg())
actionDone=True
# if no action done : we do "all" ...
if actionDone==False:
#load the target if needed :
if target == None:
target = lutinTarget.target_load(targetName, compilator, mode, generatePackage, externBuild, simulationMode)
target = lutinTarget.load_target(targetName, config)
target.build("all")
# stop all started threads
lutinMultiprocess.un_init()
@@ -184,6 +227,7 @@ if __name__ == '__main__':
and folder.lower()!="out" :
debug.debug("Automatic load path: '" + folder + "'")
lutinModule.import_path(folder)
lutinTarget.import_path(folder)
Start()

View File

@@ -1,4 +1,12 @@
#!/usr/bin/python
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license APACHE v2.0 (see license file)
##
import sys
import lutinDebug as debug

View File

@@ -1,8 +1,17 @@
#!/usr/bin/python
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license APACHE v2.0 (see license file)
##
import os
import thread
import lutinMultiprocess
import threading
import re
debugLevel=3
debugColor=False
@@ -41,58 +50,80 @@ def enable_color():
global color_cyan
color_cyan = "\033[36m"
def verbose(input):
def verbose(input, force=False):
global debugLock
global debugLevel
if debugLevel >= 5:
if debugLevel >= 5 \
or force == True:
debugLock.acquire()
print(color_blue + input + color_default)
debugLock.release()
def debug(input):
def debug(input, force=False):
global debugLock
global debugLevel
if debugLevel >= 4:
if debugLevel >= 4 \
or force == True:
debugLock.acquire()
print(color_green + input + color_default)
debugLock.release()
def info(input):
def info(input, force=False):
global debugLock
global debugLevel
if debugLevel >= 3:
if debugLevel >= 3 \
or force == True:
debugLock.acquire()
print(input + color_default)
debugLock.release()
def warning(input):
def warning(input, force=False):
global debugLock
global debugLevel
if debugLevel >= 2:
if debugLevel >= 2 \
or force == True:
debugLock.acquire()
print(color_purple + "[WARNING] " + input + color_default)
debugLock.release()
def error(input, threadID=-1):
def error(input, threadID=-1, force=False, crash=True):
global debugLock
global debugLevel
if debugLevel >= 1:
if debugLevel >= 1 \
or force == True:
debugLock.acquire()
print(color_red + "[ERROR] " + input + color_default)
debugLock.release()
lutinMultiprocess.error_occured()
if threadID != -1:
thread.interrupt_main()
exit(-1)
#os_exit(-1)
#raise "error happend"
if crash==True:
lutinMultiprocess.error_occured()
if threadID != -1:
thread.interrupt_main()
exit(-1)
#os_exit(-1)
#raise "error happend"
def print_element(type, lib, dir, name):
def print_element(type, lib, dir, name, force=False):
global debugLock
global debugLevel
if debugLevel >= 3:
if debugLevel >= 3 \
or force == True:
debugLock.acquire()
print(color_cyan + type + color_default + " : " + color_yellow + lib + color_default + " " + dir + " " + color_blue + name + color_default)
debugLock.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)
debugLock.acquire()
print(myString)
debugLock.release()

View File

@@ -1,4 +1,12 @@
#!/usr/bin/python
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license APACHE v2.0 (see license file)
##
import os
import lutinDebug as debug
import lutinEnv as environement
@@ -21,6 +29,11 @@ def need_re_build(dst, src, dependFile=None, file_cmd="", cmdLine=""):
and os.path.exists(dst) == False:
debug.verbose(" ==> must rebuild (dst does not exist)")
return True
if dst != "" \
and dst != None \
and os.path.exists(src) == False:
debug.warning(" ==> unexistant file :'" + src + "'")
return True
# chek the basic date if the 2 files
if dst != "" \
and dst != None \

View File

@@ -1,4 +1,12 @@
#!/usr/bin/python
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license APACHE v2.0 (see license file)
##
import lutinDebug as debug
@@ -21,7 +29,7 @@ printPrettyMode=False
def set_print_pretty_mode(val):
global printPrettyMode
if val==True:
if val == True:
printPrettyMode = True
else:
printPrettyMode = False
@@ -30,9 +38,10 @@ def get_print_pretty_mode():
global printPrettyMode
return printPrettyMode
def print_pretty(myString):
def print_pretty(myString, force=False):
global printPrettyMode
if True==printPrettyMode:
if printPrettyMode == True \
or force == True:
if myString[len(myString)-1]==' ' :
tmpcmdLine = myString[:len(myString)-1]
else :

View File

@@ -1,4 +1,12 @@
#!/usr/bin/python
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license APACHE v2.0 (see license file)
##
import lutinDebug as debug
import datetime
import lutinTools

View File

@@ -1,4 +1,12 @@
#!/usr/bin/python
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license APACHE v2.0 (see license file)
##
import lutinDebug as debug
import datetime
import lutinTools as tools

View File

@@ -1,4 +1,12 @@
#!/usr/bin/python
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license APACHE v2.0 (see license file)
##
import sys
import lutinDebug as debug

View File

@@ -1,4 +1,12 @@
#!/usr/bin/python
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license APACHE v2.0 (see license file)
##
import platform
import sys
import lutinDebug as debug
@@ -13,8 +21,13 @@ elif platform.system() == "Darwin":
else:
debug.error("Unknow the Host OS ... '" + platform.system() + "'")
debug.debug(" host.OS = " + OS)
debug.debug("host.OS = " + OS)
OS64BITS = sys.maxsize > 2**32
OS32BITS = OS64BITS==False
if sys.maxsize > 2**32:
BUS_SIZE = 64
else:
BUS_SIZE = 32
debug.debug("host.BUS_SIZE = " + str(BUS_SIZE))

View File

@@ -1,15 +1,27 @@
#!/usr/bin/python
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license APACHE v2.0 (see license file)
##
import lutinDebug as debug
import lutinTools as tools
import platform
import os
import lutinMultiprocess
import lutinDepend as dependency
if platform.system() == "Darwin":
import CoreGraphics
else:
from PIL import Image
enableResizeImage = True
try:
if platform.system() == "Darwin":
import CoreGraphics
else:
from PIL import Image
except:
enableResizeImage = False
debug.warning("Missing python tools : CoreGraphics (MacOs) or PIL")
def get_pow_2_multiple(size):
base = 2
@@ -22,6 +34,8 @@ def get_pow_2_multiple(size):
# check if time change
# check if command line change
def resize(srcFile, destFile, x, y, cmd_file=None):
if enableResizeImage == False:
return
if os.path.exists(srcFile) == False:
debug.error("Request a resize an image that does not existed : '" + srcFile + "'")
cmd_line = "resize Image : " + srcFile + " ==> " + destFile + " newSize=(" + str(x) + "x" + str(y) + ")"

View File

@@ -1,4 +1,12 @@
#!/usr/bin/python
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license APACHE v2.0 (see license file)
##
import sys
import os
import inspect
@@ -91,7 +99,7 @@ class Module:
"RIGHT" : [],
"ADMOD_POSITION" : "top"
}
self.subHeritageList = None
##
## @brief add Some copilation flags for this module (and only this one)
@@ -318,7 +326,7 @@ class Module:
lutinTools.create_directory_of_file(file_dst)
debug.print_element("SharedLib", libName, "==>", file_dst)
lutinMultiprocess.run_command(cmdLine)
if "release"==target.buildMode \
if target.config["mode"] == "release" \
or lutinEnv.get_force_strip_mode()==True:
# get the file size of the non strip file
originSize = lutinTools.file_size(file_dst);
@@ -360,7 +368,7 @@ class Module:
debug.print_element("Executable", self.name, "==>", file_dst)
lutinMultiprocess.run_command(cmdLine)
if "release"==target.buildMode \
if "release"==target.config["mode"] \
or lutinEnv.get_force_strip_mode()==True:
# get the file size of the non strip file
originSize = lutinTools.file_size(file_dst);
@@ -427,6 +435,8 @@ class Module:
def build(self, target, packageName):
# ckeck if not previously build
if target.is_module_build(self.name)==True:
if self.subHeritageList == None:
self.localHeritage = heritage.heritage(self)
return self.subHeritageList
# create the packege heritage
self.localHeritage = heritage.heritage(self)
@@ -473,7 +483,7 @@ class Module:
resFile = self.compile_m_to_o(file, packageName, target, self.subHeritageList)
listSubFileNeededTobuild.append(resFile)
else:
debug.verbose(" TODO : gcc " + self.originFolder + "/" + file)
debug.warning(" UN-SUPPORTED file format: '" + self.originFolder + "/" + file + "'")
# when multiprocess availlable, we need to synchronize here ...
lutinMultiprocess.pool_synchrosize()

View File

@@ -1,4 +1,12 @@
#!/usr/bin/python
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license APACHE v2.0 (see license file)
##
import sys
import lutinDebug as debug
import threading
@@ -8,11 +16,21 @@ import os
import subprocess
import lutinTools
import lutinEnv
import shlex
queueLock = threading.Lock()
workQueue = Queue.Queue()
currentThreadWorking = 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 = {
"id":-1,
"cmd":"",
"return":0,
"err":"",
"out":"",
}
exitFlag = False # resuest stop of the thread
isinit = False # the thread are initialized
@@ -24,7 +42,6 @@ def store_command(cmdLine, file):
if file != "" \
and file != None:
# Create directory:
debug.warning("lklk " + file)
lutinTools.create_directory_of_file(file)
# Store the command Line:
file2 = open(file, "w")
@@ -33,27 +50,62 @@ def store_command(cmdLine, file):
file2.close()
def run_command(cmdLine, storeCmdLine=""):
debug.debug(lutinEnv.print_pretty(cmdLine))
def run_command(cmdLine, storeCmdLine="", buildId=-1, file=""):
global errorOccured
global exitFlag
global currentIdExecution
# prepare command line:
args = shlex.split(cmdLine)
#debug.verbose("cmd = " + str(args))
try:
retcode = subprocess.call(cmdLine, shell=True)
except OSError as e:
print >>sys.stderr, "Execution failed:", e
if retcode != 0:
global errorOccured
# create the subprocess
p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
except subprocess.CalledProcessError as e:
debug.error("subprocess.CalledProcessError : TODO ...")
# launch the subprocess:
output, err = p.communicate()
# Check error :
if p.returncode == 0:
debug.debug(lutinEnv.print_pretty(cmdLine))
queueLock.acquire()
# TODO : Print the output all the time .... ==> to show warnings ...
if buildId >= 0 and (output != "" or err != ""):
debug.warning("output in subprocess compiling: '" + file + "'")
if output != "":
debug.print_compilator(output)
if err != "":
debug.print_compilator(err)
queueLock.release()
else:
errorOccured = True
global exitFlag
exitFlag = True
if retcode == 2:
debug.error("can not compile file ... [keyboard interrrupt]")
# if No ID : Not in a multiprocess mode ==> just stop here
if buildId < 0:
debug.debug(lutinEnv.print_pretty(cmdLine), force=True)
debug.print_compilator(output)
debug.print_compilator(err)
if p.returncode == 2:
debug.error("can not compile file ... [keyboard interrrupt]")
else:
debug.error("can not compile file ... ret : " + str(p.returncode))
else:
debug.error("can not compile file ... ret : " + str(retcode))
# in multiprocess interface
queueLock.acquire()
# if an other write an error before, check if the current process is started before ==> then is the first error
if errorExecution["id"] >= buildId:
# nothing to do ...
queueLock.release()
return;
errorExecution["id"] = buildId
errorExecution["cmd"] = cmdLine
errorExecution["return"] = p.returncode
errorExecution["err"] = err,
errorExecution["out"] = output,
queueLock.release()
# not write the command file...
return
# write cmd line only after to prevent errors ...
store_command(cmdLine, storeCmdLine)
@@ -69,7 +121,7 @@ class myThread(threading.Thread):
global exitFlag
global currentThreadWorking
workingSet = False
while False==exitFlag:
while exitFlag == False:
self.lock.acquire()
if not self.queue.empty():
if workingSet==False:
@@ -82,8 +134,8 @@ class myThread(threading.Thread):
comment = data[2]
cmdLine = data[1]
cmdStoreFile = data[3]
debug.print_element( "[" + str(self.threadID) + "] " + comment[0], comment[1], comment[2], comment[3])
run_command(cmdLine, cmdStoreFile)
debug.print_element( "[" + str(data[4]) + "][" + str(self.threadID) + "] " + comment[0], comment[1], comment[2], comment[3])
run_command(cmdLine, cmdStoreFile, buildId=data[4], file=comment[3])
else:
debug.warning("unknow request command : " + data[0])
else:
@@ -139,21 +191,24 @@ def un_init():
def run_in_pool(cmdLine, comment, storeCmdLine=""):
global currentIdExecution
if processorAvaillable <= 1:
debug.print_element(comment[0], comment[1], comment[2], comment[3])
run_command(cmdLine, storeCmdLine)
run_command(cmdLine, storeCmdLine, file=comment[3])
return
# multithreaded mode
init()
# Fill the queue
queueLock.acquire()
debug.verbose("add : in pool cmdLine")
workQueue.put(["cmdLine", cmdLine, comment, storeCmdLine])
workQueue.put(["cmdLine", cmdLine, comment, storeCmdLine, currentIdExecution])
currentIdExecution +=1;
queueLock.release()
def pool_synchrosize():
global errorOccured
global errorExecution
if processorAvaillable <= 1:
#in this case : nothing to synchronise
return
@@ -172,7 +227,17 @@ def pool_synchrosize():
if False==errorOccured:
debug.verbose("queue is empty")
else:
debug.debug("Thread return with error ... ==> stop all the pool")
un_init()
debug.error("Pool error occured ...")
debug.debug("Thread return with error ... ==> stop all the pool")
if errorExecution["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(lutinEnv.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("can not compile file ... [keyboard interrrupt]")
else:
debug.error("can not compile file ... return value : " + str(errorExecution["return"]))

View File

@@ -1,50 +1,67 @@
#!/usr/bin/python
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license APACHE v2.0 (see license file)
##
import sys
import os
import inspect
import fnmatch
import lutinDebug as debug
import datetime
import lutinTools
import lutinModule
import lutinImage
import lutinHost
class Target:
def __init__(self, name, typeCompilator, debugMode, generatePackage, arch, cross, sumulator=False):
def __init__(self, name, config, arch):
self.config = config
#processor type selection (auto/arm/ppc/x86)
self.selectArch = config["arch"]; # TODO : Remove THIS ...
#bus size selection (auto/32/64)
self.selectBus = config["bus-size"]; # TODO : Remove THIS ...
if config["bus-size"] == "auto":
debug.error("system error ==> must generate the default 'bus-size' config")
if config["arch"] == "auto":
debug.error("system error ==> must generate the default 'bus-size' config")
debug.debug("config=" + str(config))
if arch != "":
self.arch = "-arch " + arch
else:
self.arch = ""
self.sumulator = sumulator
self.cross = cross
# todo : remove this :
self.sumulator = config["simulation"]
self.name=name
self.endGeneratePackage = generatePackage
self.endGeneratePackage = config["generate-package"]
debug.info("=================================");
debug.info("== Target='" + self.name + "'");
debug.info("== Target='" + self.name + "' " + config["bus-size"] + " bits for arch '" + config["arch"] + "'");
debug.info("=================================");
self.ar=self.cross + "ar"
self.ranlib=self.cross + "ranlib"
if typeCompilator == "clang":
self.cc=self.cross + "clang"
self.xx=self.cross + "clang++"
#self.ar=self.cross + "llvm-ar"
#self.ranlib="ls"
else:
self.cc=self.cross + "gcc"
self.xx=self.cross + "g++"
#self.ar=self.cross + "ar"
#self.ranlib=self.cross + "ranlib"
self.ld=self.cross + "ld"
self.nm=self.cross + "nm"
self.strip=self.cross + "strip"
self.dlltool=self.cross + "dlltool"
self.set_cross_base()
###############################################################################
# Target global variables.
###############################################################################
self.global_include_cc=[]
self.global_flags_cc=['-D__TARGET_OS__'+self.name,
'-D__TARGET_ARCH__'+self.selectArch,
'-D__TARGET_ADDR__'+self.selectBus + 'BITS',
'-D_REENTRANT']
if self.name != "Windows":
self.global_flags_xx=['-std=c++11']
self.global_flags_mm=['-std=c++11']
else:
self.global_flags_xx=['-static-libgcc', '-static-libstdc++', '-L', '-std=c++11']
self.global_flags_xx=['-static-libgcc', '-static-libstdc++', '-std=c++11']
self.global_flags_mm=[]
self.global_flags_m=[]
self.global_flags_ar=['rcs']
@@ -65,19 +82,14 @@ class Target:
self.folder_arch="/" + self.name
if "debug" == debugMode:
self.buildMode = "debug"
if "debug" == self.config["mode"]:
self.global_flags_cc.append("-g")
self.global_flags_cc.append("-DDEBUG")
self.global_flags_cc.append("-O0")
else:
self.buildMode = "release"
self.global_flags_cc.append("-DNDEBUG")
self.global_flags_cc.append("-O3")
self.folder_out="/out" + self.folder_arch + "/" + self.buildMode
self.folder_final="/final/" + typeCompilator
self.folder_staging="/staging/" + typeCompilator
self.folder_build="/build/" + typeCompilator
self.update_folder_tree()
self.folder_bin="/usr/bin"
self.folder_lib="/usr/lib"
self.folder_data="/usr/share"
@@ -92,6 +104,33 @@ class Target:
self.externProjectManager = None
def update_folder_tree(self):
self.folder_out="/out/" + self.name + "_" + self.config["arch"] + "_" + self.config["bus-size"] + "/" + self.config["mode"]
self.folder_final="/final/" + self.config["compilator"]
self.folder_staging="/staging/" + self.config["compilator"]
self.folder_build="/build/" + self.config["compilator"]
def set_cross_base(self, cross=""):
self.cross = cross
debug.debug("== Target='" + self.cross + "'");
self.ar = self.cross + "ar"
self.ranlib = self.cross + "ranlib"
if self.config["compilator"] == "clang":
self.cc = self.cross + "clang"
self.xx = self.cross + "clang++"
#self.ar=self.cross + "llvm-ar"
#self.ranlib="ls"
else:
self.cc = self.cross + "gcc"
self.xx = self.cross + "g++"
#self.ar=self.cross + "ar"
#self.ranlib=self.cross + "ranlib"
self.ld = self.cross + "ld"
self.nm = self.cross + "nm"
self.strip = self.cross + "strip"
self.dlltool = self.cross + "dlltool"
self.update_folder_tree()
def set_use_of_extern_build_tool(self, mode):
if mode == True:
if self.externProjectManager == None:
@@ -101,7 +140,7 @@ class Target:
self.externProjectManager = None
def get_build_mode(self):
return self.buildMode
return self.config["mode"]
def add_image_staging(self, inputFile, outputFile, sizeX, sizeY, cmdFile=None):
for source, dst, x, y, cmdFile2 in self.listFinalFile:
@@ -321,13 +360,61 @@ class Target:
debug.error("not know module name : '" + moduleName + "' to '" + actionName + "' it")
__startTargetName="lutinTarget"
targetList=[]
__startTargetName="lutinTarget_"
def target_load(targetName, compilator, mode, generatePackage, externBuild, simulationMode):
theTarget = __import__(__startTargetName + targetName)
#try:
tmpTarget = theTarget.Target(compilator, mode, generatePackage, simulationMode)
tmpTarget.set_use_of_extern_build_tool(externBuild)
return tmpTarget
#except:
# debug.error("Can not create the Target : '" + targetName + "'")
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, __startTargetName + "*.py")
# Import the module :
for filename in tmpList:
debug.debug(' 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)) )
targetName = filename.replace('.py', '')
targetName = targetName.replace(__startTargetName, '')
debug.debug("integrate module: '" + targetName + "' from '" + os.path.join(root, filename) + "'")
targetList.append([targetName,os.path.join(root, filename)])
def load_target(name, config):
global targetList
debug.debug("load target: " + name)
if len(targetList) == 0:
debug.error("No target to compile !!!")
debug.debug("list target: " + str(targetList))
for mod in targetList:
if mod[0] == name:
debug.verbose("add to path: '" + os.path.dirname(mod[1]) + "'")
sys.path.append(os.path.dirname(mod[1]))
debug.verbose("import target : '" + __startTargetName + name + "'")
theTarget = __import__(__startTargetName + name)
#create the target
tmpTarget = theTarget.Target(config)
#tmpTarget.set_use_of_extern_build_tool(externBuild)
return tmpTarget
def list_all_target():
global targetList
tmpListName = []
for mod in targetList:
tmpListName.append(mod[0])
return tmpListName
def list_all_target_with_desc():
global targetList
tmpList = []
for mod in targetList:
sys.path.append(os.path.dirname(mod[1]))
theTarget = __import__(__startTargetName + mod[0])
try:
tmpdesc = theTarget.get_desc()
tmpList.append([mod[0], tmpdesc])
except:
debug.warning("has no name : " + mod[0])
tmpList.append([mod[0], ""])
return tmpList

View File

@@ -1,4 +1,12 @@
#!/usr/bin/python
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license APACHE v2.0 (see license file)
##
import os
import shutil
import errno

View File

@@ -1,4 +1,12 @@
#!/usr/bin/python
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license APACHE v2.0 (see license file)
##
import lutinDebug as debug
import lutinTarget
@@ -6,11 +14,21 @@ import lutinTools
import lutinHost
import lutinImage
import lutinMultiprocess
import lutinHost
import os
import sys
class Target(lutinTarget.Target):
def __init__(self, typeCompilator, debugMode, generatePackage, sumulator=False):
def __init__(self, config):
#processor type selection (auto/arm/ppc/x86)
if config["arch"] == "auto":
config["arch"] = "arm"
#bus size selection (auto/32/64)
if config["bus-size"] == "auto":
config["bus-size"] = "32"
arch = ""#"ARMv7"
lutinTarget.Target.__init__(self, "Android", config, arch)
self.folder_ndk = os.getenv('PROJECT_NDK', "AUTO")
self.folder_sdk = os.getenv('PROJECT_SDK', "AUTO")
@@ -31,26 +49,30 @@ class Target(lutinTarget.Target):
if self.folder_sdk == "AUTO":
self.folder_sdk = lutinTools.get_run_folder() + "/../android/sdk"
arch = ""#"ARMv7"
if not os.path.isdir(self.folder_ndk):
debug.error("NDK path not set !!! set env : PROJECT_NDK on the NDK path")
if not os.path.isdir(self.folder_sdk):
debug.error("SDK path not set !!! set env : PROJECT_SDK on the SDK path")
tmpOsVal = "64"
gccVersion = "4.8"
if lutinHost.OS64BITS==True:
if lutinHost.BUS_SIZE==64:
tmpOsVal = "_64"
if typeCompilator == "clang":
cross = self.folder_ndk + "/toolchains/llvm-3.3/prebuilt/linux-x86_64/bin/"
if self.config["compilator"] == "clang":
self.set_cross_base(self.folder_ndk + "/toolchains/llvm-3.3/prebuilt/linux-x86_64/bin/")
else:
baseFolderArm = self.folder_ndk + "/toolchains/arm-linux-androideabi-" + gccVersion + "/prebuilt/linux-x86" + tmpOsVal + "/bin/"
baseFolderMips = self.folder_ndk + "/toolchains/mipsel-linux-android-" + gccVersion + "/prebuilt/linux-x86" + tmpOsVal + "/bin/"
baseFolderX86 = self.folder_ndk + "/toolchains/x86-" + gccVersion + "/prebuilt/linux-x86" + tmpOsVal + "/bin/"
cross = baseFolderArm + "arm-linux-androideabi-"
self.set_cross_base(baseFolderArm + "arm-linux-androideabi-")
if not os.path.isdir(baseFolderArm):
debug.error("Gcc Arm pah does not exist !!!")
debug.error("Gcc Arm path does not exist !!!")
if not os.path.isdir(baseFolderMips):
debug.info("Gcc Mips pah does not exist !!!")
debug.info("Gcc Mips path does not exist !!!")
if not os.path.isdir(baseFolderX86):
debug.info("Gcc x86 pah does not exist !!!")
debug.info("Gcc x86 path does not exist !!!")
lutinTarget.Target.__init__(self, "Android", typeCompilator, debugMode, generatePackage, arch, cross, sumulator)
arch = "ARMv7"
# for gcc :
@@ -73,7 +95,7 @@ class Target(lutinTarget.Target):
self.global_include_cc.append("-I" + self.folder_ndk +"/platforms/android-" + str(self.boardId) + "/arch-x86/usr/include/")
if True:
if typeCompilator == "clang":
if self.config["compilator"] == "clang":
self.global_include_cc.append("-I" + self.folder_ndk +"/sources/cxx-stl/llvm-libc++/libcxx/include/")
if arch == "ARMv5":
stdCppBasePath = self.folder_ndk +"/sources/cxx-stl/llvm-libc++/libcxx/libs/armeabi/"
@@ -177,7 +199,7 @@ class Target(lutinTarget.Target):
debug.info("Generate package '" + pkgName + "'")
debug.debug("------------------------------------------------------------------------")
pkgNameApplicationName = pkgName
if "debug"==self.buildMode:
if self.config["mode"] == "debug":
pkgNameApplicationName += "debug"
# FINAL_FOLDER_JAVA_PROJECT
self.folder_javaProject= self.get_staging_folder(pkgName) \
@@ -204,7 +226,7 @@ class Target(lutinTarget.Target):
tmpFile.write( "/**\n")
tmpFile.write( " * @author Edouard DUPIN, Kevin BILLONNEAU\n")
tmpFile.write( " * @copyright 2011, Edouard DUPIN, all right reserved\n")
tmpFile.write( " * @license BSD v3 (see license file)\n")
tmpFile.write( " * @license APACHE v2.0 (see license file)\n")
tmpFile.write( " * @note This file is autogenerate ==> see documantation to generate your own\n")
tmpFile.write( " */\n")
tmpFile.write( "package "+ compleatePackageName + ";\n")
@@ -293,7 +315,7 @@ class Target(lutinTarget.Target):
tmpFile.write( "/**\n")
tmpFile.write( " * @author Edouard DUPIN, Kevin BILLONNEAU\n")
tmpFile.write( " * @copyright 2011, Edouard DUPIN, all right reserved\n")
tmpFile.write( " * @license BSD v3 (see license file)\n")
tmpFile.write( " * @license APACHE v2.0 (see license file)\n")
tmpFile.write( " * @note This file is autogenerate ==> see documantation to generate your own\n")
tmpFile.write( " */\n")
tmpFile.write( "package "+ compleatePackageName + ";\n")
@@ -341,7 +363,7 @@ class Target(lutinTarget.Target):
tmpFile.write( ' <application android:label="' + pkgNameApplicationName + '" \n')
if "ICON" in pkgProperties.keys():
tmpFile.write( ' android:icon="@drawable/icon" \n')
if "debug"==self.buildMode:
if self.config["mode"] == "debug":
tmpFile.write( ' android:debuggable="true" \n')
tmpFile.write( ' >\n')
if "ADMOD_ID" in pkgProperties:
@@ -350,7 +372,7 @@ class Target(lutinTarget.Target):
tmpFile.write( ' <activity android:name=".' + pkgNameApplicationName + '" \n')
tmpFile.write( ' android:label="' + pkgProperties['NAME'])
if "debug"==self.buildMode:
if self.config["mode"] == "debug":
tmpFile.write("-debug")
tmpFile.write( '"\n')
if "ICON" in pkgProperties.keys():
@@ -375,7 +397,7 @@ class Target(lutinTarget.Target):
tmpFile.write( ' >\n')
tmpFile.write( ' <service android:name=".' + pkgNameApplicationName + '" \n')
tmpFile.write( ' android:label="' + pkgProperties['NAME'])
if "debug"==self.buildMode:
if self.config["mode"] == "debug":
tmpFile.write("-debug")
tmpFile.write( '"\n')
if "ICON" in pkgProperties.keys():
@@ -557,7 +579,7 @@ class Target(lutinTarget.Target):
# http://asantoso.wordpress.com/2009/09/15/how-to-build-android-application-package-apk-from-the-command-line-using-the-sdk-tools-continuously-integrated-using-cruisecontrol/
debug.print_element("pkg", "R.java", "<==", "Resources files")
lutinTools.create_directory_of_file(self.get_staging_folder(pkgName) + "/src/noFile")
androidToolPath = self.folder_sdk + "/build-tools/19.0.3/"
androidToolPath = self.folder_sdk + "/build-tools/20.0.0/"
adModResouceFolder = ""
if "ADMOD_ID" in pkgProperties:
adModResouceFolder = " -S " + self.folder_sdk + "/extras/google/google_play_services/libproject/google-play-services_lib/res/ "
@@ -642,7 +664,7 @@ class Target(lutinTarget.Target):
# http://developer.android.com/tools/publishing/app-signing.html
# Create a key for signing your application:
# keytool -genkeypair -v -keystore AndroidKey.jks -storepass Pass__AndroidDebugKey -alias alias__AndroidDebugKey -keypass PassKey__AndroidDebugKey -keyalg RSA -validity 36500
if "debug"==self.buildMode:
if self.config["mode"] == "debug":
tmpFile = open("tmpPass.boo", 'w')
tmpFile.write("Pass__AndroidDebugKey\n")
tmpFile.write("PassKey__AndroidDebugKey\n")
@@ -681,7 +703,7 @@ class Target(lutinTarget.Target):
debug.print_element("pkg", ".apk(aligned)", "<==", ".apk (not aligned)")
lutinTools.remove_file(self.get_staging_folder(pkgName) + "/" + pkgNameApplicationName + ".apk")
# verbose mode : -v
cmdLine = self.folder_sdk + "/tools/zipalign 4 " \
cmdLine = androidToolPath + "zipalign 4 " \
+ self.get_staging_folder(pkgName) + "/build/" + pkgNameApplicationName + "-unalligned.apk " \
+ self.get_staging_folder(pkgName) + "/" + pkgNameApplicationName + ".apk "
lutinMultiprocess.run_command(cmdLine)
@@ -696,7 +718,7 @@ class Target(lutinTarget.Target):
debug.info("Install package '" + pkgName + "'")
debug.debug("------------------------------------------------------------------------")
pkgNameApplicationName = pkgName
if "debug"==self.buildMode:
if self.config["mode"] == "debug":
pkgNameApplicationName += "debug"
cmdLine = self.folder_sdk + "/platform-tools/adb install -r " \
+ self.get_staging_folder(pkgName) + "/" + pkgNameApplicationName + ".apk "
@@ -707,7 +729,7 @@ class Target(lutinTarget.Target):
debug.info("Un-Install package '" + pkgName + "'")
debug.debug("------------------------------------------------------------------------")
pkgNameApplicationName = pkgName
if "debug"==self.buildMode:
if self.config["mode"] == "debug":
pkgNameApplicationName += "debug"
cmdLine = self.folder_sdk + "/platform-tools/adb uninstall " + pkgNameApplicationName
RlutinMultiprocess.unCommand(cmdLine)

View File

@@ -1,4 +1,12 @@
#!/usr/bin/python
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license APACHE v2.0 (see license file)
##
import lutinDebug as debug
import lutinTarget
import lutinTools
@@ -7,24 +15,34 @@ import os
import stat
import lutinExtProjectGeneratorXCode
import lutinMultiprocess
import lutinHost
import random
import re
class Target(lutinTarget.Target):
def __init__(self, typeCompilator, debugMode, generatePackage, sumulator=False):
if typeCompilator == "gcc":
def __init__(self, config):
if config["compilator"] == "gcc":
debug.info("compile only with clang for IOs");
typeCompilator = "clang"
config["compilator"] = "clang"
#processor type selection (auto/arm/ppc/x86)
if config["arch"] == "auto":
config["arch"] = "arm"
#bus size selection (auto/32/64)
if config["bus-size"] == "auto":
config["bus-size"] = "64"
# http://biolpc22.york.ac.uk/pub/linux-mac-cross/
# http://devs.openttd.org/~truebrain/compile-farm/apple-darwin9.txt
if sumulator == True:
arch = "i386"
cross = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/"
else:
arch="arm64" # for ipad air
#arch="armv7" # for Iphone 4
cross = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/"
lutinTarget.Target.__init__(self, "IOs", typeCompilator, debugMode, generatePackage, arch, cross, sumulator)
lutinTarget.Target.__init__(self, "IOs", config, arch)
if self.config["simulation"] == True:
self.set_cross_base("/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/")
else:
self.set_cross_base("/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/")
# remove unneeded ranlib ...
self.ranlib=""

View File

@@ -1,4 +1,12 @@
#!/usr/bin/python
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license APACHE v2.0 (see license file)
##
import lutinDebug as debug
import lutinTarget
import lutinTools as tools
@@ -6,10 +14,25 @@ import os
import stat
import re
import lutinMultiprocess
import lutinHost
class Target(lutinTarget.Target):
def __init__(self, typeCompilator, debugMode, generatePackage, sumulator=False):
lutinTarget.Target.__init__(self, "Linux", typeCompilator, debugMode, generatePackage, "", "")
def __init__(self, config):
#processor type selection (auto/arm/ppc/x86)
if config["arch"] == "auto":
config["arch"] = "x86"
#bus size selection (auto/32/64)
if config["bus-size"] == "auto":
config["bus-size"] = str(lutinHost.BUS_SIZE)
lutinTarget.Target.__init__(self, "Linux", config, "")
if self.config["bus-size"] == "64":
# 64 bits
if lutinHost.BUS_SIZE != 64:
self.global_flags_cc.append("-m64")
else:
# 32 bits
if lutinHost.BUS_SIZE != 32:
self.global_flags_cc.append("-m32")
def generate_list_separate_coma(self, list):
result = ""

View File

@@ -1,17 +1,30 @@
#!/usr/bin/python
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license APACHE v2.0 (see license file)
##
import lutinDebug as debug
import lutinTarget
import lutinTools
import lutinHost
import os
import stat
class Target(lutinTarget.Target):
def __init__(self, typeCompilator, debugMode, generatePackage, sumulator=False):
cross = ""
def __init__(self, config):
#processor type selection (auto/arm/ppc/x86)
if config["arch"] == "auto":
config["arch"] = "x86"
#bus size selection (auto/32/64)
if config["bus-size"] == "auto":
config["bus-size"] = str(lutinHost.BUS_SIZE)
# http://biolpc22.york.ac.uk/pub/linux-mac-cross/
# http://devs.openttd.org/~truebrain/compile-farm/apple-darwin9.txt
lutinTarget.Target.__init__(self, "MacOs", typeCompilator, debugMode, generatePackage, "", cross)
lutinTarget.Target.__init__(self, "MacOs", config, "")
self.folder_bin="/MacOS"
self.folder_lib="/lib"

View File

@@ -1,30 +1,49 @@
#!/usr/bin/python
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license APACHE v2.0 (see license file)
##
import lutinDebug as debug
import lutinTarget
import lutinTools
import lutinHost
import os
import stat
import lutinHost
import sys
class Target(lutinTarget.Target):
def __init__(self, typeCompilator, debugMode, generatePackage, sumulator=False):
def __init__(self, config):
if config["compilator"] != "gcc":
debug.error("Windows does not support '" + config["compilator"] + "' compilator ... availlable : [gcc]")
config["compilator"] = "gcc"
#processor type selection (auto/arm/ppc/x86)
if config["arch"] == "auto":
config["arch"] = "x86"
#bus size selection (auto/32/64)
if config["bus-size"] == "auto":
config["bus-size"] = str(lutinHost.BUS_SIZE)
lutinTarget.Target.__init__(self, "Windows", config, "")
# on windows board the basic path is not correct
# TODO : get external PATH for the minGW path
# TODO : Set the cyngwin path ...
if lutinHost.OS == "Windows":
cross = "c:\\MinGW\\bin\\"
self.set_cross_base("c:\\MinGW\\bin\\")
sys.path.append("c:\\MinGW\\bin" )
os.environ['PATH'] += ";c:\\MinGW\\bin\\"
else:
#cross = "i586-mingw32msvc-"
cross = "x86_64-w64-mingw32-"
#cross = "i686-w64-mingw32-"
if typeCompilator!="gcc":
debug.error("Android does not support '" + typeCompilator + "' compilator ... availlable : [gcc]")
lutinTarget.Target.__init__(self, "Windows", typeCompilator, debugMode, generatePackage, "", cross)
if self.config["bus-size"] == "64":
# 64 bits
self.set_cross_base("x86_64-w64-mingw32-")
else:
# 32 bits
self.set_cross_base("i686-w64-mingw32-")
self.folder_bin=""
self.folder_lib="/lib"