Compare commits
84 Commits
Author | SHA1 | Date | |
---|---|---|---|
48d1ff1937 | |||
6386467b45 | |||
017cbc50ba | |||
d3be28a1a3 | |||
cb4c8c050f | |||
3a39092af2 | |||
a7732fba54 | |||
66e98727b9 | |||
55e5f44c42 | |||
d7383332cb | |||
f29316f493 | |||
6b2563483f | |||
3058308f18 | |||
b4bce09b46 | |||
a994af78d4 | |||
f6abd70d75 | |||
0946252a10 | |||
03742be308 | |||
7ca034a430 | |||
9131d375b8 | |||
ed7fc49324 | |||
64d39a9def | |||
87bd7f8e7a | |||
94c3c82543 | |||
abfae29839 | |||
75f237b349 | |||
162f7785f0 | |||
898a730f70 | |||
25028a136c | |||
b509625653 | |||
3457215994 | |||
791c7fe6e8 | |||
87d5cde1ae | |||
27a84e888f | |||
dd6adc574e | |||
ee61965e07 | |||
75c6381481 | |||
f24e1a6d90 | |||
0e7458cc06 | |||
fad39e0bb9 | |||
49bb4ffa2b | |||
98e4dc9e8d | |||
0a536b5203 | |||
1c66efa105 | |||
edfe7a1c96 | |||
92a0e5198c | |||
156abe3533 | |||
2992699ec5 | |||
44dbcdd56d | |||
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 |
21
.travis.yml
21
.travis.yml
@@ -1,6 +1,8 @@
|
||||
#language: python
|
||||
language: cpp
|
||||
|
||||
sudo: false
|
||||
#sudo: false
|
||||
sudo: required
|
||||
dist: trusty
|
||||
|
||||
branches:
|
||||
only:
|
||||
@@ -24,14 +26,14 @@ addons:
|
||||
matrix:
|
||||
include:
|
||||
- os: linux
|
||||
env: CONF=release BUILDER=gcc TARGET=Linux TAG=Linux
|
||||
env: CONF=release BUILDER=gcc TARGET=Linux TAG=Linux COMPILATOR_OPTION="--compilator-version=4.9"
|
||||
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
|
||||
compiler: x86_64-w64-mingw32-gcc
|
||||
- os: linux
|
||||
env: CONF=release BUILDER=gcc TARGET=Android TAG=Android DISABLE_PACKAGE=-p
|
||||
compiler: gcc
|
||||
@@ -43,6 +45,8 @@ matrix:
|
||||
compiler: clang
|
||||
|
||||
install:
|
||||
- ./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 ..
|
||||
# download NDK
|
||||
- if [ "$TAG" == "Android" ]; then
|
||||
@@ -53,15 +57,16 @@ install:
|
||||
- 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 *
|
||||
- ls -l
|
||||
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then
|
||||
export PATH=$PATH:/Users/travis/Library/Python/2.7/bin/;
|
||||
fi
|
||||
- ./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=$?
|
||||
- ./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:
|
||||
|
13
COPYING
13
COPYING
@@ -1,13 +0,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.
|
373
LICENSE
Normal file
373
LICENSE
Normal file
@@ -0,0 +1,373 @@
|
||||
Mozilla Public License Version 2.0
|
||||
==================================
|
||||
|
||||
1. Definitions
|
||||
--------------
|
||||
|
||||
1.1. "Contributor"
|
||||
means each individual or legal entity that creates, contributes to
|
||||
the creation of, or owns Covered Software.
|
||||
|
||||
1.2. "Contributor Version"
|
||||
means the combination of the Contributions of others (if any) used
|
||||
by a Contributor and that particular Contributor's Contribution.
|
||||
|
||||
1.3. "Contribution"
|
||||
means Covered Software of a particular Contributor.
|
||||
|
||||
1.4. "Covered Software"
|
||||
means Source Code Form to which the initial Contributor has attached
|
||||
the notice in Exhibit A, the Executable Form of such Source Code
|
||||
Form, and Modifications of such Source Code Form, in each case
|
||||
including portions thereof.
|
||||
|
||||
1.5. "Incompatible With Secondary Licenses"
|
||||
means
|
||||
|
||||
(a) that the initial Contributor has attached the notice described
|
||||
in Exhibit B to the Covered Software; or
|
||||
|
||||
(b) that the Covered Software was made available under the terms of
|
||||
version 1.1 or earlier of the License, but not also under the
|
||||
terms of a Secondary License.
|
||||
|
||||
1.6. "Executable Form"
|
||||
means any form of the work other than Source Code Form.
|
||||
|
||||
1.7. "Larger Work"
|
||||
means a work that combines Covered Software with other material, in
|
||||
a separate file or files, that is not Covered Software.
|
||||
|
||||
1.8. "License"
|
||||
means this document.
|
||||
|
||||
1.9. "Licensable"
|
||||
means having the right to grant, to the maximum extent possible,
|
||||
whether at the time of the initial grant or subsequently, any and
|
||||
all of the rights conveyed by this License.
|
||||
|
||||
1.10. "Modifications"
|
||||
means any of the following:
|
||||
|
||||
(a) any file in Source Code Form that results from an addition to,
|
||||
deletion from, or modification of the contents of Covered
|
||||
Software; or
|
||||
|
||||
(b) any new file in Source Code Form that contains any Covered
|
||||
Software.
|
||||
|
||||
1.11. "Patent Claims" of a Contributor
|
||||
means any patent claim(s), including without limitation, method,
|
||||
process, and apparatus claims, in any patent Licensable by such
|
||||
Contributor that would be infringed, but for the grant of the
|
||||
License, by the making, using, selling, offering for sale, having
|
||||
made, import, or transfer of either its Contributions or its
|
||||
Contributor Version.
|
||||
|
||||
1.12. "Secondary License"
|
||||
means either the GNU General Public License, Version 2.0, the GNU
|
||||
Lesser General Public License, Version 2.1, the GNU Affero General
|
||||
Public License, Version 3.0, or any later versions of those
|
||||
licenses.
|
||||
|
||||
1.13. "Source Code Form"
|
||||
means the form of the work preferred for making modifications.
|
||||
|
||||
1.14. "You" (or "Your")
|
||||
means an individual or a legal entity exercising rights under this
|
||||
License. For legal entities, "You" includes any entity that
|
||||
controls, is controlled by, or is under common control with You. For
|
||||
purposes of this definition, "control" means (a) the power, direct
|
||||
or indirect, to cause the direction or management of such entity,
|
||||
whether by contract or otherwise, or (b) ownership of more than
|
||||
fifty percent (50%) of the outstanding shares or beneficial
|
||||
ownership of such entity.
|
||||
|
||||
2. License Grants and Conditions
|
||||
--------------------------------
|
||||
|
||||
2.1. Grants
|
||||
|
||||
Each Contributor hereby grants You a world-wide, royalty-free,
|
||||
non-exclusive license:
|
||||
|
||||
(a) under intellectual property rights (other than patent or trademark)
|
||||
Licensable by such Contributor to use, reproduce, make available,
|
||||
modify, display, perform, distribute, and otherwise exploit its
|
||||
Contributions, either on an unmodified basis, with Modifications, or
|
||||
as part of a Larger Work; and
|
||||
|
||||
(b) under Patent Claims of such Contributor to make, use, sell, offer
|
||||
for sale, have made, import, and otherwise transfer either its
|
||||
Contributions or its Contributor Version.
|
||||
|
||||
2.2. Effective Date
|
||||
|
||||
The licenses granted in Section 2.1 with respect to any Contribution
|
||||
become effective for each Contribution on the date the Contributor first
|
||||
distributes such Contribution.
|
||||
|
||||
2.3. Limitations on Grant Scope
|
||||
|
||||
The licenses granted in this Section 2 are the only rights granted under
|
||||
this License. No additional rights or licenses will be implied from the
|
||||
distribution or licensing of Covered Software under this License.
|
||||
Notwithstanding Section 2.1(b) above, no patent license is granted by a
|
||||
Contributor:
|
||||
|
||||
(a) for any code that a Contributor has removed from Covered Software;
|
||||
or
|
||||
|
||||
(b) for infringements caused by: (i) Your and any other third party's
|
||||
modifications of Covered Software, or (ii) the combination of its
|
||||
Contributions with other software (except as part of its Contributor
|
||||
Version); or
|
||||
|
||||
(c) under Patent Claims infringed by Covered Software in the absence of
|
||||
its Contributions.
|
||||
|
||||
This License does not grant any rights in the trademarks, service marks,
|
||||
or logos of any Contributor (except as may be necessary to comply with
|
||||
the notice requirements in Section 3.4).
|
||||
|
||||
2.4. Subsequent Licenses
|
||||
|
||||
No Contributor makes additional grants as a result of Your choice to
|
||||
distribute the Covered Software under a subsequent version of this
|
||||
License (see Section 10.2) or under the terms of a Secondary License (if
|
||||
permitted under the terms of Section 3.3).
|
||||
|
||||
2.5. Representation
|
||||
|
||||
Each Contributor represents that the Contributor believes its
|
||||
Contributions are its original creation(s) or it has sufficient rights
|
||||
to grant the rights to its Contributions conveyed by this License.
|
||||
|
||||
2.6. Fair Use
|
||||
|
||||
This License is not intended to limit any rights You have under
|
||||
applicable copyright doctrines of fair use, fair dealing, or other
|
||||
equivalents.
|
||||
|
||||
2.7. Conditions
|
||||
|
||||
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
|
||||
in Section 2.1.
|
||||
|
||||
3. Responsibilities
|
||||
-------------------
|
||||
|
||||
3.1. Distribution of Source Form
|
||||
|
||||
All distribution of Covered Software in Source Code Form, including any
|
||||
Modifications that You create or to which You contribute, must be under
|
||||
the terms of this License. You must inform recipients that the Source
|
||||
Code Form of the Covered Software is governed by the terms of this
|
||||
License, and how they can obtain a copy of this License. You may not
|
||||
attempt to alter or restrict the recipients' rights in the Source Code
|
||||
Form.
|
||||
|
||||
3.2. Distribution of Executable Form
|
||||
|
||||
If You distribute Covered Software in Executable Form then:
|
||||
|
||||
(a) such Covered Software must also be made available in Source Code
|
||||
Form, as described in Section 3.1, and You must inform recipients of
|
||||
the Executable Form how they can obtain a copy of such Source Code
|
||||
Form by reasonable means in a timely manner, at a charge no more
|
||||
than the cost of distribution to the recipient; and
|
||||
|
||||
(b) You may distribute such Executable Form under the terms of this
|
||||
License, or sublicense it under different terms, provided that the
|
||||
license for the Executable Form does not attempt to limit or alter
|
||||
the recipients' rights in the Source Code Form under this License.
|
||||
|
||||
3.3. Distribution of a Larger Work
|
||||
|
||||
You may create and distribute a Larger Work under terms of Your choice,
|
||||
provided that You also comply with the requirements of this License for
|
||||
the Covered Software. If the Larger Work is a combination of Covered
|
||||
Software with a work governed by one or more Secondary Licenses, and the
|
||||
Covered Software is not Incompatible With Secondary Licenses, this
|
||||
License permits You to additionally distribute such Covered Software
|
||||
under the terms of such Secondary License(s), so that the recipient of
|
||||
the Larger Work may, at their option, further distribute the Covered
|
||||
Software under the terms of either this License or such Secondary
|
||||
License(s).
|
||||
|
||||
3.4. Notices
|
||||
|
||||
You may not remove or alter the substance of any license notices
|
||||
(including copyright notices, patent notices, disclaimers of warranty,
|
||||
or limitations of liability) contained within the Source Code Form of
|
||||
the Covered Software, except that You may alter any license notices to
|
||||
the extent required to remedy known factual inaccuracies.
|
||||
|
||||
3.5. Application of Additional Terms
|
||||
|
||||
You may choose to offer, and to charge a fee for, warranty, support,
|
||||
indemnity or liability obligations to one or more recipients of Covered
|
||||
Software. However, You may do so only on Your own behalf, and not on
|
||||
behalf of any Contributor. You must make it absolutely clear that any
|
||||
such warranty, support, indemnity, or liability obligation is offered by
|
||||
You alone, and You hereby agree to indemnify every Contributor for any
|
||||
liability incurred by such Contributor as a result of warranty, support,
|
||||
indemnity or liability terms You offer. You may include additional
|
||||
disclaimers of warranty and limitations of liability specific to any
|
||||
jurisdiction.
|
||||
|
||||
4. Inability to Comply Due to Statute or Regulation
|
||||
---------------------------------------------------
|
||||
|
||||
If it is impossible for You to comply with any of the terms of this
|
||||
License with respect to some or all of the Covered Software due to
|
||||
statute, judicial order, or regulation then You must: (a) comply with
|
||||
the terms of this License to the maximum extent possible; and (b)
|
||||
describe the limitations and the code they affect. Such description must
|
||||
be placed in a text file included with all distributions of the Covered
|
||||
Software under this License. Except to the extent prohibited by statute
|
||||
or regulation, such description must be sufficiently detailed for a
|
||||
recipient of ordinary skill to be able to understand it.
|
||||
|
||||
5. Termination
|
||||
--------------
|
||||
|
||||
5.1. The rights granted under this License will terminate automatically
|
||||
if You fail to comply with any of its terms. However, if You become
|
||||
compliant, then the rights granted under this License from a particular
|
||||
Contributor are reinstated (a) provisionally, unless and until such
|
||||
Contributor explicitly and finally terminates Your grants, and (b) on an
|
||||
ongoing basis, if such Contributor fails to notify You of the
|
||||
non-compliance by some reasonable means prior to 60 days after You have
|
||||
come back into compliance. Moreover, Your grants from a particular
|
||||
Contributor are reinstated on an ongoing basis if such Contributor
|
||||
notifies You of the non-compliance by some reasonable means, this is the
|
||||
first time You have received notice of non-compliance with this License
|
||||
from such Contributor, and You become compliant prior to 30 days after
|
||||
Your receipt of the notice.
|
||||
|
||||
5.2. If You initiate litigation against any entity by asserting a patent
|
||||
infringement claim (excluding declaratory judgment actions,
|
||||
counter-claims, and cross-claims) alleging that a Contributor Version
|
||||
directly or indirectly infringes any patent, then the rights granted to
|
||||
You by any and all Contributors for the Covered Software under Section
|
||||
2.1 of this License shall terminate.
|
||||
|
||||
5.3. In the event of termination under Sections 5.1 or 5.2 above, all
|
||||
end user license agreements (excluding distributors and resellers) which
|
||||
have been validly granted by You or Your distributors under this License
|
||||
prior to termination shall survive termination.
|
||||
|
||||
************************************************************************
|
||||
* *
|
||||
* 6. Disclaimer of Warranty *
|
||||
* ------------------------- *
|
||||
* *
|
||||
* Covered Software is provided under this License on an "as is" *
|
||||
* basis, without warranty of any kind, either expressed, implied, or *
|
||||
* statutory, including, without limitation, warranties that the *
|
||||
* Covered Software is free of defects, merchantable, fit for a *
|
||||
* particular purpose or non-infringing. The entire risk as to the *
|
||||
* quality and performance of the Covered Software is with You. *
|
||||
* Should any Covered Software prove defective in any respect, You *
|
||||
* (not any Contributor) assume the cost of any necessary servicing, *
|
||||
* repair, or correction. This disclaimer of warranty constitutes an *
|
||||
* essential part of this License. No use of any Covered Software is *
|
||||
* authorized under this License except under this disclaimer. *
|
||||
* *
|
||||
************************************************************************
|
||||
|
||||
************************************************************************
|
||||
* *
|
||||
* 7. Limitation of Liability *
|
||||
* -------------------------- *
|
||||
* *
|
||||
* Under no circumstances and under no legal theory, whether tort *
|
||||
* (including negligence), contract, or otherwise, shall any *
|
||||
* Contributor, or anyone who distributes Covered Software as *
|
||||
* permitted above, be liable to You for any direct, indirect, *
|
||||
* special, incidental, or consequential damages of any character *
|
||||
* including, without limitation, damages for lost profits, loss of *
|
||||
* goodwill, work stoppage, computer failure or malfunction, or any *
|
||||
* and all other commercial damages or losses, even if such party *
|
||||
* shall have been informed of the possibility of such damages. This *
|
||||
* limitation of liability shall not apply to liability for death or *
|
||||
* personal injury resulting from such party's negligence to the *
|
||||
* extent applicable law prohibits such limitation. Some *
|
||||
* jurisdictions do not allow the exclusion or limitation of *
|
||||
* incidental or consequential damages, so this exclusion and *
|
||||
* limitation may not apply to You. *
|
||||
* *
|
||||
************************************************************************
|
||||
|
||||
8. Litigation
|
||||
-------------
|
||||
|
||||
Any litigation relating to this License may be brought only in the
|
||||
courts of a jurisdiction where the defendant maintains its principal
|
||||
place of business and such litigation shall be governed by laws of that
|
||||
jurisdiction, without reference to its conflict-of-law provisions.
|
||||
Nothing in this Section shall prevent a party's ability to bring
|
||||
cross-claims or counter-claims.
|
||||
|
||||
9. Miscellaneous
|
||||
----------------
|
||||
|
||||
This License represents the complete agreement concerning the subject
|
||||
matter hereof. If any provision of this License is held to be
|
||||
unenforceable, such provision shall be reformed only to the extent
|
||||
necessary to make it enforceable. Any law or regulation which provides
|
||||
that the language of a contract shall be construed against the drafter
|
||||
shall not be used to construe this License against a Contributor.
|
||||
|
||||
10. Versions of the License
|
||||
---------------------------
|
||||
|
||||
10.1. New Versions
|
||||
|
||||
Mozilla Foundation is the license steward. Except as provided in Section
|
||||
10.3, no one other than the license steward has the right to modify or
|
||||
publish new versions of this License. Each version will be given a
|
||||
distinguishing version number.
|
||||
|
||||
10.2. Effect of New Versions
|
||||
|
||||
You may distribute the Covered Software under the terms of the version
|
||||
of the License under which You originally received the Covered Software,
|
||||
or under the terms of any subsequent version published by the license
|
||||
steward.
|
||||
|
||||
10.3. Modified Versions
|
||||
|
||||
If you create software not governed by this License, and you want to
|
||||
create a new license for such software, you may create and use a
|
||||
modified version of this License if you rename the license and remove
|
||||
any references to the name of the license steward (except to note that
|
||||
such modified license differs from this License).
|
||||
|
||||
10.4. Distributing Source Code Form that is Incompatible With Secondary
|
||||
Licenses
|
||||
|
||||
If You choose to distribute Source Code Form that is Incompatible With
|
||||
Secondary Licenses under the terms of this version of the License, the
|
||||
notice described in Exhibit B of this License must be attached.
|
||||
|
||||
Exhibit A - Source Code Form License Notice
|
||||
-------------------------------------------
|
||||
|
||||
This Source Code Form is subject to the terms of the Mozilla Public
|
||||
License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
If it is not possible or desirable to put the notice in a particular
|
||||
file, then You may include the notice in a location (such as a LICENSE
|
||||
file in a relevant directory) where a recipient would be likely to look
|
||||
for such a notice.
|
||||
|
||||
You may add additional accurate notices of copyright ownership.
|
||||
|
||||
Exhibit B - "Incompatible With Secondary Licenses" Notice
|
||||
---------------------------------------------------------
|
||||
|
||||
This Source Code Form is "Incompatible With Secondary Licenses", as
|
||||
defined by the Mozilla Public License, v. 2.0.
|
@@ -67,16 +67,16 @@ Install pip on MacOs:
|
||||
sudo easy_install pip
|
||||
|
||||
|
||||
License (APACHE v2.0)
|
||||
License (MPL v2.0)
|
||||
---------------------
|
||||
|
||||
Copyright lutin Edouard DUPIN
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
Licensed under the Mozilla Public 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
|
||||
https://www.mozilla.org/MPL/2.0/
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
|
94
bin/lutin
94
bin/lutin
@@ -5,16 +5,17 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
# for path inspection:
|
||||
import sys
|
||||
import os
|
||||
import copy
|
||||
from realog import debug as debug
|
||||
import lutin
|
||||
import lutin.debug as debug
|
||||
import lutin.arg as arguments
|
||||
import death.Arguments as arguments
|
||||
import death.ArgElement as arg_element
|
||||
import lutin.host as host
|
||||
import lutin.module as module
|
||||
import lutin.target as target
|
||||
@@ -24,7 +25,7 @@ import lutin.tools as tools
|
||||
import lutin.host as lutinHost
|
||||
import lutin.tools as lutinTools
|
||||
|
||||
myArgs = arguments.LutinArg()
|
||||
myArgs = arguments.Arguments()
|
||||
myArgs.add("h", "help", desc="Display this help")
|
||||
myArgs.add("H", "HELP", desc="Display this help (with all compleate information)")
|
||||
myArgs.add_section("option", "Can be set one time in all case")
|
||||
@@ -38,10 +39,11 @@ myArgs.add("s", "force-strip", desc="Force the stripping of the compile elements
|
||||
myArgs.add("o", "force-optimisation", desc="Force optimisation of the build")
|
||||
myArgs.add("w", "warning", desc="Store warning in a file build file")
|
||||
myArgs.add("i", "isolate-system", desc="Isolate system build (copy header of c and c++ system lib to not include unneeded external libs) EXPERIMENTAL (archlinux)")
|
||||
myArgs.add("K", "ccache", desc="Enable the ccache interface")
|
||||
|
||||
myArgs.add_section("properties", "keep in the sequency of the cible")
|
||||
myArgs.add("t", "target", haveParam=True, desc="Select a target (by default the platform is the computer that compile this) To know list : 'lutin.py --list-target'")
|
||||
myArgs.add("c", "compilator", list=[["clang",""],["gcc",""]], desc="Compile with clang or Gcc mode (by default gcc will be used)")
|
||||
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")
|
||||
@@ -69,6 +71,15 @@ def usage(full=False):
|
||||
print(" clean all (same as previous)")
|
||||
print(" " + color['green'] + "dump" + color['default'])
|
||||
print(" Dump all the module dependency and properties")
|
||||
print(" " + color['green'] + "dependency" + color['default'])
|
||||
print(" generate a file dependency.dot that represent all the dependency link")
|
||||
print(" Select what in included: 'dependency:LPBDK'")
|
||||
print(" L: Library")
|
||||
print(" P: Pre-build")
|
||||
print(" D: Data")
|
||||
print(" B: Binary")
|
||||
print(" K: Package")
|
||||
print(" eg: lutin dependency:LD ; dot -Tsvg dependency.dot -o dependency.svg ; firefox dependency.svg")
|
||||
print(" " + color['green'] + "gcov" + color['default'])
|
||||
print(" Parse all the code of the library with the gcov resolution")
|
||||
listOfAllModule = module.list_all_module_with_desc()
|
||||
@@ -153,7 +164,12 @@ def usage(full=False):
|
||||
print(" maintainers:")
|
||||
for elem in mod["maintainer"]:
|
||||
print(" " + str(elem))
|
||||
print(" ex: " + sys.argv[0] + " all --target=Android all -t Windows -m debug all")
|
||||
print(" ex simple 1: " + sys.argv[0])
|
||||
print(" ex simple 2: " + sys.argv[0] + " -t Windows")
|
||||
print(" ex multiple platform : " + sys.argv[0] + " all --target=Android all -t Windows -m debug all")
|
||||
print(" ex complex arguments : " + sys.argv[0] + " -cclang -mdebug zeus-package-base?build?run%zeus-launcher:--srv=user:--elog-level=5")
|
||||
print(" ex gcov: " + sys.argv[0] + " -cgcc --gcov -mdebug etk-test?build?run etk?gcov")
|
||||
print(" ex gcov with output: " + sys.argv[0] + " -cgcc --gcov -mdebug etk-test?build?run etk?gcov:output")
|
||||
exit(0)
|
||||
|
||||
def check_boolean(value):
|
||||
@@ -169,18 +185,18 @@ def check_boolean(value):
|
||||
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:
|
||||
if active == False:
|
||||
usage()
|
||||
return True
|
||||
if argument.get_option_name() == "HELP":
|
||||
if active==False:
|
||||
if active == False:
|
||||
usage(True)
|
||||
return True
|
||||
if argument.get_option_name() == "list-module":
|
||||
if active==False:
|
||||
listOfModule = module.list_all_module()
|
||||
if active == False:
|
||||
list_of_module = module.list_all_module()
|
||||
retValue = ""
|
||||
for moduleName in listOfModule:
|
||||
for moduleName in list_of_module:
|
||||
if retValue != "":
|
||||
retValue += " "
|
||||
retValue += moduleName
|
||||
@@ -188,10 +204,10 @@ def parseGenericArg(argument, active):
|
||||
exit(0)
|
||||
return True
|
||||
if argument.get_option_name() == "list-target":
|
||||
if active==False:
|
||||
listOfTarget = target.list_all_target()
|
||||
if active == False:
|
||||
list_of_target = target.list_all_target()
|
||||
retValue = ""
|
||||
for targetName in listOfTarget:
|
||||
for targetName in list_of_target:
|
||||
if retValue != "":
|
||||
retValue += " "
|
||||
retValue += targetName
|
||||
@@ -199,61 +215,68 @@ def parseGenericArg(argument, active):
|
||||
exit(0)
|
||||
return True
|
||||
elif argument.get_option_name()=="jobs":
|
||||
if active==True:
|
||||
if active == True:
|
||||
multiprocess.set_core_number(int(argument.get_arg()))
|
||||
return True
|
||||
elif argument.get_option_name()=="depth":
|
||||
if active==True:
|
||||
if active == True:
|
||||
env.set_parse_depth(int(argument.get_arg()))
|
||||
return True
|
||||
elif argument.get_option_name()=="ccache":
|
||||
if active == True:
|
||||
if check_boolean(argument.get_arg()) == True:
|
||||
env.set_ccache(True)
|
||||
else:
|
||||
env.set_ccache(False)
|
||||
return True
|
||||
elif argument.get_option_name() == "verbose":
|
||||
if active==True:
|
||||
if active == True:
|
||||
debug.set_level(int(argument.get_arg()))
|
||||
return True
|
||||
elif argument.get_option_name() == "color":
|
||||
if active==True:
|
||||
if active == True:
|
||||
if check_boolean(argument.get_arg()) == True:
|
||||
debug.enable_color()
|
||||
else:
|
||||
debug.disable_color()
|
||||
return True
|
||||
elif argument.get_option_name() == "force-build":
|
||||
if active==True:
|
||||
if active == 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:
|
||||
if active == 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 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 active == True:
|
||||
if check_boolean(argument.get_arg()) == True:
|
||||
env.set_isolate_system(True)
|
||||
else:
|
||||
env.set_isolate_system(False)
|
||||
return True
|
||||
elif argument.get_option_name() == "force-strip":
|
||||
if active==True:
|
||||
if active == 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:
|
||||
if active == True:
|
||||
if check_boolean(argument.get_arg()) == True:
|
||||
env.set_warning_mode(True)
|
||||
else:
|
||||
@@ -279,37 +302,42 @@ if os.path.isfile(config_file) == True:
|
||||
if "get_parsing_depth" in dir(configuration_file):
|
||||
data = configuration_file.get_parsing_depth()
|
||||
debug.debug(" get default config 'get_parsing_depth' val='" + str(data) + "'")
|
||||
parseGenericArg(arguments.ArgElement("depth", str(data)), True)
|
||||
parseGenericArg(arg_element.ArgElement("depth", str(data)), True)
|
||||
|
||||
if "get_ccache" in dir(configuration_file):
|
||||
data = configuration_file.get_ccache()
|
||||
debug.debug(" get default config 'get_ccache' val='" + str(data) + "'")
|
||||
parseGenericArg(arg_element.ArgElement("ccache", str(data)), True)
|
||||
|
||||
if "get_default_jobs" in dir(configuration_file):
|
||||
data = configuration_file.get_default_jobs()
|
||||
debug.debug(" get default config 'get_default_jobs' val='" + str(data) + "'")
|
||||
parseGenericArg(arguments.ArgElement("jobs", str(data)), True)
|
||||
parseGenericArg(arg_element.ArgElement("jobs", str(data)), True)
|
||||
|
||||
if "get_default_color" in dir(configuration_file):
|
||||
data = configuration_file.get_default_color()
|
||||
debug.debug(" get default config 'get_default_color' val='" + str(data) + "'")
|
||||
parseGenericArg(arguments.ArgElement("color", str(data)), True)
|
||||
parseGenericArg(arg_element.ArgElement("color", str(data)), True)
|
||||
|
||||
if "get_default_debug_level" in dir(configuration_file):
|
||||
data = configuration_file.get_default_debug_level()
|
||||
debug.debug(" get default config 'get_default_debug_level' val='" + str(data) + "'")
|
||||
parseGenericArg(arguments.ArgElement("verbose", str(data)), True)
|
||||
parseGenericArg(arg_element.ArgElement("verbose", str(data)), True)
|
||||
|
||||
if "get_default_print_pretty" in dir(configuration_file):
|
||||
data = configuration_file.get_default_print_pretty()
|
||||
debug.debug(" get default config 'get_default_print_pretty' val='" + str(data) + "'")
|
||||
parseGenericArg(arguments.ArgElement("pretty", str(data)), True)
|
||||
parseGenericArg(arg_element.ArgElement("pretty", str(data)), True)
|
||||
|
||||
if "get_default_force_optimisation" in dir(configuration_file):
|
||||
data = configuration_file.get_default_force_optimisation()
|
||||
debug.debug(" get default config 'get_default_force_optimisation' val='" + str(data) + "'")
|
||||
parseGenericArg(arguments.ArgElement("force-optimisation", str(data)), True)
|
||||
parseGenericArg(arg_element.ArgElement("force-optimisation", str(data)), True)
|
||||
|
||||
if "get_default_isolate_system" in dir(configuration_file):
|
||||
data = configuration_file.get_default_isolate_system()
|
||||
debug.debug(" get default config 'get_default_isolate_system' val='" + str(data) + "'")
|
||||
parseGenericArg(arguments.ArgElement("isolate-system", str(data)), True)
|
||||
parseGenericArg(arg_element.ArgElement("isolate-system", str(data)), True)
|
||||
|
||||
|
||||
|
||||
@@ -323,7 +351,7 @@ 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",
|
||||
@@ -364,7 +392,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",
|
||||
|
@@ -7,7 +7,7 @@ Lutin permit simply to compile applications and library.
|
||||
|
||||
To simply understand the use, we will use a simple library:
|
||||
|
||||
```bash
|
||||
```{.sh}
|
||||
git clone http://github.con/atria-soft/etk.git
|
||||
```
|
||||
|
||||
@@ -17,7 +17,7 @@ compile a module: {#lutin_use_compile}
|
||||
|
||||
It is really simple:
|
||||
|
||||
```bash
|
||||
```{.sh}
|
||||
lutin yourModuleName
|
||||
#example:
|
||||
lutin etk
|
||||
@@ -47,7 +47,7 @@ Display help: {#lutin_use_options_help}
|
||||
|
||||
Availlable everywhere ...
|
||||
|
||||
```bash
|
||||
```{.sh}
|
||||
lutin -h
|
||||
lutin --help
|
||||
```
|
||||
@@ -61,7 +61,7 @@ At the end of the help you an see an help about the etk librery with the associa
|
||||
Build in color: {#lutin_use_options_color}
|
||||
---------------
|
||||
|
||||
```bash
|
||||
```{.sh}
|
||||
lutin -C
|
||||
lutin --color
|
||||
```
|
||||
@@ -70,19 +70,19 @@ Display build line in pretty print mode: {#lutin_u
|
||||
----------------------------------------
|
||||
|
||||
when an error apear, the gcc or clang compile line can be really unreadable:
|
||||
```bash
|
||||
```{.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:
|
||||
|
||||
```bash
|
||||
```{.sh}
|
||||
lutin -P
|
||||
lutin --pretty
|
||||
```
|
||||
|
||||
result:
|
||||
```bash
|
||||
```{.sh}
|
||||
g++ \
|
||||
-o /home/XXX/dev/out/Linux_x86_64/release/build/gcc/etk/obj/etk/Color.cpp.o \
|
||||
-I/home/XXX/dev/etk \
|
||||
@@ -115,7 +115,7 @@ lutin log: {#lutin_use_options_log}
|
||||
|
||||
Lutin have an internal log system. To enable or disable it just select your debug level with the option:
|
||||
|
||||
```bash
|
||||
```{.sh}
|
||||
lutin -v4
|
||||
lutin --verbose 4
|
||||
```
|
||||
@@ -134,7 +134,7 @@ Select the number of CPU core used: {#lutin_use_op
|
||||
|
||||
By default lutin manage only 1 CPU core (faster to debug) but for speed requirement you can use use multiple core:
|
||||
|
||||
```bash
|
||||
```{.sh}
|
||||
#for 5 core
|
||||
lutin -j5
|
||||
lutin --jobs 5
|
||||
@@ -145,7 +145,7 @@ Force rebuild all: {#lutin_use_options_rebuild_for
|
||||
|
||||
Sometime it is needed to rebuild all the program, just do:
|
||||
|
||||
```bash
|
||||
```{.sh}
|
||||
lutin -B
|
||||
lutin --force-build
|
||||
# or remove the build directory
|
||||
@@ -157,7 +157,7 @@ Force strip all library and programs: {#lutin_use_
|
||||
|
||||
Force strip of output binary (remove symboles)
|
||||
|
||||
```bash
|
||||
```{.sh}
|
||||
lutin -s
|
||||
lutin --force-strip
|
||||
```
|
||||
@@ -169,7 +169,7 @@ The main objective of lutin is managing the cross compilation to build from linu
|
||||
|
||||
For android you can use:
|
||||
|
||||
```bash
|
||||
```{.sh}
|
||||
lutin -t Android your-module
|
||||
lutin -t Windows your-module
|
||||
```
|
||||
@@ -179,14 +179,14 @@ Build in debug mode: {#lutin_use_options_debug_rel
|
||||
|
||||
To developp it is fasted with debug tools
|
||||
|
||||
```bash
|
||||
```{.sh}
|
||||
lutin -m debug your-module
|
||||
lutin -m release your-module
|
||||
```
|
||||
|
||||
You can desire to have compilation optimisation when you build in debug mode:
|
||||
|
||||
```bash
|
||||
```{.sh}
|
||||
lutin -m debug --force-optimisation your-module
|
||||
```
|
||||
|
||||
@@ -212,7 +212,7 @@ Install your program after building it: {#lutin_us
|
||||
|
||||
You can install your build module:
|
||||
|
||||
```bash
|
||||
```{.sh}
|
||||
lutin -m debug your-module?build?install
|
||||
```
|
||||
|
||||
|
@@ -9,7 +9,7 @@ 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
|
||||
```
|
||||
|
||||
@@ -17,7 +17,7 @@ Replace your ``module-name`` with the delivery you want. The name can contain [a
|
||||
|
||||
In the module name you must define some values:
|
||||
|
||||
```python
|
||||
```{.py}
|
||||
#!/usr/bin/python
|
||||
import lutin.module as module
|
||||
import lutin.tools as tools
|
||||
@@ -45,6 +45,7 @@ def get_desc():
|
||||
# "BSD-1" / "BSD-2" / "BSD-3" / "BSD-4"
|
||||
# "GPL-1" / "GPL-2" / "GPL-3"
|
||||
# "LGPL-1" / "LGPL-2" / "LGPL-3"
|
||||
# "MPL-1" / "MPL-1.1" / "MPL-2"
|
||||
# PROPRIETARY
|
||||
# ...
|
||||
# Note: this fucntion is optionnal.
|
||||
@@ -82,11 +83,12 @@ def get_version():
|
||||
|
||||
# create the module
|
||||
# @param[in] target reference on the Target that is currently build
|
||||
# @param[in] module_name Name of the module that is extract from the file name (to be generic)
|
||||
def create(target, module_name):
|
||||
my_module = module.Module(__file__, module_name, get_type())
|
||||
# @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 my_module
|
||||
return True
|
||||
```
|
||||
|
||||
Thes it is simple to specify build for:
|
||||
@@ -95,7 +97,7 @@ Create a new Module (LIBRARY): {#lutin_module_libr
|
||||
==============================
|
||||
|
||||
What to change:
|
||||
```python
|
||||
```{.py}
|
||||
def get_type():
|
||||
return "LIBRARY"
|
||||
```
|
||||
@@ -112,7 +114,7 @@ Generic Binary: {#lutin_module_binar
|
||||
---------------
|
||||
|
||||
What to change:
|
||||
```python
|
||||
```{.py}
|
||||
def get_type():
|
||||
return "BINARY"
|
||||
```
|
||||
@@ -126,7 +128,7 @@ Create a new Module (TEST-BINARY / TOOL-BINARY): {#lutin_module_binar
|
||||
Two binary are really usefull in developpement, the tools and the test-unit, This is the reason why we specify for this 2 cases.
|
||||
|
||||
Add the subElement description:
|
||||
```python
|
||||
```{.py}
|
||||
def get_type():
|
||||
return "BINARY"
|
||||
|
||||
@@ -134,7 +136,7 @@ def get_sub_type():
|
||||
return "TEST"
|
||||
```
|
||||
or:
|
||||
```python
|
||||
```{.py}
|
||||
def get_type():
|
||||
return "BINARY"
|
||||
|
||||
@@ -149,7 +151,7 @@ Create a new Module (DATA): {#lutin_module_data
|
||||
This pode permit to only copy data and no dependency with compilling system
|
||||
|
||||
What to change:
|
||||
```python
|
||||
```{.py}
|
||||
def get_type():
|
||||
return "DATA"
|
||||
```
|
||||
@@ -163,8 +165,8 @@ Add file to compile: {#lutin_module_int
|
||||
|
||||
This is simple: (you just need to specify all the file to compile)
|
||||
|
||||
```python
|
||||
def create(target, module_name):
|
||||
```{.py}
|
||||
def configure(target, my_module):
|
||||
...
|
||||
|
||||
# add the file to compile:
|
||||
@@ -186,8 +188,8 @@ The developper must isolate the external include and internal include, then luti
|
||||
This permit to check error inclusion directly in developpement and separate the ```#include "XXX.h"``` and the ```#include <lib-xxx/XXX.h>```
|
||||
|
||||
Add file to external include:
|
||||
```python
|
||||
def create(target, module_name):
|
||||
```{.py}
|
||||
def configure(target, my_module):
|
||||
...
|
||||
|
||||
my_module.add_header_file([
|
||||
@@ -199,8 +201,8 @@ def create(target, module_name):
|
||||
```
|
||||
|
||||
You can add a path to your local include:
|
||||
```python
|
||||
def create(target, module_name):
|
||||
```{.py}
|
||||
def configure(target, my_module):
|
||||
...
|
||||
|
||||
my_module.add_path(os.path.join(tools.get_current_path(__file__), "lib-name"))
|
||||
@@ -213,32 +215,32 @@ Add Sub-dependency: {#lutin_module_int
|
||||
-------------------
|
||||
|
||||
All library need to add at minimum of a simple library (C lib) and other if needed. To do it jus call:
|
||||
```python
|
||||
def create(target, module_name):
|
||||
```{.py}
|
||||
def configure(target, my_module):
|
||||
...
|
||||
|
||||
# add dependency of the generic C library:
|
||||
my_module.add_module_depend('c')
|
||||
my_module.add_depend('c')
|
||||
# add dependency of the generic C++ library:
|
||||
my_module.add_module_depend('cxx')
|
||||
my_module.add_depend('cxx')
|
||||
# add dependency of the generic math library:
|
||||
my_module.add_module_depend('m')
|
||||
my_module.add_depend('m')
|
||||
# or other user lib:
|
||||
my_module.add_module_depend('lib-name')
|
||||
my_module.add_depend('lib-name')
|
||||
|
||||
...
|
||||
```
|
||||
|
||||
The system can have optinnal sub-library, then if you just want to add an optionnal dependency:
|
||||
```python
|
||||
def create(target, module_name):
|
||||
```{.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_module_depend('z', ["c++", "-DLIB_NAME_BUILD_ZLIB"])
|
||||
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_module_depend('z', ["c++", "-DLIB_NAME_BUILD_ZLIB"], export=True)
|
||||
my_module.add_optionnal_depend('z', ["c++", "-DLIB_NAME_BUILD_ZLIB"], export=True)
|
||||
|
||||
...
|
||||
```
|
||||
@@ -247,8 +249,8 @@ Compilation adn link flags/libs: {#lutin_module_int
|
||||
--------------------------------
|
||||
|
||||
It is possible to define local and external flags (external are set internal too):
|
||||
```python
|
||||
def create(target, module_name):
|
||||
```{.py}
|
||||
def configure(target, my_module):
|
||||
...
|
||||
# external flags:
|
||||
my_module.add_flag('link-lib', "pthread", export=True)
|
||||
@@ -263,8 +265,8 @@ build mode (release/debug): {#lutin_module_int
|
||||
---------------------------
|
||||
|
||||
To add somes element dependent of the build mode:
|
||||
```python
|
||||
def create(target, module_name):
|
||||
```{.py}
|
||||
def configure(target, my_module):
|
||||
...
|
||||
|
||||
if target.get_mode() == "release":
|
||||
@@ -280,8 +282,8 @@ build type target: {#lutin_module_int
|
||||
|
||||
To add somes element dependent of the target type:
|
||||
|
||||
```python
|
||||
def create(target, module_name):
|
||||
```{.py}
|
||||
def configure(target, my_module):
|
||||
...
|
||||
|
||||
if "Windows" in target.get_type():
|
||||
@@ -308,8 +310,8 @@ Add some data in the install path (share path): {#lutin_module_in
|
||||
|
||||
You can install a simple file:
|
||||
|
||||
```python
|
||||
def create(target, module_name):
|
||||
```{.py}
|
||||
def configure(target, my_module):
|
||||
...
|
||||
|
||||
# copy file in the share/binanyName/ path (no sub path)
|
||||
@@ -320,8 +322,8 @@ def create(target, module_name):
|
||||
|
||||
Copy multiple files (change path)
|
||||
|
||||
```python
|
||||
def create(target, module_name):
|
||||
```{.py}
|
||||
def configure(target, my_module):
|
||||
...
|
||||
|
||||
my_module.copy_path('data/*', 'destinationPath')
|
||||
@@ -333,7 +335,7 @@ display some debug to help writing code: {#lutin_module_in
|
||||
----------------------------------------
|
||||
|
||||
|
||||
```python
|
||||
```{.py}
|
||||
import lutin.debug as debug
|
||||
|
||||
def function(...):
|
||||
@@ -350,12 +352,12 @@ A Full template: {#lutin_module_fu
|
||||
================
|
||||
|
||||
Create the file:
|
||||
```
|
||||
```{.sh}
|
||||
lutin_module-name.py
|
||||
```
|
||||
|
||||
With:
|
||||
```python
|
||||
```{.py}
|
||||
#!/usr/bin/python
|
||||
import lutin.module as module
|
||||
import lutin.tools as tools
|
||||
@@ -385,6 +387,7 @@ def get_desc():
|
||||
# "BSD-1" / "BSD-2" / "BSD-3" / "BSD-4"
|
||||
# "GPL-1" / "GPL-2" / "GPL-3"
|
||||
# "LGPL-1" / "LGPL-2" / "LGPL-3"
|
||||
# "MPL-1" / "MPL-1.1" / "MPL-2"
|
||||
# PROPRIETARY
|
||||
# ...
|
||||
# Note: this fucntion is optionnal.
|
||||
@@ -414,17 +417,20 @@ def get_compagny_name():
|
||||
# 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] module_name Name of the module that is extract from the file name (to be generic)
|
||||
def create(target, module_name):
|
||||
my_module = module.Module(__file__, module_name, get_type())
|
||||
# @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([
|
||||
@@ -441,28 +447,28 @@ def create(target, module_name):
|
||||
my_module.add_path(os.path.join(tools.get_current_path(__file__), "lib-name"))
|
||||
|
||||
# add dependency of the generic C library:
|
||||
my_module.add_module_depend('c')
|
||||
my_module.add_depend('c')
|
||||
# add dependency of the generic C++ library:
|
||||
my_module.add_module_depend('cxx')
|
||||
my_module.add_depend('cxx')
|
||||
# add dependency of the generic math library:
|
||||
my_module.add_module_depend('m')
|
||||
my_module.add_depend('m')
|
||||
# or other user lib:
|
||||
my_module.add_module_depend([
|
||||
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_module_depend('z', ["c++", "-DLIB_NAME_BUILD_ZLIB"])
|
||||
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_module_depend('z', ["c++", "-DLIB_NAME_BUILD_ZLIB"], export=True)
|
||||
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_flags('c', "-DMODE_RELEASE")
|
||||
my_module.add_flag('c', "-DMODE_RELEASE")
|
||||
|
||||
if target.get_mode() == "release":
|
||||
pass
|
||||
@@ -485,7 +491,8 @@ def create(target, module_name):
|
||||
|
||||
my_module.copy_path('data/*', 'destinationPath')
|
||||
|
||||
return my_module
|
||||
# Return True if the module is compatible with the target or ...
|
||||
return True
|
||||
```
|
||||
|
||||
|
||||
|
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
|
||||
```
|
||||
|
||||
Application 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
|
||||
```
|
15
doc/101_Use_on_Android.md
Normal file
15
doc/101_Use_on_Android.md
Normal file
@@ -0,0 +1,15 @@
|
||||
Connect device
|
||||
To connect to a real device or phone via ADB under Arch, you must:
|
||||
|
||||
install android-udev
|
||||
|
||||
plug in your android device via USB.
|
||||
|
||||
Enable USB Debugging on your phone or device:
|
||||
|
||||
Jelly Bean (4.2) and newer: Go to Settings --> About Phone tap “Build Number” 7 times until you get a popup that you have become a developer. Then go to Settings --> Developer --> USB debugging and enable it. The device will ask to allow the computer with its fingerprint to connect. allowing it permanent will copy $HOME/.android/adbkey.pub onto the devices /data/misc/adb/adb_keys folder.
|
||||
|
||||
If android-udev has been installed, add yourself to the adbusers group:
|
||||
|
||||
# gpasswd -a username adbusers
|
||||
|
@@ -63,7 +63,7 @@ Install lutin:
|
||||
--------------
|
||||
|
||||
Just run:
|
||||
```bash
|
||||
```{.sh}
|
||||
pip install lutin
|
||||
```
|
||||
|
||||
@@ -71,24 +71,24 @@ Install pip:
|
||||
------------
|
||||
|
||||
Install pip on debian/ubuntu:
|
||||
```bash
|
||||
```{.sh}
|
||||
sudo apt-get install pip
|
||||
```
|
||||
|
||||
Install pip on ARCH-linux:
|
||||
```bash
|
||||
```{.sh}
|
||||
sudo pacman -S pip
|
||||
```
|
||||
|
||||
Install pip on MacOs:
|
||||
```bash
|
||||
```{.sh}
|
||||
sudo easy_install pip
|
||||
```
|
||||
|
||||
Install from sources:
|
||||
---------------------
|
||||
|
||||
```bash
|
||||
```{.sh}
|
||||
git clone http://github.com/HeeroYui/lutin.git
|
||||
cd lutin
|
||||
sudo ./setup.py install
|
||||
@@ -105,18 +105,19 @@ Tutorals: {#lutin_mainpage_tutorial}
|
||||
- @ref lutin_concept
|
||||
- @ref lutin_use
|
||||
- @ref lutin_module
|
||||
- @ref lutin_ios
|
||||
|
||||
|
||||
License (APACHE v2.0) {#lutin_mainpage_licence}
|
||||
License (MPL v2.0) {#lutin_mainpage_licence}
|
||||
=====================
|
||||
|
||||
Copyright lutin Edouard DUPIN
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
Licensed under the Mozilla Public 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
|
||||
https://www.mozilla.org/MPL/2.0/
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -138,3 +139,6 @@ Some other problem example:
|
||||
- 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)
|
||||
|
@@ -6,7 +6,7 @@ import doxy.tools as tools
|
||||
|
||||
def create(target, module_name):
|
||||
my_module = module.Module(__file__, module_name)
|
||||
my_module.set_version([2,0,0])
|
||||
my_module.set_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)
|
||||
|
@@ -5,18 +5,19 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
import os
|
||||
import sys
|
||||
import fnmatch
|
||||
# Local import
|
||||
from . import macro
|
||||
from . import target
|
||||
from . import builder
|
||||
from . import system
|
||||
from . import host
|
||||
from . import tools
|
||||
from . import debug
|
||||
from realog import debug
|
||||
from . import module
|
||||
from . import env
|
||||
is_init = False
|
||||
@@ -148,6 +149,7 @@ def init():
|
||||
module.import_path(list_of_lutin_files)
|
||||
system.import_path(list_of_lutin_files)
|
||||
target.import_path(list_of_lutin_files)
|
||||
macro.import_path(list_of_lutin_files)
|
||||
|
||||
builder.init()
|
||||
is_init = True
|
||||
|
378
lutin/arg.py
378
lutin/arg.py
@@ -1,378 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
import sys
|
||||
from . import debug
|
||||
|
||||
##
|
||||
## @brief Single argument class. It permit to define the getted argument.
|
||||
##
|
||||
class ArgElement:
|
||||
##
|
||||
## @brief Contructor.
|
||||
## @param[in] self Class handle
|
||||
## @param[in] option (string) Option name (write in fullmode ex: '--verbose' even if user write '-v')
|
||||
## @param[in] value (string) Writed value by the user (defult '')
|
||||
##
|
||||
def __init__(self, option, value=""):
|
||||
self.option = option;
|
||||
self.arg = value;
|
||||
|
||||
##
|
||||
## @brief Get the name of the argument: (write in fullmode ex: '--verbose' even if user write '-v')
|
||||
## @param[in] self Class handle
|
||||
## @return (string) The argument name
|
||||
##
|
||||
def get_option_name(self):
|
||||
return self.option
|
||||
|
||||
##
|
||||
## @brief Get argument data set by the user
|
||||
## @param[in] self Class handle
|
||||
## @return (string) The argument value
|
||||
##
|
||||
def get_arg(self):
|
||||
return self.arg
|
||||
|
||||
##
|
||||
## @brief Display the Argument property
|
||||
## @param[in] self Class handle
|
||||
##
|
||||
def display(self):
|
||||
if len(self.arg) == 0:
|
||||
debug.info("option : " + self.option)
|
||||
elif len(self.option) == 0:
|
||||
debug.info("element : " + self.arg)
|
||||
else:
|
||||
debug.info("option : " + self.option + ":" + self.arg)
|
||||
|
||||
##
|
||||
## @brief Declare a possibility of an argument value
|
||||
##
|
||||
class ArgDefine:
|
||||
##
|
||||
## @brief Contructor.
|
||||
## @param[in] self Class handle
|
||||
## @param[in] smallOption (char) Value for the small option ex: '-v' '-k' ... 1 single char element (no need of '-')
|
||||
## @param[in] bigOption (string) Value of the big option name ex: '--verbose' '--kill' ... stated with -- and with the full name (no need of '--')
|
||||
## @param[in] list ([[string,string],...]) Optionnal list of availlable option: '--mode=debug' ==> [['debug', 'debug mode'],['release', 'release the software']]
|
||||
## @param[in] desc (string) user friendly description with this parameter (default "")
|
||||
## @param[in] haveParam (bool) The option must have a parameter (default False)
|
||||
##
|
||||
def __init__(self,
|
||||
smallOption="", # like v for -v
|
||||
bigOption="", # like verbose for --verbose
|
||||
list=[], # ["val", "description"]
|
||||
desc="",
|
||||
haveParam=False):
|
||||
self.option_small = smallOption;
|
||||
self.option_big = bigOption;
|
||||
self.list = list;
|
||||
if len(self.list)!=0:
|
||||
self.have_param = True
|
||||
else:
|
||||
if True==haveParam:
|
||||
self.have_param = True
|
||||
else:
|
||||
self.have_param = False
|
||||
self.description = desc;
|
||||
|
||||
##
|
||||
## @brief Get the small name of the option ex: '-v'
|
||||
## @param[in] self Class handle
|
||||
## @return (string) Small name value
|
||||
##
|
||||
def get_option_small(self):
|
||||
return self.option_small
|
||||
|
||||
##
|
||||
## @brief Get the big name of the option ex: '--verbose'
|
||||
## @param[in] self Class handle
|
||||
## @return (string) Big name value
|
||||
##
|
||||
def get_option_big(self):
|
||||
return self.option_big
|
||||
|
||||
##
|
||||
## @brief Get the status of getting user parameter value
|
||||
## @param[in] self Class handle
|
||||
## @return True The user must write a value
|
||||
## @return False The user must NOT write a value
|
||||
##
|
||||
def need_parameters(self):
|
||||
return self.have_param
|
||||
|
||||
##
|
||||
## @brief Compatibility with @ref ArgSection class
|
||||
## @param[in] self Class handle
|
||||
## @return (string) empty string
|
||||
##
|
||||
def get_porperties(self):
|
||||
return ""
|
||||
|
||||
##
|
||||
## @brief Check if the user added value is correct or not with the list of availlable value
|
||||
## @param[in] self Class handle
|
||||
## @param[in] argument (string) User parameter value (string)
|
||||
## @return True The parameter is OK
|
||||
## @return False The parameter is NOT Availlable
|
||||
##
|
||||
def check_availlable(self, argument):
|
||||
if len(self.list)==0:
|
||||
return True
|
||||
for element,desc in self.list:
|
||||
if element == argument:
|
||||
return True
|
||||
return False
|
||||
|
||||
##
|
||||
## @brief Display the argument property when user request help
|
||||
## @param[in] self Class handle
|
||||
##
|
||||
def display(self):
|
||||
color = debug.get_color_set()
|
||||
if self.option_small != "" and self.option_big != "":
|
||||
print(" " + color['red'] + "-" + self.option_small + "" + color['default'] + " / " + color['red'] + "--" + self.option_big + color['default'])
|
||||
elif self.option_small != "":
|
||||
print(" " + color['red'] + "-" + self.option_small + color['default'])
|
||||
elif self.option_big != "":
|
||||
print(" " + color['red'] + "--" + self.option_big + color['default'])
|
||||
else:
|
||||
print(" ???? ==> internal error ...")
|
||||
if self.description != "":
|
||||
print(" " + self.description)
|
||||
if len(self.list)!=0:
|
||||
hasDescriptiveElement=False
|
||||
for val,desc in self.list:
|
||||
if desc!="":
|
||||
hasDescriptiveElement=True
|
||||
break;
|
||||
if hasDescriptiveElement==True:
|
||||
for val,desc in self.list:
|
||||
print(" " + val + " : " + desc)
|
||||
else:
|
||||
tmpElementPrint = ""
|
||||
for val,desc in self.list:
|
||||
if len(tmpElementPrint)!=0:
|
||||
tmpElementPrint += " / "
|
||||
tmpElementPrint += val
|
||||
print(" { " + tmpElementPrint + " }")
|
||||
|
||||
|
||||
##
|
||||
## @brief Section Class definition (permit to add a comment when requesting help
|
||||
##
|
||||
class ArgSection:
|
||||
##
|
||||
## @brief Constructor
|
||||
## @param[in] self Class handle
|
||||
## @param[in] sectionName (string) Name of the cestion ex: "option" is displayed [option]
|
||||
## @param[in] desc (string) Comment assiciated with the group
|
||||
##
|
||||
def __init__(self,
|
||||
sectionName="",
|
||||
desc=""):
|
||||
self.section = sectionName;
|
||||
self.description = desc;
|
||||
|
||||
##
|
||||
## @brief Compatibility with @ref ArgDefine class
|
||||
## @param[in] self Class handle
|
||||
## @return empty string
|
||||
##
|
||||
def get_option_small(self):
|
||||
return ""
|
||||
|
||||
##
|
||||
## @brief Compatibility with @ref ArgDefine class
|
||||
## @param[in] self Class handle
|
||||
## @return empty string
|
||||
##
|
||||
def get_option_big(self):
|
||||
return ""
|
||||
|
||||
##
|
||||
## @brief get property print value with the correct writing mode
|
||||
## @param[in] self Class handle
|
||||
## @return String to display in the short line help
|
||||
##
|
||||
def get_porperties(self):
|
||||
color = debug.get_color_set()
|
||||
return " [" + color['blue'] + self.section + color['default'] + "]"
|
||||
|
||||
##
|
||||
## @brief Display the argument property when user request help
|
||||
## @param[in] self Class handle
|
||||
##
|
||||
def display(self):
|
||||
color = debug.get_color_set()
|
||||
print(" [" + color['blue'] + self.section + color['default'] + "] : " + self.description)
|
||||
|
||||
|
||||
##
|
||||
## @brief Class to define the agmument list availlable for a program
|
||||
##
|
||||
class LutinArg:
|
||||
##
|
||||
## @brief Constructor.
|
||||
## @param[in] self Class handle
|
||||
##
|
||||
def __init__(self):
|
||||
self.list_properties = []
|
||||
|
||||
##
|
||||
## @brief Add a new argument possibilities...
|
||||
## @param[in] self Class handle
|
||||
## @param[in] smallOption (char) Value for the small option ex: '-v' '-k' ... 1 single char element (no need of '-')
|
||||
## @param[in] bigOption (string) Value of the big option name ex: '--verbose' '--kill' ... stated with -- and with the full name (no need of '--')
|
||||
## @param[in] list ([[string,string],...]) Optionnal list of availlable option: '--mode=debug' ==> [['debug', 'debug mode'],['release', 'release the software']]
|
||||
## @param[in] desc (string) user friendly description with this parameter (default "")
|
||||
## @param[in] haveParam (bool) The option must have a parameter (default False)
|
||||
##
|
||||
def add(self, smallOption="", bigOption="", list=[], desc="", haveParam=False):
|
||||
self.list_properties.append(ArgDefine(smallOption, bigOption, list, desc, haveParam))
|
||||
|
||||
##
|
||||
## @brief Add section on argument list
|
||||
## @param[in] self Class handle
|
||||
## @param[in] sectionName (string) Name of the cestion ex: "option" is displayed [option]
|
||||
## @param[in] sectionDesc (string) Comment assiciated with the group
|
||||
##
|
||||
def add_section(self, sectionName, sectionDesc):
|
||||
self.list_properties.append(ArgSection(sectionName, sectionDesc))
|
||||
|
||||
##
|
||||
## @brief Parse the argument set in the command line
|
||||
## @param[in] self Class handle
|
||||
##
|
||||
def parse(self):
|
||||
listArgument = [] # composed of list element
|
||||
NotparseNextElement=False
|
||||
for iii in range(1, len(sys.argv)):
|
||||
# special case of parameter in some elements
|
||||
if NotparseNextElement==True:
|
||||
NotparseNextElement = False
|
||||
continue
|
||||
debug.verbose("parse [" + str(iii) + "]=" + sys.argv[iii])
|
||||
argument = sys.argv[iii]
|
||||
optionList = argument.split("=")
|
||||
debug.verbose(str(optionList))
|
||||
if type(optionList) == type(str()):
|
||||
option = optionList
|
||||
else:
|
||||
option = optionList[0]
|
||||
optionParam = argument[len(option)+1:]
|
||||
debug.verbose(option)
|
||||
argumentFound=False;
|
||||
if option[:2]=="--":
|
||||
# big argument
|
||||
for prop in self.list_properties:
|
||||
if prop.get_option_big()=="":
|
||||
continue
|
||||
if prop.get_option_big() == option[2:]:
|
||||
# find it
|
||||
debug.verbose("find argument 2 : " + option[2:])
|
||||
if prop.need_parameters()==True:
|
||||
internalSub = option[2+len(prop.get_option_big()):]
|
||||
if len(internalSub)!=0:
|
||||
if len(optionParam)!=0:
|
||||
# wrong argument ...
|
||||
debug.warning("maybe wrong argument for : '" + prop.get_option_big() + "' cmdLine='" + argument + "'")
|
||||
prop.display()
|
||||
continue
|
||||
optionParam = internalSub
|
||||
if len(optionParam)==0:
|
||||
#Get the next parameters
|
||||
if len(sys.argv) > iii+1:
|
||||
optionParam = sys.argv[iii+1]
|
||||
NotparseNextElement=True
|
||||
else :
|
||||
# missing arguments
|
||||
debug.warning("parsing argument error : '" + prop.get_option_big() + "' Missing : subParameters ... cmdLine='" + argument + "'")
|
||||
prop.display()
|
||||
exit(-1)
|
||||
if prop.check_availlable(optionParam)==False:
|
||||
debug.warning("argument error : '" + prop.get_option_big() + "' SubParameters not availlable ... cmdLine='" + argument + "' option='" + optionParam + "'")
|
||||
prop.display()
|
||||
exit(-1)
|
||||
listArgument.append(ArgElement(prop.get_option_big(),optionParam))
|
||||
argumentFound = True
|
||||
else:
|
||||
if len(optionParam)!=0:
|
||||
debug.warning("parsing argument error : '" + prop.get_option_big() + "' need no subParameters : '" + optionParam + "' cmdLine='" + argument + "'")
|
||||
prop.display()
|
||||
listArgument.append(ArgElement(prop.get_option_big()))
|
||||
argumentFound = True
|
||||
break;
|
||||
if False==argumentFound:
|
||||
debug.error("UNKNOW argument : '" + argument + "'")
|
||||
elif option[:1]=="-":
|
||||
# small argument
|
||||
for prop in self.list_properties:
|
||||
if prop.get_option_small()=="":
|
||||
continue
|
||||
if prop.get_option_small() == option[1:1+len(prop.get_option_small())]:
|
||||
# find it
|
||||
debug.verbose("find argument 1 : " + option[1:1+len(prop.get_option_small())])
|
||||
if prop.need_parameters()==True:
|
||||
internalSub = option[1+len(prop.get_option_small()):]
|
||||
if len(internalSub)!=0:
|
||||
if len(optionParam)!=0:
|
||||
# wrong argument ...
|
||||
debug.warning("maybe wrong argument for : '" + prop.get_option_big() + "' cmdLine='" + argument + "'")
|
||||
prop.display()
|
||||
continue
|
||||
optionParam = internalSub
|
||||
if len(optionParam)==0:
|
||||
#Get the next parameters
|
||||
if len(sys.argv) > iii+1:
|
||||
optionParam = sys.argv[iii+1]
|
||||
NotparseNextElement=True
|
||||
else :
|
||||
# missing arguments
|
||||
debug.warning("parsing argument error : '" + prop.get_option_big() + "' Missing : subParameters cmdLine='" + argument + "'")
|
||||
prop.display()
|
||||
exit(-1)
|
||||
if prop.check_availlable(optionParam)==False:
|
||||
debug.warning("argument error : '" + prop.get_option_big() + "' SubParameters not availlable ... cmdLine='" + argument + "' option='" + optionParam + "'")
|
||||
prop.display()
|
||||
exit(-1)
|
||||
listArgument.append(ArgElement(prop.get_option_big(),optionParam))
|
||||
argumentFound = True
|
||||
else:
|
||||
if len(optionParam)!=0:
|
||||
debug.warning("parsing argument error : '" + prop.get_option_big() + "' need no subParameters : '" + optionParam + "' cmdLine='" + argument + "'")
|
||||
prop.display()
|
||||
listArgument.append(ArgElement(prop.get_option_big()))
|
||||
argumentFound = True
|
||||
break;
|
||||
|
||||
if argumentFound==False:
|
||||
#unknow element ... ==> just add in the list ...
|
||||
debug.verbose("unknow argument : " + argument)
|
||||
listArgument.append(ArgElement("", argument))
|
||||
|
||||
#for argument in listArgument:
|
||||
# argument.display()
|
||||
#exit(0)
|
||||
return listArgument;
|
||||
|
||||
##
|
||||
## @brief Display help on console output
|
||||
## @param[in] self Class handle
|
||||
##
|
||||
def display(self):
|
||||
print("usage:")
|
||||
listOfPropertiesArg = "";
|
||||
for element in self.list_properties :
|
||||
listOfPropertiesArg += element.get_porperties()
|
||||
print(" " + sys.argv[0] + listOfPropertiesArg + " ...")
|
||||
for element in self.list_properties :
|
||||
element.display()
|
||||
|
@@ -5,7 +5,7 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
import sys
|
||||
import os
|
||||
@@ -13,7 +13,7 @@ import inspect
|
||||
import fnmatch
|
||||
import datetime
|
||||
# Local import
|
||||
from . import debug
|
||||
from realog import debug
|
||||
from . import heritage
|
||||
from . import env
|
||||
|
||||
|
262
lutin/debug.py
262
lutin/debug.py
@@ -1,262 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
##
|
||||
|
||||
import os
|
||||
import threading
|
||||
import re
|
||||
|
||||
debug_level=3
|
||||
debug_color=False
|
||||
|
||||
color_default= ""
|
||||
color_red = ""
|
||||
color_green = ""
|
||||
color_yellow = ""
|
||||
color_blue = ""
|
||||
color_purple = ""
|
||||
color_cyan = ""
|
||||
|
||||
|
||||
debug_lock = threading.Lock()
|
||||
|
||||
##
|
||||
## @brief Set log level of the console log system
|
||||
## @param[in] id (int) Value of the log level:
|
||||
## 0: None
|
||||
## 1: error
|
||||
## 2: warning
|
||||
## 3: info
|
||||
## 4: debug
|
||||
## 5: verbose
|
||||
## 6: extreme_verbose
|
||||
##
|
||||
def set_level(id):
|
||||
global debug_level
|
||||
debug_level = id
|
||||
#print "SetDebug level at " + str(debug_level)
|
||||
|
||||
##
|
||||
## @brief Get the current debug leval
|
||||
## @return The value of the log level. Show: @ref set_level
|
||||
##
|
||||
def get_level():
|
||||
global debug_level
|
||||
return debug_level
|
||||
|
||||
##
|
||||
## @brief Enable color of the console Log system
|
||||
##
|
||||
def enable_color():
|
||||
global debug_color
|
||||
debug_color = True
|
||||
global color_default
|
||||
color_default= "\033[00m"
|
||||
global color_red
|
||||
color_red = "\033[31m"
|
||||
global color_green
|
||||
color_green = "\033[32m"
|
||||
global color_yellow
|
||||
color_yellow = "\033[33m"
|
||||
global color_blue
|
||||
color_blue = "\033[01;34m"
|
||||
global color_purple
|
||||
color_purple = "\033[35m"
|
||||
global color_cyan
|
||||
color_cyan = "\033[36m"
|
||||
|
||||
##
|
||||
## @brief Disable color of the console Log system
|
||||
##
|
||||
def disable_color():
|
||||
global debug_color
|
||||
debug_color = True
|
||||
global color_default
|
||||
color_default= ""
|
||||
global color_red
|
||||
color_red = ""
|
||||
global color_green
|
||||
color_green = ""
|
||||
global color_yellow
|
||||
color_yellow = ""
|
||||
global color_blue
|
||||
color_blue = ""
|
||||
global color_purple
|
||||
color_purple = ""
|
||||
global color_cyan
|
||||
color_cyan = ""
|
||||
|
||||
##
|
||||
## @brief Print a extreme verbose log
|
||||
## @param[in] input (string) Value to print if level is enough
|
||||
## @param[in] force (bool) force display (no check of log level)
|
||||
##
|
||||
def extreme_verbose(input, force=False):
|
||||
global debug_lock
|
||||
global debug_level
|
||||
if debug_level >= 6 \
|
||||
or force == True:
|
||||
debug_lock.acquire()
|
||||
print(color_blue + input + color_default)
|
||||
debug_lock.release()
|
||||
|
||||
##
|
||||
## @brief Print a verbose log
|
||||
## @param[in] input (string) Value to print if level is enough
|
||||
## @param[in] force (bool) force display (no check of log level)
|
||||
##
|
||||
def verbose(input, force=False):
|
||||
global debug_lock
|
||||
global debug_level
|
||||
if debug_level >= 5 \
|
||||
or force == True:
|
||||
debug_lock.acquire()
|
||||
print(color_blue + input + color_default)
|
||||
debug_lock.release()
|
||||
|
||||
##
|
||||
## @brief Print a debug log
|
||||
## @param[in] input (string) Value to print if level is enough
|
||||
## @param[in] force (bool) force display (no check of log level)
|
||||
##
|
||||
def debug(input, force=False):
|
||||
global debug_lock
|
||||
global debug_level
|
||||
if debug_level >= 4 \
|
||||
or force == True:
|
||||
debug_lock.acquire()
|
||||
print(color_green + input + color_default)
|
||||
debug_lock.release()
|
||||
|
||||
##
|
||||
## @brief Print an info log
|
||||
## @param[in] input (string) Value to print if level is enough
|
||||
## @param[in] force (bool) force display (no check of log level)
|
||||
##
|
||||
def info(input, force=False):
|
||||
global debug_lock
|
||||
global debug_level
|
||||
if debug_level >= 3 \
|
||||
or force == True:
|
||||
debug_lock.acquire()
|
||||
print(input + color_default)
|
||||
debug_lock.release()
|
||||
|
||||
##
|
||||
## @brief Print a warning log
|
||||
## @param[in] input (string) Value to print if level is enough
|
||||
## @param[in] force (bool) force display (no check of log level)
|
||||
##
|
||||
def warning(input, force=False):
|
||||
global debug_lock
|
||||
global debug_level
|
||||
if debug_level >= 2 \
|
||||
or force == True:
|
||||
debug_lock.acquire()
|
||||
print(color_purple + "[WARNING] " + input + color_default)
|
||||
debug_lock.release()
|
||||
|
||||
##
|
||||
## @brief Print a todo log
|
||||
## @param[in] input (string) Value to print if level is enough
|
||||
## @param[in] force (bool) force display (no check of log level)
|
||||
##
|
||||
def todo(input, force=False):
|
||||
global debug_lock
|
||||
global debug_level
|
||||
if debug_level >= 3 \
|
||||
or force == True:
|
||||
debug_lock.acquire()
|
||||
print(color_purple + "[TODO] " + input + color_default)
|
||||
debug_lock.release()
|
||||
|
||||
##
|
||||
## @brief Print an error log
|
||||
## @param[in] input (string) Value to print if level is enough
|
||||
## @param[in] thread_id (int) Current thead ID of the builder thread
|
||||
## @param[in] force (bool) force display (no check of log level)
|
||||
## @param[in] crash (bool) build error has appear ==> request stop of all builds
|
||||
##
|
||||
def error(input, thread_id=-1, force=False, crash=True):
|
||||
global debug_lock
|
||||
global debug_level
|
||||
if debug_level >= 1 \
|
||||
or force == True:
|
||||
debug_lock.acquire()
|
||||
print(color_red + "[ERROR] " + input + color_default)
|
||||
debug_lock.release()
|
||||
if crash == True:
|
||||
from . import multiprocess
|
||||
multiprocess.set_error_occured()
|
||||
if thread_id != -1:
|
||||
threading.interrupt_main()
|
||||
exit(-1)
|
||||
#os_exit(-1)
|
||||
#raise "error happend"
|
||||
|
||||
|
||||
##
|
||||
## @brief Print a log for a specific element action like generateing .so or binary ...
|
||||
## @param[in] type (string) type of action. Like: "copy file", "StaticLib", "Prebuild", "Library" ...
|
||||
## @param[in] lib (string) Name of the library/binary/package that action is done
|
||||
## @param[in] dir (string) build direction. ex: "<==", "==>" ...
|
||||
## @param[in] name (string) Destination of the data
|
||||
## @param[in] force (bool) force display (no check of log level)
|
||||
##
|
||||
def print_element(type, lib, dir, name, force=False):
|
||||
global debug_lock
|
||||
global debug_level
|
||||
if debug_level >= 3 \
|
||||
or force == True:
|
||||
debug_lock.acquire()
|
||||
print(color_cyan + type + color_default + " : " + color_yellow + lib + color_default + " " + dir + " " + color_blue + name + color_default)
|
||||
debug_lock.release()
|
||||
|
||||
##
|
||||
## @brief Print a compilation return (output)
|
||||
## @param[in] my_string (string) Std-error/std-info that is generate by the build system
|
||||
##
|
||||
def print_compilator(my_string):
|
||||
global debug_color
|
||||
global debug_lock
|
||||
if debug_color == True:
|
||||
my_string = my_string.replace('\\n', '\n')
|
||||
my_string = my_string.replace('\\t', '\t')
|
||||
my_string = my_string.replace('error:', color_red+'error:'+color_default)
|
||||
my_string = my_string.replace('warning:', color_purple+'warning:'+color_default)
|
||||
my_string = my_string.replace('note:', color_green+'note:'+color_default)
|
||||
my_string = re.sub(r'([/\w_-]+\.\w+):', r'-COLORIN-\1-COLOROUT-:', my_string)
|
||||
my_string = my_string.replace('-COLORIN-', color_yellow)
|
||||
my_string = my_string.replace('-COLOROUT-', color_default)
|
||||
|
||||
debug_lock.acquire()
|
||||
print(my_string)
|
||||
debug_lock.release()
|
||||
|
||||
##
|
||||
## @brief Get the list of default color
|
||||
## @return A map with keys: "default","red","green","yellow","blue","purple","cyan"
|
||||
##
|
||||
def get_color_set() :
|
||||
global color_default
|
||||
global color_red
|
||||
global color_green
|
||||
global color_yellow
|
||||
global color_blue
|
||||
global color_purple
|
||||
global color_cyan
|
||||
return {
|
||||
"default": color_default,
|
||||
"red": color_red,
|
||||
"green": color_green,
|
||||
"yellow": color_yellow,
|
||||
"blue": color_blue,
|
||||
"purple": color_purple,
|
||||
"cyan": color_cyan,
|
||||
}
|
@@ -5,11 +5,11 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
import os
|
||||
# Local import
|
||||
from . import debug
|
||||
from realog import debug
|
||||
from . import env
|
||||
|
||||
def _create_directory_of_file(file):
|
||||
|
15
lutin/env.py
15
lutin/env.py
@@ -5,11 +5,11 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
# Local import
|
||||
from . import debug
|
||||
from realog import debug
|
||||
|
||||
|
||||
|
||||
@@ -112,6 +112,17 @@ def get_warning_mode():
|
||||
global store_warning
|
||||
return store_warning
|
||||
|
||||
ccache=False
|
||||
def set_ccache(val):
|
||||
global ccache
|
||||
if val == True:
|
||||
ccache = True
|
||||
else:
|
||||
ccache = False
|
||||
|
||||
def get_ccache():
|
||||
global ccache
|
||||
return ccache
|
||||
|
||||
def end_with(name, list):
|
||||
for appl in list:
|
||||
|
@@ -5,12 +5,12 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
import sys
|
||||
import copy
|
||||
# Local import
|
||||
from . import debug
|
||||
from realog import debug
|
||||
|
||||
|
||||
def append_to_list(list_out, elem):
|
||||
@@ -157,7 +157,10 @@ class HeritageList:
|
||||
## @return (string) string of str() convertion
|
||||
##
|
||||
def __repr__(self):
|
||||
return "{HeritageList:" + str(self.list_heritage) + "}"
|
||||
dep = []
|
||||
for elem in reversed(self.list_heritage):
|
||||
dep.append(str(elem.name))
|
||||
return "{HeritageList: " + str(dep) + "}"
|
||||
|
||||
class heritage:
|
||||
def __init__(self, module, target):
|
||||
@@ -258,6 +261,6 @@ class heritage:
|
||||
## @return (string) string of str() convertion
|
||||
##
|
||||
def __repr__(self):
|
||||
return "{Heritage:" + str(self.name) + " ... }"
|
||||
return "{Heritage:" + str(self.name) + " depend on: " + str(reversed(self.depends)) + " ... }"
|
||||
|
||||
|
||||
|
@@ -5,20 +5,23 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
import platform
|
||||
import sys
|
||||
# Local import
|
||||
from . import debug
|
||||
from realog 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() + "'")
|
||||
|
||||
|
@@ -5,12 +5,12 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
import platform
|
||||
import os
|
||||
# Local import
|
||||
from . import debug
|
||||
from realog import debug
|
||||
from . import tools
|
||||
from . import multiprocess
|
||||
from . import depend
|
||||
|
@@ -5,7 +5,7 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
license_base = {
|
||||
@@ -14,7 +14,7 @@ license_base = {
|
||||
"contaminate-static":False,
|
||||
"contaminate-dynamic":False,
|
||||
"redistribute-source":False,
|
||||
"title":"APACHE v2.0 license",
|
||||
"title":"MPL v2.0 license",
|
||||
"licence-file":"licence/apache-2.txt"
|
||||
},
|
||||
"GPL-2": {
|
||||
@@ -88,7 +88,31 @@ license_base = {
|
||||
"redistribute-source":False,
|
||||
"title":"PNG License",
|
||||
"licence-file":"licence/png.txt"
|
||||
}
|
||||
},
|
||||
"MPL-1": {
|
||||
"generic":True,
|
||||
"contaminate-static":False,
|
||||
"contaminate-dynamic":False,
|
||||
"redistribute-source":True,
|
||||
"title":"MPL: Mozilla Public Licence v1.0",
|
||||
"licence-file":"licence/MPL-1.txt"
|
||||
},
|
||||
"MPL-1.1": {
|
||||
"generic":True,
|
||||
"contaminate-static":False,
|
||||
"contaminate-dynamic":False,
|
||||
"redistribute-source":True,
|
||||
"title":"MPL: Mozilla Public Licence v1.1",
|
||||
"licence-file":"licence/MPL-1.1.txt"
|
||||
},
|
||||
"MPL-2": {
|
||||
"generic":True,
|
||||
"contaminate-static":False,
|
||||
"contaminate-dynamic":False,
|
||||
"redistribute-source":True,
|
||||
"title":"MPL: Mozilla Public Licence v2.0",
|
||||
"licence-file":"licence/MPL-2.txt"
|
||||
},
|
||||
}
|
||||
|
||||
def get_basic_list():
|
||||
|
76
lutin/macro.py
Normal file
76
lutin/macro.py
Normal file
@@ -0,0 +1,76 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
import sys
|
||||
import os
|
||||
import inspect
|
||||
import fnmatch
|
||||
import datetime
|
||||
# Local import
|
||||
from realog import debug
|
||||
from . import tools
|
||||
from . import env
|
||||
|
||||
|
||||
__macro_list=[]
|
||||
__start_macro_name="Macro_"
|
||||
|
||||
##
|
||||
## @brief Import all File that start with env.get_build_system_base_name() + __start_macro_name + XXX and register in the list of Target
|
||||
## @param[in] path_list ([string,...]) List of file that start with env.get_build_system_base_name() in the running worktree (Parse one time ==> faster)
|
||||
##
|
||||
def import_path(path_list):
|
||||
global __macro_list
|
||||
global_base = env.get_build_system_base_name()
|
||||
debug.debug("TARGET: 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_macro_name)] != __start_macro_name:
|
||||
debug.extreme_verbose("MACRO: NOT-Integrate: '" + filename + "' from '" + elem + "' ==> rejected")
|
||||
continue
|
||||
# Remove local patern
|
||||
target_name = filename[len(__start_macro_name):]
|
||||
debug.verbose("MACRO: Integrate: '" + target_name + "' from '" + elem + "'")
|
||||
__macro_list.append([target_name, elem])
|
||||
debug.verbose("New list MACRO: ")
|
||||
for elem in __macro_list:
|
||||
debug.verbose(" " + str(elem[0]))
|
||||
|
||||
##
|
||||
## @brief Load a specific target
|
||||
##
|
||||
def load_macro(name):
|
||||
global __macro_list
|
||||
debug.debug("load macro: " + name)
|
||||
if len(__macro_list) == 0:
|
||||
debug.error("No macro to compile !!!")
|
||||
debug.debug("list macro: " + str(__macro_list))
|
||||
for mod in __macro_list:
|
||||
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 macro : '" + env.get_build_system_base_name() + __start_macro_name + name + "'")
|
||||
the_macro = __import__(env.get_build_system_base_name() + __start_macro_name + name)
|
||||
return the_macro
|
||||
raise KeyError("No entry for : " + name)
|
||||
|
||||
def list_all_macro():
|
||||
global __macro_list
|
||||
tmp_list_name = []
|
||||
for mod in __macro_list:
|
||||
tmp_list_name.append(mod[0])
|
||||
return tmp_list_name
|
586
lutin/module.py
586
lutin/module.py
@@ -5,7 +5,7 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
import sys
|
||||
@@ -16,7 +16,7 @@ import fnmatch
|
||||
# Local import
|
||||
from . import host
|
||||
from . import tools
|
||||
from . import debug
|
||||
from realog import debug
|
||||
from . import heritage
|
||||
from . import builder
|
||||
from . import multiprocess
|
||||
@@ -54,14 +54,29 @@ class Module:
|
||||
def __init__(self, file, module_name, module_type):
|
||||
## Remove all variable to prevent error of multiple deffinition of the module ...
|
||||
debug.verbose("Create a new module : '" + module_name + "' TYPE=" + module_type)
|
||||
self._origin_file=''
|
||||
self._origin_path=''
|
||||
self._origin_file = file;
|
||||
self._origin_path = tools.get_current_path(self._origin_file)
|
||||
# type of the module:
|
||||
self._type='LIBRARY'
|
||||
if module_type == 'BINARY' \
|
||||
or module_type == 'BINARY_SHARED' \
|
||||
or module_type == 'BINARY_STAND_ALONE' \
|
||||
or module_type == 'LIBRARY' \
|
||||
or module_type == 'LIBRARY_DYNAMIC' \
|
||||
or module_type == 'LIBRARY_STATIC' \
|
||||
or module_type == 'PACKAGE' \
|
||||
or module_type == 'PREBUILD' \
|
||||
or module_type == 'DATA':
|
||||
self._type=module_type
|
||||
else :
|
||||
debug.error('for module "%s"' %module_name)
|
||||
debug.error(' ==> error : "%s" ' %module_type)
|
||||
raise 'Input value error'
|
||||
# Name of the module
|
||||
self._name=module_name
|
||||
self._name = module_name
|
||||
# Tools list:
|
||||
self._tools = []
|
||||
# list of action to do:
|
||||
self._actions = []
|
||||
# Dependency list:
|
||||
self._depends = []
|
||||
# Dependency list (optionnal module):
|
||||
@@ -86,25 +101,9 @@ class Module:
|
||||
self._paths = []
|
||||
# The module has been already build ...
|
||||
self._isbuild = False
|
||||
## end of basic INIT ...
|
||||
if module_type == 'BINARY' \
|
||||
or module_type == 'BINARY_SHARED' \
|
||||
or module_type == 'BINARY_STAND_ALONE' \
|
||||
or module_type == 'LIBRARY' \
|
||||
or module_type == 'LIBRARY_DYNAMIC' \
|
||||
or module_type == 'LIBRARY_STATIC' \
|
||||
or module_type == 'PACKAGE' \
|
||||
or module_type == 'PREBUILD' \
|
||||
or module_type == 'DATA':
|
||||
self._type=module_type
|
||||
else :
|
||||
debug.error('for module "%s"' %module_name)
|
||||
debug.error(' ==> error : "%s" ' %module_type)
|
||||
raise 'Input value error'
|
||||
self._origin_file = file;
|
||||
self._origin_path = tools.get_current_path(self._origin_file)
|
||||
# configure default heritage
|
||||
self._local_heritage = None
|
||||
# TODO : Do a better dynamic property system => not really versatil
|
||||
# TODO : Do a better dynamic property system => not really versatile
|
||||
self._package_prop = { "COMPAGNY_TYPE" : "",
|
||||
"COMPAGNY_NAME" : "",
|
||||
"COMPAGNY_NAME2" : "",
|
||||
@@ -164,6 +163,14 @@ class Module:
|
||||
def get_name(self):
|
||||
return self._name
|
||||
|
||||
##
|
||||
## @brief Get origin path of the module declaration
|
||||
## @param[in] self (handle) Class handle
|
||||
## @return (string) path of the module
|
||||
##
|
||||
def get_origin_path(self):
|
||||
return self._origin_path
|
||||
|
||||
##
|
||||
## @brief Get type of the module ("BINARY", "LIBRARY", ...)
|
||||
## @param[in] self (handle) Class handle
|
||||
@@ -244,7 +251,14 @@ class Module:
|
||||
if sizeX > 0:
|
||||
debug.verbose("Image file : " + display_source + " ==> " + destination + " resize=(" + str(sizeX) + "," + str(sizeY) + ")")
|
||||
fileName, fileExtension = os.path.splitext(os.path.join(self._origin_path,source))
|
||||
image.resize(source, os.path.join(target.get_build_path_data(self._name), destination), sizeX, sizeY, file_cmd)
|
||||
# Create the resized file in a temporary path to auto-copy when needed
|
||||
temporary_file = os.path.join(target.get_build_path_temporary_generate(self._name), "image_generation", destination)
|
||||
image.resize(source, temporary_file, sizeX, sizeY, file_cmd)
|
||||
# Copy file in statndard mode
|
||||
tools.copy_file(temporary_file,
|
||||
os.path.join(target.get_build_path_data(self._name), destination),
|
||||
file_cmd,
|
||||
in_list=copy_list)
|
||||
else:
|
||||
debug.verbose("Might copy file : " + display_source + " ==> " + destination)
|
||||
tools.copy_file(source,
|
||||
@@ -503,40 +517,43 @@ class Module:
|
||||
if target.is_module_build(self._name) == True:
|
||||
if self._sub_heritage_list == None:
|
||||
self._local_heritage = heritage.heritage(self, target)
|
||||
debug.warning("plop " + str(self._local_heritage));
|
||||
debug.debug("plop " + str(self._local_heritage));
|
||||
return copy.deepcopy(self._sub_heritage_list)
|
||||
# create the package heritage
|
||||
self._local_heritage = heritage.heritage(self, target)
|
||||
|
||||
if package_name==None \
|
||||
if len(self._actions) != 0:
|
||||
debug.verbose("execute actions: " + str(len(self._actions)))
|
||||
for action in self._actions:
|
||||
action["action"](target, self, action["data"]);
|
||||
if package_name == None \
|
||||
and ( self._type == 'BINARY'
|
||||
or self._type == 'BINARY_SHARED' \
|
||||
or self._type == 'BINARY_STAND_ALONE' \
|
||||
or self._type == 'PACKAGE' ) :
|
||||
# this is the endpoint binary ...
|
||||
package_name = self._name
|
||||
debug.debug("package name = " + package_name)
|
||||
else:
|
||||
pass
|
||||
# build dependency before
|
||||
list_sub_file_needed_to_build = []
|
||||
self._sub_heritage_list = heritage.HeritageList()
|
||||
# optionnal dependency :
|
||||
for dep, option, export in self._depends_optionnal:
|
||||
for dep, option, export, src_file, header_file, option_not_found in self._depends_optionnal:
|
||||
debug.verbose("try find optionnal dependency: '" + str(dep) + "'")
|
||||
inherit_list, isBuilt = target.build(dep, True)
|
||||
inherit_list, isBuilt = target.build(dep, True, package_name=package_name)
|
||||
if isBuilt == True:
|
||||
self._local_heritage.add_depends(dep);
|
||||
# TODO : Add optionnal Flags ...
|
||||
# ==> do it really better ...
|
||||
if export == False:
|
||||
self.add_flag(option[0], option[1]);
|
||||
else:
|
||||
self.add_flag(option[0], option[1], export=True);
|
||||
self.add_flag(option[0], option[1], export=export);
|
||||
self.add_src_file(src_file)
|
||||
self.add_header_file(header_file)
|
||||
else:
|
||||
self.add_flag(option_not_found[0], option_not_found[1], export=export);
|
||||
# add at the heritage list :
|
||||
self._sub_heritage_list.add_heritage_list(inherit_list)
|
||||
for dep in self._depends:
|
||||
debug.debug("module: '" + str(self._name) + "' request: '" + dep + "'")
|
||||
inherit_list = target.build(dep, False)
|
||||
inherit_list = target.build(dep, False, package_name=package_name)
|
||||
# add at the heritage list :
|
||||
self._sub_heritage_list.add_heritage_list(inherit_list)
|
||||
# do sub library action for automatic generating ...
|
||||
@@ -587,19 +604,32 @@ class Module:
|
||||
include_path = target.get_build_path_include(self._name)
|
||||
have_only_generate_file = False
|
||||
if len(self._generate_file) > 0:
|
||||
debug.debug("install GENERATED headers ...")
|
||||
debug.debug("install GENERATED headers / src ...")
|
||||
for elem_generate in self._generate_file:
|
||||
# write data in the generate path ... (all is generated at the same path) ...
|
||||
debug.debug("Create data: " + os.path.join(generate_path, elem_generate["filename"]))
|
||||
ret_write = tools.file_write_data(os.path.join(generate_path, elem_generate["filename"]), elem_generate["data"], only_if_new=True)
|
||||
if ret_write == True:
|
||||
debug.print_element("generate", self._name, "##", elem_generate["filename"])
|
||||
dst = os.path.join(include_path, elem_generate["filename"])
|
||||
copy_list[dst] = {"src":os.path.join(generate_path, elem_generate["filename"]),
|
||||
"cmd_file":None,
|
||||
"need_copy":ret_write}
|
||||
if elem_generate["install"] == True:
|
||||
have_only_generate_file = True
|
||||
if elem_generate["type"] == "header":
|
||||
dst = os.path.join(include_path, elem_generate["filename"])
|
||||
copy_list[dst] = {"src":os.path.join(generate_path, elem_generate["filename"]),
|
||||
"cmd_file":None,
|
||||
"need_copy":ret_write}
|
||||
if elem_generate["install"] == True:
|
||||
have_only_generate_file = True
|
||||
# TODO : Do it better, we force the include path in the heritage to permit to have a correct inclusion ...
|
||||
self._local_heritage.include = target.get_build_path_include(self._name)
|
||||
elif elem_generate["type"] == "data":
|
||||
# data file to install:
|
||||
if elem_generate["install"] == True:
|
||||
self._files.append([os.path.join(generate_path, elem_generate["filename"]), elem_generate["filename"]])
|
||||
else:
|
||||
# add file to compile
|
||||
debug.warning("Add file to build : " + os.path.join(generate_path, elem_generate["filename"]) )
|
||||
self.add_src_file(os.path.join(generate_path, elem_generate["filename"]))
|
||||
if have_only_generate_file == True:
|
||||
self.add_path(generate_path)
|
||||
self._add_path(generate_path)
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# -- install header (do it first for extern lib and gcov better interface) --
|
||||
@@ -625,12 +655,13 @@ class Module:
|
||||
# remove unneded files (NOT folder ...)
|
||||
tools.clean_directory(include_path, copy_list)
|
||||
# add the pat to the usable dirrectory
|
||||
self.add_path(include_path)
|
||||
self._add_path(include_path)
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# -- Sources compilation --
|
||||
# ---------------------------------------------------------------------------
|
||||
if self._type != 'PREBUILD':
|
||||
if self._type != 'PREBUILD' \
|
||||
and self._type != 'PACKAGE':
|
||||
# build local sources in a specific order:
|
||||
for extention_local in self._extention_order_build:
|
||||
list_file = tools.filter_extention(self._src, [extention_local])
|
||||
@@ -656,7 +687,7 @@ class Module:
|
||||
if res_file["action"] == "add":
|
||||
list_sub_file_needed_to_build.append(res_file["file"])
|
||||
elif res_file["action"] == "path":
|
||||
self.add_path(res_file["path"], type='c')
|
||||
self._add_path(res_file["path"], type='c')
|
||||
else:
|
||||
debug.error("an not do action for : " + str(res_file))
|
||||
except ValueError:
|
||||
@@ -685,7 +716,7 @@ class Module:
|
||||
if res_file["action"] == "add":
|
||||
list_sub_file_needed_to_build.append(res_file["file"])
|
||||
elif res_file["action"] == "path":
|
||||
self.add_path(res_file["path"], type='c')
|
||||
self._add_path(res_file["path"], type='c')
|
||||
else:
|
||||
debug.error("an not do action for : " + str(res_file))
|
||||
except ValueError:
|
||||
@@ -696,7 +727,7 @@ class Module:
|
||||
# ----------------------------------------------------
|
||||
# -- Generation point --
|
||||
# ----------------------------------------------------
|
||||
if self._type=='PREBUILD':
|
||||
if self._type == 'PREBUILD':
|
||||
self._local_heritage.add_sources(self._src)
|
||||
elif self._type == 'LIBRARY' \
|
||||
or self._type == 'LIBRARY_DYNAMIC' \
|
||||
@@ -794,8 +825,23 @@ class Module:
|
||||
basic_path = self._origin_path)
|
||||
self._local_heritage.add_sources(res_file)
|
||||
except ValueError:
|
||||
debug.error(" UN-SUPPORTED link format: '.jar'")
|
||||
debug.error("UN-SUPPORTED link format: '.jar'")
|
||||
else:
|
||||
# try to build the binary with dependency of .so and the standalone binary (Not package dependent)
|
||||
if target.support_dynamic_link == True:
|
||||
try:
|
||||
tmp_builder = builder.get_builder_with_output("bin");
|
||||
res_file = tmp_builder.link(list_sub_file_needed_to_build,
|
||||
package_name,
|
||||
target,
|
||||
self._sub_heritage_list,
|
||||
flags = self._flags,
|
||||
name = self._name,
|
||||
basic_path = self._origin_path,
|
||||
static = True)
|
||||
#self._local_heritage.add_sources(res_file)
|
||||
except ValueError:
|
||||
debug.error("UN-SUPPORTED link format: '.bin'")
|
||||
try:
|
||||
tmp_builder = builder.get_builder_with_output("bin");
|
||||
res_file = tmp_builder.link(list_sub_file_needed_to_build,
|
||||
@@ -805,9 +851,10 @@ class Module:
|
||||
flags = self._flags,
|
||||
name = self._name,
|
||||
basic_path = self._origin_path,
|
||||
static = static_mode)
|
||||
static = False)
|
||||
#self._local_heritage.add_sources(res_file)
|
||||
except ValueError:
|
||||
debug.error(" UN-SUPPORTED link format: '.bin'")
|
||||
debug.error("UN-SUPPORTED link format: '.bin'")
|
||||
elif self._type == "PACKAGE":
|
||||
if "Android" in target.get_type():
|
||||
# special case for android wrapper:
|
||||
@@ -823,7 +870,7 @@ class Module:
|
||||
basic_path = self._origin_path)
|
||||
self._local_heritage.add_sources(res_file)
|
||||
except ValueError:
|
||||
debug.error(" UN-SUPPORTED link format: '.so'")
|
||||
debug.error("UN-SUPPORTED link format: '.so'")
|
||||
try:
|
||||
tmp_builder = builder.get_builder_with_output("jar");
|
||||
list_file = tools.filter_extention(list_sub_file_needed_to_build, tmp_builder.get_input_type())
|
||||
@@ -839,6 +886,9 @@ class Module:
|
||||
except ValueError:
|
||||
debug.error(" UN-SUPPORTED link format: '.jar'")
|
||||
else:
|
||||
pass
|
||||
# TODO : Check this but I this this is not needed ==> a package can not have build stage ...
|
||||
"""
|
||||
try:
|
||||
tmp_builder = builder.get_builder_with_output("bin");
|
||||
res_file = tmp_builder.link(list_sub_file_needed_to_build,
|
||||
@@ -850,6 +900,7 @@ class Module:
|
||||
basic_path = self._origin_path)
|
||||
except ValueError:
|
||||
debug.error(" UN-SUPPORTED link format: 'binary'")
|
||||
"""
|
||||
elif self._type == "DATA":
|
||||
debug.debug("Data package have noting to build... just install")
|
||||
else:
|
||||
@@ -860,7 +911,7 @@ class Module:
|
||||
# ----------------------------------------------------
|
||||
debug.debug("install datas")
|
||||
copy_list={}
|
||||
self.image_to_build(target, copy_list) # TODO : When file is resized, the final file is not removed if the file is not needed anymore
|
||||
self.image_to_build(target, copy_list)
|
||||
self.files_to_build(target, copy_list)
|
||||
self.paths_to_build(target, copy_list)
|
||||
#real copy files
|
||||
@@ -877,14 +928,17 @@ class Module:
|
||||
# ----------------------------------------------------
|
||||
if self._type[:6] == 'BINARY' \
|
||||
or self._type == 'PACKAGE':
|
||||
debug.verbose("Request creating of package : " + str(self._name))
|
||||
debug.extreme_verbose("Heritage : " + str(self._local_heritage))
|
||||
# TODO : Do package for library ...
|
||||
if target.end_generate_package == True:
|
||||
# generate the package with his properties ...
|
||||
if "Android" in target.get_type():
|
||||
self._sub_heritage_list.add_heritage(self._local_heritage)
|
||||
target.make_package(self._name, self._package_prop, os.path.join(self._origin_path, ".."), self._sub_heritage_list)
|
||||
else:
|
||||
target.make_package(self._name, self._package_prop, os.path.join(self._origin_path, ".."), self._sub_heritage_list)
|
||||
|
||||
elif self._type == 'PACKAGE':
|
||||
self._sub_heritage_list.add_heritage(self._local_heritage)
|
||||
debug.extreme_verbose("HeritageList : " + str(self._sub_heritage_list))
|
||||
target.make_package(self._name, self._package_prop, os.path.join(self._origin_path, ".."), self._sub_heritage_list)
|
||||
# return local dependency ...
|
||||
return copy.deepcopy(self._sub_heritage_list)
|
||||
|
||||
@@ -939,49 +993,82 @@ class Module:
|
||||
def add_depend(self, list):
|
||||
tools.list_append_to(self._depends, list, True)
|
||||
|
||||
## @brief deprecated ...
|
||||
## @return None
|
||||
def add_module_depend(self, list):
|
||||
debug.warning("[" + self._name + "] add_module_depend is deprecated ==> use add_depend(...)")
|
||||
self.add_depend(list)
|
||||
|
||||
##
|
||||
## @brief Add an optionnal dependency on this module
|
||||
## @param[in] self (handle) Class handle
|
||||
## @param[in] module_name (string) Name of the optionnal dependency
|
||||
## @param[in] compilation_flags ([string,string]) flag to add if dependency if find.
|
||||
## @param[in] compilation_flags ([string,string]) flag to add if dependency is found.
|
||||
## @param[in] compilation_flags_not_found ([string,string]) flag to add if dependency is NOT found.
|
||||
## @param[in] export (bool) export the flat that has been requested to add if module is present.
|
||||
## @param[in] src_file ([string,...]) File to compile if the dependecy if found.
|
||||
## @param[in] header_file ([string,...]) File to add in header if the dependecy if found.
|
||||
## @return None
|
||||
##
|
||||
def add_optionnal_depend(self, module_name, compilation_flags=["", ""], export=False):
|
||||
tools.list_append_and_check(self._depends_optionnal, [module_name, compilation_flags, export], True)
|
||||
|
||||
## @brief deprecated ...
|
||||
## @return None
|
||||
def add_optionnal_module_depend(self, module_name, compilation_flags=["", ""], export=False):
|
||||
debug.warning("[" + self._name + "] add_optionnal_module_depend is deprecated ==> use add_optionnal_depend(...)")
|
||||
self.add_optionnal_depend(module_name, compilation_flags, export)
|
||||
def add_optionnal_depend(self, module_name, compilation_flags=["", ""], export=False, src_file=[], header_file=[], compilation_flags_not_found=["", ""]):
|
||||
tools.list_append_and_check(self._depends_optionnal, [module_name, compilation_flags, export, src_file, header_file, compilation_flags_not_found], True)
|
||||
|
||||
##
|
||||
## @brief Add a path to include when build
|
||||
## @param[in] self (handle) Class handle
|
||||
## @param[in] list ([string,...] or string) List of path to include
|
||||
## @param[in] list ([string,...] or string) List of path to include (default: local path) only relative path...
|
||||
## @param[in] type (string) inclusion group name 'c', 'c++', 'java' ...
|
||||
## @param[in] export (bool) export the include path.
|
||||
## @return None
|
||||
##
|
||||
def add_path(self, list, type='c', export=False):
|
||||
def add_path(self, list=".", type='c', export=False):
|
||||
if tools.get_type_string(list) == "list":
|
||||
add_list = []
|
||||
for elem in list:
|
||||
if len(elem) > 1 \
|
||||
and elem[0] == '/':
|
||||
# unix case
|
||||
debug.warning(" add_path(" + str(list) + ")")
|
||||
debug.warning("[" + self._name + "] Not permited to add a path that start in / directory (only relative path) (compatibility until 2.x)")
|
||||
add_list.append(elem)
|
||||
elif len(elem) > 2 \
|
||||
and elem[1] == ':':
|
||||
# windows case :
|
||||
debug.warning(" add_path(" + str(list) + ")")
|
||||
debug.warning("[" + self._name + "] Not permited to add a path that start in '" + elem[0] + ":' directory (only relative path) (compatibility until 2.x)")
|
||||
add_list.append(elem)
|
||||
if elem == ".":
|
||||
add_list.append(tools.get_current_path(self._origin_file))
|
||||
else:
|
||||
add_list.append(os.path.join(tools.get_current_path(self._origin_file), elem))
|
||||
else:
|
||||
if len(list) > 1 \
|
||||
and list[0] == '/':
|
||||
# unix case
|
||||
debug.warning(" add_path(" + str(list) + ")")
|
||||
debug.warning("[" + self._name + "] Not permited to add a path that start in / directory (only relative path) (compatibility until 2.x)")
|
||||
add_list = list
|
||||
elif len(list) > 2 \
|
||||
and list[1] == ':':
|
||||
# windows case :
|
||||
debug.warning(" add_path(" + str(list) + ")")
|
||||
debug.warning("[" + self._name + "] Not permited to add a path that start in '" + list[0] + ":' directory (only relative path) (compatibility until 2.x)")
|
||||
add_list = list
|
||||
elif list == ".":
|
||||
add_list = tools.get_current_path(self._origin_file)
|
||||
else:
|
||||
add_list = os.path.join(tools.get_current_path(self._origin_file), list)
|
||||
debug.verbose("Convert path : " + str(list) + " in " + str(add_list))
|
||||
self._add_path(add_list, type, export)
|
||||
|
||||
##
|
||||
## @brief (INTERNAL API) Add a path to include when build
|
||||
## @param[in] self (handle) Class handle
|
||||
## @param[in] list ([string,...] or string) List of path to include (default: local path)
|
||||
## @param[in] type (string) inclusion group name 'c', 'c++', 'java' ...
|
||||
## @param[in] export (bool) export the include path.
|
||||
## @return None
|
||||
##
|
||||
def _add_path(self, list=".", type='c', export=False):
|
||||
if export == True:
|
||||
tools.list_append_to_2(self._path["export"], type, list)
|
||||
else:
|
||||
tools.list_append_to_2(self._path["local"], type, list)
|
||||
|
||||
## @brief deprecated ...
|
||||
## @return None
|
||||
def add_export_path(self, list, type='c'):
|
||||
debug.warning("[" + self._name + "] add_export_path is deprecated ==> use add_path(xxx, yyy, export=True)")
|
||||
self.add_path(list, type, export=True)
|
||||
|
||||
##
|
||||
## @brief Add compilation flags
|
||||
## @param[in] self (handle) Class handle
|
||||
@@ -996,18 +1083,6 @@ class Module:
|
||||
else:
|
||||
tools.list_append_to_2(self._flags["local"], type, list)
|
||||
|
||||
## @brief deprecated ...
|
||||
## @return None
|
||||
def add_export_flag(self, type, list):
|
||||
debug.warning("[" + self._name + "] add_export_flag is deprecated ==> use add_flag(xxx, yyy, export=True)")
|
||||
self.add_flag(type, list, export=True)
|
||||
|
||||
## @brief deprecated ...
|
||||
## @return None
|
||||
def compile_flags(self, type, list):
|
||||
debug.warning("[" + self._name + "] compile_flags is deprecated ==> use add_flag(xxx, yyy)")
|
||||
self.add_flag(type, list)
|
||||
|
||||
##
|
||||
## @brief Set the compilation version of the
|
||||
## @param[in] self (handle) Class handle
|
||||
@@ -1020,9 +1095,9 @@ class Module:
|
||||
def compile_version(self, compilator_type, version, same_as_api=True, gnu=False):
|
||||
if compilator_type == "c++" \
|
||||
or compilator_type == "C++":
|
||||
cpp_version_list = [1999, 2003, 2011, 2014, 2017]
|
||||
cpp_version_list = [1999, 2003, 2011, 2014, 2017, 2020]
|
||||
if version not in cpp_version_list:
|
||||
debug.error("can not select CPP version : " + str(version) + " not in " + str(cpp_version_list))
|
||||
debug.error("[" + self._name + "] Can not select CPP version : " + str(version) + " not in " + str(cpp_version_list))
|
||||
# select API version:
|
||||
api_version = 1999
|
||||
if same_as_api == True:
|
||||
@@ -1032,12 +1107,12 @@ class Module:
|
||||
}
|
||||
self._flags["export"]["c++-version"] = api_version
|
||||
if gnu == True and same_as_api == True:
|
||||
debug.warning("Can not propagate the gnu extention of the CPP vesion for API");
|
||||
debug.debug("[" + self._name + "] Can not propagate the gnu extention of the CPP vesion for API");
|
||||
elif compilator_type == "c" \
|
||||
or compilator_type == "C":
|
||||
c_version_list = [1989, 1990, 1999, 2011]
|
||||
c_version_list = [1989, 1990, 1999, 2011, 2017, 1018]
|
||||
if version not in c_version_list:
|
||||
debug.error("can not select C version : " + str(version) + " not in " + str(c_version_list))
|
||||
debug.error("[" + self._name + "] Can not select C version : " + str(version) + " not in " + str(c_version_list))
|
||||
# select API version:
|
||||
api_version = 1999
|
||||
if same_as_api == True:
|
||||
@@ -1047,9 +1122,9 @@ class Module:
|
||||
}
|
||||
self._flags["export"]["c-version"] = api_version
|
||||
if gnu == True and same_as_api == True:
|
||||
debug.warning("Can not propagate the gnu extention of the C vesion for API");
|
||||
debug.debug("[" + self._name + "] Can not propagate the gnu extention of the C vesion for API");
|
||||
else:
|
||||
debug.warning("Can not set version of compilator:" + str(compilator_type));
|
||||
debug.warning("[" + self._name + "] Can not set version of compilator:" + str(compilator_type));
|
||||
|
||||
##
|
||||
## @brief Add source file to compile
|
||||
@@ -1059,6 +1134,28 @@ class Module:
|
||||
##
|
||||
def add_src_file(self, list):
|
||||
tools.list_append_to(self._src, list, True)
|
||||
|
||||
##
|
||||
## @brief Add all files in a specific path as source file to compile
|
||||
## @param[in] self (handle) Class handle
|
||||
## @param[in] base_path (string) Path where to search files
|
||||
## @param[in] regex (string) regular expression of the search
|
||||
## @param[in] recursive (bool) Search in resursive mode
|
||||
## @return None
|
||||
##
|
||||
def add_src_path(self, base_path, regex="*", recursive=False):
|
||||
if len(base_path) == 0:
|
||||
debug.error("[" + self.get_name() + "] ==> no path set for function add_src_path")
|
||||
if base_path[0] == '/' \
|
||||
or base_path[0] == '\\':
|
||||
debug.error("[" + self.get_name() + "] ==> use relative path for function add_src_path")
|
||||
list_of_file = tools.get_list_of_file_in_path(os.path.join(self._origin_path, base_path), regex=regex, recursive=recursive, remove_path=self._origin_path)
|
||||
if list_of_file == None:
|
||||
debug.warning("[" + self.get_name() + "] ==> Can not find any file : " + os.path.join(self._origin_path, base_path) + " " + regex)
|
||||
return
|
||||
debug.debug("[" + self.get_name() + "] add " + str(len(list_of_file)) + " file(s)")
|
||||
self.add_src_file(list_of_file)
|
||||
|
||||
##
|
||||
## @brief An an header file in the install directory
|
||||
## @param[in] self (handle) Class handle
|
||||
@@ -1067,6 +1164,8 @@ class Module:
|
||||
## @param[in] clip_path (string) Remove a part of the path set in the list and install data in generic include path
|
||||
## @param[in] recursive (bool) when use regexp in file list ==> we can add recursive property
|
||||
##
|
||||
## @note see add_header_path for a simple integration
|
||||
##
|
||||
## @code
|
||||
## my_module.add_header_file([
|
||||
## 'include/ewol/widget.h',
|
||||
@@ -1109,7 +1208,7 @@ class Module:
|
||||
if destination_path != None:
|
||||
debug.verbose("Change destination PATH: '" + str(destination_path) + "'")
|
||||
new_list = []
|
||||
if type(list) == str:
|
||||
if tools.get_type_string(list) == "string":
|
||||
list = [list]
|
||||
for elem in list:
|
||||
base = os.path.basename(elem)
|
||||
@@ -1160,7 +1259,39 @@ class Module:
|
||||
tools.list_append_to(self._header, new_list, True)
|
||||
|
||||
##
|
||||
## @brief Many library need to generate dynamic file configuration, use this to generat your configuration and add it in the include path
|
||||
## @brief An an header path in the install directory
|
||||
## @param[in] self (handle) Class handle
|
||||
## @param[in] base_path (string) Path where to search files
|
||||
## @param[in] regex (string) regular expression of the search
|
||||
## @param[in] clip_path (string) Remove a part of the path set in the list and install data in generic include path
|
||||
## @param[in] recursive (bool) Search in resursive mode
|
||||
## @param[in] destination_path (string) Path to install the files (remove all the path of the file)
|
||||
## @return None
|
||||
##
|
||||
def add_header_path(self, base_path, regex="*", clip_path=None, recursive=False, destination_path=None):
|
||||
if base_path[-1] == '/' \
|
||||
or base_path[-1] == '\\':
|
||||
self.add_header_file(base_path + regex, clip_path=clip_path, recursive=recursive, destination_path=destination_path)
|
||||
else:
|
||||
self.add_header_file(base_path + "/" + regex, clip_path=clip_path, recursive=recursive, destination_path=destination_path)
|
||||
##
|
||||
## @brief Many library need to generate dynamic data file, use this to add dynamic generated files
|
||||
## @param[in] self (handle) Class handle
|
||||
## @param[in] data_file (string) Data of the file that is generated
|
||||
## @param[in] destination_path (string) Path where to install data
|
||||
## @param[in] install_element (bool) add the file in the include path and not only in the generate path
|
||||
## @note this does not rewrite the file if it is not needed
|
||||
## @return None
|
||||
##
|
||||
def add_generated_data_file(self, data_file, destination_path, install_element=False):
|
||||
self._generate_file.append({
|
||||
"type":"data",
|
||||
"data":data_file,
|
||||
"filename":destination_path,
|
||||
"install":install_element
|
||||
});
|
||||
##
|
||||
## @brief Many library need to generate dynamic file configuration, use this to generate your configuration and add it in the include path
|
||||
## @param[in] self (handle) Class handle
|
||||
## @param[in] data_file (string) Data of the file that is generated
|
||||
## @param[in] destination_path (string) Path where to install data
|
||||
@@ -1170,10 +1301,40 @@ class Module:
|
||||
##
|
||||
def add_generated_header_file(self, data_file, destination_path, install_element=False):
|
||||
self._generate_file.append({
|
||||
"type":"header",
|
||||
"data":data_file,
|
||||
"filename":destination_path,
|
||||
"install":install_element
|
||||
});
|
||||
##
|
||||
## @brief Many library need to generate dynamic file to compile, use this to create and add to build your files
|
||||
## @param[in] self (handle) Class handle
|
||||
## @param[in] data_file (string) Data of the file that is generated
|
||||
## @param[in] destination_path (string) Path where to install data
|
||||
## @note this does not rewrite the file if it is not needed
|
||||
## @return None
|
||||
##
|
||||
def add_generated_src_file(self, data_file, destination_path):
|
||||
self._generate_file.append({
|
||||
"type":"src",
|
||||
"data":data_file,
|
||||
"filename":destination_path,
|
||||
"install":False
|
||||
});
|
||||
|
||||
##
|
||||
## @brief Add action to do for the module
|
||||
## @param[in] action (function handle) Function to call to execure action
|
||||
## @param[in] data (*) Data to set at the action function
|
||||
## @return None
|
||||
##
|
||||
def add_action(self, action, data=None, name=None):
|
||||
debug.verbose("add action : " + str(name))
|
||||
self._actions.append({
|
||||
"name":name,
|
||||
"action":action,
|
||||
"data":data
|
||||
})
|
||||
|
||||
##
|
||||
## @brief copy image in the module datas
|
||||
@@ -1215,7 +1376,7 @@ class Module:
|
||||
## @return None
|
||||
##
|
||||
def _print_list(self, description, input_list):
|
||||
if type(input_list) == list:
|
||||
if tools.get_type_string(input_list) == "list":
|
||||
if len(input_list) > 0:
|
||||
print(' ' + str(description))
|
||||
for elem in input_list:
|
||||
@@ -1239,6 +1400,7 @@ class Module:
|
||||
|
||||
self._print_list('depends',self._depends)
|
||||
self._print_list('depends_optionnal', self._depends_optionnal)
|
||||
print(' action count=' + str(len(self._actions)) + str(self._actions))
|
||||
|
||||
for element in self._flags["local"]:
|
||||
value = self._flags["local"][element]
|
||||
@@ -1258,6 +1420,109 @@ class Module:
|
||||
for element in self._path["export"]:
|
||||
value = self._path["export"][element]
|
||||
self._print_list('export path "' + str(element) + '" ' + str(len(value)), value)
|
||||
print('-----------------------------------------------')
|
||||
return True
|
||||
|
||||
def check_rules(self, type, rules):
|
||||
if ( ( type == 'LIBRARY' \
|
||||
or type == 'LIBRARY_DYNAMIC' \
|
||||
or type == 'LIBRARY_STATIC' ) \
|
||||
and "L" not in rules ) \
|
||||
or ( type == 'DATA' \
|
||||
and "D" not in rules ) \
|
||||
or ( type == 'PREBUILD'\
|
||||
and "P" not in rules ) \
|
||||
or ( type == 'PACKAGE'\
|
||||
and "K" not in rules) \
|
||||
or ( ( type == 'BINARY' \
|
||||
or type == 'BINARY_SHARED' \
|
||||
or type == 'BINARY_STAND_ALONE')\
|
||||
and "B" not in rules ) :
|
||||
return True
|
||||
return False
|
||||
|
||||
# TODO: Add to simplify the display the possibility to check if an element already depend in dependency of an element ???
|
||||
def dependency_generate(self, target, tmp_file, step, rules):
|
||||
debug.print_element("dot", "dependency.dot", "<<<", self._name)
|
||||
if self.check_rules(self._type, rules) == True:
|
||||
return
|
||||
if step == 1:
|
||||
if self._type == 'DATA':
|
||||
tmp_file.write(' node [\n');
|
||||
tmp_file.write(' shape=Mdiamond;\n');
|
||||
tmp_file.write(' style=filled;\n');
|
||||
tmp_file.write(' color=red;\n');
|
||||
tmp_file.write(' ];\n');
|
||||
elif self._type == 'PREBUILD':
|
||||
tmp_file.write(' node [\n');
|
||||
tmp_file.write(' shape=square;\n');
|
||||
tmp_file.write(' style=filled;\n');
|
||||
tmp_file.write(' color=gray;\n');
|
||||
tmp_file.write(' ];\n');
|
||||
elif self._type == 'LIBRARY' \
|
||||
or self._type == 'LIBRARY_DYNAMIC' \
|
||||
or self._type == 'LIBRARY_STATIC':
|
||||
tmp_file.write(' node [\n');
|
||||
tmp_file.write(' shape=ellipse;\n');
|
||||
tmp_file.write(' style=filled;\n');
|
||||
tmp_file.write(' color=lightblue;\n');
|
||||
tmp_file.write(' ];\n');
|
||||
elif self._type == 'BINARY' \
|
||||
or self._type == 'BINARY_SHARED' \
|
||||
or self._type == 'BINARY_STAND_ALONE':
|
||||
tmp_file.write(' node [\n');
|
||||
tmp_file.write(' shape=rectangle;\n');
|
||||
tmp_file.write(' style=filled;\n');
|
||||
tmp_file.write(' color=green;\n');
|
||||
tmp_file.write(' ];\n');
|
||||
elif self._type == 'PACKAGE':
|
||||
return
|
||||
tmp_file.write(' ' + copy.deepcopy(self._name).replace('-','_')+ ';\n');
|
||||
else:
|
||||
for elem in self._depends:
|
||||
debug.verbose("add depend on: " + elem);
|
||||
tmp_module = None
|
||||
try:
|
||||
tmp_module = target.get_module(elem)
|
||||
except:
|
||||
target.load_if_needed(elem, optionnal=True)
|
||||
try:
|
||||
tmp_module = target.get_module(elem)
|
||||
except:
|
||||
debug.verbose(" ==> get error");
|
||||
if tmp_module == None:
|
||||
debug.verbose(" ==> notFound");
|
||||
continue
|
||||
if self.check_rules(tmp_module._type, rules) == True:
|
||||
debug.verbose(" ==> not in rules");
|
||||
continue
|
||||
tmp_file.write(' ' + copy.deepcopy(self._name).replace('-','_') + ' -> ' + copy.deepcopy(elem).replace('-','_') + ';\n');
|
||||
for elem in self._depends_optionnal:
|
||||
elem = elem[0]
|
||||
debug.verbose("add depend on: " + elem);
|
||||
tmp_module = None
|
||||
try:
|
||||
tmp_module = target.get_module(elem)
|
||||
except:
|
||||
target.load_if_needed(elem, optionnal=True)
|
||||
try:
|
||||
tmp_module = target.get_module(elem)
|
||||
except:
|
||||
debug.verbose(" ==> get error");
|
||||
if tmp_module == None:
|
||||
debug.verbose(" ==> notFound");
|
||||
continue
|
||||
if self.check_rules(tmp_module._type, rules) == True:
|
||||
debug.verbose(" ==> not in rules");
|
||||
continue
|
||||
tmp_file.write(' ' + copy.deepcopy(self._name).replace('-','_') + ' -> ' + copy.deepcopy(elem).replace('-','_') + ';\n');
|
||||
"""
|
||||
tmp_file.write(' module_' + self._name.replace('-','_') + ' {\n');
|
||||
tmp_file.write(' style=filled;\n');
|
||||
tmp_file.write(' color=blue;\n');
|
||||
tmp_file.write(' label="' + self._name + '";\n');
|
||||
tmp_file.write(' }\n');
|
||||
"""
|
||||
|
||||
##
|
||||
## @brief Get packaging property variable
|
||||
@@ -1270,9 +1535,6 @@ class Module:
|
||||
return copy.deepcopy(self._package_prop[name])
|
||||
return None
|
||||
|
||||
def pkg_set(self, variable, value):
|
||||
debug.warning("[" + self._name + "] DEPRECATED : pkg_set(...) replaced by set_pkg(...)")
|
||||
self.set_pkg(variable, value)
|
||||
##
|
||||
## @brief Set packaging variables
|
||||
## @param[in] self (handle) Class handle
|
||||
@@ -1281,7 +1543,7 @@ class Module:
|
||||
## @return None
|
||||
##
|
||||
def set_pkg(self, variable, value):
|
||||
if "COMPAGNY_TYPE" == variable:
|
||||
if variable == "COMPAGNY_TYPE":
|
||||
# com : Commercial
|
||||
# net : Network??
|
||||
# org : Organisation
|
||||
@@ -1295,7 +1557,7 @@ class Module:
|
||||
else:
|
||||
self._package_prop[variable] = value
|
||||
self._package_prop_default[variable] = False
|
||||
elif "COMPAGNY_NAME" == variable:
|
||||
elif variable == "COMPAGNY_NAME":
|
||||
self._package_prop[variable] = value
|
||||
self._package_prop_default[variable] = False
|
||||
val2 = value.lower()
|
||||
@@ -1304,13 +1566,26 @@ class Module:
|
||||
val2 = val2.replace('_', '')
|
||||
self._package_prop["COMPAGNY_NAME2"] = val2
|
||||
self._package_prop_default["COMPAGNY_NAME2"] = False
|
||||
elif "ICON" == variable:
|
||||
elif variable == "ICON":
|
||||
if len(value) > 1 \
|
||||
and value[0] == '/':
|
||||
# unix case
|
||||
debug.warning(" set_pkg('ICON', " + value + ")")
|
||||
debug.warning("[" + self._name + "] Not permited to add an ICON that start in / directory (only relative path) (compatibility until 2.x)")
|
||||
self._package_prop[variable] = value
|
||||
elif len(value) > 2 \
|
||||
and value[1] == ':':
|
||||
# windows case :
|
||||
debug.warning(" set_pkg('ICON', " + value + ")")
|
||||
debug.warning("[" + self._name + "] Not permited to add a path that start in '" + value[0] + ":' directory (only relative path) (compatibility until 2.x)")
|
||||
self._package_prop[variable] = value
|
||||
else:
|
||||
self._package_prop[variable] = os.path.join(tools.get_current_path(self._origin_file), value)
|
||||
self._package_prop_default[variable] = False
|
||||
elif variable == "MAINTAINER":
|
||||
self._package_prop[variable] = value
|
||||
self._package_prop_default[variable] = False
|
||||
elif "MAINTAINER" == variable:
|
||||
self._package_prop[variable] = value
|
||||
self._package_prop_default[variable] = False
|
||||
elif "SECTION" == variable:
|
||||
elif variable == "SECTION":
|
||||
# project section : (must be separate by coma
|
||||
# refer to : http://packages.debian.org/sid/
|
||||
# admin cli-mono comm database debian-installer
|
||||
@@ -1323,7 +1598,7 @@ class Module:
|
||||
# text utils vcs video virtual web x11 xfce zope ...
|
||||
self._package_prop[variable] = value
|
||||
self._package_prop_default[variable] = False
|
||||
elif "PRIORITY" == variable:
|
||||
elif variable == "PRIORITY":
|
||||
#list = ["required","important","standard","optional","extra"]
|
||||
#if isinstance(value, list):
|
||||
if value not in ["required", "important", "standard", "optional", "extra"]:
|
||||
@@ -1331,6 +1606,22 @@ class Module:
|
||||
else:
|
||||
self._package_prop[variable] = value
|
||||
self._package_prop_default[variable] = False
|
||||
elif variable == "ANDROID_SIGN":
|
||||
if len(value) > 1 \
|
||||
and value[0] == '/':
|
||||
# unix case
|
||||
debug.warning(" set_pkg('ANDROID_SIGN', " + value + ")")
|
||||
debug.warning("[" + self._name + "] Not permited to add an ICON that start in / directory (only relative path) (compatibility until 2.x)")
|
||||
self._package_prop[variable] = value
|
||||
elif len(value) > 2 \
|
||||
and value[1] == ':':
|
||||
# windows case :
|
||||
debug.warning(" set_pkg('ANDROID_SIGN', " + value + ")")
|
||||
debug.warning("[" + self._name + "] Not permited to add a path that start in '" + value[0] + ":' directory (only relative path) (compatibility until 2.x)")
|
||||
self._package_prop[variable] = value
|
||||
else:
|
||||
self._package_prop[variable] = os.path.join(tools.get_current_path(self._origin_file), value)
|
||||
self._package_prop_default[variable] = False
|
||||
elif variable in ["DESCRIPTION",
|
||||
"VERSION",
|
||||
"VERSION_CODE",
|
||||
@@ -1342,11 +1633,10 @@ class Module:
|
||||
"ANDROID_APPL_TYPE",
|
||||
"ADMOD_ID",
|
||||
"APPLE_APPLICATION_IOS_ID",
|
||||
"LICENSE",
|
||||
"ANDROID_SIGN"]:
|
||||
"LICENSE"]:
|
||||
self._package_prop[variable] = value
|
||||
self._package_prop_default[variable] = False
|
||||
elif "ADMOD_POSITION" == variable:
|
||||
elif variable == "ADMOD_POSITION":
|
||||
if value in ["top", "bottom"]:
|
||||
self._package_prop[variable] = value
|
||||
self._package_prop_default[variable] = False
|
||||
@@ -1366,9 +1656,6 @@ class Module:
|
||||
if self._package_prop_default[variable] == True:
|
||||
self.set_pkg(variable, value)
|
||||
|
||||
def pkg_add(self, variable, value):
|
||||
debug.warning("[" + self._name + "] DEPRECATED : pkg_add(...) replaced by add_pkg(...)")
|
||||
self.add_pkg(variable, value)
|
||||
##
|
||||
## @brief add an element in tha package property
|
||||
## @param[in] self (handle) Class handle
|
||||
@@ -1382,6 +1669,14 @@ class Module:
|
||||
else:
|
||||
self._package_prop[variable] = [value]
|
||||
|
||||
##
|
||||
## @brief Get the version of the module (getted in the global value)
|
||||
## @param[in] self (handle) Class handle
|
||||
## @return the list of version parameters
|
||||
##
|
||||
def get_version(self):
|
||||
return self._package_prop["VERSION"]
|
||||
|
||||
|
||||
__module_list=[]
|
||||
__start_module_name="_"
|
||||
@@ -1445,24 +1740,29 @@ def load_module(target, name):
|
||||
# get basic module properties:
|
||||
property = get_module_option(os.path.dirname(mod[1]), the_module, name)
|
||||
# configure the module:
|
||||
if "create" in dir(the_module):
|
||||
tmp_element = the_module.create(target, name)
|
||||
if tmp_element != None:
|
||||
# overwrite some package default property (if not set by user)
|
||||
if property["compagny-type"] != None:
|
||||
tmp_element._pkg_set_if_default("COMPAGNY_TYPE", property["compagny-type"])
|
||||
if property["compagny-name"] != None:
|
||||
tmp_element._pkg_set_if_default("COMPAGNY_NAME", property["compagny-name"])
|
||||
if property["maintainer"] != None:
|
||||
tmp_element._pkg_set_if_default("MAINTAINER", property["maintainer"])
|
||||
if property["name"] != None:
|
||||
tmp_element._pkg_set_if_default("NAME", property["name"])
|
||||
if property["description"] != None:
|
||||
tmp_element._pkg_set_if_default("DESCRIPTION", property["description"])
|
||||
if property["license"] != None:
|
||||
tmp_element._pkg_set_if_default("LICENSE", property["license"])
|
||||
if property["version"] != None:
|
||||
tmp_element._pkg_set_if_default("VERSION", property["version"])
|
||||
if "configure" in dir(the_module):
|
||||
# create the module:
|
||||
tmp_element = Module(the_module_file, name, property["type"])
|
||||
# overwrite some package default property (if not set by user)
|
||||
if property["compagny-type"] != None:
|
||||
tmp_element._pkg_set_if_default("COMPAGNY_TYPE", property["compagny-type"])
|
||||
if property["compagny-name"] != None:
|
||||
tmp_element._pkg_set_if_default("COMPAGNY_NAME", property["compagny-name"])
|
||||
if property["maintainer"] != None:
|
||||
tmp_element._pkg_set_if_default("MAINTAINER", property["maintainer"])
|
||||
if property["name"] != None:
|
||||
tmp_element._pkg_set_if_default("NAME", property["name"])
|
||||
if property["description"] != None:
|
||||
tmp_element._pkg_set_if_default("DESCRIPTION", property["description"])
|
||||
if property["license"] != None:
|
||||
tmp_element._pkg_set_if_default("LICENSE", property["license"])
|
||||
if property["version"] != None:
|
||||
tmp_element._pkg_set_if_default("VERSION", property["version"])
|
||||
# call user to configure it:
|
||||
ret = the_module.configure(target, tmp_element)
|
||||
if ret == False:
|
||||
# the user request remove the capabilities of this module for this platform
|
||||
tmp_element = None
|
||||
else:
|
||||
debug.warning(" no function 'create' in the module : " + mod[0] + " from:'" + mod[1] + "'")
|
||||
continue
|
||||
@@ -1505,12 +1805,12 @@ def list_all_module():
|
||||
##
|
||||
def list_all_module_with_desc():
|
||||
global __module_list
|
||||
tmpList = []
|
||||
tmp_list = []
|
||||
for mod in __module_list:
|
||||
sys.path.append(os.path.dirname(mod[1]))
|
||||
the_module = __import__(env.get_build_system_base_name() + __start_module_name + mod[0])
|
||||
tmpList.append(get_module_option(os.path.dirname(mod[1]), the_module, mod[0]))
|
||||
return tmpList
|
||||
tmp_list.append(get_module_option(os.path.dirname(mod[1]), the_module, mod[0]))
|
||||
return tmp_list
|
||||
|
||||
|
||||
##
|
||||
@@ -1536,7 +1836,7 @@ def get_module_option(path, the_module, name):
|
||||
if "get_type" in list_of_function_in_factory:
|
||||
type = the_module.get_type()
|
||||
else:
|
||||
debug.debug(" function get_type() must be provided in the module: " + name)
|
||||
debug.error(" function get_type() must be provided in the module: " + name)
|
||||
|
||||
if "get_sub_type" in list_of_function_in_factory:
|
||||
sub_type = the_module.get_sub_type()
|
||||
|
@@ -5,7 +5,7 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
import sys
|
||||
@@ -20,7 +20,7 @@ import os
|
||||
import subprocess
|
||||
import shlex
|
||||
# Local import
|
||||
from . import debug
|
||||
from realog import debug
|
||||
from . import tools
|
||||
from . import env
|
||||
from . import depend
|
||||
@@ -55,8 +55,9 @@ def run_command_no_lock_out(cmd_line):
|
||||
p = subprocess.Popen(args)
|
||||
except subprocess.CalledProcessError as e:
|
||||
debug.error("subprocess.CalledProcessError : " + str(args))
|
||||
except:
|
||||
debug.error("Exception on : " + str(args))
|
||||
return
|
||||
#except:
|
||||
# debug.error("Exception on : " + str(args))
|
||||
# launch the subprocess:
|
||||
p.communicate()
|
||||
|
||||
@@ -85,6 +86,7 @@ def run_command_direct(cmd_line):
|
||||
return err[:-1];
|
||||
return output[:-1];
|
||||
else:
|
||||
debug.warning("get an error cmd " + str(err))
|
||||
return False
|
||||
|
||||
|
||||
@@ -210,6 +212,10 @@ def set_error_occured():
|
||||
global exit_flag
|
||||
exit_flag = True
|
||||
|
||||
# set the debug system call us to stop threading
|
||||
debug.set_callback_error(set_error_occured)
|
||||
|
||||
|
||||
def set_core_number(number_of_core):
|
||||
global processor_availlable
|
||||
processor_availlable = number_of_core
|
||||
|
@@ -5,7 +5,7 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
import sys
|
||||
@@ -14,7 +14,7 @@ import inspect
|
||||
import fnmatch
|
||||
import datetime
|
||||
# Local import
|
||||
from . import debug
|
||||
from realog import debug
|
||||
from . import module
|
||||
from . import tools
|
||||
from . import env
|
||||
@@ -155,11 +155,15 @@ class System:
|
||||
debug.verbose("add element :" + str(elem) + " elems=" + str(self._export_flags[elem]))
|
||||
module.add_flag(elem, self._export_flags[elem], export=True)
|
||||
# add module dependency
|
||||
module.add_depend(self._export_depends)
|
||||
if self._export_depends != []:
|
||||
module.add_depend(self._export_depends)
|
||||
# add exporting sources
|
||||
module.add_src_file(self._export_src)
|
||||
if self._export_src != []:
|
||||
module.add_src_file(self._export_src)
|
||||
# add export path
|
||||
module.add_path(self._export_path, export=True)
|
||||
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]
|
||||
@@ -250,52 +254,71 @@ def display():
|
||||
##
|
||||
## @brief Check if a system Module is availlable for a specific target
|
||||
## @param[in] lib_name (string) Name of the Library
|
||||
## @param[in] target_name (string) Name of the target
|
||||
## @param[in] 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, target_name, target) :
|
||||
def exist(lib_name, list_target_name, target) :
|
||||
global __system_list
|
||||
debug.verbose("exist= " + lib_name + " in " + target_name)
|
||||
if target_name not in __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 __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"]
|
||||
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()
|
||||
"""
|
||||
if data["exist"] == False:
|
||||
debug.warning("Can not Import: '" + data["name"] + "' ==> disabled")
|
||||
"""
|
||||
else:
|
||||
debug.warning("Not find: '" + data["name"] + "' ==> get exception")
|
||||
return data["exist"]
|
||||
return False
|
||||
|
||||
##
|
||||
## @brief Load a system Module for a specific target
|
||||
## @param[in] target (handle) Handle on the @ref Target build engine
|
||||
## @param[in] lib_name (string) Name of the Library
|
||||
## @param[in] target_name (string) Name of the target
|
||||
## @param[in] list_target_name ([string,...]) list of name of the target (ordered by request order)
|
||||
## @return None
|
||||
##
|
||||
def load(target, lib_name, target_name):
|
||||
def load(target, lib_name, list_target_name):
|
||||
global __system_list
|
||||
if target_name not in __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 __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
|
||||
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
|
||||
|
||||
|
256
lutin/target.py
256
lutin/target.py
@@ -5,7 +5,7 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
import sys
|
||||
@@ -14,7 +14,7 @@ import inspect
|
||||
import fnmatch
|
||||
import datetime
|
||||
# Local import
|
||||
from . import debug
|
||||
from realog import debug
|
||||
from . import heritage
|
||||
from . import tools
|
||||
from . import module
|
||||
@@ -27,11 +27,15 @@ from . import env
|
||||
class Target:
|
||||
##
|
||||
## @brief contructor
|
||||
## @param[in] name (string) Name of the target
|
||||
## @param[in] name ([string,...]) Name of the target
|
||||
## @param[in] config (dict) User configuration
|
||||
## @param[in] arch (string) specific parameter for gcc -arch element
|
||||
##
|
||||
def __init__(self, name, config, arch):
|
||||
if tools.get_type_string(name) != "list":
|
||||
debug.error("You must define a name in a list ...")
|
||||
if len(name) < 1:
|
||||
debug.error("You must define a name for your target ...")
|
||||
## configuration of the build
|
||||
self.config = config
|
||||
|
||||
@@ -48,10 +52,11 @@ class Target:
|
||||
|
||||
self.end_generate_package = config["generate-package"]
|
||||
# todo : remove this :
|
||||
self._name = name
|
||||
self._config_based_on = [name]
|
||||
self._name = name[-1]
|
||||
self._config_based_on = name
|
||||
debug.info("=================================");
|
||||
debug.info("== Target='" + self._name + "' " + self.config["bus-size"] + " bits for arch '" + self.config["arch"] + "'");
|
||||
debug.info("== Target list=" + str(self._config_based_on))
|
||||
debug.info("=================================");
|
||||
|
||||
self.set_cross_base()
|
||||
@@ -78,14 +83,22 @@ class Target:
|
||||
self.path_generate_code="/generate_header"
|
||||
self.path_arch = "/" + self._name
|
||||
|
||||
for elem in self._config_based_on:
|
||||
self.add_flag("c", '-D__TARGET_OS__' + elem)
|
||||
self.add_flag("c", [
|
||||
'-D__TARGET_OS__' + self._name,
|
||||
'-D__TARGET_ARCH__' + self.config["arch"],
|
||||
'-D__TARGET_ADDR__' + self.config["bus-size"] + 'BITS',
|
||||
'-D_REENTRANT'
|
||||
])
|
||||
if self.config["compilator"] == "clang" \
|
||||
and self.xx_version >= 4002001: # >= 4.2.1
|
||||
self.add_flag("c++", "-Wno-undefined-var-template")
|
||||
self.add_flag("c", "-nodefaultlibs")
|
||||
self.add_flag("c++", "-nostdlib")
|
||||
# this disable the need to have the __cxa_guard_release
|
||||
self.add_flag("c++", "-fno-threadsafe-statics")
|
||||
#self.add_flag("c", "-nostdinc") #ignores standard C include directories
|
||||
#self.add_flag("c++", "-nostdinc++") #ignores standard C++ include directories
|
||||
self.add_flag("ar", 'rcs')
|
||||
|
||||
if self._name == "Windows":
|
||||
@@ -206,15 +219,38 @@ class Target:
|
||||
def get_simulation(self):
|
||||
return self.config["simulation"]
|
||||
|
||||
##
|
||||
## @brief Get compilator name (clang / gcc)
|
||||
## @param[in] self (handle) Class handle
|
||||
## @return (bool) name of the compilator requested
|
||||
##
|
||||
def get_compilator(self):
|
||||
return self.config["compilator"]
|
||||
|
||||
##
|
||||
## @brief Get architecture name (x86 / arm / ...)
|
||||
## @param[in] self (handle) Class handle
|
||||
## @return (bool) name of the arch requested
|
||||
##
|
||||
def get_arch(self):
|
||||
return self.config["arch"]
|
||||
##
|
||||
## @brief Get architecture name (x86 / arm / ...)
|
||||
## @param[in] self (handle) Class handle
|
||||
## @return (bool) name of the arch requested
|
||||
##
|
||||
def get_bus_size(self):
|
||||
return self.config["bus-size"]
|
||||
|
||||
##
|
||||
## @brief Add global target flags
|
||||
## @param[in] self (handle) Class handle
|
||||
## @param[in] type (string) inclusion group name 'c', 'c++', 'java' ...
|
||||
## @param[in] list ([string,...] or string) List of path to include
|
||||
## @param[in] in_list ([string,...] or string) List of path to include
|
||||
## @return None
|
||||
##
|
||||
def add_flag(self, type, list):
|
||||
tools.list_append_to_2(self.global_flags, type, list)
|
||||
def add_flag(self, in_type, in_list):
|
||||
tools.list_append_to_2(self.global_flags, in_type, in_list)
|
||||
|
||||
##
|
||||
## @brief Update basic tree path positions on the build tree
|
||||
@@ -225,6 +261,7 @@ class Target:
|
||||
self.path_out = os.path.join("out", self._name + "_" + self.config["arch"] + "_" + self.config["bus-size"], self.config["mode"])
|
||||
self.path_final = os.path.join("final", self.config["compilator"])
|
||||
self.path_staging = os.path.join("staging", self.config["compilator"])
|
||||
self.path_staging_tmp = os.path.join("staging_tmp", self.config["compilator"])
|
||||
self.path_build = os.path.join("build", self.config["compilator"])
|
||||
|
||||
# TODO: Remove this from here ==> this is a tools
|
||||
@@ -286,7 +323,7 @@ class Target:
|
||||
if ret == False:
|
||||
debug.error("Can not get the g++/clang++ version ...")
|
||||
self.xx_version = self.create_number_from_version_string(ret)
|
||||
debug.verbose(self.config["compilator"] + "++ version=" + str(ret) + " number=" + str(self.xx_version))
|
||||
debug.debug(self.config["compilator"] + "++ version=" + str(ret) + " number=" + str(self.xx_version))
|
||||
|
||||
self.ld = self.cross + "ld"
|
||||
self.nm = self.cross + "nm"
|
||||
@@ -361,8 +398,11 @@ class Target:
|
||||
## @param[in] name (string) Name of the module
|
||||
## @return (string) The path
|
||||
##
|
||||
def get_staging_path(self, name):
|
||||
return os.path.join(tools.get_run_path(), self.path_out, self.path_staging, name)
|
||||
def get_staging_path(self, name, tmp=False):
|
||||
if tmp == False:
|
||||
return os.path.join(tools.get_run_path(), self.path_out, self.path_staging, name)
|
||||
else:
|
||||
return os.path.join(tools.get_run_path(), self.path_out, self.path_staging_tmp, name)
|
||||
|
||||
##
|
||||
## @brief Get the build path ==> dependency file, object files, cmdlines files, generate files, local install headers ...
|
||||
@@ -433,8 +473,10 @@ class Target:
|
||||
## @param[in] name (string) Name of the module
|
||||
## @return (string) The path
|
||||
##
|
||||
def get_build_file_bin(self, name):
|
||||
return os.path.join(self.get_build_path_bin(name), name + self.suffix_binary)
|
||||
def get_build_file_bin(self, name, static):
|
||||
if static == True:
|
||||
return os.path.join(self.get_build_path_bin(name), name + "_static" + self.suffix_binary)
|
||||
return os.path.join(self.get_build_path_bin(name), name + "_dynamic" + self.suffix_binary)
|
||||
|
||||
##
|
||||
## @brief Get the path filename of the build static library name
|
||||
@@ -461,8 +503,8 @@ class Target:
|
||||
## @param[in] name (string) Name of the package
|
||||
## @return (string) The path
|
||||
##
|
||||
def get_staging_path_bin(self, name):
|
||||
return os.path.join(self.get_staging_path(name), self.path_bin)
|
||||
def get_staging_path_bin(self, name, tmp=False):
|
||||
return os.path.join(self.get_staging_path(name, tmp), self.path_bin)
|
||||
|
||||
##
|
||||
## @brief Get the lib path for staging step
|
||||
@@ -470,8 +512,8 @@ class Target:
|
||||
## @param[in] name (string) Name of the package
|
||||
## @return (string) The path
|
||||
##
|
||||
def get_staging_path_lib(self, name):
|
||||
return os.path.join(self.get_staging_path(name), self.path_lib, name)
|
||||
def get_staging_path_lib(self, name, tmp=False):
|
||||
return os.path.join(self.get_staging_path(name, tmp), self.path_lib, name)
|
||||
|
||||
##
|
||||
## @brief Get the data path for staging step
|
||||
@@ -479,8 +521,8 @@ class Target:
|
||||
## @param[in] name (string) Name of the package
|
||||
## @return (string) The path
|
||||
##
|
||||
def get_staging_path_data(self, name):
|
||||
return os.path.join(self.get_staging_path(name), self.path_data, name)
|
||||
def get_staging_path_data(self, name, tmp=False):
|
||||
return os.path.join(self.get_staging_path(name, tmp), self.path_data, name)
|
||||
|
||||
##
|
||||
## @brief Get the include path for staging step
|
||||
@@ -575,9 +617,9 @@ class Target:
|
||||
module.load_module(self, name)
|
||||
return True;
|
||||
# need to import the module (or the system module ...)
|
||||
exist = system.exist(name, self._name, self)
|
||||
exist = system.exist(name, self._config_based_on, self)
|
||||
if exist == True:
|
||||
system.load(self, name, self._name)
|
||||
system.load(self, name, self._config_based_on)
|
||||
return True;
|
||||
# we did not find the module ...
|
||||
return False;
|
||||
@@ -599,9 +641,10 @@ class Target:
|
||||
## @param[in] name (string) Module to build
|
||||
## @param[in] optionnal (bool) If the module is not accessible, this is not a probleme ==> optionnal dependency requested
|
||||
## @param[in] actions ([string,...]) list of action to do. ex: build, gcov, dump, all, clean, install, uninstall, run, log
|
||||
## @param[in] package_name Current package name that request the build
|
||||
## @return (None|Module handle| ...) complicated return ...
|
||||
##
|
||||
def build(self, name, optionnal=False, actions=[]):
|
||||
def build(self, name, optionnal=False, actions=[], package_name=None):
|
||||
if len(name.split("?")) != 1\
|
||||
or len(name.split("@")) != 1:
|
||||
debug.error("need update")
|
||||
@@ -620,17 +663,48 @@ class Target:
|
||||
for mod in self.module_list:
|
||||
mod.display()
|
||||
return
|
||||
if name[:10] == "dependency":
|
||||
if len(name) > 10:
|
||||
rules = name.split(":")[1]
|
||||
else:
|
||||
rules = "LBDPK"
|
||||
# L for library
|
||||
# B for binary
|
||||
# D for Data
|
||||
# P for prebuild
|
||||
# K for package
|
||||
debug.print_element("dot", "", "---", "dependency.dot")
|
||||
self.load_all()
|
||||
tmp_file = open("dependency.dot", 'w')
|
||||
tmp_file.write('digraph G {\n')
|
||||
tmp_file.write(' rankdir=\"LR\";\n')
|
||||
for mod in self.module_list:
|
||||
mod.dependency_generate(self, tmp_file, 1, rules)
|
||||
# TODO : do it better ==> system library hook (do a oad of all avillable system library)
|
||||
tmp_file.write(' node [\n');
|
||||
tmp_file.write(' shape=square;\n');
|
||||
tmp_file.write(' style=filled;\n');
|
||||
tmp_file.write(' color=gray;\n');
|
||||
tmp_file.write(' ];\n');
|
||||
# TODO : End hook
|
||||
for mod in self.module_list:
|
||||
mod.dependency_generate(self, tmp_file, 2, rules)
|
||||
tmp_file.write('}\n')
|
||||
tmp_file.flush()
|
||||
tmp_file.close()
|
||||
debug.print_element("dot", "", "---", "dependency.dot")
|
||||
return
|
||||
if name == "all":
|
||||
debug.info("build all")
|
||||
self.load_all()
|
||||
for mod in self.module_list:
|
||||
if self._name=="Android":
|
||||
if self._name == "Android":
|
||||
if mod.get_type() == "PACKAGE":
|
||||
mod.build(self, None)
|
||||
mod.build(self, package_name)
|
||||
else:
|
||||
if mod.get_type() == "BINARY" \
|
||||
or mod.get_type() == "PACKAGE":
|
||||
mod.build(self, None)
|
||||
mod.build(self, package_name)
|
||||
elif name == "clean":
|
||||
debug.info("clean all")
|
||||
self.load_all()
|
||||
@@ -653,12 +727,25 @@ class Target:
|
||||
except AttributeError:
|
||||
debug.error("target have no 'un_install_package' instruction")
|
||||
elif action_name[:3] == "run":
|
||||
"""
|
||||
if mod.get_type() != "BINARY" \
|
||||
and mod.get_type() != "PACKAGE":
|
||||
debug.error("Can not run other than 'BINARY' ... pakage='" + mod.get_type() + "' for module='" + module_name + "'")
|
||||
"""
|
||||
bin_name = None
|
||||
if len(action_name) > 3:
|
||||
if action_name[3] == '%':
|
||||
bin_name = ""
|
||||
for elem in action_name[4:]:
|
||||
if elem == ":":
|
||||
break;
|
||||
bin_name += elem
|
||||
# we have option:
|
||||
action_name2 = action_name.replace("\:", "1234COLUMN4321")
|
||||
option_list = action_name2.split(":")
|
||||
if len(option_list) == 0:
|
||||
debug.warning("action 'run' wrong options options ... : '" + action_name + "' might be separate with ':'")
|
||||
if bin_name != None:
|
||||
debug.warning("action 'run' wrong options options ... : '" + action_name + "' might be separate with ':'")
|
||||
option_list = []
|
||||
else:
|
||||
option_list_tmp = option_list[1:]
|
||||
@@ -668,7 +755,7 @@ class Target:
|
||||
else:
|
||||
option_list = []
|
||||
#try:
|
||||
self.run(module_name, option_list)
|
||||
self.run(module_name, option_list, bin_name)
|
||||
#except AttributeError:
|
||||
# debug.error("target have no 'run' instruction")
|
||||
elif action_name == "log":
|
||||
@@ -719,9 +806,9 @@ class Target:
|
||||
debug.warning("action 'build' does not support options ... : '" + action_name + "'")
|
||||
debug.debug("build module '" + module_name + "'")
|
||||
if optionnal == True:
|
||||
ret = [mod.build(self, None), True]
|
||||
ret = [mod.build(self, package_name), True]
|
||||
else:
|
||||
ret = mod.build(self, None)
|
||||
ret = mod.build(self, package_name)
|
||||
break
|
||||
if optionnal == True \
|
||||
and ret == None:
|
||||
@@ -766,6 +853,7 @@ class Target:
|
||||
## @param[in] static The package is build in static mode
|
||||
##
|
||||
def make_package(self, pkg_name, pkg_properties, base_pkg_path, heritage_list):
|
||||
debug.debug("make_package [START]")
|
||||
#The package generated depend of the type of the element:
|
||||
end_point_module_name = heritage_list.list_heritage[-1].name
|
||||
module = self.get_module(end_point_module_name)
|
||||
@@ -774,19 +862,19 @@ class Target:
|
||||
if module.get_type() == 'PREBUILD':
|
||||
#nothing to do ...
|
||||
return
|
||||
if module.get_type() == 'LIBRARY' \
|
||||
or module.get_type() == 'LIBRARY_DYNAMIC' \
|
||||
or module.get_type() == 'LIBRARY_STATIC':
|
||||
elif module.get_type() == 'LIBRARY' \
|
||||
or module.get_type() == 'LIBRARY_DYNAMIC' \
|
||||
or module.get_type() == 'LIBRARY_STATIC':
|
||||
debug.info("Can not create package for library");
|
||||
return
|
||||
if module.get_type() == 'BINARY' \
|
||||
or module.get_type() == 'BINARY_STAND_ALONE':
|
||||
elif module.get_type() == 'BINARY' \
|
||||
or module.get_type() == 'BINARY_STAND_ALONE':
|
||||
self.make_package_binary(pkg_name, pkg_properties, base_pkg_path, heritage_list, static = True)
|
||||
if module.get_type() == 'BINARY_SHARED':
|
||||
elif module.get_type() == 'BINARY_SHARED':
|
||||
self.make_package_binary(pkg_name, pkg_properties, base_pkg_path, heritage_list, static = False)
|
||||
if module.get_type() == 'PACKAGE':
|
||||
debug.info("Can not create package for package");
|
||||
return
|
||||
elif module.get_type() == 'PACKAGE':
|
||||
self.make_package_binary(pkg_name, pkg_properties, base_pkg_path, heritage_list, static = False)
|
||||
debug.debug("make_package [STOP]")
|
||||
return
|
||||
|
||||
##
|
||||
@@ -799,6 +887,7 @@ class Target:
|
||||
## @return False Nothing has been copied
|
||||
##
|
||||
def make_package_binary_data(self, path_package, pkg_name, base_pkg_path, heritage_list, static):
|
||||
debug.debug("make_package_binary_data [START]")
|
||||
target_shared_path = os.path.join(path_package, self.pkg_path_data)
|
||||
if static == True:
|
||||
path_package_data = os.path.join(target_shared_path, pkg_name)
|
||||
@@ -833,6 +922,7 @@ class Target:
|
||||
ret_copy = tools.copy_list(copy_list)
|
||||
# remove unneded files (NOT folder ...)
|
||||
ret_remove = tools.clean_directory(target_shared_path, copy_list)
|
||||
debug.debug("make_package_binary_data [STOP]")
|
||||
return ret_copy or ret_remove
|
||||
|
||||
##
|
||||
@@ -845,21 +935,69 @@ class Target:
|
||||
## @return False Nothing has been copied
|
||||
##
|
||||
def make_package_binary_bin(self, path_package, pkg_name, base_pkg_path, heritage_list, static):
|
||||
debug.debug("make_package_binary_bin [START]")
|
||||
copy_list={}
|
||||
# creata basic output path
|
||||
path_package_bin = os.path.join(path_package, self.pkg_path_bin)
|
||||
tools.create_directory_of_file(path_package_bin)
|
||||
path_src = self.get_build_file_bin(pkg_name)
|
||||
path_dst = os.path.join(path_package_bin, pkg_name + self.suffix_binary)
|
||||
debug.verbose("path_dst: " + str(path_dst))
|
||||
tools.copy_file(path_src,
|
||||
path_dst,
|
||||
in_list=copy_list)
|
||||
# Local module binary
|
||||
path_src = self.get_build_file_bin(pkg_name, static)
|
||||
if os.path.exists(path_src) == True:
|
||||
try:
|
||||
path_dst = os.path.join(path_package_bin, pkg_name + self.suffix_binary)
|
||||
debug.verbose("path_dst: " + str(path_dst))
|
||||
tools.copy_file(path_src,
|
||||
path_dst,
|
||||
in_list=copy_list)
|
||||
except:
|
||||
debug.extreme_verbose("can not find : " + path_src)
|
||||
pass
|
||||
path_src = self.get_build_file_bin(pkg_name, static)
|
||||
path_src = path_src[:len(path_src)-4] + "js"
|
||||
if os.path.exists(path_src) == True:
|
||||
try:
|
||||
path_dst = os.path.join(path_package_bin, pkg_name + self.suffix_binary2)
|
||||
debug.verbose("path_dst: " + str(path_dst))
|
||||
tools.copy_file(path_src,
|
||||
path_dst,
|
||||
in_list=copy_list)
|
||||
except:
|
||||
debug.extreme_verbose("can not find : " + path_src)
|
||||
pass
|
||||
# heritage binary
|
||||
debug.debug("heritage for " + str(pkg_name) + ":")
|
||||
for heritage in heritage_list.list_heritage:
|
||||
debug.debug("sub elements: " + str(heritage.name))
|
||||
path_src = self.get_build_file_bin(heritage.name, static)
|
||||
if os.path.exists(path_src) == True:
|
||||
try:
|
||||
path_dst = os.path.join(path_package_bin, heritage.name + self.suffix_binary)
|
||||
debug.verbose("path_dst: " + str(path_dst))
|
||||
tools.copy_file(path_src,
|
||||
path_dst,
|
||||
in_list=copy_list)
|
||||
except:
|
||||
debug.extreme_verbose("can not find : " + path_src)
|
||||
pass
|
||||
path_src = self.get_build_file_bin(heritage.name, static)
|
||||
path_src = path_src[:len(path_src)-4] + "js"
|
||||
if os.path.exists(path_src) == True:
|
||||
try:
|
||||
path_dst = os.path.join(path_package_bin, heritage.name + self.suffix_binary2)
|
||||
debug.verbose("path_dst: " + str(path_dst))
|
||||
tools.copy_file(path_src,
|
||||
path_dst,
|
||||
in_list=copy_list)
|
||||
except:
|
||||
debug.extreme_verbose("can not find : " + path_src)
|
||||
pass
|
||||
#real copy files
|
||||
ret_copy = tools.copy_list(copy_list)
|
||||
ret_remove = False
|
||||
if self.pkg_path_bin != "":
|
||||
# remove unneded files (NOT folder ...)
|
||||
ret_remove = tools.clean_directory(path_package_bin, copy_list)
|
||||
debug.debug("make_package_binary_bin [STOP]")
|
||||
return ret_copy or ret_remove
|
||||
|
||||
##
|
||||
@@ -872,6 +1010,7 @@ class Target:
|
||||
## @return False Nothing has been copied
|
||||
##
|
||||
def make_package_binary_lib(self, path_package, pkg_name, base_pkg_path, heritage_list, static):
|
||||
debug.debug("make_package_binary_lib [START]")
|
||||
copy_list={}
|
||||
path_package_lib = os.path.join(path_package, self.pkg_path_lib)
|
||||
if static == False:
|
||||
@@ -895,10 +1034,12 @@ class Target:
|
||||
if self.pkg_path_lib != "":
|
||||
# remove unneded files (NOT folder ...)
|
||||
ret_remove = tools.clean_directory(path_package_lib, copy_list)
|
||||
debug.debug("make_package_binary_lib [STOP]")
|
||||
return ret_copy or ret_remove
|
||||
|
||||
|
||||
def make_package_generic_files(self, path_package, pkg_properties, pkg_name, base_pkg_path, heritage_list, static):
|
||||
debug.debug("make_package_generic_files [START]")
|
||||
## Create version file:
|
||||
ret_version = tools.file_write_data(os.path.join(path_package, self.pkg_path_version_file),
|
||||
tools.version_to_string(pkg_properties["VERSION"]),
|
||||
@@ -959,6 +1100,7 @@ class Target:
|
||||
ret_changelog = tools.file_write_data(change_log_file_dest,
|
||||
"No changelog data " + pkg_name + "\n",
|
||||
only_if_new=True)
|
||||
debug.debug("make_package_generic_files [STOP]")
|
||||
return ret_version \
|
||||
or ret_maintainer \
|
||||
or ret_appl_name \
|
||||
@@ -966,6 +1108,30 @@ class Target:
|
||||
or ret_readme \
|
||||
or ret_changelog
|
||||
|
||||
def install_package(self, pkg_name):
|
||||
debug.debug("------------------------------------------------------------------------")
|
||||
debug.info("-- Install package '" + pkg_name + "'")
|
||||
debug.debug("------------------------------------------------------------------------")
|
||||
debug.error("action not implemented ...")
|
||||
|
||||
def un_install_package(self, pkg_name):
|
||||
debug.debug("------------------------------------------------------------------------")
|
||||
debug.info("-- Un-Install package '" + pkg_name + "'")
|
||||
debug.debug("------------------------------------------------------------------------")
|
||||
debug.error("action not implemented ...")
|
||||
|
||||
def run(self, pkg_name, option_list, binary_name = None):
|
||||
debug.debug("------------------------------------------------------------------------")
|
||||
debug.info("-- Run package '" + pkg_name + "' + option: " + str(option_list))
|
||||
debug.debug("------------------------------------------------------------------------")
|
||||
debug.error("action not implemented ...")
|
||||
|
||||
def show_log(self, pkg_name):
|
||||
debug.debug("------------------------------------------------------------------------")
|
||||
debug.info("-- Show log logcat '" + pkg_name + "'")
|
||||
debug.debug("------------------------------------------------------------------------")
|
||||
debug.error("action not implemented ...")
|
||||
|
||||
##
|
||||
## @brief convert a s list of string in a string separated by a ","
|
||||
## @param[in] list List of element to transform
|
||||
|
115
lutin/tools.py
115
lutin/tools.py
@@ -5,7 +5,7 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
import os
|
||||
@@ -14,7 +14,7 @@ import errno
|
||||
import fnmatch
|
||||
import stat
|
||||
# Local import
|
||||
from . import debug
|
||||
from realog import debug
|
||||
from . import depend
|
||||
from . import env
|
||||
|
||||
@@ -61,6 +61,7 @@ def file_size(path):
|
||||
return statinfo.st_size
|
||||
|
||||
def file_read_data(path, binary=False):
|
||||
debug.verbose("path= " + path)
|
||||
if not os.path.isfile(path):
|
||||
return ""
|
||||
if binary == True:
|
||||
@@ -92,9 +93,10 @@ def version_to_string(version):
|
||||
##
|
||||
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 False
|
||||
if os.path.exists(path) == True:
|
||||
old_data = file_read_data(path)
|
||||
if old_data == data:
|
||||
return False
|
||||
#real write of data:
|
||||
create_directory_of_file(path)
|
||||
file = open(path, "w")
|
||||
@@ -170,6 +172,51 @@ def copy_file(src, dst, cmd_file=None, force=False, force_identical=False, in_li
|
||||
"need_copy":True}
|
||||
return True
|
||||
|
||||
##
|
||||
## @brief Get list of all Files in a specific path (with a regex)
|
||||
## @param[in] path (string) Full path of the machine to search files (start with / or x:)
|
||||
## @param[in] regex (string) Regular expression to search data
|
||||
## @param[in] recursive (bool) List file with recursive search
|
||||
## @param[in] remove_path (string) Data to remove in the path
|
||||
## @return (list) return files requested
|
||||
##
|
||||
def get_list_of_file_in_path(path, regex="*", recursive = False, remove_path=""):
|
||||
out = []
|
||||
debug.verbose(" List all in : '" + str(path) + "'")
|
||||
if os.path.isdir(os.path.realpath(path)):
|
||||
tmp_path = os.path.realpath(path)
|
||||
tmp_rule = regex
|
||||
else:
|
||||
debug.error("path does not exist : '" + str(path) + "'")
|
||||
|
||||
debug.verbose(" " + str(tmp_path) + ":")
|
||||
for root, dirnames, filenames in os.walk(tmp_path):
|
||||
deltaRoot = root[len(tmp_path):]
|
||||
while len(deltaRoot) > 0 \
|
||||
and ( deltaRoot[0] == '/' \
|
||||
or deltaRoot[0] == '\\' ):
|
||||
deltaRoot = deltaRoot[1:]
|
||||
if recursive == False \
|
||||
and deltaRoot != "":
|
||||
return out
|
||||
debug.verbose(" root='" + str(deltaRoot) + "'")
|
||||
debug.extreme_verbose(" files=" + str(filenames))
|
||||
tmpList = filenames
|
||||
if len(tmp_rule) > 0:
|
||||
tmpList = fnmatch.filter(filenames, tmp_rule)
|
||||
# Import the module :
|
||||
for cycleFile in tmpList:
|
||||
#for cycleFile in filenames:
|
||||
add_file = os.path.join(tmp_path, deltaRoot, cycleFile)
|
||||
if len(remove_path) != 0:
|
||||
if add_file[:len(remove_path)] != remove_path:
|
||||
debug.error("Request remove start of a path that is not the same: '" + add_file[:len(remove_path)] + "' demand remove of '" + str(remove_path) + "'")
|
||||
else:
|
||||
add_file = add_file[len(remove_path)+1:]
|
||||
debug.verbose(" '" + add_file + "'")
|
||||
out.append(add_file)
|
||||
return out;
|
||||
|
||||
##
|
||||
## @brief Copy a compleate directory in a specific folder
|
||||
## @param[in] src Input folder path
|
||||
@@ -316,6 +363,14 @@ 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):
|
||||
@@ -339,16 +394,16 @@ def list_append_to(out_list, in_list, order=False):
|
||||
else:
|
||||
debug.warning("can not add in list other than {list/dict/str} : " + str(type(in_list)))
|
||||
|
||||
def list_append_to_2(listout, module, list, order=False):
|
||||
def list_append_to_2(listout, module, in_list, order=False):
|
||||
# sepcial cse of bool
|
||||
if type(list) == bool:
|
||||
listout[module] = list
|
||||
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], list, order)
|
||||
list_append_to(listout[module], in_list, order)
|
||||
|
||||
|
||||
##
|
||||
@@ -373,16 +428,19 @@ def get_version_from_file_or_direct(path_module, filename_or_version):
|
||||
line = lines[0]
|
||||
debug.debug("Parse line: '" + line + "'")
|
||||
#check if we have "-dev"
|
||||
dev_mode = False
|
||||
if line[-4:] == "-dev":
|
||||
dev_mode = True
|
||||
line = line[:-4]
|
||||
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 == True:
|
||||
out.append("dev")
|
||||
if dev_mode != "":
|
||||
out.append(dev_mode)
|
||||
debug.debug(" ==> " + str(out))
|
||||
return out
|
||||
|
||||
@@ -410,4 +468,29 @@ def get_maintainer_from_file_or_direct(path_module, filename_or_author):
|
||||
# comment ...
|
||||
continue
|
||||
out.append(elem)
|
||||
return out
|
||||
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;
|
||||
|
||||
|
||||
|
@@ -5,5 +5,5 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
@@ -5,7 +5,7 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
##
|
||||
@@ -13,7 +13,7 @@
|
||||
##
|
||||
from lutin import multiprocess
|
||||
from lutin import tools
|
||||
from lutin import debug
|
||||
from realog import debug
|
||||
from lutin import depend
|
||||
from lutin import env
|
||||
import os
|
||||
@@ -59,7 +59,7 @@ def get_support_multithreading():
|
||||
##
|
||||
def link(file, binary, target, depancy, flags, name, basic_path, static = False):
|
||||
file_src = file
|
||||
file_dst = target.get_build_file_bin(binary)
|
||||
file_dst = target.get_build_file_bin(name, static)
|
||||
file_depend = file_dst + target.suffix_dependence
|
||||
file_cmd = file_dst + target.suffix_cmd_line
|
||||
file_warning = file_dst + target.suffix_warning
|
||||
@@ -83,8 +83,12 @@ def link(file, binary, target, depancy, flags, name, basic_path, static = False)
|
||||
lib_name = elem[:-len(target.suffix_lib_static)] + target.suffix_lib_dynamic
|
||||
if lib_name not in depancy.src['dynamic']:
|
||||
list_static.append(elem)
|
||||
# set ccache interface:
|
||||
compilator_ccache = ""
|
||||
if env.get_ccache() == True:
|
||||
compilator_ccache = "ccache"
|
||||
#create comand line:
|
||||
cmd = []
|
||||
cmd = [compilator_ccache]
|
||||
# a specific case to not depend on the libstdc++ automaticly added by the G++ or clang++ compilator ==> then need to compile with GCC or CLANG if use libcxx from llvm or other ...
|
||||
if "need-libstdc++" in depancy.flags \
|
||||
and depancy.flags["need-libstdc++"] == True:
|
||||
@@ -128,7 +132,7 @@ def link(file, binary, target, depancy, flags, name, basic_path, static = False)
|
||||
cmd.append("-Wl,-R$ORIGIN/../lib/")
|
||||
except:
|
||||
pass
|
||||
cmd.append("-Wl,-rpath,\"\$ORIGIN/../lib\"")
|
||||
cmd.append("-Wl,-rpath,\"$ORIGIN/../lib\"")
|
||||
try:
|
||||
cmd.append(flags["local"]["link"])
|
||||
except:
|
||||
|
@@ -5,7 +5,7 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
##
|
||||
@@ -13,8 +13,9 @@
|
||||
##
|
||||
from lutin import multiprocess
|
||||
from lutin import tools
|
||||
from lutin import debug
|
||||
from realog import debug
|
||||
from lutin import depend
|
||||
from lutin import env
|
||||
|
||||
# C version:
|
||||
default_version = 1989
|
||||
@@ -65,8 +66,13 @@ def compile(file, binary, target, depancy, flags, path, name, basic_path, module
|
||||
file_depend = target.get_full_dependency(name, basic_path, file)
|
||||
file_warning = target.get_full_name_warning(name, basic_path, file)
|
||||
|
||||
# set ccache interface:
|
||||
compilator_ccache = ""
|
||||
if env.get_ccache() == True:
|
||||
compilator_ccache = "ccache"
|
||||
# create the command line befor requesting start:
|
||||
cmd = [
|
||||
compilator_ccache,
|
||||
target.cc,
|
||||
"-o", file_dst,
|
||||
target.arch,
|
||||
@@ -85,19 +91,30 @@ def compile(file, binary, target, depancy, flags, path, name, basic_path, module
|
||||
cmd.append(get_version_compilation_flags(flags, depancy.flags))
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
cmd.append(target.global_flags["c"])
|
||||
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")
|
||||
@@ -129,21 +146,31 @@ def get_version_compilation_flags(flags, dependency_flags):
|
||||
is_gnu = default_version_gnu
|
||||
|
||||
version = max(version_local, dependency_version)
|
||||
if version == 2011:
|
||||
if version == 2018:
|
||||
if is_gnu ==True:
|
||||
out = ["-std=gnu18", "-D__C_VERSION__=2018"]
|
||||
else:
|
||||
out = ["-std=c18", "-D__C_VERSION__=2018"]
|
||||
elif version == 2017:
|
||||
if is_gnu ==True:
|
||||
out = ["-std=gnu17", "-D__C_VERSION__=2017"]
|
||||
else:
|
||||
out = ["-std=c17", "-D__C_VERSION__=2017"]
|
||||
elif version == 2011:
|
||||
if is_gnu ==True:
|
||||
out = ["-std=gnu11", "-D__C_VERSION__=2011"]
|
||||
else:
|
||||
out = ["-std=c11", "-D__C_VERSION__=1989"]
|
||||
out = ["-std=c11", "-D__C_VERSION__=2011"]
|
||||
elif version == 1999:
|
||||
if is_gnu ==True:
|
||||
out = ["-std=gnu99", "-D__C_VERSION__=1999"]
|
||||
else:
|
||||
out = ["-std=c99", "-D__C_VERSION__=1989"]
|
||||
out = ["-std=c99", "-D__C_VERSION__=1999"]
|
||||
elif version == 1990:
|
||||
if is_gnu ==True:
|
||||
out = ["-std=gnu90", "-D__C_VERSION__=1990"]
|
||||
else:
|
||||
out = ["-std=c90", "-D__C_VERSION__=1989"]
|
||||
out = ["-std=c90", "-D__C_VERSION__=1990"]
|
||||
else:
|
||||
if is_gnu ==True:
|
||||
out = ["-std=gnu89", "-D__C_VERSION__=1989"]
|
||||
|
@@ -5,7 +5,7 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
##
|
||||
@@ -13,8 +13,9 @@
|
||||
##
|
||||
from lutin import multiprocess
|
||||
from lutin import tools
|
||||
from lutin import debug
|
||||
from realog import debug
|
||||
from lutin import depend
|
||||
from lutin import env
|
||||
# C++ default version:
|
||||
default_version = 1999
|
||||
default_version_gnu = False
|
||||
@@ -54,12 +55,6 @@ def get_output_type():
|
||||
def get_support_multithreading():
|
||||
return True
|
||||
|
||||
def remove_element(data, to_remove):
|
||||
out = []
|
||||
for elem in data:
|
||||
if elem not in to_remove:
|
||||
out.append(elem)
|
||||
return out;
|
||||
|
||||
##
|
||||
## @brief Commands for running gcc to compile a C++ file in object file.
|
||||
@@ -70,8 +65,13 @@ def compile(file, binary, target, depancy, flags, path, name, basic_path, module
|
||||
file_dst = target.get_full_name_destination(name, basic_path, file, get_output_type())
|
||||
file_depend = target.get_full_dependency(name, basic_path, file)
|
||||
file_warning = target.get_full_name_warning(name, basic_path, file)
|
||||
# set ccache interface:
|
||||
compilator_ccache = ""
|
||||
if env.get_ccache() == True:
|
||||
compilator_ccache = "ccache"
|
||||
# create the command line befor requesting start:
|
||||
cmd = [
|
||||
compilator_ccache,
|
||||
target.xx,
|
||||
"-o", file_dst,
|
||||
target.arch,
|
||||
@@ -94,48 +94,36 @@ def compile(file, binary, target, depancy, flags, path, name, basic_path, module
|
||||
except:
|
||||
pass
|
||||
list_flags = [];
|
||||
try:
|
||||
if "c" in target.global_flags:
|
||||
list_flags.append(target.global_flags["c"])
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
if "c++" in target.global_flags:
|
||||
list_flags.append(target.global_flags["c++"])
|
||||
except:
|
||||
pass
|
||||
for type in ["c", "c++"]:
|
||||
try:
|
||||
if type in depancy.flags:
|
||||
list_flags.append(depancy.flags[type])
|
||||
except:
|
||||
pass
|
||||
for view in ["local", "export"]:
|
||||
for type in ["c", "c++"]:
|
||||
try:
|
||||
list_flags.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 = [];
|
||||
try:
|
||||
if "c-remove" in target.global_flags:
|
||||
list_flags_blacklist.append(target.global_flags["c-remove"])
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
if "c++-remove" in target.global_flags:
|
||||
list_flags_blacklist.append(target.global_flags["c++-remove"])
|
||||
except:
|
||||
pass
|
||||
for type in ["c-remove", "c++-remove"]:
|
||||
try:
|
||||
if type in depancy.flags:
|
||||
list_flags_blacklist.append(depancy.flags[type])
|
||||
except:
|
||||
pass
|
||||
for view in ["local", "export"]:
|
||||
for type in ["c-remove", "c++-remove"]:
|
||||
try:
|
||||
list_flags_blacklist.append(flags[view][type])
|
||||
except:
|
||||
pass
|
||||
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
|
||||
cmd.append(remove_element(list_flags, list_flags_blacklist));
|
||||
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
|
||||
@@ -164,13 +152,17 @@ def get_version_compilation_flags(flags, dependency_flags):
|
||||
is_gnu = default_version_gnu
|
||||
|
||||
version = max(version_local, dependency_version)
|
||||
if version == 2017:
|
||||
debug.error("not supported flags for X17 ...");
|
||||
if version == 2020:
|
||||
if is_gnu == True:
|
||||
out = ["-std=gnu++2a", "-D__CPP_VERSION__=2020"]
|
||||
else:
|
||||
out = ["-std=c++2a", "-D__CPP_VERSION__=2020"]
|
||||
elif version == 2017:
|
||||
if is_gnu == True:
|
||||
out = ["-std=gnu++17", "-D__CPP_VERSION__=2017"]
|
||||
else:
|
||||
out = ["-std=c++17", "-D__CPP_VERSION__=2017"]
|
||||
if version == 2014:
|
||||
elif version == 2014:
|
||||
if is_gnu == True:
|
||||
out = ["-std=gnu++14", "-D__CPP_VERSION__=2014"]
|
||||
else:
|
||||
|
@@ -5,7 +5,7 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
##
|
||||
@@ -13,7 +13,7 @@
|
||||
##
|
||||
from lutin import multiprocess
|
||||
from lutin import tools
|
||||
from lutin import debug
|
||||
from realog import debug
|
||||
from lutin import depend
|
||||
from lutin import env
|
||||
import os
|
||||
|
@@ -5,7 +5,7 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
##
|
||||
@@ -13,7 +13,7 @@
|
||||
##
|
||||
from lutin import multiprocess
|
||||
from lutin import tools
|
||||
from lutin import debug
|
||||
from realog import debug
|
||||
from lutin import depend
|
||||
|
||||
##
|
||||
|
@@ -5,7 +5,7 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
##
|
||||
@@ -13,7 +13,7 @@
|
||||
##
|
||||
from lutin import multiprocess
|
||||
from lutin import tools
|
||||
from lutin import debug
|
||||
from realog import debug
|
||||
from lutin import depend
|
||||
|
||||
##
|
||||
|
@@ -5,7 +5,7 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
##
|
||||
@@ -13,7 +13,7 @@
|
||||
##
|
||||
from lutin import multiprocess
|
||||
from lutin import tools
|
||||
from lutin import debug
|
||||
from realog import debug
|
||||
from lutin import depend
|
||||
from lutin import env
|
||||
import os
|
||||
@@ -86,8 +86,12 @@ def link(file, binary, target, depancy, flags, name, basic_path, static=False):
|
||||
lib_name = elem[:-len(target.suffix_lib_static)] + target.suffix_lib_dynamic
|
||||
if lib_name not in depancy.src['dynamic']:
|
||||
list_static.append(elem)
|
||||
# set ccache interface:
|
||||
compilator_ccache = ""
|
||||
if env.get_ccache() == True:
|
||||
compilator_ccache = "ccache"
|
||||
#create command Line
|
||||
cmd = []
|
||||
cmd = [compilator_ccache]
|
||||
# a specific case to not depend on the libstdc++ automaticly added by the G++ or clang++ compilator ==> then need to compile with GCC or CLANG if use libcxx from llvm or other ...
|
||||
if "need-libstdc++" in depancy.flags \
|
||||
and depancy.flags["need-libstdc++"] == True:
|
||||
@@ -165,7 +169,7 @@ def link(file, binary, target, depancy, flags, 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, "", "")
|
||||
if target.name == "MacOs":
|
||||
if "MacOs" in target.get_type():
|
||||
cmdLineStrip=tools.list_to_str([
|
||||
target.strip,
|
||||
"-u",
|
||||
|
@@ -5,7 +5,7 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
##
|
||||
@@ -13,7 +13,7 @@
|
||||
##
|
||||
from lutin import multiprocess
|
||||
from lutin import tools
|
||||
from lutin import debug
|
||||
from realog import debug
|
||||
from lutin import depend
|
||||
from lutin import env
|
||||
import os
|
||||
@@ -68,7 +68,12 @@ def link(file, binary, target, depancy, flags, name, basic_path):
|
||||
debug.extreme_verbose("file_cmd = " + file_cmd)
|
||||
debug.extreme_verbose("file_warning = " + file_warning)
|
||||
|
||||
# set ccache interface:
|
||||
compilator_ccache = ""
|
||||
if env.get_ccache() == True:
|
||||
compilator_ccache = "ccache"
|
||||
cmd = [
|
||||
compilator_ccache,
|
||||
target.ar
|
||||
]
|
||||
try:
|
||||
|
@@ -5,7 +5,7 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
##
|
||||
@@ -14,8 +14,9 @@
|
||||
from lutin import multiprocess
|
||||
from lutin import tools
|
||||
from lutin import builder
|
||||
from lutin import debug
|
||||
from realog import debug
|
||||
from lutin import depend
|
||||
from lutin import env
|
||||
|
||||
local_ref_on_builder_c = None
|
||||
|
||||
@@ -65,8 +66,13 @@ def compile(file, binary, target, depancy, flags, path, name, basic_path, module
|
||||
file_dst = target.get_full_name_destination(name, basic_path, file, get_output_type())
|
||||
file_depend = target.get_full_dependency(name, basic_path, file)
|
||||
file_warning = target.get_full_name_warning(name, basic_path, file)
|
||||
# set ccache interface:
|
||||
compilator_ccache = ""
|
||||
if env.get_ccache() == True:
|
||||
compilator_ccache = "ccache"
|
||||
# create the command line befor requesting start:
|
||||
cmd = [
|
||||
compilator_ccache,
|
||||
target.cc,
|
||||
"-o", file_dst ,
|
||||
target.arch,
|
||||
@@ -87,25 +93,37 @@ 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["c"])
|
||||
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)
|
||||
|
@@ -5,7 +5,7 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
##
|
||||
@@ -14,8 +14,9 @@
|
||||
from lutin import multiprocess
|
||||
from lutin import tools
|
||||
from lutin import builder
|
||||
from lutin import debug
|
||||
from realog import debug
|
||||
from lutin import depend
|
||||
from lutin import env
|
||||
|
||||
local_ref_on_builder_cpp = None
|
||||
|
||||
@@ -65,8 +66,13 @@ def compile(file, binary, target, depancy, flags, path, name, basic_path, module
|
||||
file_dst = target.get_full_name_destination(name, basic_path, file, get_output_type())
|
||||
file_depend = target.get_full_dependency(name, basic_path, file)
|
||||
file_warning = target.get_full_name_warning(name, basic_path, file)
|
||||
# set ccache interface:
|
||||
compilator_ccache = ""
|
||||
if env.get_ccache() == True:
|
||||
compilator_ccache = "ccache"
|
||||
# create the command line befor requesting start:
|
||||
cmd = [
|
||||
compilator_ccache,
|
||||
target.xx,
|
||||
"-o", file_dst,
|
||||
target.arch,
|
||||
@@ -87,22 +93,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
|
||||
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(target.global_flags[type])
|
||||
except:
|
||||
pass
|
||||
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)
|
||||
|
@@ -5,7 +5,7 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
##
|
||||
@@ -14,6 +14,7 @@
|
||||
from lutin import multiprocess
|
||||
from lutin import tools
|
||||
from lutin import depend
|
||||
from lutin import env
|
||||
|
||||
##
|
||||
## Initialize the builder, if needed ... to get dependency between builder (for example)
|
||||
@@ -60,8 +61,13 @@ def compile(file, binary, target, depancy, flags, path, name, basic_path, module
|
||||
file_depend = target.get_full_dependency(name, basic_path, file)
|
||||
file_warning = target.get_full_name_warning(name, basic_path, file)
|
||||
|
||||
# set ccache interface:
|
||||
compilator_ccache = ""
|
||||
if env.get_ccache() == True:
|
||||
compilator_ccache = "ccache"
|
||||
# create the command line befor requesting start:
|
||||
cmd = [
|
||||
compilator_ccache,
|
||||
target.cc,
|
||||
"-o", file_dst,
|
||||
target.arch,
|
||||
|
@@ -5,5 +5,5 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
@@ -5,10 +5,10 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
|
@@ -5,10 +5,10 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
|
@@ -5,10 +5,10 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
|
@@ -5,10 +5,10 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
|
@@ -5,10 +5,10 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
|
@@ -5,10 +5,10 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
@@ -31,6 +31,6 @@ class System(system.System):
|
||||
destination_path="GL",
|
||||
recursive=True)
|
||||
"""
|
||||
self.add_flag('link-lib', "GLESv2")
|
||||
self.add_flag('link-lib', "GLESv3")
|
||||
|
||||
|
||||
|
@@ -5,10 +5,10 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
|
@@ -4,10 +4,10 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
|
@@ -5,10 +5,10 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
|
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 MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("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 MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("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 MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("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 MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("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 MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("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 MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("C: Generic C library")
|
||||
self.add_flag("c-remove","-nodefaultlibs")
|
||||
self.set_valid(True)
|
||||
|
@@ -5,10 +5,10 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
|
@@ -5,10 +5,10 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
|
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 MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("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 MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("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/")
|
||||
"""
|
||||
|
||||
|
||||
|
46
lutin/z_system/lutinSystem_Linux_SDL.py
Normal file
46
lutin/z_system/lutinSystem_Linux_SDL.py
Normal file
@@ -0,0 +1,46 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("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)
|
||||
else:
|
||||
self.add_path("/usr/include/SDL/")
|
||||
|
||||
|
@@ -5,10 +5,10 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
@@ -22,6 +22,8 @@ class System(system.System):
|
||||
self.set_valid(True)
|
||||
# no check needed ==> just add this:
|
||||
self.add_depend(['c'])
|
||||
self.add_flag('link-lib', 'Xv')
|
||||
self.add_flag('link-lib', 'Xt')
|
||||
self.add_flag('link-lib', 'X11')
|
||||
if env.get_isolate_system() == True:
|
||||
self.add_header_file([
|
||||
|
@@ -5,10 +5,10 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
|
@@ -5,10 +5,10 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
|
@@ -5,10 +5,10 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
|
@@ -5,10 +5,10 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
@@ -22,6 +22,7 @@ class System(system.System):
|
||||
self.set_valid(True)
|
||||
if env.get_isolate_system() == False:
|
||||
# We must have it ... all time
|
||||
self.add_flag("c-remove", "-nostdinc")
|
||||
pass
|
||||
else:
|
||||
# grep "This file is part of the GNU C Library" /usr/include/*
|
||||
@@ -149,7 +150,7 @@ class System(system.System):
|
||||
self.add_header_file([
|
||||
"/usr/include/linux/*",
|
||||
],
|
||||
destination_path="linux",
|
||||
destination_path="",
|
||||
recursive=True)
|
||||
self.add_header_file([
|
||||
"/usr/include/asm/*",
|
||||
@@ -171,5 +172,11 @@ class System(system.System):
|
||||
],
|
||||
destination_path="net",
|
||||
recursive=True)
|
||||
# remove dependency of libc to lib std c++ when compile with g++
|
||||
#self.add_header_file([
|
||||
# "stdarg.h",
|
||||
# ],
|
||||
# destination_path="",
|
||||
# recursive=True)
|
||||
self.add_flag("link", "-B/usr/lib")
|
||||
|
||||
|
@@ -5,10 +5,10 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import multiprocess
|
||||
|
36
lutin/z_system/lutinSystem_Linux_egl.py
Normal file
36
lutin/z_system/lutinSystem_Linux_egl.py
Normal file
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("OpenGL: Generic graphic library")
|
||||
self.set_valid(True)
|
||||
# no check needed ==> just add this:
|
||||
self.add_depend([
|
||||
'khr',
|
||||
])
|
||||
self.add_flag('link-lib', 'EGL')
|
||||
if env.get_isolate_system() == True:
|
||||
self.add_header_file([
|
||||
"/usr/include/EGL/*"
|
||||
],
|
||||
destination_path="EGL",
|
||||
recursive=True)
|
||||
|
||||
|
||||
|
36
lutin/z_system/lutinSystem_Linux_gles2.py
Normal file
36
lutin/z_system/lutinSystem_Linux_gles2.py
Normal file
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("OpenGL: Generic graphic library")
|
||||
self.set_valid(True)
|
||||
# no check needed ==> just add this:
|
||||
self.add_depend([
|
||||
'opengl',
|
||||
])
|
||||
self.add_flag('link-lib', 'GLESv2')
|
||||
if env.get_isolate_system() == True:
|
||||
self.add_header_file([
|
||||
"/usr/include/GLES2/*"
|
||||
],
|
||||
destination_path="GLES2",
|
||||
recursive=True)
|
||||
|
||||
|
||||
|
@@ -5,10 +5,10 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
|
36
lutin/z_system/lutinSystem_Linux_khr.py
Normal file
36
lutin/z_system/lutinSystem_Linux_khr.py
Normal file
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("OpenGL: Generic graphic library")
|
||||
self.set_valid(True)
|
||||
# no check needed ==> just add this:
|
||||
self.add_depend([
|
||||
'c',
|
||||
])
|
||||
self.add_flag('link-lib', 'wayland-egl')
|
||||
if env.get_isolate_system() == True:
|
||||
self.add_header_file([
|
||||
"/usr/include/KHR/*"
|
||||
],
|
||||
destination_path="KHR",
|
||||
recursive=True)
|
||||
|
||||
|
||||
|
@@ -5,10 +5,10 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
|
46
lutin/z_system/lutinSystem_Linux_mysql.py
Normal file
46
lutin/z_system/lutinSystem_Linux_mysql.py
Normal file
@@ -0,0 +1,46 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("mysql: My sql interface (microsoft) or mariadB interface.")
|
||||
# check if the library exist:
|
||||
if not os.path.isfile("/usr/include/mysql/mysql.h"):
|
||||
# we did not find the library reqiested (just return) (automaticly set at false)
|
||||
return;
|
||||
self.set_valid(True)
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_flag("link-lib", "mysqlclient")
|
||||
self.add_flag("link-lib", "ssl")
|
||||
self.add_depend([
|
||||
'pthread',
|
||||
'z',
|
||||
'm',
|
||||
#'ssl',
|
||||
'crypto'
|
||||
])
|
||||
if env.get_isolate_system() == True:
|
||||
self.add_header_file([
|
||||
"/usr/include/mysql/"
|
||||
],
|
||||
clip_path="/usr/include/mysql/")
|
||||
else:
|
||||
self.add_path("/usr/include/mysql/");
|
||||
|
||||
|
||||
|
@@ -5,10 +5,10 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
@@ -23,32 +23,14 @@ class System(system.System):
|
||||
# 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([
|
||||
self.add_header_file([
|
||||
"/usr/include/GL/*"
|
||||
],
|
||||
destination_path="GL",
|
||||
recursive=True)
|
||||
|
||||
"""
|
||||
if target.name=="Linux":
|
||||
|
||||
elif target.name=="Android":
|
||||
my_module.add_flag('link-lib', "GLESv2")
|
||||
elif target.name=="Windows":
|
||||
my_module.add_depend([
|
||||
"glew"
|
||||
])
|
||||
elif target.name=="MacOs":
|
||||
my_module.add_flag('link', [
|
||||
"-framework OpenGL"])
|
||||
elif target.name=="IOs":
|
||||
my_module.add_flag('link', [
|
||||
"-framework OpenGLES"
|
||||
])
|
||||
"""
|
||||
|
||||
|
||||
|
||||
|
@@ -5,10 +5,10 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
|
@@ -5,10 +5,10 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
|
@@ -5,10 +5,10 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
@@ -25,13 +25,23 @@ class System(system.System):
|
||||
return;
|
||||
dst_data = tools.file_read_data("/usr/include/pulse/version.h")
|
||||
lines = dst_data.split("\n")
|
||||
patern = "#define pa_get_headers_version() (\""
|
||||
patern = "#define pa_get_headers_version() (\"" # " #corect edn error parsing
|
||||
version = None
|
||||
for line in lines:
|
||||
if line[:len(patern)] == patern:
|
||||
#Find the version line
|
||||
version = line[len(patern)]
|
||||
version2 = line[len(patern)+2]
|
||||
offset = len(patern)
|
||||
version = ""
|
||||
while offset < len(line) \
|
||||
and line[offset] != '.':
|
||||
version += line[offset]
|
||||
offset += 1
|
||||
offset += 1
|
||||
version2 = ""
|
||||
while offset < len(line) \
|
||||
and line[offset] != '.':
|
||||
version2 += line[offset]
|
||||
offset += 1
|
||||
debug.verbose("detect version '" + version + "'")
|
||||
break;
|
||||
if version == None:
|
||||
@@ -49,6 +59,11 @@ class System(system.System):
|
||||
])
|
||||
else:
|
||||
# todo : create a searcher of the presence of the library:
|
||||
"""
|
||||
self.add_flag("link-lib", [
|
||||
"-l/lib/pulseaudio/libpulsecommon-" + version + ".0.so"
|
||||
])
|
||||
"""
|
||||
self.add_flag("link-lib", [
|
||||
"pulsecommon-" + version + ".0",
|
||||
"pulse-mainloop-glib",
|
||||
@@ -56,6 +71,7 @@ class System(system.System):
|
||||
"pulse"
|
||||
])
|
||||
self.add_flag("link", "-L/usr/lib/pulseaudio")
|
||||
self.add_flag("link", "-Wl,-R/usr/lib/pulseaudio")
|
||||
self.add_header_file([
|
||||
"/usr/include/pulse/*",
|
||||
],
|
||||
|
@@ -5,10 +5,10 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
@@ -25,7 +25,7 @@ class System(system.System):
|
||||
'c'
|
||||
])
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_flag("link-lib", "rpcsvc")
|
||||
#self.add_flag("link-lib", "rpcsvc")
|
||||
if env.get_isolate_system() == True:
|
||||
self.add_header_file([
|
||||
"/usr/include/rpc/*"
|
||||
|
@@ -5,10 +5,10 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
|
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 MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("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 MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("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)
|
||||
|
||||
|
||||
|
||||
|
34
lutin/z_system/lutinSystem_Linux_wayland.py
Normal file
34
lutin/z_system/lutinSystem_Linux_wayland.py
Normal file
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("wayland: Basic interface of Linux Graphic interface (replace X11)")
|
||||
self.set_valid(True)
|
||||
# no check needed ==> just add this:
|
||||
self.add_depend(['c'])
|
||||
self.add_flag('link-lib', 'wayland-client')
|
||||
self.add_flag('link-lib', 'wayland-cursor')
|
||||
if env.get_isolate_system() == True:
|
||||
self.add_header_file([
|
||||
"/usr/include/wayland-*"
|
||||
],
|
||||
destination_path="",
|
||||
recursive=True)
|
||||
|
||||
|
33
lutin/z_system/lutinSystem_Linux_xkbcommon.py
Normal file
33
lutin/z_system/lutinSystem_Linux_xkbcommon.py
Normal file
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("XKB common: common wrapping of keyborad layout")
|
||||
self.set_valid(True)
|
||||
# no check needed ==> just add this:
|
||||
self.add_depend(['c'])
|
||||
self.add_flag('link-lib', 'xkbcommon')
|
||||
if env.get_isolate_system() == True:
|
||||
self.add_header_file([
|
||||
"/usr/include/xkbcommon/*"
|
||||
],
|
||||
destination_path="xkbcommon",
|
||||
recursive=True)
|
||||
|
||||
|
@@ -5,10 +5,10 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
|
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 MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("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 MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("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 MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("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")
|
||||
|
@@ -5,10 +5,10 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
|
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 MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("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 MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("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 MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("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 MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("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 MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("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 MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("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 MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("OpenGL: Generic graphic library")
|
||||
self.set_valid(True)
|
||||
# no check needed ==> just add this:
|
||||
self.add_depend([
|
||||
'c'
|
||||
])
|
||||
self.add_flag('link', [
|
||||
"-framework VideoDecodeAcceleration"
|
||||
])
|
||||
|
||||
|
||||
|
213
lutin/z_system/lutinSystem_MacOs_c.py
Normal file
213
lutin/z_system/lutinSystem_MacOs_c.py
Normal file
@@ -0,0 +1,213 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("C: Generic C library")
|
||||
self.add_flag("c-remove","-nodefaultlibs")
|
||||
self.set_valid(True)
|
||||
if env.get_isolate_system() == False:
|
||||
# We must have it ... all time
|
||||
pass
|
||||
else:
|
||||
# grep "This file is part of the GNU C Library" /usr/include/*
|
||||
self.add_header_file([
|
||||
'/usr/include/aio.h*',
|
||||
'/usr/include/aliases.h*',
|
||||
'/usr/include/alloca.h*',
|
||||
'/usr/include/ansidecl.h*',
|
||||
'/usr/include/argp.h*',
|
||||
'/usr/include/argz.h*',
|
||||
'/usr/include/ar.h*',
|
||||
'/usr/include/assert.h*',
|
||||
'/usr/include/byteswap.h*',
|
||||
'/usr/include/complex.h*',
|
||||
'/usr/include/cpio.h*',
|
||||
'/usr/include/ctype.h*',
|
||||
'/usr/include/dirent.h*',
|
||||
'/usr/include/dlfcn.h*',
|
||||
'/usr/include/elf.h*',
|
||||
'/usr/include/endian.h*',
|
||||
'/usr/include/envz.h*',
|
||||
'/usr/include/err.h*',
|
||||
'/usr/include/errno.h*',
|
||||
'/usr/include/error.h*',
|
||||
'/usr/include/execinfo.h*',
|
||||
'/usr/include/fcntl.h*',
|
||||
'/usr/include/features.h*',
|
||||
'/usr/include/fenv.h*',
|
||||
'/usr/include/fmtmsg.h*',
|
||||
'/usr/include/fnmatch.h*',
|
||||
'/usr/include/fpu_control.h*',
|
||||
'/usr/include/fts.h*',
|
||||
'/usr/include/ftw.h*',
|
||||
'/usr/include/gconv.h*',
|
||||
'/usr/include/getopt.h*',
|
||||
'/usr/include/glob.h*',
|
||||
'/usr/include/gnu-versions.h*',
|
||||
'/usr/include/grp.h*',
|
||||
'/usr/include/gshadow.h*',
|
||||
'/usr/include/iconv.h*',
|
||||
'/usr/include/ieee754.h*',
|
||||
'/usr/include/ifaddrs.h*',
|
||||
'/usr/include/inttypes.h*',
|
||||
'/usr/include/langinfo.h*',
|
||||
'/usr/include/libgen.h*',
|
||||
'/usr/include/libintl.h*',
|
||||
'/usr/include/libio.h*',
|
||||
'/usr/include/limits.h*',
|
||||
'/usr/include/link.h*',
|
||||
'/usr/include/locale.h*',
|
||||
'/usr/include/malloc.h*',
|
||||
'/usr/include/mcheck.h*',
|
||||
'/usr/include/memory.h*',
|
||||
'/usr/include/mntent.h*',
|
||||
'/usr/include/monetary.h*',
|
||||
'/usr/include/mqueue.h*',
|
||||
'/usr/include/netdb.h*',
|
||||
'/usr/include/nl_types.h*',
|
||||
'/usr/include/nss.h*',
|
||||
'/usr/include/obstack.h*',
|
||||
'/usr/include/printf.h*',
|
||||
'/usr/include/pthread.h*',
|
||||
'/usr/include/pty.h*',
|
||||
'/usr/include/pwd.h*',
|
||||
'/usr/include/re_comp.h*',
|
||||
'/usr/include/regex.h*',
|
||||
'/usr/include/regexp.h*',
|
||||
'/usr/include/sched.h*',
|
||||
'/usr/include/search.h*',
|
||||
'/usr/include/semaphore.h*',
|
||||
'/usr/include/setjmp.h*',
|
||||
'/usr/include/sgtty.h*',
|
||||
'/usr/include/shadow.h*',
|
||||
'/usr/include/signal.h*',
|
||||
'/usr/include/spawn.h*',
|
||||
'/usr/include/stdc-predef.h*',
|
||||
'/usr/include/stdint.h*',
|
||||
'/usr/include/stdio_ext.h*',
|
||||
'/usr/include/stdio.h*',
|
||||
'/usr/include/stdlib.h*',
|
||||
'/usr/include/string.h*',
|
||||
'/usr/include/strings.h*',
|
||||
'/usr/include/stropts.h*',
|
||||
'/usr/include/tar.h*',
|
||||
'/usr/include/termios.h*',
|
||||
'/usr/include/tgmath.h*',
|
||||
'/usr/include/thread_db.h*',
|
||||
'/usr/include/time.h*',
|
||||
'/usr/include/uchar.h*',
|
||||
'/usr/include/ucontext.h*',
|
||||
'/usr/include/ulimit.h*',
|
||||
'/usr/include/unistd.h*',
|
||||
'/usr/include/utime.h*',
|
||||
'/usr/include/utmp.h*',
|
||||
'/usr/include/utmpx.h*',
|
||||
'/usr/include/values.h*',
|
||||
'/usr/include/wchar.h*',
|
||||
'/usr/include/wctype.h*',
|
||||
'/usr/include/wordexp.h*',
|
||||
'/usr/include/xlocale.h*',
|
||||
'/usr/include/Availability*',
|
||||
'/usr/include/_types.h*',
|
||||
'/usr/include/_wctype.h*',
|
||||
'/usr/include/runetype.h*',
|
||||
'/usr/include/_locale.h*',
|
||||
'/usr/include/_xlocale.h*',
|
||||
'/usr/include/gethostuuid.h*',
|
||||
],
|
||||
destination_path="")
|
||||
self.add_header_file([
|
||||
'/usr/include/poll.h*',
|
||||
'/usr/include/unistdio.h*',
|
||||
'/usr/include/syslog.h*',
|
||||
'/usr/include/_G_config.h*',
|
||||
],
|
||||
destination_path="")
|
||||
self.add_header_file([
|
||||
"/usr/include/machine/*",
|
||||
],
|
||||
destination_path="machine",
|
||||
recursive=True)
|
||||
self.add_header_file([
|
||||
"/usr/include/xlocale/*",
|
||||
],
|
||||
destination_path="xlocale",
|
||||
recursive=True)
|
||||
self.add_header_file([
|
||||
"/usr/include/i386/*",
|
||||
],
|
||||
destination_path="i386",
|
||||
recursive=True)
|
||||
self.add_header_file([
|
||||
"/usr/include/_types/*",
|
||||
],
|
||||
destination_path="_types",
|
||||
recursive=True)
|
||||
self.add_header_file([
|
||||
"/usr/include/libkern/*",
|
||||
],
|
||||
destination_path="libkern",
|
||||
recursive=True)
|
||||
self.add_header_file([
|
||||
"/usr/include/mach/*",
|
||||
],
|
||||
destination_path="mach",
|
||||
recursive=True)
|
||||
self.add_header_file([
|
||||
"/usr/include/sys/*",
|
||||
],
|
||||
destination_path="sys",
|
||||
recursive=True)
|
||||
self.add_header_file([
|
||||
"/usr/include/bits/*",
|
||||
],
|
||||
destination_path="bits",
|
||||
recursive=True)
|
||||
self.add_header_file([
|
||||
"/usr/include/gnu/*",
|
||||
],
|
||||
destination_path="gnu",
|
||||
recursive=True)
|
||||
self.add_header_file([
|
||||
"/usr/include/linux/*",
|
||||
],
|
||||
destination_path="linux",
|
||||
recursive=True)
|
||||
self.add_header_file([
|
||||
"/usr/include/asm/*",
|
||||
],
|
||||
destination_path="asm",
|
||||
recursive=True)
|
||||
self.add_header_file([
|
||||
"/usr/include/asm-generic/*",
|
||||
],
|
||||
destination_path="asm-generic",
|
||||
recursive=True)
|
||||
self.add_header_file([
|
||||
"/usr/include/netinet/*",
|
||||
],
|
||||
destination_path="netinet",
|
||||
recursive=True)
|
||||
self.add_header_file([
|
||||
"/usr/include/net/*",
|
||||
],
|
||||
destination_path="net",
|
||||
recursive=True)
|
||||
self.add_flag("link", "-B/usr/lib")
|
||||
|
@@ -5,13 +5,14 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
from lutin import multiprocess
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
@@ -21,8 +22,25 @@ class System(system.System):
|
||||
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)
|
||||
self.add_depend("c")
|
||||
self.add_flag("c++", "-D__STDCPP_LLVM__")
|
||||
if env.get_isolate_system() == False:
|
||||
self.add_flag("c++-remove", "-nostdlib")
|
||||
self.add_flag("need-libstdc++", True)
|
||||
else:
|
||||
self.add_flag("link-lib", "stdc++")
|
||||
compilator_gcc = "g++"
|
||||
if target.config["compilator-version"] != "":
|
||||
compilator_gcc = compilator_gcc + "-" + target.config["compilator-version"]
|
||||
|
||||
#get g++ compilation version :
|
||||
version_cpp = multiprocess.run_command_direct(compilator_gcc + " -dumpversion");
|
||||
if version_cpp == False:
|
||||
debug.error("Can not get the g++ version ...")
|
||||
|
||||
self.add_header_file([
|
||||
"/usr/include/c++/" + version_cpp + "/*"
|
||||
],
|
||||
recursive=True)
|
||||
|
||||
|
||||
|
@@ -5,10 +5,10 @@
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license APACHE v2.0 (see license file)
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from lutin import debug
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
@@ -23,5 +23,14 @@ class System(system.System):
|
||||
self.set_valid(True)
|
||||
# todo : create a searcher of the presence of the library:
|
||||
self.add_flag("link-lib", "m")
|
||||
self.add_depend([
|
||||
'c'
|
||||
])
|
||||
if env.get_isolate_system() == True:
|
||||
self.add_header_file([
|
||||
"/usr/include/math.h"
|
||||
],
|
||||
clip_path="/usr/include",
|
||||
recursive=False)
|
||||
|
||||
|
||||
|
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 MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("OpenGL: Generic graphic library")
|
||||
self.set_valid(True)
|
||||
# no check needed ==> just add this:
|
||||
self.add_depend([
|
||||
'c'
|
||||
])
|
||||
self.add_flag('link', [
|
||||
"-framework OpenGL"
|
||||
])
|
||||
|
||||
|
||||
|
52
lutin/z_system/lutinSystem_MacOs_pthread.py
Normal file
52
lutin/z_system/lutinSystem_MacOs_pthread.py
Normal file
@@ -0,0 +1,52 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
## @author Edouard DUPIN
|
||||
##
|
||||
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||
##
|
||||
## @license MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("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/")
|
||||
self.add_header_file([
|
||||
"/usr/include/pthread/*",
|
||||
],
|
||||
destination_path="pthread",
|
||||
recursive=True)
|
||||
self.add_header_file([
|
||||
"/usr/include/pthread/*",
|
||||
],
|
||||
destination_path="",
|
||||
recursive=True)
|
||||
|
||||
|
||||
|
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 MPL v2.0 (see license file)
|
||||
##
|
||||
|
||||
from realog import debug
|
||||
from lutin import system
|
||||
from lutin import tools
|
||||
from lutin import env
|
||||
import os
|
||||
|
||||
class System(system.System):
|
||||
def __init__(self, target):
|
||||
system.System.__init__(self)
|
||||
# create some HELP:
|
||||
self.set_help("advapi interface")
|
||||
self.set_valid(True)
|
||||
self.add_flag('link-lib', 'advapi32')
|
||||
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user