Compare commits
49 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 |
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,
|
||||
|
88
bin/lutin
88
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,6 +39,7 @@ myArgs.add("s", "force-strip", desc="Force the stripping of the compile elements
|
||||
myArgs.add("o", "force-optimisation", desc="Force optimisation of the build")
|
||||
myArgs.add("w", "warning", desc="Store warning in a file build file")
|
||||
myArgs.add("i", "isolate-system", desc="Isolate system build (copy header of c and c++ system lib to not include unneeded external libs) EXPERIMENTAL (archlinux)")
|
||||
myArgs.add("K", "ccache", desc="Enable the ccache interface")
|
||||
|
||||
myArgs.add_section("properties", "keep in the sequency of the cible")
|
||||
myArgs.add("t", "target", haveParam=True, desc="Select a target (by default the platform is the computer that compile this) To know list : 'lutin.py --list-target'")
|
||||
@@ -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)
|
||||
|
||||
|
||||
|
||||
|
@@ -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.
|
||||
@@ -386,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.
|
||||
|
@@ -47,8 +47,8 @@ Do it ... it does not work ...
|
||||
lutin -C -D -tIOs yourApplication?install
|
||||
```
|
||||
|
||||
Appliocation ID
|
||||
---------------
|
||||
Application ID
|
||||
--------------
|
||||
|
||||
It miss some things to do:
|
||||
|
||||
|
15
doc/101_Use_on_Android.md
Normal file
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
|
||||
|
@@ -108,16 +108,16 @@ Tutorals: {#lutin_mainpage_tutorial}
|
||||
- @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,
|
||||
|
@@ -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,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 sys
|
||||
# Local import
|
||||
from . import debug
|
||||
from realog import debug
|
||||
|
||||
# print os.name # ==> 'posix'
|
||||
if platform.system() == "Linux":
|
||||
|
@@ -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
|
377
lutin/module.py
377
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
|
||||
@@ -510,37 +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, src_file, header_file 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);
|
||||
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 ...
|
||||
@@ -591,17 +604,30 @@ 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)
|
||||
|
||||
@@ -634,7 +660,8 @@ class Module:
|
||||
# ---------------------------------------------------------------------------
|
||||
# -- 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])
|
||||
@@ -700,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' \
|
||||
@@ -798,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,
|
||||
@@ -809,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:
|
||||
@@ -827,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())
|
||||
@@ -843,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,
|
||||
@@ -854,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:
|
||||
@@ -881,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)
|
||||
|
||||
@@ -947,14 +997,15 @@ class Module:
|
||||
## @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, src_file=[], header_file=[]):
|
||||
tools.list_append_and_check(self._depends_optionnal, [module_name, compilation_flags, export, src_file, header_file], True)
|
||||
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
|
||||
@@ -971,13 +1022,13 @@ class Module:
|
||||
if len(elem) > 1 \
|
||||
and elem[0] == '/':
|
||||
# unix case
|
||||
debug.warning(" add_path(" + list + ")")
|
||||
debug.warning(" add_path(" + str(list) + ")")
|
||||
debug.warning("[" + self._name + "] Not permited to add a path that start in / directory (only relative path) (compatibility until 2.x)")
|
||||
add_list.append(elem)
|
||||
elif len(elem) > 2 \
|
||||
and elem[1] == ':':
|
||||
# windows case :
|
||||
debug.warning(" add_path(" + list + ")")
|
||||
debug.warning(" add_path(" + str(list) + ")")
|
||||
debug.warning("[" + self._name + "] Not permited to add a path that start in '" + elem[0] + ":' directory (only relative path) (compatibility until 2.x)")
|
||||
add_list.append(elem)
|
||||
if elem == ".":
|
||||
@@ -988,13 +1039,13 @@ class Module:
|
||||
if len(list) > 1 \
|
||||
and list[0] == '/':
|
||||
# unix case
|
||||
debug.warning(" add_path(" + list + ")")
|
||||
debug.warning(" add_path(" + str(list) + ")")
|
||||
debug.warning("[" + self._name + "] Not permited to add a path that start in / directory (only relative path) (compatibility until 2.x)")
|
||||
add_list = list
|
||||
elif len(list) > 2 \
|
||||
and list[1] == ':':
|
||||
# windows case :
|
||||
debug.warning(" add_path(" + list + ")")
|
||||
debug.warning(" add_path(" + str(list) + ")")
|
||||
debug.warning("[" + self._name + "] Not permited to add a path that start in '" + list[0] + ":' directory (only relative path) (compatibility until 2.x)")
|
||||
add_list = list
|
||||
elif list == ".":
|
||||
@@ -1044,7 +1095,7 @@ class Module:
|
||||
def compile_version(self, compilator_type, version, same_as_api=True, gnu=False):
|
||||
if compilator_type == "c++" \
|
||||
or compilator_type == "C++":
|
||||
cpp_version_list = [1999, 2003, 2011, 2014, 2017]
|
||||
cpp_version_list = [1999, 2003, 2011, 2014, 2017, 2020]
|
||||
if version not in cpp_version_list:
|
||||
debug.error("[" + self._name + "] Can not select CPP version : " + str(version) + " not in " + str(cpp_version_list))
|
||||
# select API version:
|
||||
@@ -1059,7 +1110,7 @@ class Module:
|
||||
debug.debug("[" + self._name + "] Can not propagate the gnu extention of the CPP vesion for API");
|
||||
elif compilator_type == "c" \
|
||||
or compilator_type == "C":
|
||||
c_version_list = [1989, 1990, 1999, 2011]
|
||||
c_version_list = [1989, 1990, 1999, 2011, 2017, 1018]
|
||||
if version not in c_version_list:
|
||||
debug.error("[" + self._name + "] Can not select C version : " + str(version) + " not in " + str(c_version_list))
|
||||
# select API version:
|
||||
@@ -1083,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
|
||||
@@ -1091,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',
|
||||
@@ -1184,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
|
||||
@@ -1194,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
|
||||
@@ -1263,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]
|
||||
@@ -1285,6 +1423,107 @@ class Module:
|
||||
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
|
||||
## @param[in] self (handle) Class handle
|
||||
@@ -1304,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
|
||||
@@ -1318,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()
|
||||
@@ -1327,7 +1566,7 @@ 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
|
||||
@@ -1343,10 +1582,10 @@ class Module:
|
||||
else:
|
||||
self._package_prop[variable] = os.path.join(tools.get_current_path(self._origin_file), value)
|
||||
self._package_prop_default[variable] = False
|
||||
elif "MAINTAINER" == variable:
|
||||
elif variable == "MAINTAINER":
|
||||
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
|
||||
@@ -1359,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"]:
|
||||
@@ -1367,7 +1606,7 @@ class Module:
|
||||
else:
|
||||
self._package_prop[variable] = value
|
||||
self._package_prop_default[variable] = False
|
||||
elif "ANDROID_SIGN" == variable:
|
||||
elif variable == "ANDROID_SIGN":
|
||||
if len(value) > 1 \
|
||||
and value[0] == '/':
|
||||
# unix case
|
||||
@@ -1397,7 +1636,7 @@ class Module:
|
||||
"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
|
||||
@@ -1430,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="_"
|
||||
|
@@ -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
|
||||
@@ -86,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
|
||||
|
||||
|
||||
@@ -211,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
|
||||
@@ -283,6 +283,10 @@ def exist(lib_name, list_target_name, target) :
|
||||
if "System" in dir(the_system):
|
||||
data["system"] = the_system.System(target)
|
||||
data["exist"] = data["system"].get_valid()
|
||||
"""
|
||||
if data["exist"] == False:
|
||||
debug.warning("Can not Import: '" + data["name"] + "' ==> disabled")
|
||||
"""
|
||||
else:
|
||||
debug.warning("Not find: '" + data["name"] + "' ==> get exception")
|
||||
return data["exist"]
|
||||
|
157
lutin/target.py
157
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
|
||||
@@ -90,8 +90,15 @@ class Target:
|
||||
'-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":
|
||||
@@ -316,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"
|
||||
@@ -466,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
|
||||
@@ -632,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")
|
||||
@@ -653,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()
|
||||
@@ -686,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:]
|
||||
@@ -701,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":
|
||||
@@ -752,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:
|
||||
@@ -808,19 +862,18 @@ 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)
|
||||
elif module.get_type() == 'PACKAGE':
|
||||
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
|
||||
debug.debug("make_package [STOP]")
|
||||
return
|
||||
|
||||
@@ -884,14 +937,60 @@ class Target:
|
||||
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
|
||||
@@ -1021,7 +1120,7 @@ class Target:
|
||||
debug.debug("------------------------------------------------------------------------")
|
||||
debug.error("action not implemented ...")
|
||||
|
||||
def run(self, pkg_name, option_list):
|
||||
def run(self, pkg_name, option_list, binary_name = None):
|
||||
debug.debug("------------------------------------------------------------------------")
|
||||
debug.info("-- Run package '" + pkg_name + "' + option: " + str(option_list))
|
||||
debug.debug("------------------------------------------------------------------------")
|
||||
|
@@ -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
|
||||
|
@@ -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,
|
||||
@@ -140,21 +146,31 @@ def get_version_compilation_flags(flags, dependency_flags):
|
||||
is_gnu = default_version_gnu
|
||||
|
||||
version = max(version_local, dependency_version)
|
||||
if version == 2011:
|
||||
if version == 2018:
|
||||
if is_gnu ==True:
|
||||
out = ["-std=gnu18", "-D__C_VERSION__=2018"]
|
||||
else:
|
||||
out = ["-std=c18", "-D__C_VERSION__=2018"]
|
||||
elif version == 2017:
|
||||
if is_gnu ==True:
|
||||
out = ["-std=gnu17", "-D__C_VERSION__=2017"]
|
||||
else:
|
||||
out = ["-std=c17", "-D__C_VERSION__=2017"]
|
||||
elif version == 2011:
|
||||
if is_gnu ==True:
|
||||
out = ["-std=gnu11", "-D__C_VERSION__=2011"]
|
||||
else:
|
||||
out = ["-std=c11", "-D__C_VERSION__=1989"]
|
||||
out = ["-std=c11", "-D__C_VERSION__=2011"]
|
||||
elif version == 1999:
|
||||
if is_gnu ==True:
|
||||
out = ["-std=gnu99", "-D__C_VERSION__=1999"]
|
||||
else:
|
||||
out = ["-std=c99", "-D__C_VERSION__=1989"]
|
||||
out = ["-std=c99", "-D__C_VERSION__=1999"]
|
||||
elif version == 1990:
|
||||
if is_gnu ==True:
|
||||
out = ["-std=gnu90", "-D__C_VERSION__=1990"]
|
||||
else:
|
||||
out = ["-std=c90", "-D__C_VERSION__=1989"]
|
||||
out = ["-std=c90", "-D__C_VERSION__=1990"]
|
||||
else:
|
||||
if is_gnu ==True:
|
||||
out = ["-std=gnu89", "-D__C_VERSION__=1989"]
|
||||
|
@@ -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
|
||||
@@ -64,8 +65,13 @@ def compile(file, binary, target, depancy, flags, path, name, basic_path, module
|
||||
file_dst = target.get_full_name_destination(name, basic_path, file, get_output_type())
|
||||
file_depend = target.get_full_dependency(name, basic_path, file)
|
||||
file_warning = target.get_full_name_warning(name, basic_path, file)
|
||||
# set ccache interface:
|
||||
compilator_ccache = ""
|
||||
if env.get_ccache() == True:
|
||||
compilator_ccache = "ccache"
|
||||
# create the command line befor requesting start:
|
||||
cmd = [
|
||||
compilator_ccache,
|
||||
target.xx,
|
||||
"-o", file_dst,
|
||||
target.arch,
|
||||
@@ -146,13 +152,17 @@ def get_version_compilation_flags(flags, dependency_flags):
|
||||
is_gnu = default_version_gnu
|
||||
|
||||
version = max(version_local, dependency_version)
|
||||
if version == 2017:
|
||||
debug.error("not supported flags for X17 ...");
|
||||
if version == 2020:
|
||||
if is_gnu == True:
|
||||
out = ["-std=gnu++2a", "-D__CPP_VERSION__=2020"]
|
||||
else:
|
||||
out = ["-std=c++2a", "-D__CPP_VERSION__=2020"]
|
||||
elif version == 2017:
|
||||
if is_gnu == True:
|
||||
out = ["-std=gnu++17", "-D__CPP_VERSION__=2017"]
|
||||
else:
|
||||
out = ["-std=c++17", "-D__CPP_VERSION__=2017"]
|
||||
if version == 2014:
|
||||
elif version == 2014:
|
||||
if is_gnu == True:
|
||||
out = ["-std=gnu++14", "-D__CPP_VERSION__=2014"]
|
||||
else:
|
||||
|
@@ -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:
|
||||
|
@@ -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,
|
||||
|
@@ -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,
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
@@ -40,5 +40,7 @@ class System(system.System):
|
||||
],
|
||||
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,7 +23,6 @@ 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:
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
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
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
@@ -21,4 +21,193 @@ class System(system.System):
|
||||
self.set_help("C: Generic C library")
|
||||
self.add_flag("c-remove","-nodefaultlibs")
|
||||
self.set_valid(True)
|
||||
if env.get_isolate_system() == False:
|
||||
# We must have it ... all time
|
||||
pass
|
||||
else:
|
||||
# grep "This file is part of the GNU C Library" /usr/include/*
|
||||
self.add_header_file([
|
||||
'/usr/include/aio.h*',
|
||||
'/usr/include/aliases.h*',
|
||||
'/usr/include/alloca.h*',
|
||||
'/usr/include/ansidecl.h*',
|
||||
'/usr/include/argp.h*',
|
||||
'/usr/include/argz.h*',
|
||||
'/usr/include/ar.h*',
|
||||
'/usr/include/assert.h*',
|
||||
'/usr/include/byteswap.h*',
|
||||
'/usr/include/complex.h*',
|
||||
'/usr/include/cpio.h*',
|
||||
'/usr/include/ctype.h*',
|
||||
'/usr/include/dirent.h*',
|
||||
'/usr/include/dlfcn.h*',
|
||||
'/usr/include/elf.h*',
|
||||
'/usr/include/endian.h*',
|
||||
'/usr/include/envz.h*',
|
||||
'/usr/include/err.h*',
|
||||
'/usr/include/errno.h*',
|
||||
'/usr/include/error.h*',
|
||||
'/usr/include/execinfo.h*',
|
||||
'/usr/include/fcntl.h*',
|
||||
'/usr/include/features.h*',
|
||||
'/usr/include/fenv.h*',
|
||||
'/usr/include/fmtmsg.h*',
|
||||
'/usr/include/fnmatch.h*',
|
||||
'/usr/include/fpu_control.h*',
|
||||
'/usr/include/fts.h*',
|
||||
'/usr/include/ftw.h*',
|
||||
'/usr/include/gconv.h*',
|
||||
'/usr/include/getopt.h*',
|
||||
'/usr/include/glob.h*',
|
||||
'/usr/include/gnu-versions.h*',
|
||||
'/usr/include/grp.h*',
|
||||
'/usr/include/gshadow.h*',
|
||||
'/usr/include/iconv.h*',
|
||||
'/usr/include/ieee754.h*',
|
||||
'/usr/include/ifaddrs.h*',
|
||||
'/usr/include/inttypes.h*',
|
||||
'/usr/include/langinfo.h*',
|
||||
'/usr/include/libgen.h*',
|
||||
'/usr/include/libintl.h*',
|
||||
'/usr/include/libio.h*',
|
||||
'/usr/include/limits.h*',
|
||||
'/usr/include/link.h*',
|
||||
'/usr/include/locale.h*',
|
||||
'/usr/include/malloc.h*',
|
||||
'/usr/include/mcheck.h*',
|
||||
'/usr/include/memory.h*',
|
||||
'/usr/include/mntent.h*',
|
||||
'/usr/include/monetary.h*',
|
||||
'/usr/include/mqueue.h*',
|
||||
'/usr/include/netdb.h*',
|
||||
'/usr/include/nl_types.h*',
|
||||
'/usr/include/nss.h*',
|
||||
'/usr/include/obstack.h*',
|
||||
'/usr/include/printf.h*',
|
||||
'/usr/include/pthread.h*',
|
||||
'/usr/include/pty.h*',
|
||||
'/usr/include/pwd.h*',
|
||||
'/usr/include/re_comp.h*',
|
||||
'/usr/include/regex.h*',
|
||||
'/usr/include/regexp.h*',
|
||||
'/usr/include/sched.h*',
|
||||
'/usr/include/search.h*',
|
||||
'/usr/include/semaphore.h*',
|
||||
'/usr/include/setjmp.h*',
|
||||
'/usr/include/sgtty.h*',
|
||||
'/usr/include/shadow.h*',
|
||||
'/usr/include/signal.h*',
|
||||
'/usr/include/spawn.h*',
|
||||
'/usr/include/stdc-predef.h*',
|
||||
'/usr/include/stdint.h*',
|
||||
'/usr/include/stdio_ext.h*',
|
||||
'/usr/include/stdio.h*',
|
||||
'/usr/include/stdlib.h*',
|
||||
'/usr/include/string.h*',
|
||||
'/usr/include/strings.h*',
|
||||
'/usr/include/stropts.h*',
|
||||
'/usr/include/tar.h*',
|
||||
'/usr/include/termios.h*',
|
||||
'/usr/include/tgmath.h*',
|
||||
'/usr/include/thread_db.h*',
|
||||
'/usr/include/time.h*',
|
||||
'/usr/include/uchar.h*',
|
||||
'/usr/include/ucontext.h*',
|
||||
'/usr/include/ulimit.h*',
|
||||
'/usr/include/unistd.h*',
|
||||
'/usr/include/utime.h*',
|
||||
'/usr/include/utmp.h*',
|
||||
'/usr/include/utmpx.h*',
|
||||
'/usr/include/values.h*',
|
||||
'/usr/include/wchar.h*',
|
||||
'/usr/include/wctype.h*',
|
||||
'/usr/include/wordexp.h*',
|
||||
'/usr/include/xlocale.h*',
|
||||
'/usr/include/Availability*',
|
||||
'/usr/include/_types.h*',
|
||||
'/usr/include/_wctype.h*',
|
||||
'/usr/include/runetype.h*',
|
||||
'/usr/include/_locale.h*',
|
||||
'/usr/include/_xlocale.h*',
|
||||
'/usr/include/gethostuuid.h*',
|
||||
],
|
||||
destination_path="")
|
||||
self.add_header_file([
|
||||
'/usr/include/poll.h*',
|
||||
'/usr/include/unistdio.h*',
|
||||
'/usr/include/syslog.h*',
|
||||
'/usr/include/_G_config.h*',
|
||||
],
|
||||
destination_path="")
|
||||
self.add_header_file([
|
||||
"/usr/include/machine/*",
|
||||
],
|
||||
destination_path="machine",
|
||||
recursive=True)
|
||||
self.add_header_file([
|
||||
"/usr/include/xlocale/*",
|
||||
],
|
||||
destination_path="xlocale",
|
||||
recursive=True)
|
||||
self.add_header_file([
|
||||
"/usr/include/i386/*",
|
||||
],
|
||||
destination_path="i386",
|
||||
recursive=True)
|
||||
self.add_header_file([
|
||||
"/usr/include/_types/*",
|
||||
],
|
||||
destination_path="_types",
|
||||
recursive=True)
|
||||
self.add_header_file([
|
||||
"/usr/include/libkern/*",
|
||||
],
|
||||
destination_path="libkern",
|
||||
recursive=True)
|
||||
self.add_header_file([
|
||||
"/usr/include/mach/*",
|
||||
],
|
||||
destination_path="mach",
|
||||
recursive=True)
|
||||
self.add_header_file([
|
||||
"/usr/include/sys/*",
|
||||
],
|
||||
destination_path="sys",
|
||||
recursive=True)
|
||||
self.add_header_file([
|
||||
"/usr/include/bits/*",
|
||||
],
|
||||
destination_path="bits",
|
||||
recursive=True)
|
||||
self.add_header_file([
|
||||
"/usr/include/gnu/*",
|
||||
],
|
||||
destination_path="gnu",
|
||||
recursive=True)
|
||||
self.add_header_file([
|
||||
"/usr/include/linux/*",
|
||||
],
|
||||
destination_path="linux",
|
||||
recursive=True)
|
||||
self.add_header_file([
|
||||
"/usr/include/asm/*",
|
||||
],
|
||||
destination_path="asm",
|
||||
recursive=True)
|
||||
self.add_header_file([
|
||||
"/usr/include/asm-generic/*",
|
||||
],
|
||||
destination_path="asm-generic",
|
||||
recursive=True)
|
||||
self.add_header_file([
|
||||
"/usr/include/netinet/*",
|
||||
],
|
||||
destination_path="netinet",
|
||||
recursive=True)
|
||||
self.add_header_file([
|
||||
"/usr/include/net/*",
|
||||
],
|
||||
destination_path="net",
|
||||
recursive=True)
|
||||
self.add_flag("link", "-B/usr/lib")
|
||||
|
||||
|
@@ -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):
|
||||
@@ -22,8 +23,24 @@ class System(system.System):
|
||||
self.set_valid(True)
|
||||
# no check needed ==> just add this:
|
||||
self.add_depend("c")
|
||||
self.add_flag("c++","-D__STDCPP_LLVM__")
|
||||
self.add_flag("c++-remove","-nostdlib")
|
||||
self.add_flag("need-libstdc++", True)
|
||||
self.add_flag("c++", "-D__STDCPP_LLVM__")
|
||||
if env.get_isolate_system() == False:
|
||||
self.add_flag("c++-remove", "-nostdlib")
|
||||
self.add_flag("need-libstdc++", True)
|
||||
else:
|
||||
self.add_flag("link-lib", "stdc++")
|
||||
compilator_gcc = "g++"
|
||||
if target.config["compilator-version"] != "":
|
||||
compilator_gcc = compilator_gcc + "-" + target.config["compilator-version"]
|
||||
|
||||
#get g++ compilation version :
|
||||
version_cpp = multiprocess.run_command_direct(compilator_gcc + " -dumpversion");
|
||||
if version_cpp == False:
|
||||
debug.error("Can not get the g++ version ...")
|
||||
|
||||
self.add_header_file([
|
||||
"/usr/include/c++/" + version_cpp + "/*"
|
||||
],
|
||||
recursive=True)
|
||||
|
||||
|
||||
|
@@ -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)
|
||||
|
||||
|
||||
|
@@ -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,14 +31,22 @@ class System(system.System):
|
||||
self.add_depend([
|
||||
'c'
|
||||
])
|
||||
"""
|
||||
if env.get_isolate_system() == True:
|
||||
self.add_header_file([
|
||||
"/usr/include/sched.h",
|
||||
"/usr/include/pthread.h"
|
||||
],
|
||||
clip_path="/usr/include/")
|
||||
"""
|
||||
self.add_header_file([
|
||||
"/usr/include/pthread/*",
|
||||
],
|
||||
destination_path="pthread",
|
||||
recursive=True)
|
||||
self.add_header_file([
|
||||
"/usr/include/pthread/*",
|
||||
],
|
||||
destination_path="",
|
||||
recursive=True)
|
||||
|
||||
|
||||
|
||||
|
@@ -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,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
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user