Compare commits

...

221 Commits
0.5.7 ... main

Author SHA1 Message Date
48d1ff1937 [RELEASE] new version 2.5.0 2019-04-26 23:56:04 +02:00
6386467b45 [DEV] update at the new external argument parser (death) 2019-04-26 23:41:11 +02:00
017cbc50ba [DEV] update at the new external log system 2019-04-26 23:41:11 +02:00
d3be28a1a3 [RELEASE] new version 2.4.0 2019-04-15 22:41:41 +02:00
cb4c8c050f [DEV] update doc to commit on pip 2019-04-15 22:40:22 +02:00
3a39092af2 [DEV] add some logs 2019-04-01 22:15:41 +02:00
a7732fba54 [DEV] add C++20 2018-08-16 23:10:54 +02:00
66e98727b9 [DEBUG] correct the run of the library 2018-07-09 21:56:54 +02:00
55e5f44c42 [DOC] update doc for gcov 2018-06-19 21:01:15 +02:00
d7383332cb [DOC] add helper doc 2018-06-19 07:14:58 +02:00
f29316f493 [DEV] add ysql interface 2018-04-12 23:17:42 +02:00
6b2563483f [DEV] small fix 2018-02-27 21:17:34 +01:00
3058308f18 [DEV] add ccache 2018-02-27 21:17:34 +01:00
b4bce09b46 [DEBUG] correct the log display 2018-01-12 21:25:15 +01:00
a994af78d4 [DEBUG] remove UTF8 error print when add some µs in files 2017-10-21 23:19:47 +02:00
f6abd70d75 [DEBUG] some naming correction 2017-10-09 10:23:52 +02:00
0946252a10 [DEV] try to remove dependency on STL 2017-09-07 23:35:23 +02:00
03742be308 [DEV] try isolate in macOs 2017-09-07 23:35:35 +02:00
7ca034a430 [DEV] add doc and set android in openGL ES 3 limit at API 19(4.3) 2017-06-28 08:20:50 +02:00
9131d375b8 [DEV] add a get version 2017-04-21 21:07:04 +02:00
ed7fc49324 [DEBUG] correct pulseaudio (step 3) 2017-04-13 21:36:11 +02:00
64d39a9def [DEBUG] correct pulseaudio (step 2) 2017-04-13 21:10:27 +02:00
87bd7f8e7a [DEV] set back pulseaudio 2017-04-12 23:32:32 +02:00
94c3c82543 [RELEASE] new version 2.3.0 2017-03-30 21:56:15 +02:00
abfae29839 [DEV] corect wrong log 2017-03-27 23:50:52 +02:00
75f237b349 [DEV] add generate data file 2017-03-21 22:32:11 +01:00
162f7785f0 [DEBUG] copy empty file 2017-03-20 21:45:37 +01:00
898a730f70 Revert "[DEV] optimise check of file date (3.2s->2.9s in userland and 0.60s->0.26s in kernel)" ==> reate compilation bug
This reverts commit 3457215994d7091ee3af6874946ddd3e28d5a9a0.
2017-02-01 23:33:22 +01:00
25028a136c Revert "[TEST] remove log in the debug, verbose, extreme_verbose and speed move 2.95s to 2.64s ==> not enougth"
This reverts commit b5096256532d3db8e56dcd0db72ca8674256994c.
2017-01-31 23:03:46 +01:00
b509625653 [TEST] remove log in the debug, verbose, extreme_verbose and speed move 2.95s to 2.64s ==> not enougth 2017-01-31 23:01:45 +01:00
3457215994 [DEV] optimise check of file date (3.2s->2.9s in userland and 0.60s->0.26s in kernel)
I expected more gain
2017-01-31 22:44:04 +01:00
791c7fe6e8 [DEV] add xdg compose 2017-01-17 22:16:53 +01:00
87d5cde1ae [DEBUG] add missing link in wayland 2017-01-14 22:05:33 +01:00
27a84e888f [DEV] add some element needed for wayland client port 2017-01-11 23:04:13 +01:00
dd6adc574e Change licence APACHE-2 to MPL-2 ==> force source redistribution and permit static link 2017-01-05 21:28:23 +01:00
ee61965e07 [DEV] missing dome include for X11 2016-12-29 21:58:46 +01:00
75c6381481 [DEV] add generated src in auto set 2016-11-25 21:02:42 +01:00
f24e1a6d90 [DEV] add macro concept 2016-11-24 21:13:08 +01:00
0e7458cc06 [DEV] integrate PACKAGE generation and run binary inside 2016-11-23 22:08:43 +01:00
fad39e0bb9 [DEV] try think at a correct package 2016-11-23 00:10:37 +01:00
49bb4ffa2b [DEV] add control on a specific new clang flag 2016-11-17 23:43:35 +01:00
98e4dc9e8d [DEV] add an API to add flag when a optionnal dependence is not found 2016-11-17 22:10:56 +01:00
0a536b5203 [RELEASE] release version 2.2.2 2016-11-10 21:56:36 +01:00
1c66efa105 [DEV] simplify naming of asset 2016-11-10 21:14:42 +01:00
edfe7a1c96 [DEV] add add_src_path and add_header_path 2016-11-09 23:33:38 +01:00
92a0e5198c [DEV] add base of emscripten build for firefox test 2016-11-04 22:54:25 +01:00
156abe3533 [CI] correct build CI 2016-10-28 00:31:06 +02:00
2992699ec5 [DEBUG] correct local simple C test 2016-10-28 00:08:46 +02:00
44dbcdd56d [DEV] add a dependency graph generator
lutin dependency:LD ; dot -Tsvg dependency.dot -o dependency.svg ; firefox dependency.svg
2016-10-28 00:06:05 +02:00
f2060d4c97 [RELEASE] release version 2.2.1 2016-10-27 21:13:24 +02:00
cfde4a549f [DEBUG] correct version number parsing 2016-10-27 21:13:24 +02:00
72e956f06a [DEBUG] correct ARM7 or ARM64 selection 2016-10-11 21:14:19 +02:00
058c425feb [RELEASE] new version 2.2.0 2016-10-23 13:59:54 +02:00
7e6f391dbf [DEV] remove deprecated 2016-10-23 13:58:35 +02:00
e25ceee5a8 (DEV) add some element of Mac OS framework 2016-10-11 21:14:19 +02:00
42e3deed44 [DEV] add better flag for android 2016-10-11 21:00:08 +02:00
f0690cd75a [DEV] add some include in windows platform 2016-10-10 21:18:17 +02:00
acc69912a0 [DEV] correct run api for IOs 2016-10-07 21:02:35 +02:00
73a230826b [DEBUG] missing depend in specific target interface 2016-10-06 22:51:40 +02:00
da8233d34e [DEV] add ws2 include support for windows 2016-09-28 23:41:41 +02:00
27f6a95d41 [DEBUG] correct basic path to create the zip file in Windows Target 2016-10-05 23:45:46 +02:00
71e0f242bf [DEV] zip data for windows and create a zip package for final output 2016-10-05 22:57:30 +02:00
092843cd02 [DEV] add support of heritage of target and better support of Debian distro 2016-10-05 21:17:12 +02:00
3b37e78dd3 [DEBUG] wrong deprecated version 2016-10-04 23:19:05 +02:00
94d8b82321 [API/DEV] set ICON and ANDROID_SIGN in relative only 2016-10-04 22:56:40 +02:00
4c883f177c [DEV] set relative path in add path 2016-10-04 22:42:54 +02:00
b6a5f7e539 [DEV] update build to support configure instead of create in module ==> permit to get back the version ... order issue 2016-10-04 21:08:06 +02:00
fb4b03a441 [DEV] add run on linux for windows 2016-09-29 21:29:29 +02:00
ed3a26a638 [DEV] add rpc for gtest and gui mode for graphic windows application 2016-09-28 23:41:41 +02:00
2a9f3feed7 [DEV] add many system support for MacOs, IOs and Windows.Correct the target flags 2016-09-28 23:39:14 +02:00
e148a7e204 [DEV] add ptherd for Windows cross compile 2016-09-27 23:16:41 +02:00
13e6d98ac4 [DEV] add prebuild SDL 2016-09-26 21:00:33 +02:00
45bd6e6213 [DEV] add get_compilator in target 2016-09-25 21:35:07 +02:00
82e8946227 [DOC] add help to deploy on IOs 2016-09-22 21:33:06 +02:00
aa96a415b5 [DEBUG] correct MacOS releae build 2016-09-21 21:35:13 +02:00
52729c3c71 [DEV/DEBUG] correct the build of IOs target and correct the resize installed image 2016-09-20 22:33:00 +02:00
62d084b351 [DEV/DOC] correct template of module, add API of set file with dependency availlable 2016-09-20 21:57:00 +02:00
1c76227b27 [DEBUG] write error when action on target does not exist 2016-09-18 22:49:56 +02:00
f46c5116b1 [DEBUG] Run / intall executable on MacOs 2016-09-18 22:40:01 +02:00
1cf731910d [DEBUG] build on MacOs 2016-09-16 23:06:51 +02:00
a2fdd6eef9 [DEV] update flags on MacOs 2016-09-15 23:19:57 +02:00
9c9809c359 [DEV] change warning in debug 2016-09-15 23:29:21 +02:00
3bea09cfc2 [DEBUG] set comiplation for Windows on Linux back 2016-09-14 23:53:22 +02:00
cc397679bb [DEV] wrong code specification 2016-09-13 23:56:20 +02:00
33688801bb [RELEASE] new version 2.1.0 2016-09-12 23:14:16 +02:00
6440dc6309 [DEV] integrate the version in the get version in file 2016-09-12 21:46:11 +02:00
e1e896fcc1 [DOC] wrong doc number 2016-09-09 23:22:15 +02:00
8c85a2ea09 [RELEASE] new version 2.0.0 2016-09-09 22:55:43 +02:00
082556e591 [DOC] better documentation 2016-09-09 21:30:25 +02:00
604078f1c0 [DEV/API] update API to use a mximum of accessor instead of variable, some deprecation 2016-09-08 22:56:16 +02:00
40d2e8eac1 [API/DOC] change API to have a good coherency 2016-09-07 22:17:41 +02:00
2ebe27a5a4 [DOC/DEV] continue documentation and update API ==> end of normalisation 2016-09-06 21:04:01 +02:00
dff87a00ee [CI] add ci of gitlab 2016-09-05 21:39:25 +02:00
9fc593fb59 [DOC] update documentation and add better stanadart API 2016-09-05 21:08:58 +02:00
dc42a8e14b [RELEASE] new version 1.2.6 2016-09-02 21:39:18 +02:00
97f7566a7e [DEV] rework isaolated function to manage it in option 2016-09-02 21:39:18 +02:00
bf6fde3770 [RELEASE] new version 1.2.4 2016-08-31 23:49:11 +02:00
97db63bcfd [DEV] add based on element 2016-08-22 21:52:31 +02:00
43c7947b95 [DEBUG/DEV] correct copy of library data, add DATA type of a module 2016-08-22 22:37:47 +02:00
1c32b7089a [DEV] add empty element for Android board (not work ...) 2016-08-09 23:44:55 +02:00
760a589cbe [DEV] correct copy of generated files 2016-08-09 21:26:39 +02:00
d38ecf5432 [DEV] continue proper isolation of basic c and c++ libs 2016-08-09 21:09:26 +02:00
7e44373f79 [DEV] better isolation 2016-08-08 22:23:27 +02:00
3804de2078 [DEV] create an isolation in the include file in Linux...
now libc header is install in a specific directory
lib c++ header is install in a specific directory
idem for pthread, X11, openGL, m, ...
2016-08-07 22:42:05 +02:00
8fa25bb8ec [DEBUG] correct the android build dependency order' 2016-08-01 00:28:18 +02:00
beb97f4bed [DEV] add compilation of S and s file (asm) 2016-07-13 20:50:01 +02:00
47dcca5578 [DEV] install header before building project 2016-05-05 23:18:19 +02:00
dde9c9c280 [RELEASE] new version 1.2.3 2016-04-28 22:31:32 +02:00
598d301284 [DEBUG] correct gcov report 2016-04-14 21:57:56 +02:00
520f97c7f6 [RELEASE] create version 1.2.2 2016-04-10 13:39:36 +02:00
e4b69d17f4 [DEV] thik of coverage for clang 2016-04-01 21:35:42 +02:00
42be4afd0a [DEV] optimize build for linux and windows with no regeneration of package when not needed 2016-03-17 22:38:58 +01:00
1fa860e5b3 [DEBUG] set back target optimisation 2016-03-17 21:45:22 +01:00
87a4106101 [DEBUG] correct the compilation with wrong dependency include ==> remove target optimisation 2016-03-17 21:11:17 +01:00
1ec07b9446 [DEV] add multiple compilation requesting with xxx* (only work with * at the end) 2016-03-16 23:41:25 +01:00
5995effd9e [DEV] add specific subfolder in the file lutinParseSubFolders.txt 2016-03-16 23:41:25 +01:00
43c0ec2535 [DEBUG] correct android signing property 2016-03-07 22:09:23 +01:00
31fb9818ff [DEBUG/DEV] correct android build (gcc) and add force optimisation to build with -O3 in debug 2016-03-07 22:08:50 +01:00
83d7154254 [DEV] add base on target 2016-02-24 21:20:49 +01:00
55609b904c [DEBUG] clean and display log error 2016-02-23 21:55:32 +01:00
4beda0dd23 [DEBUG] correct the no line to execute 2016-02-23 21:49:03 +01:00
236f19bf36 [RELEASE] new release for bugFix 2016-02-23 21:43:37 +01:00
fe75da7ef9 [DEBUG] Missing type of string for python file 2016-02-23 21:40:24 +01:00
e1728a4d8d [DEV] new release 2016-02-23 21:36:56 +01:00
c6ea16d046 [DEV] correct gcov methodologie 2016-02-23 21:34:16 +01:00
b645f087f3 [DEV] support of gcov with french translating 2016-02-22 21:05:06 +01:00
6e69681480 [DEBUG] error when no parameter in run 2016-02-15 21:45:50 +01:00
14114158aa [DEV] add parameter in run 2016-02-10 21:01:57 +01:00
618825ac76 [DEBUG] release need setup.cfg 2016-02-09 23:08:28 +01:00
2a0bdd9e90 [DEV] create new release 1.1.0 2016-02-09 22:39:40 +01:00
3b2c888fad [DEV] add run and multiple action in taget 2016-02-09 22:32:33 +01:00
77358efa48 [DEV] add write of class 2016-02-09 21:55:43 +01:00
f069299a53 [DEV] naming error 2016-01-19 21:56:15 +01:00
c962b4fb9f [DEBUG] copy file when not pillow or coregraphic is install 2016-01-18 23:51:22 +01:00
5d92a27738 [DEBUG] remove some bad log 2016-01-18 21:57:14 +01:00
c35e1d3a24 [DEBUG] Android build in multithread ==> java build is now mono threaded 2016-01-18 21:48:23 +01:00
7c664f156d [DEV] add missing m lib on global platform 2016-01-18 21:18:01 +01:00
198513660e [DEV] Change and test the subfolder force parsing 2016-01-18 21:05:07 +01:00
61db92894a [DEBUG] correct the basic export of XX++ linker when needed 2016-01-15 21:27:54 +01:00
a9dd50575a [DEV] faster search methode of the lutin element, and add configuration file lutinConfig.py 2016-01-15 21:27:54 +01:00
d21217bfc4 [DEV] better remove of libc++ 2016-01-11 21:30:50 +01:00
9b9c65d036 [DEV] set the search in the current worktree before the system worktree
If an element is not present in the worktree we use the generic system worktree
2016-01-08 23:17:12 +01:00
055a37bcd5 [RELEASE] Change API ==> change master version 2016-01-08 22:33:51 +01:00
6c3f96c2a9 [DEV] correct the target flag methodology 2016-01-08 22:28:31 +01:00
1200434b97 [DEV] Rework API of the c++ lib to be more versatil and permit to have local c++ lib 2016-01-07 21:46:43 +01:00
6c431ad300 [DEV] add the version number in the current package build 2015-12-30 22:27:07 +01:00
8a72df67c6 [DEBUG] Correct the Android multiple version of tools 2015-11-06 21:26:35 +01:00
7360adce0b [DEBUG] correct python 3 correction of dict comparing 2015-11-05 21:02:49 +01:00
5065c7b6ee [CI] version 0.7.10 2015-11-02 22:11:42 +01:00
b497e09dd0 [CI] set minGW builder better 2015-11-02 21:55:32 +01:00
75d1490a59 [DEV] correct the android application naming 2015-11-02 21:35:08 +01:00
ddff6f82b9 [RELEASE] new version 0.7.9 2015-10-30 21:12:01 +01:00
4067d6266e [DEBUG] update android build 2015-10-30 21:05:49 +01:00
fcd357e452 [RELEASE] new version 0.7.8 (fix error android) 2015-10-29 21:19:29 +01:00
3c186dc92e [RELEASE] new version 0.7.7 2015-10-29 21:19:29 +01:00
0b33c94680 [DEV] start add unitary test 2015-10-22 21:01:35 +02:00
6c416c9fef [RELEASE] new version 2015-10-21 21:56:53 +02:00
fc6493f441 [DEBUG] strip Ok on MacOs (missing -u flag) 2015-10-21 21:40:59 +02:00
16c019ac5b [DEBUG] compile OK in IOs even if secret key not present (release mode) 2015-10-21 21:28:32 +02:00
328681d44b [DEBUG] correct jar link 2015-10-21 21:25:12 +02:00
fbf7d2dbad [DEBUG] correct force strip 2015-10-21 21:22:34 +02:00
5f008a153e [DEBUG] correct dynamic-build 2015-10-20 23:52:51 +02:00
4d82e31d40 [TAG] creata a new version 2015-10-20 23:39:12 +02:00
c913e19ccf [DEBUG] Correct creating directory of file when needed 2015-10-20 23:33:53 +02:00
62ac51e78b [TAG] creata a new version 2015-10-20 23:39:12 +02:00
ce407605c9 [DEBUG] Compile again on MacOs and IOs 2015-10-20 23:33:53 +02:00
8336411ec2 [DEBUG] corect help 2015-10-19 21:56:11 +02:00
fd58b31c26 [DEBUG] correct windows minGW version 2015-10-16 23:36:10 +02:00
fa1b618896 [DEBUG] MacOs dynamic variable 2015-10-16 22:10:24 +02:00
2dcbbe9639 [DEV] Remove completion for linux ... 2015-10-15 21:24:20 +02:00
242a086ba1 [DEV] add missing license file 2015-10-15 08:33:38 +02:00
14fcfc1d54 [DEV] Update lutin API (try stabilize) 2015-10-14 21:39:43 +02:00
4b091e964a [DEV] end simplify create package 2015-10-07 21:58:28 +02:00
64a6e47b37 [DEV] update package building (start generization) 2015-10-06 21:34:32 +02:00
f0fe760836 [DEV] update android build 2015-10-03 12:32:51 +02:00
7d48e91b9b [DEV] remove unneeded file in shared folder 2015-10-01 21:04:22 +02:00
1ac0ecd5c5 [DEV] update methodologie of copy data 2015-09-30 21:05:57 +02:00
54fddc82b5 [DEV] Add C++ 17 and better support for Android platform 2015-09-24 21:48:32 +02:00
663188773d [DEV] integrate new methode for IOs and MacOs 2015-09-24 21:16:00 +02:00
773a644ba1 [DEBUG] internal error 2015-09-18 21:19:33 +02:00
f1d6ad6ce8 [DEV] reintegrate Android interfac package builder (bug on DATA) 2015-09-17 22:07:20 +02:00
dc921d651b [DEV] compile java file only when needed and change basic version of sdk (15, 14 has been removed) 2015-09-16 23:51:23 +02:00
06481abcbf [DEV] set work compilation again on windows 2015-09-16 16:58:01 +02:00
6ac4cc45fa [DEV] set it back (integration android) 2015-09-15 22:01:19 +02:00
979e71c101 [DEV] correct copy headers 2015-09-14 23:24:05 +02:00
a070f64716 [DEV] continue integration of the isolated build methodologie 2015-09-14 23:21:29 +02:00
21af5be1a3 [DEV] start compile in shered object mode 2015-09-13 23:28:01 +02:00
0afb15c5b3 [DEV] generic package generation on Linux is back 2015-09-11 22:26:32 +02:00
7e5d8db361 [DEV] add list of element package (no package generated) 2015-09-10 21:50:26 +02:00
a9f8ab7ea2 [DEV] rework the entire build directory (no package generated) 2015-09-10 21:32:50 +02:00
22965f5a57 [DEV] review methodologie of build 2015-09-09 21:53:22 +02:00
10c0f98cef [DEV] try to create generic package 2015-09-08 22:19:18 +02:00
ca67cb4c26 [DEV] new release for archlinux 2015-09-07 21:52:03 +02:00
836dee5cf8 [DEBUG] some correction after installing archlinux 2015-09-07 11:30:11 +02:00
d70b82683b [DEBUG] correct dependency building of element 2015-08-28 22:10:35 +02:00
93693ed0f0 [DEV] add warning file generation 2015-08-27 21:24:40 +02:00
eeb070e014 [DEV] update the gcov version to use 2015-08-25 23:42:01 +02:00
99927380d6 Update README.rst 2015-08-25 23:37:26 +02:00
8fc81f1caa Update README.rst 2015-08-25 23:36:06 +02:00
5f325c2d7e Update README.rst 2015-08-25 23:31:33 +02:00
f65a5f58ee [DEV] add badge pip version 2015-08-25 23:26:19 +02:00
4020c70fc3 [DEV] add correct gcov generator of result 2015-08-25 21:37:49 +02:00
6cb2ef2bd2 [DEV] crate basic version 0.6.0 2015-08-24 23:41:23 +02:00
aa120cde57 [DEV] add color in help 2015-08-24 21:03:34 +02:00
2604cd93be [DEV] try integrate clang on android 2015-07-10 23:02:17 +02:00
10055dd3c6 [DEV] update version 2015-07-01 23:24:39 +02:00
db0c2a8e11 [DEV] correct some builder interface 2015-06-22 23:16:08 +02:00
2bb4e2d377 [DEV] minor correction 2015-06-21 21:59:25 +02:00
07058eda14 [DEV] android dev is now ok 2015-06-18 23:17:38 +02:00
a4ddf8e81b [DEV] continue re-integration of android 2015-06-19 23:55:18 +02:00
c73a7a0df6 [DEV] add h generator form class 2015-06-18 23:17:38 +02:00
7e41e6f393 [DEV] rework the build of java file for android 2015-06-18 21:06:06 +02:00
2e2143ebcf [DEBUG] remove dependency of pil 2015-06-15 21:54:22 +02:00
780979e0f0 [DEV] correct some interface 2015-06-12 21:35:28 +02:00
9034d303e5 [DEBUG] correct the inclusion of many element 2015-06-12 10:14:50 +02:00
912171b33d [DEV] new release 2015-06-07 08:41:31 +02:00
18b37ba5d0 [DEV] correct autocomplesion 2015-06-07 08:23:53 +02:00
3111d3899f [DEV] rework arbo of the ewol interface for android ==> do a better clean 2015-05-20 22:51:18 +02:00
8d92551ec8 [DEV] add a basic interface for shell 2015-05-20 21:08:21 +02:00
78edf4851a [DEV] Add install interface and .dmg creator for MacOSX 2015-05-19 22:23:52 +02:00
2b7baf2581 [DEV] correct packege error in ios 2015-05-12 23:33:58 +02:00
160 changed files with 13573 additions and 4307 deletions

34
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,34 @@
# This file is a template, and might need editing before it works on your project.
# use the official gcc image, based on debian
# can use verions as well, like gcc:5.2
# see https://hub.docker.com/_/gcc/
image: gcc
before_script:
- pwd
- git clone --depth 1 --branch master https://gitlab.com/atria-soft/ci.git
- ls -l *
- ls -l ..
- apt-get update -qy
- apt-get install -y python-dev python-pip
#- pip install setuptools
- ./setup.py install
#- export PYTHONPATH=$PYTHONPATH:./lutin/build/lib.linux-x86_64-2.7/:./lutin/build/lib.linux-x86_64-2.7/lutin/:./lutin/build/lib:./lutin/build/lib/lutin/
# - ./ci/build_send.py --tag=$TAG --status=START;
build:
stage: build
# instead of calling g++ directly you can also use some build toolkit like make
# install the necessary build tools when needed
# before_script:
# - apt update && apt -y install make autoconf
script:
- export TARGET=-tLinux
- export CONF=-mdebug
- export BUILDER=-cgcc
- lutin -w -j4 -C -P $TARGET $BUILDER $COMPILATOR_OPTION $BUS $CONF $GCOV $DISABLE_PACKAGE test-c; STATUS=$?
# - ./ci/build_send.py --tag=$TAG --status="$STATUS";
# artifacts:
# paths:
# - mybinary

74
.travis.yml Normal file
View File

@ -0,0 +1,74 @@
language: cpp
#sudo: false
sudo: required
dist: trusty
branches:
only:
- master
- dev
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.9
- expect
- binutils-mingw-w64-i686 # 32bit MinGW
- gcc-mingw-w64-i686
- g++-mingw-w64-i686
- binutils-mingw-w64-x86-64 # 64bit MinGW
- gcc-mingw-w64-x86-64
- g++-mingw-w64-x86-64
matrix:
include:
- os: linux
env: CONF=release BUILDER=gcc TARGET=Linux TAG=Linux 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: x86_64-w64-mingw32-gcc
- os: linux
env: CONF=release BUILDER=gcc TARGET=Android TAG=Android DISABLE_PACKAGE=-p
compiler: gcc
- os: osx
env: CONF=release BUILDER=clang TARGET=MacOs TAG=MacOs
compiler: clang
- os: osx
env: CONF=release BUILDER=clang TARGET=IOs TAG=IOs
compiler: clang
install:
- ./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
git clone --depth 1 --branch master https://github.com/HeeroYui/android-download-tool;
./android-download-tool/dl-android.sh;
fi
- git clone --depth 1 --branch master https://github.com/atria-soft/ci.git
- cd -
before_script:
- cd ..
- pwd
- 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=$?
- ./ci/build_send.py --tag=$TAG --status="$STATUS";
notifications:
email:
- yui.heero@gmail.com

13
COPYING
View File

@ -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
View 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.

View File

@ -1 +1,2 @@
include README.rst
include bash-autocompletion/lutin

View File

@ -3,6 +3,25 @@ Lutin
`lutin` is a generic builder and package maker is a FREE software tool.
.. image:: https://badge.fury.io/py/lutin.png
:target: https://pypi.python.org/pypi/lutin
Release (master)
----------------
.. image:: https://travis-ci.org/HeeroYui/lutin.svg?branch=master
:target: https://travis-ci.org/HeeroYui/lutin
Developement (dev)
------------------
.. image:: https://travis-ci.org/HeeroYui/lutin.svg?branch=dev
:target: https://travis-ci.org/HeeroYui/lutin
Instructions
------------
@ -24,32 +43,40 @@ http://github.com/HeeroYui/lutin/
Documentation
-------------
http://github.io/HeeroYui/lutin/
http://HeeroYui.github.io/lutin/
Installation
------------
Requirements: ``Python >= 2.7`` and ``pip``
Just run::
Just run:
pip install lutin
On mac-os you may install pip before:
Install pip on debian/ubuntu:
sudo apt-get install pip
Install pip on ARCH-linux:
sudo pacman -S pip
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,

View File

@ -61,7 +61,7 @@ _lutin()
return 0
;;
--target)
local names=`lutin.py --list-target`
local names=`lutin --list-target`
COMPREPLY=( $(compgen -W "${names}" -- ${cur}) )
return 0
;;
@ -82,9 +82,9 @@ _lutin()
COMPREPLY=( $(compgen -W "${optshorts}" -- ${cur}) )
return 0
fi
listmodule=`lutin.py --list-module`
listmodule=`lutin --list-module`
COMPREPLY=( $(compgen -W "${listmodule}" -- ${cur}) )
return 0
}
complete -F _lutin lutin.py
complete -F _lutin lutin

View File

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

400
bin/lutin
View File

@ -1,44 +1,58 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @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 lutin.debug as debug
import lutin.arg as arguments
import copy
from realog import debug as debug
import lutin
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
import lutin.env as env
import lutin.multiprocess as multiprocess
import lutin.tools as tools
import lutin.host as lutinHost
import lutin.tools as lutinTools
myArgs = arguments.LutinArg()
myArgs.add(arguments.ArgDefine("h", "help", desc="display this help"))
myArgs = 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")
myArgs.add(arguments.ArgDefine("v", "verbose", list=[["0","None"],["1","error"],["2","warning"],["3","info"],["4","debug"],["5","verbose"],["6","extreme_verbose"]], desc="display makefile debug level (verbose) default =2"))
myArgs.add(arguments.ArgDefine("C", "color", desc="display makefile output in color"))
myArgs.add(arguments.ArgDefine("f", "force", desc="Force the rebuild without checking the dependency"))
myArgs.add(arguments.ArgDefine("P", "pretty", desc="print the debug has pretty display"))
myArgs.add(arguments.ArgDefine("j", "jobs", haveParam=True, desc="Specifies the number of jobs (commands) to run simultaneously"))
myArgs.add(arguments.ArgDefine("s", "force-strip", desc="Force the stripping of the compile elements"))
myArgs.add("v", "verbose", list=[["0","None"],["1","error"],["2","warning"],["3","info"],["4","debug"],["5","verbose"],["6","extreme_verbose"]], desc="display makefile debug level (verbose) default =2")
myArgs.add("C", "color", desc="Display makefile output in color")
myArgs.add("B", "force-build", desc="Force the rebuild without checking the dependency")
myArgs.add("P", "pretty", desc="Print the debug has pretty display")
myArgs.add("j", "jobs", haveParam=True, desc="Specifies the number of jobs (commands) to run simultaneously")
myArgs.add("d", "depth", haveParam=True, desc="Depth of the search of sub element lutin_*.py (default=" + str(env.get_parse_depth()) + ")")
myArgs.add("s", "force-strip", desc="Force the stripping of the compile elements")
myArgs.add("o", "force-optimisation", desc="Force optimisation of the build")
myArgs.add("w", "warning", desc="Store warning in a file build file")
myArgs.add("i", "isolate-system", desc="Isolate system build (copy header of c and c++ system lib to not include unneeded external libs) EXPERIMENTAL (archlinux)")
myArgs.add("K", "ccache", desc="Enable the ccache interface")
myArgs.add_section("properties", "keep in the sequency of the cible")
myArgs.add(arguments.ArgDefine("t", "target", haveParam=True, desc="Select a target (by default the platform is the computer that compile this) To know list : 'lutin.py --list-target'"))
myArgs.add(arguments.ArgDefine("c", "compilator", list=[["clang",""],["gcc",""]], desc="Compile with clang or Gcc mode (by default gcc will be used)"))
myArgs.add(arguments.ArgDefine("m", "mode", list=[["debug",""],["release",""]], desc="Compile in release or debug mode (default release)"))
myArgs.add(arguments.ArgDefine("a", "arch", list=[["auto","Automatic choice"],["arm","Arm processer"],["x86","Generic PC : AMD/Intel"],["ppc","Power PC"]], desc="Architecture to compile"))
myArgs.add(arguments.ArgDefine("b", "bus", list=[["auto","Automatic choice"],["32","32 bits"],["64","64 bits"]], desc="Adressing size (Bus size)"))
myArgs.add(arguments.ArgDefine("p", "package", desc="Disable the package generation (usefull when just compile for test on linux ...)"))
myArgs.add(arguments.ArgDefine("g", "gcov", desc="Enable code coverage intrusion in code"))
myArgs.add(arguments.ArgDefine("", "simulation", desc="simulater mode (availlable only for IOS)"))
myArgs.add(arguments.ArgDefine("", "list-target", desc="list all availlables targets ==> for auto completion"))
myArgs.add(arguments.ArgDefine("", "list-module", desc="list all availlables module ==> for auto completion"))
myArgs.add("t", "target", haveParam=True, desc="Select a target (by default the platform is the computer that compile this) To know list : 'lutin.py --list-target'")
myArgs.add("c", "compilator", list=[["clang",""],["gcc",""]], desc="Compile with clang or Gcc mode (by default " + lutinHost.HOST_DEFAULT_COMPILATOR + " will be used)")
myArgs.add("", "compilator-version", haveParam=True, desc="With travis we need to specify the name of the version if we want to compile with gcc 4.9 ==> --compilator-version=4.9")
myArgs.add("m", "mode", list=[["debug",""],["release",""]], desc="Compile in release or debug mode (default release)")
myArgs.add("a", "arch", list=[["auto","Automatic choice"],["arm","Arm processer"],["x86","Generic PC : AMD/Intel"],["ppc","Power PC"]], desc="Architecture to compile")
myArgs.add("b", "bus", list=[["auto","Automatic choice"],["32","32 bits"],["64","64 bits"]], desc="Adressing size (Bus size)")
myArgs.add("p", "package", desc="Disable the package generation (usefull when just compile for test on linux ...)")
myArgs.add("g", "gcov", desc="Enable code coverage intrusion in code")
myArgs.add("", "simulation", desc="Simulater mode (availlable only for IOS)")
myArgs.add("", "list-target", desc="List all availlables targets ==> for auto completion")
myArgs.add("", "list-module", desc="List all availlables module ==> for auto completion")
myArgs.add_section("cible", "generate in order set")
localArgument = myArgs.parse()
@ -46,100 +60,305 @@ localArgument = myArgs.parse()
"""
display the help of this makefile
"""
def usage():
def usage(full=False):
color = debug.get_color_set()
# generic argument displayed :
myArgs.display()
print(" All target can finish with '?clean' '?dump' ... ?action")
print(" all")
print(" All target can finish with '?clean' '?dump' '?gcov' ... ?action (@ can replace ?)" )
print(" " + color['green'] + "all" + color['default'])
print(" build all (only for the current selected board) (bynary and packages)")
print(" clean")
print(" " + color['green'] + "clean" + color['default'])
print(" clean all (same as previous)")
print(" dump")
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()
for mod in listOfAllModule:
print(" " + mod[0])
if mod[1] != "":
print(" " + mod[1])
print(" ex: " + sys.argv[0] + " all --target=Android all -t Windows -m debug all")
data_print = " "
if full == False:
if mod["type"] != None \
and mod["type"][:6] == "BINARY":
data_print += color['blue']
if mod["sub-type"] == "":
data_print += "* "
elif mod["sub-type"] == "TEST":
data_print += "T "
elif mod["sub-type"] == "TOOLS":
data_print += "U "
elif mod["sub-type"] == "SAMPLE":
data_print += "S "
else:
data_print += " "
elif mod["type"] != None \
and mod["type"] == "PACKAGE":
data_print += color['red'] + "# "
elif mod["type"] != None \
and mod["type"][:7] == "LIBRARY":
data_print += color['yellow'] + " "
else:
data_print += color['default'] + " "
else:
data_print += color['green']
data_print += mod["name"] + color['default']
if full == False:
data_print += "\r\t\t\t\t\t\t\t"
if mod["license"] != None \
and mod["license"] != "":
data_print += color['yellow'] + " [" + mod["license"] + "]" + color['default']
if mod["version"] != None \
and mod["version"] != []:
version_ID = tools.version_to_string(mod["version"])
data_print += color['blue'] + " (" + version_ID + ")" + color['default']
"""
if mod["compagny-type"] != "" \
and mod["compagny-name"] != "":
data_print += color['purple'] + " " + mod["compagny-type"] + "/" + mod["compagny-name"] + color['default']
elif mod["compagny-name"] != "":
data_print += color['purple'] + " " + mod["compagny-name"] + color['default']
"""
print(data_print)
if mod["description"] != "":
print(" " + mod["description"])
if full == True:
if mod["type"] != None \
and mod["type"] != "":
print(" Type: " + mod["type"])
if mod["sub-type"] != None \
and mod["sub-type"] != "":
print(" Sub-Type: " + mod["sub-type"])
if mod["version"] != None \
and mod["version"] != []:
version_ID = ""
for id in mod["version"]:
if len(version_ID) != 0:
if type(id) == str:
version_ID+="-"
else:
version_ID+="."
version_ID += str(id)
print(" version: " + color['blue'] + version_ID + color['default'])
if mod["compagny-type"] != None \
and mod["compagny-name"] != None \
and mod["compagny-type"] != "" \
and mod["compagny-name"] != "":
print(" compagny: " + color['purple'] + mod["compagny-type"] + "/" + mod["compagny-name"] + color['default'])
elif mod["compagny-name"] != None \
and mod["compagny-name"] != "":
print(" compagny: " + color['purple'] + mod["compagny-name"] + color['default'])
if mod["license"] != None \
and mod["license"] != "":
print(" license: " + color['yellow'] + mod["license"] + color['default'])
if mod["maintainer"] != None \
and mod["maintainer"] != []:
print(" maintainers:")
for elem in mod["maintainer"]:
print(" " + str(elem))
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):
if value == "" \
or value == "1" \
or value == "true" \
or value == "True" \
or value == True:
return True
return False
# preparse the argument to get the verbose element for debug mode
def parseGenericArg(argument, active):
if argument.get_option_nName() == "help":
#display help
if active==False:
debug.extreme_verbose("parse arg : " + argument.get_option_name() + " " + argument.get_arg() + " active=" + str(active))
if argument.get_option_name() == "help":
if active == False:
usage()
return True
if argument.get_option_nName() == "list-module":
if active==False:
listOfModule = module.list_all_module()
if argument.get_option_name() == "HELP":
if active == False:
usage(True)
return True
if argument.get_option_name() == "list-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
print(retValue)
exit(0)
return True
if argument.get_option_nName() == "list-target":
if active==False:
listOfTarget = target.list_all_target()
if argument.get_option_name() == "list-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
print(retValue)
exit(0)
return True
elif argument.get_option_nName()=="jobs":
if active==True:
elif argument.get_option_name()=="jobs":
if active == True:
multiprocess.set_core_number(int(argument.get_arg()))
return True
elif argument.get_option_nName() == "verbose":
if active==True:
elif argument.get_option_name()=="depth":
if active == True:
env.set_parse_depth(int(argument.get_arg()))
return True
elif argument.get_option_name()=="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:
debug.set_level(int(argument.get_arg()))
return True
elif argument.get_option_nName() == "color":
if active==True:
debug.enable_color()
elif argument.get_option_name() == "color":
if active == True:
if check_boolean(argument.get_arg()) == True:
debug.enable_color()
else:
debug.disable_color()
return True
elif argument.get_option_nName() == "force":
if active==True:
env.set_force_mode(True)
elif argument.get_option_name() == "force-build":
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_nName() == "pretty":
if active==True:
env.set_print_pretty_mode(True)
elif argument.get_option_name() == "pretty":
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_nName() == "force-strip":
if active==True:
env.set_force_strip_mode(True)
elif argument.get_option_name() == "force-optimisation":
if active == True:
if check_boolean(argument.get_arg()) == True:
env.set_force_optimisation(True)
else:
env.set_force_optimisation(False)
return True
elif argument.get_option_name() == "isolate-system":
if active == True:
if check_boolean(argument.get_arg()) == True:
env.set_isolate_system(True)
else:
env.set_isolate_system(False)
return True
elif argument.get_option_name() == "force-strip":
if active == True:
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 check_boolean(argument.get_arg()) == True:
env.set_warning_mode(True)
else:
env.set_warning_mode(False)
return True
return False
# open configuration of lutin:
config_file_name = "lutinConfig.py"
config_file = os.path.join(tools.get_run_path(), config_file_name)
if os.path.isfile(config_file) == True:
sys.path.append(os.path.dirname(config_file))
debug.debug("Find basic configuration file: '" + config_file + "'")
# the file exist, we can open it and get the initial configuration:
configuration_file = __import__(config_file_name[:-3])
if "get_exclude_path" in dir(configuration_file):
data = configuration_file.get_exclude_path()
debug.debug(" get default config 'get_exclude_path' val='" + str(data) + "'")
env.set_exclude_search_path(data)
if "get_parsing_depth" in dir(configuration_file):
data = configuration_file.get_parsing_depth()
debug.debug(" get default config 'get_parsing_depth' val='" + str(data) + "'")
parseGenericArg(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(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(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(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(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(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(arg_element.ArgElement("isolate-system", str(data)), True)
# parse default unique argument:
for argument in localArgument:
parseGenericArg(argument, True)
import lutin
import lutin.host as lutinHost
import lutin.tools as lutinTools
# initialize the system ...
lutin.init()
#available target : Linux / MacOs / Windows / Android ...
targetName = host.OS
config = {
"compilator":"gcc",
"compilator":lutinHost.HOST_DEFAULT_COMPILATOR,
"mode":"release",
"bus-size":"auto",
"arch":"auto",
"generate-package":True,
"simulation":False,
"gcov":False
"gcov":False,
"compilator-version":""
}
# load the default target :
my_target = None
@ -148,54 +367,77 @@ actionDone=False
for argument in localArgument:
if parseGenericArg(argument, False) == True:
continue
elif argument.get_option_nName() == "package":
elif argument.get_option_name() == "compilator-version":
config["compilator-version"] = argument.get_arg()
elif argument.get_option_name() == "package":
config["generate-package"]=False
elif argument.get_option_nName() == "simulation":
elif argument.get_option_name() == "simulation":
config["simulation"]=True
elif argument.get_option_nName() == "gcov":
elif argument.get_option_name() == "gcov":
config["gcov"]=True
elif argument.get_option_nName() == "bus":
elif argument.get_option_name() == "bus":
config["bus-size"]=argument.get_arg()
elif argument.get_option_nName() == "arch":
elif argument.get_option_name() == "arch":
config["arch"]=argument.get_arg()
elif argument.get_option_nName() == "compilator":
elif argument.get_option_name() == "compilator":
if config["compilator"] != argument.get_arg():
debug.debug("change compilator ==> " + argument.get_arg())
config["compilator"] = argument.get_arg()
#remove previous target
my_target = None
elif argument.get_option_nName() == "target":
elif argument.get_option_name() == "target":
# No check input ==> this will be verify automaticly chen the target will be loaded
if targetName != argument.get_arg():
targetName = argument.get_arg()
debug.debug("change target ==> '" + targetName + "' & reset mode : gcc&release")
#reset properties by defauult:
config = {
"compilator":"gcc",
"compilator":lutinHost.HOST_DEFAULT_COMPILATOR,
"mode":"release",
"bus-size":"auto",
"arch":"auto",
"generate-package":True,
"simulation":False,
"gcov":False
"gcov":False,
"compilator-version":""
}
#remove previous target
my_target = None
elif argument.get_option_nName() == "mode":
elif argument.get_option_name() == "mode":
if config["mode"] != argument.get_arg():
config["mode"] = argument.get_arg()
debug.debug("change mode ==> " + config["mode"])
#remove previous target
my_target = None
else:
if argument.get_option_nName() != "":
debug.warning("Can not understand argument : '" + argument.get_option_nName() + "'")
argument_value = argument.get_arg()
debug.debug("something request : '" + argument_value + "'")
if argument.get_option_name() != "":
debug.warning("Can not understand argument : '" + argument.get_option_name() + "'")
usage()
break;
name2 = argument_value.replace("@", "?")
gettedElement = name2.split("?")
module_name = gettedElement[0]
action_list = gettedElement[1:]
if len(action_list) == 0:
action_list = "build"
debug.debug("requested: '" + module_name + "' ? actions:'" + str(action_list) + "'")
multiple_module_list = []
if module_name[-1] == "*":
base_name = module_name[:-1]
for mod in module.list_all_module():
if mod[:len(base_name)] == base_name:
debug.verbose("need do it for: " + mod);
multiple_module_list.append(mod)
else:
multiple_module_list.append(module_name)
debug.debug("Will do: '" + str(multiple_module_list) + "' ? actions:'" + str(action_list) + "'")
for module_name in multiple_module_list:
#load the target if needed :
if my_target == None:
my_target = target.load_target(targetName, config)
my_target.build(argument.get_arg())
my_target = target.load_target(targetName, copy.deepcopy(config))
my_target.build(module_name, actions=action_list)
actionDone=True
# if no action done : we do "all" ...

80
doc/010_basic_concept.md Normal file
View File

@ -0,0 +1,80 @@
Basic concept {#lutin_concept}
=============
@tableofcontents
Lutin is a compleate builder system. It is designed to answers all the application problems.
The library and the distribution problem are partially manage (no real use-case)
Technologie:
============
Lutin is designed in Python 2.X or 3.X to answers at the multiplatform problems.
On Linux or MacOs, it is really easy to compile with Makefile, cmake, but on Windows it is an other problem.
The first version of Lutin has been designed in Makefile, but we need to wait 20 minutes before the first build on Windows. In Python it is fast as Linux.
Lutin is not based over an other builder, but compile code itself.
Features:
=========
Lutin is designed to:
- support many hardware platform (X86/X64/ARM...);
- support many operation system (windows, Ios, Android ...);
- support complex worktree and depedency;
- build only when needed;
- create platform specific packages (application bundle);
global overview:
================
Every build system is based on multiple concept depending of their own designed.
For lutin we can différentiate 4 basics concepts:
- Mudule: Interface to create a part of an application, that contain binary, scipt, datas ...
- Target: methode to creata an application or a library (may be internal: medium level)
- Builder: Methode to transform element in other, for example: compile a cpp in object file, or object files in binary.
- System: Many OS manage basic element contain in the OS, This part permit to find generic module availlable in the system.
Module:
=======
When you use lutin, you migth first create a module, This is the basis of the framework. It permit to describe your "module", all it contain, and the deendency.
We can separate a module in some part:
- Binary:
* A binary is an end point element.
* It can be transform in a complete standalone bundle, or in an part installable.
- Library:
* This represent an element that is used by other application
Target:
=======
A target represent the "board" to build the module, we can separate MacOs, IOs, Linux ... and all platform that exist
You can generate a new one or use satandard that are provided
Builder:
========
By default lustin manage many methode to build element like cpp, java, asm files ...
System:
=======
This element provide all elements availlable in the Linux distribution.
**Index:**
- @ref mainpage
- @ref lutin_concept
- @ref lutin_use
- @ref lutin_module

229
doc/020_Compile_a_module.md Normal file
View File

@ -0,0 +1,229 @@
How to use lutin {#lutin_use}
================
@tableofcontents
Lutin permit simply to compile applications and library.
To simply understand the use, we will use a simple library:
```{.sh}
git clone http://github.con/atria-soft/etk.git
```
compile a module: {#lutin_use_compile}
=================
It is really simple:
```{.sh}
lutin yourModuleName
#example:
lutin etk
```
Option working: {#lutin_use_options}
===============
Lutin have a complex option methodologie. We can consider 3 part of the option:
- global option
- target option
- modules
Global options: {#lutin_use_options_global}
---------------
Globals option is parse first and manage global setting of the build (not specific of a target)
this keep the last value config set
Display help: {#lutin_use_options_help}
-------------
Availlable everywhere ...
```{.sh}
lutin -h
lutin --help
```
You can see in this help that it take a litle time to react.
The first time you run lutin, it parse all the file in your sub-directory.
But the system(OS) keep the data in cash, then the next time it is faster.
At the end of the help you an see an help about the etk librery with the associated help.
Build in color: {#lutin_use_options_color}
---------------
```{.sh}
lutin -C
lutin --color
```
Display build line in pretty print mode: {#lutin_use_options_pretty}
----------------------------------------
when an error apear, the gcc or clang compile line can be really unreadable:
```{.sh}
g++ -o /home/heero/dev/plop/out/Linux_x86_64/release/build/gcc/etk/obj/etk/Color.cpp.o -I/home/heero/dev/plop/etk -std=c++11 -D__CPP_VERSION__=2011 -D__TARGET_OS__Linux -D__TARGET_ARCH__x86 -D__TARGET_ADDR__64BITS -D_REENTRANT -DNDEBUG -O3 -fpic -D__STDCPP_GNU__ -Wall -Wsign-compare -Wreturn-type -Wno-write-strings -Woverloaded-virtual -Wnon-virtual-dtor -Wno-unused-variable -DMODE_RELEASE -c -MMD -MP /home/heero/dev/plop/etk/etk/Color.cpp
```
whith this option you can transform this not obvious line in a readable line:
```{.sh}
lutin -P
lutin --pretty
```
result:
```{.sh}
g++ \
-o /home/XXX/dev/out/Linux_x86_64/release/build/gcc/etk/obj/etk/Color.cpp.o \
-I/home/XXX/dev/etk \
-std=c++11 \
-D__CPP_VERSION__=2011 \
-D__TARGET_OS__Linux \
-D__TARGET_ARCH__x86 \
-D__TARGET_ADDR__64BITS \
-D_REENTRANT \
-DNDEBUG \
-O3 \
-fpic \
-D__STDCPP_GNU__ \
-Wall \
-Wsign-compare \
-Wreturn-type \
-Wno-write-strings \
-Woverloaded-virtual \
-Wnon-virtual-dtor \
-Wno-unused-variable \
-DMODE_RELEASE \
-c \
-MMD \
-MP \
/home/XXX/dev/etk/etk/Color.cpp
```
lutin log: {#lutin_use_options_log}
----------
Lutin have an internal log system. To enable or disable it just select your debug level with the option:
```{.sh}
lutin -v4
lutin --verbose 4
```
The level availlables are:
- 0: None
- 1: error
- 2: warning (default)
- 3: info
- 4: debug
- 5: verbose
- 6: extreme_verbose
Select the number of CPU core used: {#lutin_use_options_cpu}
-----------------------------------
By default lutin manage only 1 CPU core (faster to debug) but for speed requirement you can use use multiple core:
```{.sh}
#for 5 core
lutin -j5
lutin --jobs 5
```
Force rebuild all: {#lutin_use_options_rebuild_force}
------------------
Sometime it is needed to rebuild all the program, just do:
```{.sh}
lutin -B
lutin --force-build
# or remove the build directory
rm -rf out/
```
Force strip all library and programs: {#lutin_use_options_strip}
-------------------------------------
Force strip of output binary (remove symboles)
```{.sh}
lutin -s
lutin --force-strip
```
Manage Cross compilation: {#lutin_use_options_cross_compile}
=========================
The main objective of lutin is managing the cross compilation to build from linux to other platform:
For android you can use:
```{.sh}
lutin -t Android your-module
lutin -t Windows your-module
```
Build in debug mode: {#lutin_use_options_debug_release}
====================
To developp it is fasted with debug tools
```{.sh}
lutin -m debug your-module
lutin -m release your-module
```
You can desire to have compilation optimisation when you build in debug mode:
```{.sh}
lutin -m debug --force-optimisation your-module
```
Execute your program after building it: {#lutin_use_options_execute}
=======================================
You can execute some action in a single line for a module:
```bash
lutin -m debug your-module?clean?build?run:--run-option1:--run-option2
```
Why use ```?run``` istead of direct calling the binary?
This is simple: you does nok knoww where the binary is installed... when you build for linux in debug it will be set in ```out/Linux_x86_64/debug/staging/clang/edn/edn.app/``` for edn application.
Note that the path is distinct for gcc/clang, debug/release, Linux/windows/Android/..., 64/32 bits, and for every applications ...
Then it is really easy to run the wrong binary.
Install your program after building it: {#lutin_use_options_install}
=======================================
You can install your build module:
```{.sh}
lutin -m debug your-module?build?install
```
This option is not availlablke on all platform ...
**Index:**
- @ref mainpage
- @ref lutin_concept
- @ref lutin_use
- @ref lutin_module

View File

@ -0,0 +1,504 @@
Create a new Module: {#lutin_module}
====================
@tableofcontents
Base of the module file: {#lutin_module_base_file}
========================
To create a new module you will use a generic naming:
```{.sh}
lutin_module-name.py
```
Replace your ``module-name`` with the delivery you want. The name can contain [a-zA-Z0-9\-_] values.
In the module name you must define some values:
```{.py}
#!/usr/bin/python
import lutin.module as module
import lutin.tools as tools
# A simple list of type:
# - BINARY
# - BINARY_SHARED
# - BINARY_STAND_ALONE
# - LIBRARY
# - LIBRARY_DYNAMIC
# - LIBRARY_STATIC
# - PACKAGE
# - PREBUILD
# - DATA
def get_type():
return "LIBRARY"
# simple description of the module that appear in the 'lutin -h'
# Note: this fucntion is optionnal.
def get_desc():
return "Ewol tool kit"
# type of licence:
# "APACHE-2"
# "BSD-1" / "BSD-2" / "BSD-3" / "BSD-4"
# "GPL-1" / "GPL-2" / "GPL-3"
# "LGPL-1" / "LGPL-2" / "LGPL-3"
# "MPL-1" / "MPL-1.1" / "MPL-2"
# PROPRIETARY
# ...
# Note: this fucntion is optionnal.
def get_licence():
return "APACHE-2"
# type of compagny that provide the software:
# com : Commercial
# net : Network??
# org : Organisation
# gov : Governement
# mil : Military
# edu : Education
# pri : Private
# museum : ...
# ...
# Note: this fucntion is optionnal.
def get_compagny_type():
return "com"
# Name of the compagny
# Note: this fucntion is optionnal.
def get_compagny_name():
return "hello-compagny"
# People to contact if a problem appear in the build system / library
# Note: this fucntion is optionnal.
def get_maintainer():
return ["Mr NAME SurName <my-email@group.com>"]
# Version of the library
# Note: this fucntion is optionnal.
def get_version():
return [0,9,"dev"]
# create the module
# @param[in] target reference on the Target that is currently build
# @param[in] my_module Module handle that migh be configured
# @return True The module is welled configure
# @return False The module is Not availlable (for this target or ...)
def configure(target, my_module):
...
return True
```
Thes it is simple to specify build for:
Create a new Module (LIBRARY): {#lutin_module_library}
==============================
What to change:
```{.py}
def get_type():
return "LIBRARY"
```
By default the library is compile in shared and static. The binary select the mode it prefer...
You can force the library to be compile as a dll/so: ```LIBRARY_DYNAMIC``` or a basic include lib: .a ```LIBRARY_STATIC```
Create a new Module (BINARY): {#lutin_module_binary}
=============================
Generic Binary: {#lutin_module_binary_base}
---------------
What to change:
```{.py}
def get_type():
return "BINARY"
```
The Binay is compile by default target mode (note that the IOs target generate a single .so with all the library inside)
You can force the Binary to be use dynamic library when possible: ```BINARY_SHARED``` or create a single binary with no .so depenency: ```BINARY_STAND_ALONE```
Create a new Module (TEST-BINARY / TOOL-BINARY): {#lutin_module_binary_tools}
------------------------------------------------
Two binary are really usefull in developpement, the tools and the test-unit, This is the reason why we specify for this 2 cases.
Add the subElement description:
```{.py}
def get_type():
return "BINARY"
def get_sub_type():
return "TEST"
```
or:
```{.py}
def get_type():
return "BINARY"
def get_sub_type():
return "TOOL"
```
Create a new Module (DATA): {#lutin_module_data}
===========================
This pode permit to only copy data and no dependency with compilling system
What to change:
```{.py}
def get_type():
return "DATA"
```
Module internal specifications: {#lutin_module_internal}
===============================
Add file to compile: {#lutin_module_internal_compile}
--------------------
This is simple: (you just need to specify all the file to compile)
```{.py}
def configure(target, my_module):
...
# add the file to compile:
my_module.add_src_file([
'module-name/file1.cpp',
'module-name/file2.cpp',
'module-name/file3.S'
])
...
```
Include directory & install header: {#lutin_module_internal_header}
-----------------------------------
A big point to understand is that your library will be used by an other module, then it need to use headers.
The developper must isolate the external include and internal include, then lutin "install" the header and add the "install" header path to build the local library.
This permit to check error inclusion directly in developpement and separate the ```#include "XXX.h"``` and the ```#include <lib-xxx/XXX.h>```
Add file to external include:
```{.py}
def configure(target, my_module):
...
my_module.add_header_file([
'module-name/file1.h',
'module-name/file2.h'
])
...
```
You can add a path to your local include:
```{.py}
def configure(target, my_module):
...
my_module.add_path(os.path.join(tools.get_current_path(__file__), "lib-name"))
...
```
Add Sub-dependency: {#lutin_module_internal_depend}
-------------------
All library need to add at minimum of a simple library (C lib) and other if needed. To do it jus call:
```{.py}
def configure(target, my_module):
...
# add dependency of the generic C library:
my_module.add_depend('c')
# add dependency of the generic C++ library:
my_module.add_depend('cxx')
# add dependency of the generic math library:
my_module.add_depend('m')
# or other user lib:
my_module.add_depend('lib-name')
...
```
The system can have optinnal sub-library, then if you just want to add an optionnal dependency:
```{.py}
def configure(target, my_module):
...
# Add an optionnal dependency (set flag in CPP build if the subLib exist) ==> flag is locally set
my_module.add_optionnal_depend('z', ["c++", "-DLIB_NAME_BUILD_ZLIB"])
# Add an optionnal dependency (set flag in CPP build if the subLib exist) ==> flag is exported in external upper build
my_module.add_optionnal_depend('z', ["c++", "-DLIB_NAME_BUILD_ZLIB"], export=True)
...
```
Compilation adn link flags/libs: {#lutin_module_internal_flag}
--------------------------------
It is possible to define local and external flags (external are set internal too):
```{.py}
def configure(target, my_module):
...
# external flags:
my_module.add_flag('link-lib', "pthread", export=True)
my_module.add_flag('c++', "-DHELLO_FLAG=\"kljlkj\"", export=True)
# internal flags:
my_module.add_flag('c', "-DMODE_RELEASE")
...
```
build mode (release/debug): {#lutin_module_internal_target_mode}
---------------------------
To add somes element dependent of the build mode:
```{.py}
def configure(target, my_module):
...
if target.get_mode() == "release":
pass
else:
pass
...
```
build type target: {#lutin_module_internal_target_type}
------------------
To add somes element dependent of the target type:
```{.py}
def configure(target, my_module):
...
if "Windows" in target.get_type():
pass
elif "MacOs" in target.get_type():
pass
elif "IOs" in target.get_type():
pass
elif "Linux" in target.get_type():
pass
elif "Android" in target.get_type():
pass
...
```
The target get_type return a list of type that represent the hiararchy dependency, a simple example:
A "Debian" herited of a "Linux" then it will return ["Linux", "Debian"]
Add some data in the install path (share path): {#lutin_module_internal_data}
-----------------------------------------------
You can install a simple file:
```{.py}
def configure(target, my_module):
...
# copy file in the share/binanyName/ path (no sub path)
my_module.copy_path('data/icon.svg')
...
```
Copy multiple files (change path)
```{.py}
def configure(target, my_module):
...
my_module.copy_path('data/*', 'destinationPath')
...
```
display some debug to help writing code: {#lutin_module_internal_write_log}
----------------------------------------
```{.py}
import lutin.debug as debug
def function(...):
debug.error("comment that stop the build")
debug.warning("comment that print a simple warning")
debug.info("comment that print a simple information")
debug.debug("comment that print a simple debug")
debug.verbose("comment that print a simple verbose")
```
A Full template: {#lutin_module_full_template}
================
Create the file:
```{.sh}
lutin_module-name.py
```
With:
```{.py}
#!/usr/bin/python
import lutin.module as module
import lutin.tools as tools
import lutin.debug as debug
import os
# A simple list of type:
# - BINARY
# - BINARY_SHARED
# - BINARY_STAND_ALONE
# - LIBRARY
# - LIBRARY_DYNAMIC
# - LIBRARY_STATIC
# - PACKAGE
# - PREBUILD
# - DATA
def get_type():
return "LIBRARY"
# simple description of the module that appear in the 'lutin -h'
# Note: this fucntion is optionnal.
def get_desc():
return "Descriptiuon of the PROGRAMM"
# type of licence:
# "APACHE-2"
# "BSD-1" / "BSD-2" / "BSD-3" / "BSD-4"
# "GPL-1" / "GPL-2" / "GPL-3"
# "LGPL-1" / "LGPL-2" / "LGPL-3"
# "MPL-1" / "MPL-1.1" / "MPL-2"
# PROPRIETARY
# ...
# Note: this fucntion is optionnal.
def get_licence():
return "PROPRIETARY"
# type of compagny that provide the software:
# com : Commercial
# net : Network??
# org : Organisation
# gov : Governement
# mil : Military
# edu : Education
# pri : Private
# museum : ...
# ...
# Note: this fucntion is optionnal.
def get_compagny_type():
return "com"
# Name of the compagny
# Note: this fucntion is optionnal.
def get_compagny_name():
return "hello-compagny"
# People to contact if a problem appear in the build system / library
# Note: this fucntion is optionnal.
def get_maintainer():
return ["Mr NAME SurName <my-email@group.com>"]
# return "authors.txt"
# Version of the library
# Note: this fucntion is optionnal.
def get_version():
return [0,1,"dev"]
# return "version.txt"
# create the module
# @param[in] target reference on the Target that is currently build
# @param[in] my_module Module handle that migh be configured
# @return True The module is welled configure
# @return False The module is Not availlable (for this target or ...)
def configure(target, my_module):
# add the file to compile:
my_module.add_src_file([
'module-name/file1.cpp',
'module-name/file2.cpp',
'module-name/file3.S'
])
my_module.add_header_file([
'module-name/file1.h',
'module-name/file2.h'
])
my_module.add_path(os.path.join(tools.get_current_path(__file__), "lib-name"))
# add dependency of the generic C library:
my_module.add_depend('c')
# add dependency of the generic C++ library:
my_module.add_depend('cxx')
# add dependency of the generic math library:
my_module.add_depend('m')
# or other user lib:
my_module.add_depend([
'lib-name1',
'lib-name2'
])
# Add an optionnal dependency (set flag in CPP build if the subLib exist) ==> flag is locally set
my_module.add_optionnal_depend('z', ["c++", "-DLIB_NAME_BUILD_ZLIB"])
# Add an optionnal dependency (set flag in CPP build if the subLib exist) ==> flag is exported in external upper build
my_module.add_optionnal_depend('z', ["c++", "-DLIB_NAME_BUILD_ZLIB"], export=True)
# external flags:
my_module.add_flag('link-lib', "pthread", export=True)
my_module.add_flag('c++', "-DHELLO_FLAG=\"kljlkj\"", export=True)
# internal flags:
my_module.add_flag('c', "-DMODE_RELEASE")
if target.get_mode() == "release":
pass
else:
pass
if "Windows" in target.get_type():
pass
elif "MacOs" in target.get_type():
pass
elif "IOs" in target.get_type():
pass
elif "Linux" in target.get_type():
pass
elif "Android" in target.get_type():
pass
# copy file in the share/binanyName/ path (no sub path)
my_module.copy_path('data/icon.svg')
my_module.copy_path('data/*', 'destinationPath')
# Return True if the module is compatible with the target or ...
return True
```
**Index:**
- @ref mainpage
- @ref lutin_concept
- @ref lutin_use
- @ref lutin_module

112
doc/100_Use_on_Ios.md Normal file
View File

@ -0,0 +1,112 @@
Build and deploy for IOS {#lutin_ios}
========================
@tableofcontents
Deploy on IOs is a little complicated, due to the fact Apple demand a developper licence.
To deploy you need to buy a [developper licence](https://developer.apple.com/account) nearly 99€ / year
Step 1: deploy your application with Xcode {#lutin_ios_xcode}
==========================================
it can be conplicated to do the first deploy (register tablette:watch ... or user ...)
Then the best way is now to create your first game sample application with XCode and deploy it on your device ...
when all your problem are solved, I can help you...
**Note:**
```
To add a device, in xcode select your top project, and in the section "signing" select "automatic manage signing", select your team and activate your device ...
```
step 2: Build for IOs {#lutin_ios_build}
=====================
This step is simpliest... All is integrated:
Select the target IOs
```{.sh}
lutin -C -D -tIOs yourApplication?build
```
This is done .... now deploy ...
step 3: Deploy {#lutin_ios_deploy}
==============
Do it ... it does not work ...
```{.sh}
lutin -C -D -tIOs yourApplication?install
```
Application ID
--------------
It miss some things to do:
create a reference of you application in [apple interface](https://developer.apple.com/account/ios/identifier/bundle/create)
your application id is:
```{.py}
get_compagny_type() + "." + get_compagny_name() + "." + module.get_name()
```
For example if you module is named: ```lutin_application.py```
And you set description:
```{.py}
def get_compagny_type():
return "com"
def get_compagny_name():
return "compagny NAME"
```
your id is: ```com.compagnyname.application```
When you have create the application, it will generate for you a unique ID, you can see it on the webpage, it is like: ```DFGDSFGSDFGS.com.compagnyname.application```
In your module definition you need to add:
```{.py}
my_module.set_pkg("APPLE_APPLICATION_IOS_ID", "DFGDSFGSDFGS");
```
Team signing ID
---------------
the second point to do is creating the file: ```.iosKey.txt``` in you root path of your workspace (where you execute lutin)
it will contain sothing like:
```
'iPhone Developer: Francis DUGENOUX (YRRQE5KGTH)'
```
you can optain it with executing:
```{.sh}
certtool y | grep "Developer"
```
Install:
--------
Now it works ...
```{.sh}
lutin -C -D -tIOs yourApplication?build
```

15
doc/101_Use_on_Android.md Normal file
View 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

144
doc/mainpage.md Normal file
View File

@ -0,0 +1,144 @@
Lutin Build system {#mainpage}
==================
@tableofcontents
`lutin` is a generic builder and package maker is a FREE software tool.
![Py package](https://badge.fury.io/py/lutin.png) https://pypi.python.org/pypi/lutin
Release (master) {#lutin_mainpage_build_master}
================
![Build Status](https://travis-ci.org/HeeroYui/lutin.svg?branch=master) https://travis-ci.org/HeeroYui/lutin
Developement (dev) {#lutin_mainpage_build_dev}
==================
![Build Status](https://travis-ci.org/HeeroYui/lutin.svg?branch=dev) https://travis-ci.org/HeeroYui/lutin
What is Lutin? {#lutin_mainpage_intro}
==============
Lutin is an application/library builder, it is designed to concurence CMake, Makefile, Ant, graddle ...
Lutin is deveopped in Python 2.x and 3.x to permit many user to play with it.
Python permit to Lutin to be used in many environement in a fast way.
Lutin support can compile every thing you want, just add a builder that you need (not in the common way). Basicly Lutin support languages:
- C (ainsi/89/99) ==> .o;
- C++ (98/99/03/11/14/...) ==> .o;
- .S (assembleur) ==> .o;
- .java ==> .class;
- .class ==> jar;
- .o ==> .a;
- .o ==> .so;
- .o/.a ==> binary.
Some packege can be generate for some platform:
- debian package;
- windows application zip;
- MacOs application .app;
- iOs package;
- Android Package .apk.
Compilation is availlable for:
- gcc/g++;
- clang/clang++.
Manage **workspace build** (in oposition of CMake/make/...)
Install: {#lutin_mainpage_installation}
========
Requirements: ``Python >= 2.7`` and ``pip``
Install lutin:
--------------
Just run:
```{.sh}
pip install lutin
```
Install pip:
------------
Install pip on debian/ubuntu:
```{.sh}
sudo apt-get install pip
```
Install pip on ARCH-linux:
```{.sh}
sudo pacman -S pip
```
Install pip on MacOs:
```{.sh}
sudo easy_install pip
```
Install from sources:
---------------------
```{.sh}
git clone http://github.com/HeeroYui/lutin.git
cd lutin
sudo ./setup.py install
```
git repository {#lutin_mainpage_repository}
==============
http://github.com/HeeroYui/lutin/
Tutorals: {#lutin_mainpage_tutorial}
=========
- @ref lutin_concept
- @ref lutin_use
- @ref lutin_module
- @ref lutin_ios
License (MPL v2.0) {#lutin_mainpage_licence}
=====================
Copyright lutin Edouard DUPIN
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
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,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
History: {#lutin_mainpage_history}
========
I work with some builder, Every one have theire own adventages, and their problems.
The main point I see, is that the polimorphisme of the worktree is really hard.
The second point is the generation on different platforms is hard too.
Some other problem example:
- Makefile is too slow on windows mingw;
- Cmake does not create end point package;
- none is really simple to write.
Then I create a simple interface that manage all I need. and written in python to permit to be faster on every platform.
[link macos account developper](https://developer.apple.com/library/content/documentation/IDEs/Conceptual/AppStoreDistributionTutorial/AddingYourAccounttoXcode/AddingYourAccounttoXcode.html)

35
doxy_lutin.py Normal file
View File

@ -0,0 +1,35 @@
#!/usr/bin/python
import os
import doxy.module as module
import doxy.debug as debug
import doxy.tools as tools
def create(target, module_name):
my_module = module.Module(__file__, module_name)
my_module.set_version([2,2,0])
my_module.set_title("lutin: build system and packager")
my_module.set_website("http://HeeroYui.github.io/" + module_name)
my_module.set_website_sources("http://github.com/HeeroYui/" + module_name)
my_module.add_path([
module_name,
"doc"
])
my_module.add_exclude_symbols([
'_*',
'lutinTarget_*',
'lutinSystem_*',
'lutinBuilder_*',
])
my_module.add_file_patterns([
#'*.py',
'builder.py',
'debug.py',
'env.py',
'host.py',
'module.py',
'system.py',
'target.py',
'*.md',
])
return my_module

View File

@ -1,47 +1,157 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @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
if is_init == False:
def filter_name_and_file(root, list_files, filter):
# filter elements:
tmp_list = fnmatch.filter(list_files, filter)
out = []
for elem in tmp_list:
if os.path.isfile(os.path.join(root, elem)) == True:
out.append(elem);
return out;
def filter_path(root, list_files):
out = []
for elem in list_files:
if len(elem) == 0 \
or elem[0] == '.':
continue
if os.path.isdir(os.path.join(root, elem)) == True:
out.append(elem);
return out;
def import_path_local(path, limit_sub_folder, exclude_path = [], base_name = ""):
out = []
debug.verbose("lutin files: " + str(path) + " [START]")
if limit_sub_folder == 0:
debug.debug("Subparsing limitation append ...")
return []
try:
list_files = os.listdir(path)
except:
# an error occure, maybe read error ...
debug.warning("error when getting subdirectory of '" + str(path) + "'")
return []
if path in exclude_path:
debug.debug("find '" + str(path) + "' in exclude_path=" + str(exclude_path))
return []
# filter elements:
tmp_list_lutin_file = filter_name_and_file(path, list_files, base_name + "*.py")
debug.verbose("lutin files: " + str(path) + " : " + str(tmp_list_lutin_file))
# Import the module:
for filename in tmp_list_lutin_file:
out.append(os.path.join(path, filename))
debug.extreme_verbose(" Find a file : '" + str(out[-1]) + "'")
need_parse_sub_folder = True
rm_value = -1
# check if we need to parse sub_folder
if len(tmp_list_lutin_file) != 0:
need_parse_sub_folder = False
# check if the file "lutin_parse_sub.py" is present ==> parse SubFolder (force and add +1 in the resursing
if base_name + "ParseSubFolders.txt" in list_files:
debug.debug("find SubParser ... " + str(base_name + "ParseSubFolders.txt") + " " + path)
data_file_sub = tools.file_read_data(os.path.join(path, base_name + "ParseSubFolders.txt"))
if data_file_sub == "":
debug.debug(" Empty file Load all subfolder in the worktree in '" + str(path) + "'")
need_parse_sub_folder = True
rm_value = 0
else:
list_sub = data_file_sub.split("\n")
debug.debug(" Parse selected folders " + str(list_sub) + " no parse local folder directory")
need_parse_sub_folder = False
for folder in list_sub:
if folder == "" \
or folder == "/":
continue;
tmp_out = import_path_local(os.path.join(path, folder),
1,
exclude_path,
base_name)
# add all the elements:
for elem in tmp_out:
out.append(elem)
if need_parse_sub_folder == True:
list_folders = filter_path(path, list_files)
for folder in list_folders:
tmp_out = import_path_local(os.path.join(path, folder),
limit_sub_folder - rm_value,
exclude_path,
base_name)
# add all the elements:
for elem in tmp_out:
out.append(elem)
return out
def init():
global is_init;
if is_init == True:
return
debug.verbose("Use Make as a make stadard")
sys.path.append(tools.get_run_folder())
builder.import_path(tools.get_current_path(__file__))
module.import_path(tools.get_current_path(__file__))
system.import_path(tools.get_current_path(__file__))
target.import_path(tools.get_current_path(__file__))
debug.debug("missing file lutinBase.py ==> loading subPath...");
sys.path.append(tools.get_run_path())
# create the list of basic folder:
basic_folder_list = []
basic_folder_list.append([tools.get_current_path(__file__), True])
# Import all sub path without out and archive
for folder in os.listdir("."):
if os.path.isdir(folder)==True:
if folder.lower()!="android" \
and folder.lower()!="archive" \
and folder.lower()!="out" :
debug.debug("Automatic load path: '" + folder + "'")
builder.import_path(folder)
module.import_path(folder)
system.import_path(folder)
target.import_path(folder)
for elem_path in os.listdir("."):
if os.path.isdir(elem_path) == False:
continue
if elem_path.lower() == "android" \
or elem_path == "out" :
continue
debug.debug("Automatic load path: '" + elem_path + "'")
basic_folder_list.append([elem_path, False])
# create in a single path the basic list of lutin files (all start with lutin and end with .py)
exclude_path = env.get_exclude_search_path()
limit_sub_folder = env.get_parse_depth()
list_of_lutin_files = []
for elem_path, is_system in basic_folder_list:
if is_system == True:
limit_sub_folder_tmp = 999999
else:
limit_sub_folder_tmp = limit_sub_folder
tmp_out = import_path_local(elem_path,
limit_sub_folder_tmp,
exclude_path,
env.get_build_system_base_name())
# add all the elements:
for elem in tmp_out:
list_of_lutin_files.append(elem)
debug.debug("Files specific lutin: ")
for elem_path in list_of_lutin_files:
debug.debug(" " + elem_path)
# simply import element from the basic list of files (single parse ...)
builder.import_path(list_of_lutin_files)
module.import_path(list_of_lutin_files)
system.import_path(list_of_lutin_files)
target.import_path(list_of_lutin_files)
macro.import_path(list_of_lutin_files)
builder.init()
is_init = True

View File

@ -1,258 +0,0 @@
#!/usr/bin/python
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license APACHE v2.0 (see license file)
##
import sys
# Local import
from . import debug
class ArgElement:
def __init__(self, option, value=""):
self.m_option = option;
self.m_arg = value;
def get_option_nName(self):
return self.m_option
def get_arg(self):
return self.m_arg
def display(self):
if len(self.m_arg)==0:
debug.info("option : " + self.m_option)
elif len(self.m_option)==0:
debug.info("element : " + self.m_arg)
else:
debug.info("option : " + self.m_option + ":" + self.m_arg)
class ArgDefine:
def __init__(self,
smallOption="", # like v for -v
bigOption="", # like verbose for --verbose
list=[], # ["val", "description"]
desc="",
haveParam=False):
self.m_optionSmall = smallOption;
self.m_optionBig = bigOption;
self.m_list = list;
if len(self.m_list)!=0:
self.m_haveParam = True
else:
if True==haveParam:
self.m_haveParam = True
else:
self.m_haveParam = False
self.m_description = desc;
def get_option_small(self):
return self.m_optionSmall
def get_option_big(self):
return self.m_optionBig
def need_parameters(self):
return self.m_haveParam
def get_porperties(self):
return ""
def check_availlable(self, argument):
if len(self.m_list)==0:
return True
for element,desc in self.m_list:
if element == argument:
return True
return False
def display(self):
if self.m_optionSmall != "" and self.m_optionBig != "":
print(" -" + self.m_optionSmall + " / --" + self.m_optionBig)
elif self.m_optionSmall != "":
print(" -" + self.m_optionSmall)
elif self.m_optionBig != "":
print(" --" + self.m_optionBig)
else:
print(" ???? ==> internal error ...")
if self.m_description != "":
print(" " + self.m_description)
if len(self.m_list)!=0:
hasDescriptiveElement=False
for val,desc in self.m_list:
if desc!="":
hasDescriptiveElement=True
break;
if hasDescriptiveElement==True:
for val,desc in self.m_list:
print(" " + val + " : " + desc)
else:
tmpElementPrint = ""
for val,desc in self.m_list:
if len(tmpElementPrint)!=0:
tmpElementPrint += " / "
tmpElementPrint += val
print(" { " + tmpElementPrint + " }")
def parse(self, argList, currentID):
return currentID;
class ArgSection:
def __init__(self,
sectionName="",
desc=""):
self.m_section = sectionName;
self.m_description = desc;
def get_option_small(self):
return ""
def get_option_big(self):
return ""
def get_porperties(self):
return " [" + self.m_section + "]"
def display(self):
print(" [" + self.m_section + "] : " + self.m_description)
def parse(self, argList, currentID):
return currentID;
class LutinArg:
def __init__(self):
self.m_listProperties = []
def add(self, argument):
self.m_listProperties.append(argument) #ArgDefine(smallOption, bigOption, haveParameter, parameterList, description));
def add_section(self, sectionName, sectionDesc):
self.m_listProperties.append(ArgSection(sectionName, sectionDesc))
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.m_listProperties:
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.m_listProperties:
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;
def display(self):
print("usage:")
listOfPropertiesArg = "";
for element in self.m_listProperties :
listOfPropertiesArg += element.get_porperties()
print(" " + sys.argv[0] + listOfPropertiesArg + " ...")
for element in self.m_listProperties :
element.display()

View File

@ -1,10 +1,11 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @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
@ -12,8 +13,9 @@ import inspect
import fnmatch
import datetime
# Local import
from . import debug
from realog import debug
from . import heritage
from . import env
##
## constitution of dictionnary:
@ -23,28 +25,45 @@ from . import heritage
## - "builder": pointer on the element
##
builder_list=[]
__start_builder_name="lutinBuilder_"
__start_builder_name="Builder_"
def import_path(path):
##
## @brief Import all File that start with env.get_build_system_base_name() + __start_builder_name + XXX and register in the list of Builder
## @param[in] path_list ([string,...]) List of file that start with env.get_build_system_base_name() in the running worktree (Parse one time ==> faster)
##
def import_path(path_list):
global builder_list
matches = []
debug.debug('BUILDER: Start find sub File : "%s"' %path)
for root, dirnames, filenames in os.walk(path):
tmpList = fnmatch.filter(filenames, __start_builder_name + "*.py")
# Import the module :
for filename in tmpList:
debug.debug('BUILDER: Find a file : "%s"' %os.path.join(root, filename))
#matches.append(os.path.join(root, filename))
sys.path.append(os.path.dirname(os.path.join(root, filename)) )
builder_name = filename.replace('.py', '')
the_builder = __import__(builder_name)
builder_list.append({"name":builder_name,
"element":the_builder
})
debug.debug('BUILDER: type=' + the_builder.get_type() + " in=" + str(the_builder.get_input_type()) + " out=" + str(the_builder.get_output_type()))
global_base = env.get_build_system_base_name()
debug.debug("BUILDER: Init with Files list:")
for elem in path_list:
sys.path.append(os.path.dirname(elem))
# Get file name:
filename = os.path.basename(elem)
# Remove .py at the end:
filename = filename[:-3]
base_file_name = filename
# Remove global base name:
filename = filename[len(global_base):]
# Check if it start with the local patern:
if filename[:len(__start_builder_name)] != __start_builder_name:
debug.extreme_verbose("BUILDER: Integrate: '" + filename + "' from '" + elem + "' ==> rejected")
continue
# Remove local patern
builder_name = filename[len(__start_builder_name):]
debug.verbose("BUILDER: Integrate: '" + builder_name + "' from '" + elem + "'")
the_builder = __import__(base_file_name)
builder_list.append({"name":builder_name,
"element":the_builder
})
debug.debug('BUILDER: type=' + the_builder.get_type() + " in=" + str(the_builder.get_input_type()) + " out=" + str(the_builder.get_output_type()))
debug.verbose("List of BUILDER: ")
for elem in builder_list:
debug.verbose(" " + str(elem["name"]))
# we must have call all import before ...
##
## @brief All builder are common (no target or comilator dependency). We need to load all of them when start lutin
##
def init():
global builder_list
debug.debug('BUILDER: Initialize all ...')
@ -52,6 +71,10 @@ def init():
if element["element"] != None:
element["element"].init()
##
## @brief Get a builder tool with specifiying the input type (like cpp, S ...)
## @param[in] input_type (string) extention file that can be compile
##
def get_builder(input_type):
global builder_list
for element in builder_list:
@ -62,13 +85,16 @@ def get_builder(input_type):
debug.error("Can not find builder for type : '" + str(input_type) + "'")
raise ValueError('type error :' + str(input_type))
def get_builder_with_output(input_type):
##
## @brief Get a builder tool with specifiying the output type (like .exe, .jar ...)
## @param[in] input_type (string) extention file that can be generated
##
def get_builder_with_output(output_type):
global builder_list
for element in builder_list:
if element["element"] != None:
if input_type in element["element"].get_output_type():
if output_type in element["element"].get_output_type():
return element["element"]
# we can not find the builder ...
debug.error("Can not find builder for type : '" + str(input_type) + "'")
raise ValueError('type error :' + str(input_type))
debug.error("Can not find builder for type : '" + str(output_type) + "'")
raise ValueError('type error :' + str(output_type))

View File

@ -1,108 +0,0 @@
##
## Executable/binary builder
##
from lutin import multiprocess
from lutin import tools
from lutin import debug
from lutin import depend
from lutin import env
import os
##
## Initialize the builder, if needed ... to get dependency between builder (for example)
##
def init():
pass
##
## Get the current builder type.
## Return the type of builder
##
def get_type():
return "linker"
##
## @brief Get builder input file type
## @return List of extention supported
##
def get_input_type():
return ["o"]
##
## @brief Get builder output file type
## @return List of extention supported
##
def get_output_type():
return ["", "exe", "bin"]
##
## @brief Commands for running gcc to link an executable.
##
def link(file, binary, target, depancy, name, basic_folder):
file_src, file_dst, file_depend, file_cmd = target.generate_file(binary, name, basic_folder, file, "bin")
#create comdLine :
cmd = [
target.xx
]
try:
cmd.append(target.arch)
except:
pass
try:
cmd.append(target.sysroot)
except:
pass
try:
cmd.append(target.global_sysroot)
except:
pass
try:
cmd.append(["-o", file_dst])
except:
pass
try:
cmd.append(file_src)
except:
pass
try:
cmd.append(depancy.src)
except:
pass
try:
cmd.append(flags["local"]["link"])
except:
pass
try:
cmd.append(depancy.flags["link"])
except:
pass
try:
cmd.append(target.global_flags_ld)
except:
pass
cmdLine=tools.list_to_str(cmd)
# check the dependency for this file :
if depend.need_re_package(file_dst, file_src, True, file_cmd, cmdLine) == False \
and depend.need_re_package(file_dst, depancy.src, False, file_cmd, cmdLine) == False:
return file_dst
tools.create_directory_of_file(file_dst)
debug.print_element("Executable", name, "==>", file_dst)
multiprocess.run_command(cmdLine)
if target.config["mode"] == "release"\
or env.get_force_strip_mode() == True:
# get the file size of the non strip file
originSize = tools.file_size(file_dst);
debug.print_element("Executable(strip)", name, "", "")
cmdLineStrip=tools.list_to_str([
target.strip,
file_dst])
multiprocess.run_command(cmdLineStrip)
# get the stip size of the binary
stripSize = tools.file_size(file_dst)
debug.debug("file reduce size : " + str(originSize/1024) + "ko ==> " + str(stripSize/1024) + "ko")
# write cmd line only after to prevent errors ...
multiprocess.store_command(cmdLine, file_cmd)

View File

@ -1,136 +0,0 @@
##
## C builder
##
from lutin import multiprocess
from lutin import tools
from lutin import debug
from lutin import depend
# C version:
default_version = 1989
default_version_gnu = False
##
## Initialize the builder, if needed ... to get dependency between builder (for example)
##
def init():
pass
##
## Get the current builder type.
## Return the type of builder
##
def get_type():
return "compiler"
##
## @brief Get builder input file type
## @return List of extention supported
##
def get_input_type():
return ["c", "C"]
##
## @brief Get builder output file type
## @return List of extention supported
##
def get_output_type():
return ["o"]
##
## @brief Commands for running gcc to compile a C file in object file.
##
def compile(file, binary, target, depancy, flags, path, name, basic_folder):
file_src, file_dst, file_depend, file_cmd = target.file_generate_object(binary, name, basic_folder,file)
# create the command line befor requesting start:
cmd = [
target.cc,
"-o", file_dst,
target.arch,
target.sysroot,
target.global_include_cc]
try:
cmd.append(tools.add_prefix("-I", path["export"]))
except:
pass
try:
cmd.append(tools.add_prefix("-I", path["local"]))
except:
pass
try:
cmd.append(tools.add_prefix("-I", depancy.path))
except:
pass
try:
cmd.append(get_version_compilation_flags(flags, depancy.flags))
except:
pass
try:
cmd.append(target.global_flags_cc)
except:
pass
try:
cmd.append(depancy.flags["c"])
except:
pass
try:
cmd.append(flags["local"]["c"])
except:
pass
try:
cmd.append(flags["export"]["c"])
except:
pass
cmd.append("-c")
cmd.append("-MMD")
cmd.append("-MP")
cmd.append(file_src)
# Create cmd line
cmdLine=tools.list_to_str(cmd)
# check the dependency for this file :
if depend.need_re_build(file_dst, file_src, file_depend, file_cmd, cmdLine) == False:
return file_dst
tools.create_directory_of_file(file_dst)
comment = ["c", name, "<==", file]
# process element
multiprocess.run_in_pool(cmdLine, comment, file_cmd)
return file_dst
def get_version_compilation_flags(flags, dependency_flags):
try:
version_local = flags["local"]["c-version"]["version"]
except:
version_local = default_version
try:
dependency_version = dependency_flags["c-version"]
except:
dependency_version = default_version
try:
is_gnu = flags["local"]["c-version"]["gnu"]
except:
is_gnu = default_version_gnu
version = max(version_local, dependency_version)
if version == 2011:
if is_gnu ==True:
out = ["-std=gnu11", "-D__C_VERSION__=2011"]
else:
out = ["-std=c11", "-D__C_VERSION__=1989"]
elif version == 1999:
if is_gnu ==True:
out = ["-std=gnu99", "-D__C_VERSION__=1999"]
else:
out = ["-std=c99", "-D__C_VERSION__=1989"]
elif version == 1990:
if is_gnu ==True:
out = ["-std=gnu90", "-D__C_VERSION__=1990"]
else:
out = ["-std=c90", "-D__C_VERSION__=1989"]
else:
if is_gnu ==True:
out = ["-std=gnu89", "-D__C_VERSION__=1989"]
else:
out = ["-std=c89", "-D__C_VERSION__=1989"]
return out

View File

@ -1,151 +0,0 @@
##
## C++ builder
##
from lutin import multiprocess
from lutin import tools
from lutin import debug
from lutin import depend
# C++ default version:
default_version = 1999
default_version_gnu = False
##
## Initialize the builder, if needed ... to get dependency between builder (for example)
##
def init():
pass
##
## Get the current builder type.
## Return the type of builder
##
def get_type():
return "compiler"
##
## @brief Get builder input file type
## @return List of extention supported
##
def get_input_type():
return ["cpp", "CPP", "cxx", "CXX", "xx", "XX", "CC", "cc"]
##
## @brief Get builder output file type
## @return List of extention supported
##
def get_output_type():
return ["o"]
##
## @brief Commands for running gcc to compile a C++ file in object file.
##
def compile(file, binary, target, depancy, flags, path, name, basic_folder):
file_src, file_dst, file_depend, file_cmd = target.file_generate_object(binary, name, basic_folder, file)
# create the command line befor requesting start:
cmd = [
target.xx,
"-o", file_dst,
target.arch,
target.sysroot,
target.global_include_cc
]
try:
cmd.append(tools.add_prefix("-I",path["export"]))
except:
pass
try:
cmd.append(tools.add_prefix("-I",path["local"]))
except:
pass
try:
cmd.append(tools.add_prefix("-I",depancy.path))
except:
pass
try:
cmd.append(get_version_compilation_flags(flags, depancy.flags))
except:
pass
try:
cmd.append(target.global_flags_cc)
except:
pass
try:
cmd.append(target.global_flags_xx)
except:
pass
try:
cmd.append(depancy.flags["c"])
except:
pass
try:
cmd.append(depancy.flags["c++"])
except:
pass
try:
cmd.append(flags["local"]["c"])
except:
pass
try:
cmd.append(flags["local"]["c++"])
except:
pass
try:
cmd.append(flags["export"]["c"])
except:
pass
try:
cmd.append(flags["export"]["c++"])
except:
pass
cmd.append(["-c", "-MMD", "-MP"])
cmd.append(file_src)
# Create cmd line
cmdLine=tools.list_to_str(cmd)
# check the dependency for this file :
if depend.need_re_build(file_dst, file_src, file_depend, file_cmd, cmdLine) == False:
return file_dst
tools.create_directory_of_file(file_dst)
comment = ["c++", name, "<==", file]
#process element
multiprocess.run_in_pool(cmdLine, comment, file_cmd)
return file_dst
def get_version_compilation_flags(flags, dependency_flags):
try:
version_local = flags["local"]["c++-version"]["version"]
except:
version_local = default_version
try:
dependency_version = dependency_flags["c++-version"]
except:
dependency_version = default_version
try:
is_gnu = flags["local"]["c++-version"]["gnu"]
except:
is_gnu = default_version_gnu
version = max(version_local, dependency_version)
if version == 2014:
debug.error("not supported flags for X14 ...");
if is_gnu == True:
out = ["-std=gnu++14", "-D__CPP_VERSION__=2014"]
else:
out = ["-std=c++14", "-D__CPP_VERSION__=2014"]
elif version == 2011:
if is_gnu == True:
out = ["-std=gnu++11", "-D__CPP_VERSION__=2011"]
else:
out = ["-std=c++11", "-D__CPP_VERSION__=2011"]
elif version == 2003:
if is_gnu == True:
out = ["-std=gnu++03", "-D__CPP_VERSION__=2003"]
else:
out = ["-std=c++03", "-D__CPP_VERSION__=2003"]
else:
if is_gnu == True:
out = ["-std=gnu++98", "-D__CPP_VERSION__=1999"]
else:
out = ["-std=c++98", "-D__CPP_VERSION__=1999"]
return out

View File

@ -1,34 +0,0 @@
##
## Java builder
##
from lutin import multiprocess
from lutin import tools
from lutin import debug
from lutin import depend
##
## Initialize the builder, if needed ... to get dependency between builder (for example)
##
def init():
pass
##
## Get the current builder type.
## Return the type of builder
##
def get_type():
return "compiler"
##
## @brief Get builder input file type
## @return List of extention supported
##
def get_input_type():
return ["java"]
##
## @brief Get builder output file type
## @return List of extention supported
##
def get_output_type():
return ["class"]

View File

@ -1,100 +0,0 @@
##
## Dynamic library builder
##
from lutin import multiprocess
from lutin import tools
from lutin import debug
from lutin import depend
from lutin import env
import os
##
## Initialize the builder, if needed ... to get dependency between builder (for example)
##
def init():
pass
##
## Get the current builder type.
## Return the type of builder
##
def get_type():
return "linker"
##
## @brief Get builder input file type
## @return List of extention supported
##
def get_input_type():
return ["o"]
##
## @brief Get builder output file type
## @return List of extention supported
##
def get_output_type():
return ["so", "dynlib", "dll"]
##
## @brief Commands for running gcc to link a shared library.
##
def link(file, binary, target, depancy, name, basic_folder):
file_src, file_dst, file_depend, file_cmd = target.generate_file(binary, name, basic_folder, file, "lib-shared")
#create command Line
cmd = [
target.xx,
"-o", file_dst
]
try:
cmd.append(target.global_sysroot)
except:
pass
try:
cmd.append(target.arch)
except:
pass
cmd.append("-shared")
try:
cmd.append(file_src)
except:
pass
try:
cmd.append(depancy.src)
except:
pass
try:
cmd.append(flags["local"]["link"])
except:
pass
try:
cmd.append(depancy.flags["link"])
except:
pass
try:
cmd.append(target.global_flags_ld)
except:
pass
cmdLine=tools.list_to_str(cmd)
# check the dependency for this file :
if depend.need_re_package(file_dst, file_src, True, file_cmd, cmdLine) == False \
and depend.need_re_package(file_dst, depancy.src, False, file_cmd, cmdLine) == False:
return tmpList[1]
tools.create_directory_of_file(file_dst)
debug.print_element("SharedLib", name, "==>", file_dst)
multiprocess.run_command(cmdLine)
# strip the output file:
if target.config["mode"] == "release" \
or env.get_force_strip_mode() == True:
# get the file size of the non strip file
originSize = tools.file_size(file_dst);
debug.print_element("SharedLib(strip)", name, "", "")
cmdLineStrip=tools.list_to_str([
target.strip,
file_dst])
multiprocess.run_command(cmdLineStrip)
# get the stip size of the binary
stripSize = tools.file_size(file_dst)
debug.debug("file reduce size : " + str(originSize/1024) + "ko ==> " + str(stripSize/1024) + "ko")
# write cmd line only after to prevent errors ...
multiprocess.store_command(cmdLine, file_cmd)
#debug.print_element("SharedLib", self.name, "==>", tmpList[1])

View File

@ -1,114 +0,0 @@
##
## Objective-C builder
##
from lutin import multiprocess
from lutin import tools
from lutin import builder
from lutin import debug
from lutin import depend
local_ref_on_builder_c = None
##
## Initialize the builder, if needed ... to get dependency between builder (for example)
##
def init():
global local_ref_on_builder_c
debug.debug("m builder get dependency on the C builder")
local_ref_on_builder_c = builder.get_builder("c")
##
## Get the current builder type.
## Return the type of builder
##
def get_type():
return "compiler"
##
## @brief Get builder input file type
## @return List of extention supported
##
def get_input_type():
return ["m", "M"]
##
## @brief Get builder output file type
## @return List of extention supported
##
def get_output_type():
return ["o"]
##
## @brief Commands for running gcc to compile a m file in object file.
##
def compile(file, binary, target, depancy, flags, path, name, basic_folder):
file_src, file_dst, file_depend, file_cmd = target.file_generate_object(binary, name, basic_folder, file)
# create the command line befor requesting start:
cmd = [
target.cc,
"-o", file_dst ,
target.arch,
target.sysroot,
target.global_include_cc]
try:
cmd.append(tools.add_prefix("-I",path["export"]))
except:
pass
try:
cmd.append(tools.add_prefix("-I",path["local"]))
except:
pass
try:
cmd.append(tools.add_prefix("-I",depancy.path))
except:
pass
try:
cmd.append(local_ref_on_builder_c.get_version_compilation_flags(flags, depancy.flags))
except:
pass
try:
cmd.append(target.global_flags_cc)
except:
pass
try:
cmd.append(target.global_flags_m)
except:
pass
try:
cmd.append(depancy.flags["c"])
except:
pass
try:
cmd.append(depancy.flags["m"])
except:
pass
try:
cmd.append(flags["local"]["c"])
except:
pass
try:
cmd.append(flags["local"]["m"])
except:
pass
try:
cmd.append(flags["export"]["c"])
except:
pass
try:
cmd.append(flags["export"]["m"])
except:
pass
cmd.append("-c -MMD -MP")
cmd.append("-x objective-c")
cmd.append(file_src)
# Create cmd line
cmdLine=tools.list_to_str(cmd)
# check the dependency for this file :
if False==depend.need_re_build(file_dst, file_src, file_depend, file_cmd, cmdLine):
return file_dst
tools.create_directory_of_file(file_dst)
comment = ["m", name, "<==", file]
#process element
multiprocess.run_in_pool(cmdLine, comment, file_cmd)
return file_dst

View File

@ -1,125 +0,0 @@
##
## Objective C++ builder
##
from lutin import multiprocess
from lutin import tools
from lutin import builder
from lutin import debug
from lutin import depend
local_ref_on_builder_cpp = None
##
## Initialize the builder, if needed ... to get dependency between builder (for example)
##
def init():
global local_ref_on_builder_cpp
debug.debug("mm builder get dependency on the CPP builder")
local_ref_on_builder_cpp = builder.get_builder("cpp")
##
## Get the current builder type.
## Return the type of builder
##
def get_type():
return "compiler"
##
## @brief Get builder input file type
## @return List of extention supported
##
def get_input_type():
return ["mm", "MM"]
##
## @brief Get builder output file type
## @return List of extention supported
##
def get_output_type():
return ["o"]
##
## @brief Commands for running gcc to compile a m++ file in object file.
##
def compile(file, binary, target, depancy, flags, path, name, basic_folder):
file_src, file_dst, file_depend, file_cmd = target.file_generate_object(binary, name, basic_folder, file)
# create the command line befor requesting start:
cmd = [
target.xx,
"-o", file_dst,
target.arch,
target.sysroot,
target.global_include_cc]
try:
cmd.append(tools.add_prefix("-I",path["export"]))
except:
pass
try:
cmd.append(tools.add_prefix("-I",path["local"]))
except:
pass
try:
cmd.append(tools.add_prefix("-I",depancy.path))
except:
pass
try:
cmd.append(local_ref_on_builder_cpp.get_version_compilation_flags(flags, depancy.flags))
except:
pass
try:
cmd.append(target.global_flags_cc)
except:
pass
try:
cmd.append(target.global_flags_mm)
except:
pass
try:
cmd.append(depancy.flags["c"])
except:
pass
try:
cmd.append(depancy.flags["c++"])
except:
pass
try:
cmd.append(depancy.flags["mm"])
except:
pass
try:
cmd.append(flags["local"]["c"])
except:
pass
try:
cmd.append(flags["local"]["c++"])
except:
pass
try:
cmd.append(flags["local"]["mm"])
except:
pass
try:
cmd.append(flags["export"]["c"])
except:
pass
try:
cmd.append(flags["export"]["c++"])
except:
pass
try:
cmd.append(flags["export"]["mm"])
except:
pass
cmd.append("-c -MMD -MP")
cmd.append("-x objective-c++")
cmd.append(file_src)
# Create cmd line
cmdLine=tools.list_to_str(cmd)
# check the dependency for this file :
if False==depend.need_re_build(file_dst, file_src, file_depend, file_cmd, cmdLine):
return file_dst
tools.create_directory_of_file(file_dst)
comment = ["m++", name, "<==", file]
#process element
multiprocess.run_in_pool(cmdLine, comment, file_cmd)
return file_dst

View File

@ -1,33 +0,0 @@
##
## ASM builder
##
from lutin import multiprocess
from lutin import tools
from lutin import depend
##
## Initialize the builder, if needed ... to get dependency between builder (for example)
##
def init():
pass
##
## Get the current builder type.
## Return the type of builder
##
def get_type():
return "compiler"
##
## @brief Get builder input file type
## @return List of extention supported
##
def get_input_type():
return ["s", "S"]
##
## @brief Get builder output file type
## @return List of extention supported
##
def get_output_type():
return ["o"]

View File

@ -1,141 +0,0 @@
#!/usr/bin/python
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license APACHE v2.0 (see license file)
##
import os
import threading
import re
debugLevel=3
debugColor=False
color_default= ""
color_red = ""
color_green = ""
color_yellow = ""
color_blue = ""
color_purple = ""
color_cyan = ""
debugLock = threading.Lock()
def set_level(id):
global debugLevel
debugLevel = id
#print "SetDebug level at " + str(debugLevel)
def get_level():
global debugLevel
return debugLevel
def enable_color():
global debugColor
debugColor = 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[34m"
global color_purple
color_purple = "\033[35m"
global color_cyan
color_cyan = "\033[36m"
def extreme_verbose(input, force=False):
global debugLock
global debugLevel
if debugLevel >= 6 \
or force == True:
debugLock.acquire()
print(color_blue + input + color_default)
debugLock.release()
def verbose(input, force=False):
global debugLock
global debugLevel
if debugLevel >= 5 \
or force == True:
debugLock.acquire()
print(color_blue + input + color_default)
debugLock.release()
def debug(input, force=False):
global debugLock
global debugLevel
if debugLevel >= 4 \
or force == True:
debugLock.acquire()
print(color_green + input + color_default)
debugLock.release()
def info(input, force=False):
global debugLock
global debugLevel
if debugLevel >= 3 \
or force == True:
debugLock.acquire()
print(input + color_default)
debugLock.release()
def warning(input, force=False):
global debugLock
global debugLevel
if debugLevel >= 2 \
or force == True:
debugLock.acquire()
print(color_purple + "[WARNING] " + input + color_default)
debugLock.release()
def error(input, threadID=-1, force=False, crash=True):
global debugLock
global debugLevel
if debugLevel >= 1 \
or force == True:
debugLock.acquire()
print(color_red + "[ERROR] " + input + color_default)
debugLock.release()
if crash==True:
from . import multiprocess
multiprocess.error_occured()
if threadID != -1:
threading.interrupt_main()
exit(-1)
#os_exit(-1)
#raise "error happend"
def print_element(type, lib, dir, name, force=False):
global debugLock
global debugLevel
if debugLevel >= 3 \
or force == True:
debugLock.acquire()
print(color_cyan + type + color_default + " : " + color_yellow + lib + color_default + " " + dir + " " + color_blue + name + color_default)
debugLock.release()
def print_compilator(myString):
global debugColor
global debugLock
if debugColor == True:
myString = myString.replace('\\n', '\n')
myString = myString.replace('\\t', '\t')
myString = myString.replace('error:', color_red+'error:'+color_default)
myString = myString.replace('warning:', color_purple+'warning:'+color_default)
myString = myString.replace('note:', color_green+'note:'+color_default)
myString = re.sub(r'([/\w_-]+\.\w+):', r'-COLORIN-\1-COLOROUT-:', myString)
myString = myString.replace('-COLORIN-', color_yellow)
myString = myString.replace('-COLOROUT-', color_default)
debugLock.acquire()
print(myString)
debugLock.release()

View File

@ -1,22 +1,75 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @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 need_re_build(dst, src, dependFile=None, file_cmd="", cmdLine=""):
debug.extreme_verbose("Resuest check of dependency of :")
def _create_directory_of_file(file):
path = os.path.dirname(file)
try:
os.stat(path)
except:
os.makedirs(path)
def _file_write_data(path, data):
file = open(path, "w")
file.write(data)
file.close()
def _file_size(path):
if not os.path.isfile(path):
return 0
statinfo = os.stat(path)
return statinfo.st_size
def _file_read_data(path, binary=False):
if not os.path.isfile(path):
return ""
if binary == True:
file = open(path, "rb")
else:
file = open(path, "r")
data_file = file.read()
file.close()
return data_file
##
## @brief Creata a dependency file with a list of files
## @param[in] depend_file (string) filename to store a dependency data
## @param[in] list_files ([string,...]) List of file that depend the current element
##
def create_dependency_file(depend_file, list_files):
data = ""
for elem in list_files:
data += elem + "\n"
_create_directory_of_file(depend_file)
_file_write_data(depend_file, data)
##
## @brief Check if all dependency of a file and dependency file is correct or not
## @param[in] dst (string) File that will be generated
## @param[in] src (string) Source File needed to generate the 'dst'
## @param[in] depend_file (string) Dependency file that contain all file that the src depending
## @param[in] file_cmd (string) Filename of where is store the cmdline to generate the 'dst'
## @param[in] cmd_line (string) Command line that will be use to generate the 'dst'
## @param[in] force_identical (string) for copy file this check if the src and dst are identical
## @return (bool) True: something change ==> need to rebuild, False otherwise
##
def need_re_build(dst, src, depend_file=None, file_cmd="", cmd_line="", force_identical=False):
debug.extreme_verbose("Request check of dependency of :")
debug.extreme_verbose(" dst='" + str(dst) + "'")
debug.extreme_verbose(" str='" + str(src) + "'")
debug.extreme_verbose(" dept='" + str(dependFile) + "'")
debug.extreme_verbose(" src='" + str(src) + "'")
debug.extreme_verbose(" dept='" + str(depend_file) + "'")
debug.extreme_verbose(" cmd='" + str(file_cmd) + "'")
debug.extreme_verbose(" force_identical='" + str(force_identical) + "'")
# if force mode selected ==> just force rebuild ...
if env.get_force_mode():
debug.extreme_verbose(" ==> must rebuild (force mode)")
@ -28,21 +81,23 @@ def need_re_build(dst, src, dependFile=None, file_cmd="", cmdLine=""):
and os.path.exists(dst) == False:
debug.extreme_verbose(" ==> must rebuild (dst does not exist)")
return True
if dst != "" \
and dst != None \
if src != "" \
and src != None \
and os.path.exists(src) == False:
debug.warning(" ==> unexistant file :'" + src + "'")
return True
# chek the basic date if the 2 files
# Check the basic date if the 2 files
if dst != "" \
and dst != None \
and src != "" \
and src != None \
and os.path.getmtime(src) > os.path.getmtime(dst):
debug.extreme_verbose(" ==> must rebuild (source time greater)")
return True
if dependFile != "" \
and dependFile != None \
and os.path.exists(dependFile) == False:
if depend_file != "" \
and depend_file != None \
and os.path.exists(depend_file) == False:
debug.extreme_verbose(" ==> must rebuild (no depending file)")
return True
@ -51,69 +106,102 @@ def need_re_build(dst, src, dependFile=None, file_cmd="", cmdLine=""):
if os.path.exists(file_cmd) == False:
debug.extreme_verbose(" ==> must rebuild (no commandLine file)")
return True
# check if the 2 cmdline are similar :
# check if the 2 cmd_line are similar :
file2 = open(file_cmd, "r")
firstAndUniqueLine = file2.read()
if firstAndUniqueLine != cmdLine:
debug.extreme_verbose(" ==> must rebuild (cmdLines are not identical)")
debug.extreme_verbose(" ==> '" + cmdLine + "'")
debug.extreme_verbose(" ==> '" + firstAndUniqueLine + "'")
first_and_unique_line = file2.read()
if first_and_unique_line != cmd_line:
debug.extreme_verbose(" ==> must rebuild (cmd_lines are not identical)")
debug.extreme_verbose(" ==> '" + cmd_line + "'")
debug.extreme_verbose(" ==> '" + first_and_unique_line + "'")
file2.close()
return True
# the cmdfile is correct ...
file2.close()
if dependFile != "" \
and dependFile != None:
debug.extreme_verbose(" start parsing dependency file : '" + dependFile + "'")
file = open(dependFile, "r")
for curLine in file.readlines():
if depend_file != "" \
and depend_file != None:
debug.extreme_verbose(" start parsing dependency file : '" + depend_file + "'")
file = open(depend_file, "r")
for cur_line in file.readlines():
# normal file : end with : ": \\n"
curLine = curLine[:len(curLine)-1]
cur_line = cur_line[:len(cur_line)-1]
# removing last \ ...
if curLine[len(curLine)-1:] == '\\' :
curLine = curLine[:len(curLine)-1]
if cur_line[len(cur_line)-1:] == '\\' :
cur_line = cur_line[:len(cur_line)-1]
# remove white space :
#debug.verbose(" Line (read) : '" + curLine + "'");
curLine = curLine.strip()
#debug.verbose(" Line (strip) : '" + curLine + "'");
#debug.verbose(" Line (read) : '" + cur_line + "'");
cur_line = cur_line.strip()
#debug.verbose(" Line (strip) : '" + cur_line + "'");
testFile=""
if curLine[len(curLine)-1:] == ':':
debug.extreme_verbose(" Line (no check (already done) : '" + curLine + "'");
elif len(curLine) == 0 \
or curLine == '\\':
debug.extreme_verbose(" Line (Not parsed) : '" + curLine + "'");
test_file=""
if cur_line[len(cur_line)-1:] == ':':
debug.extreme_verbose(" Line (no check (already done) : '" + cur_line + "'");
elif len(cur_line) == 0 \
or cur_line == '\\':
debug.extreme_verbose(" Line (Not parsed) : '" + cur_line + "'");
else:
testFile = curLine
debug.extreme_verbose(" Line (might check) : '" + testFile + "'");
test_file = cur_line
debug.extreme_verbose(" Line (might check) : '" + test_file + "'");
# really check files:
if testFile!="":
if test_file != "":
debug.extreme_verbose(" ==> test");
if False==os.path.exists(testFile):
if False==os.path.exists(test_file):
debug.extreme_verbose(" ==> must rebuild (a dependency file does not exist)")
file.close()
return True
if os.path.getmtime(testFile) > os.path.getmtime(dst):
if os.path.getmtime(test_file) > os.path.getmtime(dst):
debug.extreme_verbose(" ==> must rebuild (a dependency file time is newer)")
file.close()
return True
# close the current file :
file.close()
# check the 2 files are identical:
if force_identical == True:
# check if the 2 cmd_line are similar:
size_src = _file_size(src)
size_dst = _file_size(dst)
if size_src != size_dst:
debug.extreme_verbose(" Force Rewrite not the same size size_src=" + str(size_src) + " != size_dest=" + str(size_dst))
return True
data_src = _file_read_data(src, binary=True)
data_dst = _file_read_data(dst, binary=True)
if data_src != data_dst:
debug.extreme_verbose(" Force Rewrite not the same data")
return True
debug.extreme_verbose(" ==> Not rebuild (all dependency is OK)")
return False
def need_re_package(dst, srcList, mustHaveSrc, file_cmd="", cmdLine=""):
debug.extreme_verbose("Resuest check of dependency of :")
debug.extreme_verbose(" dst='" + dst + "'")
debug.extreme_verbose(" src()=")
for src in srcList:
debug.verbose(" '" + src + "'")
##
## @brief
## @param[in] dst (string) File that will be generated
## @param[in] src_list ([string,...]) Source file list needed to generate the 'dst'
## @param[in] must_have_src (bool) All sources must be present
## @param[in] file_cmd (string) Filename of where is store the cmdline to generate the 'dst'
## @param[in] cmd_line (string) Command line that will be use to generate the 'dst'
## @return (bool) True: Need to regenerate the package, False otherwise
##
def need_re_package(dst, src_list, must_have_src, file_cmd="", cmd_line=""):
debug.extreme_verbose("Request check of dependency of :")
debug.extreme_verbose(" dst='" + str(dst) + "'")
compleate_list = []
debug.extreme_verbose(" src:")
if type(src_list) == str:
compleate_list.append(src_list)
debug.extreme_verbose(" '" + src_list + "'")
elif type(src_list) == list:
for src in src_list:
compleate_list.append(src)
debug.extreme_verbose(" '" + str(src) + "'")
elif type(src_list) == dict:
for key in src_list:
debug.extreme_verbose(" '" + str(key) + "'")
for src in src_list[key]:
compleate_list.append(src)
debug.extreme_verbose(" '" + str(src) + "'")
if mustHaveSrc==False and len(srcList)==0:
if must_have_src == False \
and len(compleate_list) == 0:
return False
# if force mode selected ==> just force rebuild ...
@ -122,14 +210,14 @@ def need_re_package(dst, srcList, mustHaveSrc, file_cmd="", cmdLine=""):
return True
# check if the destination existed:
if False==os.path.exists(dst):
if os.path.exists(dst) == False:
debug.extreme_verbose(" ==> must re-package (dst does not exist)")
return True
# chek the basic date if the 2 files
if len(srcList)==0:
if len(compleate_list) == 0:
debug.extreme_verbose(" ==> must re-package (no source ???)")
return True
for src in srcList:
for src in compleate_list:
if os.path.getmtime(src) > os.path.getmtime(dst):
debug.extreme_verbose(" ==> must re-package (source time greater) : '" + src + "'")
return True
@ -138,13 +226,13 @@ def need_re_package(dst, srcList, mustHaveSrc, file_cmd="", cmdLine=""):
if False==os.path.exists(file_cmd):
debug.extreme_verbose(" ==> must rebuild (no commandLine file)")
return True
# check if the 2 cmdline are similar :
# check if the 2 cmd_line are similar :
file2 = open(file_cmd, "r")
firstAndUniqueLine = file2.read()
if firstAndUniqueLine != cmdLine:
debug.extreme_verbose(" ==> must rebuild (cmdLines are not identical)")
debug.extreme_verbose(" ==> '" + cmdLine + "'")
debug.extreme_verbose(" ==> '" + firstAndUniqueLine + "'")
first_and_unique_line = file2.read()
if first_and_unique_line != cmd_line:
debug.extreme_verbose(" ==> must rebuild (cmd_lines are not identical)")
debug.extreme_verbose(" ==> '" + cmd_line + "'")
debug.extreme_verbose(" ==> '" + first_and_unique_line + "'")
file2.close()
return True
# the cmdfile is correct ...

View File

@ -1,98 +1,222 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @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
forceMode=False
force_mode=False
def set_force_mode(val):
global forceMode
global force_mode
if val==1:
forceMode = 1
force_mode = 1
else:
forceMode = 0
force_mode = 0
def get_force_mode():
global forceMode
return forceMode
global force_mode
return force_mode
force_optimisation=False
def set_force_optimisation(val):
global force_optimisation
if val==1:
force_optimisation = 1
else:
force_optimisation = 0
def get_force_optimisation():
global force_optimisation
return force_optimisation
isolate_system=False
def set_isolate_system(val):
global isolate_system
if val==1:
isolate_system = 1
else:
isolate_system = 0
def get_isolate_system():
global isolate_system
return isolate_system
parse_depth = 9999999
def set_parse_depth(val):
global parse_depth
parse_depth = val
debug.debug("Set depth search element: " + str(parse_depth))
def get_parse_depth():
global parse_depth
return parse_depth
exclude_search_path = []
def set_exclude_search_path(val):
global exclude_search_path
exclude_search_path = val
debug.debug("Set depth search element: " + str(exclude_search_path))
def get_exclude_search_path():
global exclude_search_path
return exclude_search_path
printPrettyMode=False
build_system_base_name = "lutin"
def set_build_system_base_name(val):
global build_system_base_name
build_system_base_name = val
debug.debug("Set basename: '" + str(build_system_base_name) + "'")
def get_build_system_base_name():
global build_system_base_name
return build_system_base_name
print_pretty_mode=False
def set_print_pretty_mode(val):
global printPrettyMode
global print_pretty_mode
if val == True:
printPrettyMode = True
print_pretty_mode = True
else:
printPrettyMode = False
print_pretty_mode = False
def get_print_pretty_mode():
global printPrettyMode
return printPrettyMode
global print_pretty_mode
return print_pretty_mode
def print_pretty(myString, force=False):
global printPrettyMode
if printPrettyMode == True \
store_warning=False
def set_warning_mode(val):
global store_warning
if val == True:
store_warning = True
else:
store_warning = False
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:
#debug.info("pppppppp : " + str([name[-len(appl):], appl]))
if name[-len(appl):] == appl:
return True
return False
def print_pretty(my_string, force=False):
global print_pretty_mode
if print_pretty_mode == True \
or force == True:
if myString[len(myString)-1]==' ' :
tmpcmdLine = myString[:len(myString)-1]
else :
tmpcmdLine = myString
if my_string[len(my_string)-1] == ' ':
tmpcmdLine = my_string[:len(my_string)-1]
else:
tmpcmdLine = my_string
cmdApplication = tmpcmdLine.split(' ')[0]
tmpcmdLine = tmpcmdLine.replace(' ', '\n\t')
tmpcmdLine = tmpcmdLine.replace('\n\t\n\t', '\n\t')
tmpcmdLine = tmpcmdLine.replace('\n\t\n\t', '\n\t')
tmpcmdLine = tmpcmdLine.replace('\n\t\n\t', '\n\t')
baseElementList = ["-o",
"-D",
"-I",
"-L",
"g++",
"gcc",
"clang",
"clang++",
"ar",
"ld",
"ranlib",
"-framework",
"-isysroot",
"-arch",
"-keystore",
"-sigalg",
"-digestalg",
"<",
"<<",
">",
">>"]
baseElementList = []
if end_with(cmdApplication, ["javac"]) == True:
baseElementList = [
"-d",
"-D",
"-classpath",
"-sourcepath"
]
elif end_with(cmdApplication, ["java"]) == True:
baseElementList = [
"-z",
"-f",
"-rf"
]
elif end_with(cmdApplication, ["jarsigner"]) == True:
baseElementList = [
"-sigalg",
"-digestalg",
"-storepass",
"-keypass"
]
elif end_with(cmdApplication, ["jar"]) == True:
baseElementList = [
"cf",
"-C"
]
elif end_with(cmdApplication, ["aapt"]) == True:
baseElementList = [
"-M",
"-F",
"-I",
"-S",
"-J"
]
elif end_with(cmdApplication, ["g++", "gcc", "clang", "clang++", "ar", "ld", "ranlib"]) == True:
baseElementList = [
"-o",
"-D",
"-I",
"-L",
"-framework",
"-isysroot",
"-arch",
"-keystore",
"-sigalg",
"-digestalg",
"-target",
"-gcc-toolchain",
"-current_version",
"-compatibility_version"
]
for element in baseElementList:
tmpcmdLine = tmpcmdLine.replace(element+'\n\t', element+' ')
baseElementList = ["g++", "gcc", "clang", "clang++", "ar", "ld", "ranlib"]
for element in baseElementList:
tmpcmdLine = tmpcmdLine.replace('/'+element+' ', '/'+element+'\n\t')
for element in ["<", "<<", ">", ">>"]:
tmpcmdLine = tmpcmdLine.replace(element+'\n\t', element+' ')
tmpcmdLine = tmpcmdLine.replace('\n\t', ' \\\n\t')
return tmpcmdLine
else:
return myString
return my_string
forceStripMode=False
force_strip_mode=False
def set_force_strip_mode(val):
global forceStripMode
if val==True:
forceStripMode = True
global force_strip_mode
if val == True:
force_strip_mode = True
else:
forceStripMode = False
force_strip_mode = False
def get_force_strip_mode():
global forceStripMode
return forceStripMode
global force_strip_mode
return force_strip_mode

View File

@ -1,37 +1,40 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @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(listout, list):
if type(list) == type(str()):
if list not in listout:
listout.append(list)
def append_to_list(list_out, elem):
if type(elem) == str:
if elem not in list_out:
list_out.append(copy.deepcopy(elem))
else:
# mulyiple imput in the list ...
for elem in list:
if elem not in listout:
listout.append(elem)
for element in elem:
if element not in list_out:
list_out.append(copy.deepcopy(element))
class HeritageList:
def __init__(self, heritage = None):
self.flags={}
self.flags = {}
# sources list:
self.src=[]
self.path=[]
self.listHeritage=[]
self.src = { 'src':[],
'dynamic':[],
'static':[]
}
self.path = {}
self.list_heritage = []
if heritage != None:
self.add_heritage(heritage)
@ -39,125 +42,202 @@ class HeritageList:
if type(heritage) == type(None) \
or heritage.name == "":
return
for element in self.listHeritage:
for element in self.list_heritage:
if element.name == heritage.name:
return
self.listHeritage.append(heritage)
self.list_heritage.append(heritage)
self.regenerate_tree()
def add_heritage_list(self, heritage_list):
if type(heritage_list) == type(None):
return
for herit in heritage_list.listHeritage:
for herit in heritage_list.list_heritage:
find = False
for element in self.listHeritage:
for element in self.list_heritage:
if element.name == herit.name:
find = True
if find == False:
self.listHeritage.append(herit)
self.list_heritage.append(herit)
self.regenerate_tree()
def regenerate_tree(self):
self.flags={}
debug.verbose("Regenerate heritage list:")
self.flags = {}
# sources list:
self.src=[]
self.path=[]
self.src = { 'src':[],
'dynamic':[],
'static':[]
}
self.path = {}
# reorder heritage list :
listHeritage = self.listHeritage
self.listHeritage = []
listHeritage = self.list_heritage
self.list_heritage = []
# first step : add all lib with no dependency:
debug.extreme_verbose(" add element with no dependency:")
for herit in listHeritage:
if len(herit.depends) == 0:
self.listHeritage.append(herit)
debug.extreme_verbose(" add: " + str(herit.name))
self.list_heritage.append(copy.deepcopy(herit))
listHeritage.remove(herit)
debug.extreme_verbose(" add element with dependency:")
while len(listHeritage) > 0:
currentHeritageSize = len(listHeritage)
debug.verbose("list heritage = " + str([[x.name, x.depends] for x in listHeritage]))
debug.verbose(" list heritage = " + str([[x.name, x.depends] for x in listHeritage]))
debug.extreme_verbose(" list heritage (rest):")
for tmppp_herit in listHeritage:
debug.extreme_verbose(" elem= " + str(tmppp_herit.name) + " : " + str(tmppp_herit.depends))
# Add element only when all dependence are resolved
for herit in listHeritage:
listDependsName = [y.name for y in self.listHeritage]
listDependsName = [y.name for y in self.list_heritage]
if all(x in listDependsName for x in herit.depends) == True:
debug.extreme_verbose(" add: " + str(herit.name))
listHeritage.remove(herit)
self.listHeritage.append(herit)
self.list_heritage.append(copy.deepcopy(herit))
if currentHeritageSize == len(listHeritage):
debug.warning("Not resolve dependency between the library ==> can be a cyclic dependency !!!")
for herit in listHeritage:
self.listHeritage.append(herit)
self.list_heritage.append(copy.deepcopy(herit))
listHeritage = []
debug.warning("new heritage list:")
for element in self.listHeritage:
for element in self.list_heritage:
debug.warning(" " + element.name + " " + str(element.depends))
debug.verbose("new heritage list:")
for element in self.listHeritage:
debug.verbose(" " + element.name + " " + str(element.depends))
for element in reversed(self.listHeritage):
debug.extreme_verbose("new heritage list:")
for element in self.list_heritage:
debug.extreme_verbose(" " + element.name + " " + str(element.depends))
for element in reversed(self.list_heritage):
for flags in element.flags:
if flags in ["c-version", "c++-version"]:
continue
# get value
value = element.flags[flags]
if flags not in self.flags:
self.flags[flags] = value
# if it is a list, simply add element on the previous one
if type(value) == list:
if flags not in self.flags:
self.flags[flags] = value
else:
append_to_list(self.flags[flags], value)
elif type(value) == bool:
if flags not in self.flags:
self.flags[flags] = value
else:
# keep only true, if false ==> bad case ...
if self.flags[flags] == True \
or value == True:
self.flags[flags] = True
elif type(value) == int:
# case of "c-version", "c++-version"
if flags not in self.flags:
self.flags[flags] = value
else:
# keep only true, if false ==> bad case ...
if self.flags[flags] < value:
self.flags[flags] = value
append_to_list(self.src['src'], element.src['src'])
append_to_list(self.src['dynamic'], element.src['dynamic'])
append_to_list(self.src['static'], element.src['static'])
for element in self.list_heritage:
debug.extreme_verbose(" elem: " + str(element.name))
debug.extreme_verbose(" Path (base): " + str(self.path))
debug.extreme_verbose(" inside: " + str(element.path))
for ppp in element.path:
value = copy.deepcopy(element.path[ppp])
if ppp not in self.path:
self.path[ppp] = value
else:
append_to_list(self.flags[flags], value)
append_to_list(self.path, element.path)
append_to_list(self.src, element.src)
if "c-version" in element.flags:
ver = element.flags["c-version"]
if "c-version" in self.flags:
if self.flags["c-version"] > ver:
ver = self.flags["c-version"]
self.flags["c-version"] = ver
if "c++-version" in element.flags:
ver = element.flags["c++-version"]
if "c++-version" in self.flags:
if self.flags["c++-version"] > ver:
ver = self.flags["c++-version"]
self.flags["c++-version"] = ver
append_to_list(self.path[ppp], value)
debug.extreme_verbose("Path : " + str(self.path))
for ppp in self.path:
tmp = self.path[ppp]
self.path[ppp] = []
for iii in reversed(tmp):
self.path[ppp].append(iii)
debug.extreme_verbose("Path : " + str(self.path))
##
## @brief Generate a string representing the class (for str(xxx))
## @param[in] self (handle) Class handle
## @return (string) string of str() convertion
##
def __repr__(self):
dep = []
for elem in reversed(self.list_heritage):
dep.append(str(elem.name))
return "{HeritageList: " + str(dep) + "}"
class heritage:
def __init__(self, module):
self.name=""
self.depends=[]
def __init__(self, module, target):
self.name = ""
self.depends = []
## Remove all variable to prevent error of multiple definition
# all the parameter that the upper classe need when build
self.flags={}
self.flags = {}
# sources list:
self.src=[]
self.path=[]
self.src = { 'src':[],
'dynamic':[],
'static':[]
}
self.path = {}
self.include = ""
# update is set at true when data are newly created ==> force upper element to update
self.hasBeenUpdated=False
self.has_been_updated=False
if type(module) != type(None):
# all the parameter that the upper classe need when build
self.name = module.name
self.depends = copy.deepcopy(module.depends)
self.name = module.get_name()
self.depends = copy.deepcopy(module.get_depends())
# keep reference because the flags can change in time
self.flags = module.flags["export"]
self.path = module.path["export"]
self.flags = module._flags["export"] # have no deep copy here is a feature ...
self.path = copy.deepcopy(module._path["export"])
# if the user install some header ==> they will ba autoamaticaly exported ...
if target != None:
if len(module._header) > 0:
self.include = target.get_build_path_include(module.get_name())
def add_depends(self, depend):
self.depends.append(depend)
def add_depends(self, elements):
self.depends.append(elements)
def add_import_path(self, list):
append_to_list(self.path, list)
def add_sources(self, list):
append_to_list(self.src, list)
def add_sources(self, elements):
if type(elements) == type(None):
debug.error("try add element none in a list ...")
append_to_list(self.src['src'], elements)
def add_lib_static(self, elements):
if type(elements) == type(None):
debug.error("try add element none in a list ...")
append_to_list(self.src['static'], elements)
def add_lib_dynamic(self, elements):
if type(elements) == type(None):
debug.error("try add element none in a list ...")
append_to_list(self.src['dynamic'], elements)
def add_lib_interpreted(self, type_interpretation, elements):
# TODO : Think at a better methodologie ...
if type(elements) == type(None):
debug.error("try add element none in a list ...")
append_to_list(self.src['src'], elements)
def auto_add_build_header(self):
if self.include != "":
# TODO :Set it better :
if 'c' not in self.path:
self.path['c'] = []
self.path['c'].append(self.include)
def need_update(self, list):
self.hasBeenUpdated=True
self.has_been_updated=True
def add_sub(self, other):
if type(other) == type(None):
debug.verbose("input of the heriatege class is None !!!")
return
if other.hasBeenUpdated == True:
self.hasBeenUpdated = True
if other.has_been_updated == True:
self.has_been_updated = True
for flags in other.flags:
value = other.flags[flags]
if flags not in self.flags:
self.flags[flags] = value
self.flags[flags] = copy.deepcopy(value)
else:
append_to_list(self.flags[flags], value)
self.add_import_path(other.path)
@ -174,5 +254,13 @@ class heritage:
if self.flags["c++-version"] > ver:
ver = self.flags["c++-version"]
self.flags["c++-version"] = ver
##
## @brief Generate a string representing the class (for str(xxx))
## @param[in] self (handle) Class handle
## @return (string) string of str() convertion
##
def __repr__(self):
return "{Heritage:" + str(self.name) + " depend on: " + str(reversed(self.depends)) + " ... }"

View File

@ -1,23 +1,27 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license APACHE v2.0 (see license file)
## @license MPL v2.0 (see license file)
##
import platform
import sys
# Local import
from . import debug
from realog import debug
# print os.name # ==> 'posix'
if platform.system() == "Linux":
OS = "Linux"
HOST_DEFAULT_COMPILATOR = "gcc"
elif platform.system() == "Windows":
OS = "Windows"
HOST_DEFAULT_COMPILATOR = "gcc"
elif platform.system() == "Darwin":
OS = "MacOs"
HOST_DEFAULT_COMPILATOR = "clang"
else:
debug.error("Unknow the Host OS ... '" + platform.system() + "'")

View File

@ -1,64 +1,81 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @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
enableResizeImage = True
enable_resize_image = True
try:
if platform.system() == "Darwin":
import CoreGraphics
else:
from PIL import Image
except:
enableResizeImage = False
enable_resize_image = False
debug.warning("Missing python tools : CoreGraphics (MacOs) or PIL")
##
## @brief Generate the upper pow 2 of the size in parameter
## @param[in] size (int) Size that might heve the upper pow(2)
## @return the new size in pow(2)
##
def get_pow_2_multiple(size):
base = 2
while size>base:
base = base * 2
return base
##
## @brief Resize an image
## @param[in] src_file (string) Path of the source image file
## @param[in] dest_file (string) Path out the destination image file
## @param[in] x (int) Width of the image
## @param[in] y (int) Height of the image
## @param[in] cmd_file (string) Filename of where is store the cmdline to generate the 'dst'
##
# TODO : 3 things to do :
# check if force requested
# check if time change
# check if command line change
def resize(srcFile, destFile, x, y, cmd_file=None):
if enableResizeImage == False:
def resize(src_file, dest_file, x, y, cmd_file=None):
if os.path.exists(src_file) == False:
debug.error("Request a resize an image that does not existed : '" + src_file + "'")
return
if os.path.exists(srcFile) == False:
debug.error("Request a resize an image that does not existed : '" + srcFile + "'")
cmd_line = "resize Image : " + srcFile + " ==> " + destFile + " newSize=(" + str(x) + "x" + str(y) + ")"
if False==depend.need_re_build(destFile, srcFile, file_cmd=cmd_file , cmdLine=cmd_line):
if enable_resize_image == False:
debug.warning("Can not resize image missing pillow or CoreGraphics : '" + src_file + "' (just copy)")
tools.copy_file(src_file, dest_file)
return
cmd_line = "resize Image : " + src_file + " ==> " + dest_file + " newSize=(" + str(x) + "x" + str(y) + ")"
if depend.need_re_build(dest_file, src_file, file_cmd=cmd_file , cmd_line=cmd_line) == False:
return
# add cmdLine ...
x = get_pow_2_multiple(x)
extension = destFile[destFile.rfind('.'):]
extension = dest_file[dest_file.rfind('.'):]
if platform.system() == "Darwin":
source_image = CoreGraphics.CGImageImport(CoreGraphics.CGDataProviderCreateWithFilename(srcFile))
source_image = CoreGraphics.CGImageImport(CoreGraphics.CGDataProviderCreateWithFilename(src_file))
source_width = source_image.getWidth()
source_height = source_image.getHeight()
if source_width <= x:
# for small image just copy:
tools.copy_file(srcFile, destFile)
tools.copy_file(src_file, dest_file)
else:
if y <= 0:
# keep ratio :
y = int(float(x) * float(source_height) / float(source_width))
y = get_pow_2_multiple(y)
debug.print_element("resize Image (" + str(x) + "x" + str(y) + ")", srcFile, "==>", destFile)
debug.debug("Resize image: " + srcFile + " size=(" + str(source_width) + "x" + str(source_height) + ") -> (" + str(x) + "x" + str(y) + ")")
debug.print_element("resize Image (" + str(x) + "x" + str(y) + ")", src_file, "==>", dest_file)
debug.debug("Resize image: " + src_file + " size=(" + str(source_width) + "x" + str(source_height) + ") -> (" + str(x) + "x" + str(y) + ")")
source_image_rect = CoreGraphics.CGRectMake(0, 0, source_width, source_height)
new_image = source_image.createWithImageInRect(source_image_rect)
colors_space = CoreGraphics.CGColorSpaceCreateDeviceRGB()
@ -67,27 +84,27 @@ def resize(srcFile, destFile, x, y, cmd_file=None):
context.setInterpolationQuality(CoreGraphics.kCGInterpolationHigh)
new_image_rect = CoreGraphics.CGRectMake(0, 0, x, y)
context.drawImage(new_image_rect, new_image)
tools.create_directory_of_file(destFile)
tools.create_directory_of_file(dest_file)
if extension == ".jpeg":
context.writeToFile(destFile, CoreGraphics.kCGImageFormatJPEG)
context.writeToFile(dest_file, CoreGraphics.kCGImageFormatJPEG)
elif extension == ".png":
context.writeToFile(destFile, CoreGraphics.kCGImageFormatPNG)
context.writeToFile(dest_file, CoreGraphics.kCGImageFormatPNG)
else:
debug.error(" can not manage extention ... : " + destFile)
debug.error(" can not manage extention ... : " + dest_file)
else:
# open an image file (.bmp,.jpg,.png,.gif) you have in the working folder
im1 = Image.open(srcFile)
# open an image file (.bmp,.jpg,.png,.gif) you have in the working path
im1 = Image.open(src_file)
if im1.size[0] <= x:
# for small image just copy:
tools.copy_file(srcFile, destFile)
tools.copy_file(src_file, dest_file)
else:
if y <= 0:
# keep ratio :
y = int(float(x) * float(im1.size[1]) / float(im1.size[0]))
y = get_pow_2_multiple(y)
debug.print_element("resize Image (" + str(x) + "x" + str(y) + ")", srcFile, "==>", destFile)
debug.print_element("resize Image (" + str(x) + "x" + str(y) + ")", src_file, "==>", dest_file)
# use one of these filter options to resize the image
tmpImage = im1.resize((x, y), Image.ANTIALIAS)
tools.create_directory_of_file(destFile)
tmpImage.save(destFile)
multiprocess.store_command(cmd_line, cmd_file)
tools.create_directory_of_file(dest_file)
tmpImage.save(dest_file)
tools.store_command(cmd_line, cmd_file)

125
lutin/license.py Normal file
View File

@ -0,0 +1,125 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license MPL v2.0 (see license file)
##
license_base = {
"APACHE-2": {
"generic":True,
"contaminate-static":False,
"contaminate-dynamic":False,
"redistribute-source":False,
"title":"MPL v2.0 license",
"licence-file":"licence/apache-2.txt"
},
"GPL-2": {
"generic":True,
"contaminate-static":True,
"contaminate-dynamic":True,
"redistribute-source":True,
"title":"GPL: Gnu Public Licence v2.0",
"licence-file":"licence/GPL-2.txt"
},
"GPL-3": {
"generic":True,
"contaminate-static":True,
"contaminate-dynamic":True,
"redistribute-source":True,
"title":"GPL: GNU General Public License v3.0",
"licence-file":"licence/GPL-3.txt"
},
"LGPL-2": {
"generic":True,
"contaminate-static":False,
"contaminate-dynamic":False,
"redistribute-source":True,
"title":"LGPL: GNU Lesser General Public License v2.0",
"licence-file":"licence/LGPL-2.txt"
},
"LGPL-3": {
"generic":True,
"contaminate-static":True,
"contaminate-dynamic":False,
"redistribute-source":True,
"title":"LGPL: GNU Lesser General Public License v3.0",
"licence-file":"licence/LGPL-3.txt"
},
"MIT": {
"generic":True,
"contaminate-static":False,
"contaminate-dynamic":False,
"redistribute-source":False,
"title":"MIT: Massachusetts Institute of Technology License",
"licence-file":"licence/MIT.txt"
},
"BSD-2": {
"generic":True,
"contaminate-static":False,
"contaminate-dynamic":False,
"redistribute-source":False,
"title":"BSD 2-clauses: Berkeley Software Distribution License",
"licence-file":"licence/BSD-2.txt"
},
"BSD-3": {
"generic":True,
"contaminate-static":False,
"contaminate-dynamic":False,
"redistribute-source":False,
"title":"BSD 3-clauses: Berkeley Software Distribution License",
"licence-file":"licence/BSD-3.txt"
},
"BSD-4": {
"generic":True,
"contaminate-static":False,
"contaminate-dynamic":False,
"redistribute-source":False,
"title":"BSD 4-clauses: Berkeley Software Distribution License",
"licence-file":"licence/BSD-4.txt"
},
"PNG": {
"generic":True,
"contaminate-static":False,
"contaminate-dynamic":False,
"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():
global license_base
out = []
for name in license_base:
out.append(name)
return out

76
lutin/macro.py Normal file
View 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

File diff suppressed because it is too large Load Diff

View File

@ -1,10 +1,11 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license APACHE v2.0 (see license file)
## @license MPL v2.0 (see license file)
##
import sys
@ -19,17 +20,18 @@ import os
import subprocess
import shlex
# Local import
from . import debug
import tools
from realog import debug
from . import tools
from . import env
from . import depend
queueLock = threading.Lock()
workQueue = queue.Queue()
currentThreadWorking = 0
queue_lock = threading.Lock()
work_queue = queue.Queue()
current_thread_working = 0
threads = []
# To know the first error arrive in the pool ==> to display all the time the same error file when multiple compilation
currentIdExecution = 0
errorExecution = {
current_id_execution = 0
error_execution = {
"id":-1,
"cmd":"",
"return":0,
@ -37,35 +39,42 @@ errorExecution = {
"out":"",
}
exitFlag = False # resuest stop of the thread
isinit = False # the thread are initialized
errorOccured = False # a thread have an error
processorAvaillable = 1 # number of CPU core availlable
def store_command(cmdLine, file):
# write cmd line only after to prevent errors ...
if file != "" \
and file != None:
# Create directory:
tools.create_directory_of_file(file)
# Store the command Line:
file2 = open(file, "w")
file2.write(cmdLine)
file2.flush()
file2.close()
exit_flag = False # resuest stop of the thread
is_init = False # the thread are initialized
error_occured = False # a thread have an error
processor_availlable = 1 # number of CPU core availlable
##
## @brief Execute the command with no get of output
##
def run_command_no_lock_out(cmd_line):
# prepare command line:
args = shlex.split(cmd_line)
debug.info("cmd = " + str(args))
try:
# create the subprocess
p = subprocess.Popen(args)
except subprocess.CalledProcessError as e:
debug.error("subprocess.CalledProcessError : " + str(args))
return
#except:
# debug.error("Exception on : " + str(args))
# launch the subprocess:
p.communicate()
##
## @brief Execute the command and ruturn generate data
##
def run_command_direct(cmdLine):
def run_command_direct(cmd_line):
# prepare command line:
args = shlex.split(cmdLine)
args = shlex.split(cmd_line)
debug.verbose("cmd = " + str(args))
try:
# create the subprocess
p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
except subprocess.CalledProcessError as e:
debug.error("subprocess.CalledProcessError : " + str(args))
except:
debug.error("Exception on : " + str(args))
# launch the subprocess:
output, err = p.communicate()
if sys.version_info >= (3, 0):
@ -77,44 +86,52 @@ def run_command_direct(cmdLine):
return err[:-1];
return output[:-1];
else:
debug.warning("get an error cmd " + str(err))
return False
def run_command(cmdLine, storeCmdLine="", buildId=-1, file=""):
global errorOccured
global exitFlag
global currentIdExecution
def run_command(cmd_line, store_cmd_line="", build_id=-1, file="", store_output_file="", depend_data=None):
global error_occured
global exit_flag
global current_id_execution
global error_execution
# prepare command line:
args = shlex.split(cmdLine)
args = shlex.split(cmd_line)
debug.verbose("cmd = " + str(args))
try:
# create the subprocess
p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
except subprocess.CalledProcessError as e:
debug.error("subprocess.CalledProcessError : TODO ...")
except:
debug.error("Exception on : " + str(args))
# launch the subprocess:
output, err = p.communicate()
if sys.version_info >= (3, 0):
output = output.decode("utf-8")
err = err.decode("utf-8")
# store error if needed:
tools.store_warning(store_output_file, output, err)
# Check error :
if p.returncode == 0:
debug.debug(env.print_pretty(cmdLine))
queueLock.acquire()
debug.debug(env.print_pretty(cmd_line))
queue_lock.acquire()
if depend_data != None:
depend.create_dependency_file(depend_data['file'], depend_data['data'])
# TODO : Print the output all the time .... ==> to show warnings ...
if buildId >= 0 and (output != "" or err != ""):
if build_id >= 0 and (output != "" or err != ""):
debug.warning("output in subprocess compiling: '" + file + "'")
if output != "":
debug.print_compilator(output)
if err != "":
debug.print_compilator(err)
queueLock.release()
queue_lock.release()
else:
errorOccured = True
exitFlag = True
error_occured = True
exit_flag = True
# if No ID : Not in a multiprocess mode ==> just stop here
if buildId < 0:
debug.debug(env.print_pretty(cmdLine), force=True)
if build_id < 0:
debug.debug(env.print_pretty(cmd_line), force=True)
debug.print_compilator(output)
debug.print_compilator(err)
if p.returncode == 2:
@ -123,59 +140,67 @@ def run_command(cmdLine, storeCmdLine="", buildId=-1, file=""):
debug.error("can not compile file ... ret : " + str(p.returncode))
else:
# in multiprocess interface
queueLock.acquire()
queue_lock.acquire()
# if an other write an error before, check if the current process is started before ==> then is the first error
if errorExecution["id"] >= buildId:
if error_execution["id"] >= build_id:
# nothing to do ...
queueLock.release()
queue_lock.release()
return;
errorExecution["id"] = buildId
errorExecution["cmd"] = cmdLine
errorExecution["return"] = p.returncode
errorExecution["err"] = err,
errorExecution["out"] = output,
queueLock.release()
error_execution["id"] = build_id
error_execution["cmd"] = cmd_line
error_execution["return"] = p.returncode
error_execution["err"] = err,
error_execution["out"] = output,
queue_lock.release()
# not write the command file...
return
debug.verbose("done 3")
# write cmd line only after to prevent errors ...
store_command(cmdLine, storeCmdLine)
tools.store_command(cmd_line, store_cmd_line)
class myThread(threading.Thread):
def __init__(self, threadID, lock, queue):
def __init__(self, thread_id, lock, queue):
threading.Thread.__init__(self)
self.threadID = threadID
self.name = "Thread " + str(threadID)
self.thread_id = thread_id
self.name = "Thread " + str(thread_id)
self.queue = queue
self.lock = lock
def run(self):
debug.verbose("Starting " + self.name)
global exitFlag
global currentThreadWorking
workingSet = False
while exitFlag == False:
global exit_flag
global current_thread_working
working_set = False
while exit_flag == False:
self.lock.acquire()
if not self.queue.empty():
if workingSet==False:
currentThreadWorking += 1
workingSet = True
if working_set == False:
current_thread_working += 1
working_set = True
data = self.queue.get()
self.lock.release()
debug.verbose(self.name + " processing '" + data[0] + "'")
if data[0]=="cmdLine":
if data[0]=="cmd_line":
comment = data[2]
cmdLine = data[1]
cmdStoreFile = data[3]
debug.print_element( "[" + str(data[4]) + "][" + str(self.threadID) + "] " + comment[0], comment[1], comment[2], comment[3])
run_command(cmdLine, cmdStoreFile, buildId=data[4], file=comment[3])
cmd_line = data[1]
cmd_store_file = data[3]
debug.print_element("[" + str(data[4]) + "][" + str(self.thread_id) + "] " + comment[0],
comment[1],
comment[2],
comment[3])
run_command(cmd_line,
cmd_store_file,
build_id=data[4],
file=comment[3],
store_output_file=data[5],
depend_data=data[6])
else:
debug.warning("unknow request command : " + data[0])
else:
if workingSet==True:
currentThreadWorking -= 1
workingSet=False
if working_set==True:
current_thread_working -= 1
working_set=False
# no element to parse, just wait ...
self.lock.release()
time.sleep(0.2)
@ -183,39 +208,45 @@ class myThread(threading.Thread):
debug.verbose("Exiting " + self.name)
def error_occured():
global exitFlag
exitFlag = True
def set_error_occured():
global exit_flag
exit_flag = True
def set_core_number(numberOfcore):
global processorAvaillable
processorAvaillable = numberOfcore
debug.debug(" set number of core for multi process compilation : " + str(processorAvaillable))
# 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
debug.debug(" set number of core for multi process compilation : " + str(processor_availlable))
# nothing else to do
def init():
global exitFlag
global isinit
if isinit==False:
isinit=True
global error_occured
global exit_flag
global is_init
if is_init == False:
is_init = True
error_occured = False
global threads
global queueLock
global workQueue
global queue_lock
global work_queue
# Create all the new threads
threadID = 0
while threadID < processorAvaillable:
thread = myThread(threadID, queueLock, workQueue)
thread_id = 0
while thread_id < processor_availlable:
thread = myThread(thread_id, queue_lock, work_queue)
thread.start()
threads.append(thread)
threadID += 1
thread_id += 1
def un_init():
global exitFlag
global exit_flag
# Notify threads it's time to exit
exitFlag = True
if processorAvaillable > 1:
exit_flag = True
if processor_availlable > 1:
# Wait for all threads to complete
for tmp in threads:
debug.verbose("join thread ...")
@ -224,54 +255,54 @@ def un_init():
def run_in_pool(cmdLine, comment, storeCmdLine=""):
global currentIdExecution
if processorAvaillable <= 1:
def run_in_pool(cmd_line, comment, store_cmd_line="", store_output_file="", depend_data=None):
global current_id_execution
if processor_availlable <= 1:
debug.print_element(comment[0], comment[1], comment[2], comment[3])
run_command(cmdLine, storeCmdLine, file=comment[3])
run_command(cmd_line, store_cmd_line, file=comment[3], store_output_file=store_output_file, depend_data=depend_data)
return
# multithreaded mode
init()
# Fill the queue
queueLock.acquire()
debug.verbose("add : in pool cmdLine")
workQueue.put(["cmdLine", cmdLine, comment, storeCmdLine, currentIdExecution])
currentIdExecution +=1;
queueLock.release()
queue_lock.acquire()
debug.verbose("add : in pool cmd_line")
work_queue.put(["cmd_line", cmd_line, comment, store_cmd_line, current_id_execution, store_output_file, depend_data])
current_id_execution +=1;
queue_lock.release()
def pool_synchrosize():
global errorOccured
global errorExecution
if processorAvaillable <= 1:
global error_occured
global error_execution
if processor_availlable <= 1:
#in this case : nothing to synchronise
return
debug.verbose("wait queue process ended\n")
# Wait for queue to empty
while not workQueue.empty() \
and False==errorOccured:
while not work_queue.empty() \
and error_occured == False:
time.sleep(0.2)
pass
# Wait all thread have ended their current process
while currentThreadWorking != 0 \
and False==errorOccured:
while current_thread_working != 0 \
and error_occured == False:
time.sleep(0.2)
pass
if False==errorOccured:
if error_occured == False:
debug.verbose("queue is empty")
else:
un_init()
debug.debug("Thread return with error ... ==> stop all the pool")
if errorExecution["id"] == -1:
if error_execution["id"] == -1:
debug.error("Pool error occured ... (No return information on Pool)")
return
debug.error("Error in an pool element : [" + str(errorExecution["id"]) + "]", crash=False)
debug.debug(env.print_pretty(errorExecution["cmd"]), force=True)
debug.print_compilator(str(errorExecution["out"][0]))
debug.print_compilator(str(errorExecution["err"][0]))
if errorExecution["return"] == 2:
debug.error("Error in an pool element : [" + str(error_execution["id"]) + "]", crash=False)
debug.debug(env.print_pretty(error_execution["cmd"]), force=True)
debug.print_compilator(str(error_execution["out"][0]))
debug.print_compilator(str(error_execution["err"][0]))
if error_execution["return"] == 2:
debug.error("can not compile file ... [keyboard interrrupt]")
else:
debug.error("can not compile file ... return value : " + str(errorExecution["return"]))
debug.error("can not compile file ... return value : " + str(error_execution["return"]))

View File

@ -1,10 +1,11 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license APACHE v2.0 (see license file)
## @license MPL v2.0 (see license file)
##
import sys
@ -13,149 +14,311 @@ import inspect
import fnmatch
import datetime
# Local import
from . import debug
from realog import debug
from . import module
from . import tools
from . import env
##
## @brief System class represent the pre-build Module that are already install and accessible in the system environment
##
class System:
##
## @brief Constructor
## @param[in] self (handle) Class handle
## @return None
##
def __init__(self):
self.valid=False;
self.help="";
self.include_cc=[]
self.export_flags_cc=[]
self.export_flags_xx=[]
self.export_flags_mm=[]
self.export_flags_m=[]
self.export_flags_ar=[]
self.export_flags_ld=[]
self.export_flags_ld_shared=[]
self.export_libs_ld=[]
self.export_libs_ld_shared=[]
def append_and_check(self, listout, newElement, order):
for element in listout:
if element==newElement:
return
listout.append(newElement)
if True==order:
listout.sort()
self._valid=False;
self._help="";
self._export_depends=[]
self._export_flags={}
self._export_src=[]
self._export_path=[]
self._action_on_state={}
self._headers=[]
self._version=None
def append_to_internalList(self, listout, list, order=False):
if type(list) == type(str()):
self.append_and_check(listout, list, order)
##
## @brief Set the help of this system Module
## @param[in] self (handle) Class handle
## @param[in] help (string) Help for the user
## @return None
##
def set_help(self, help):
self._help = help;
##
## @brief Get the help of this system Module
## @param[in] self (handle) Class handle
## @return (string) Help for the user
##
def get_help(self):
return self._help;
##
## @brief Set validity state of the system Module
## @param[in] self (handle) Class handle
## @param[in] state (bool) New valididty state of the system module
## @return None
##
def set_valid(self, state):
self._valid = state
##
## @brief Get validity state of the system Module
## @param[in] self (handle) Class handle
## @return (bool) New valididty state of the system module
##
def get_valid(self):
return self._valid
##
## @brief Add source element
## @param[in] self (handle) Class handle
## @param[in] list ([string,...]) List of all Files to add. ex: *.a, *.so ...
## @return None
##
def add_sources(self, list):
tools.list_append_to(self._export_src, list)
##
## @brief Add include path of the sources
## @param[in] self (handle) Class handle
## @param[in] list ([string,...]) List of all path to add in the -I include element
## @return None
##
# todo : add other than C ...
def add_path(self, list):
tools.list_append_to(self._export_path, list)
##
## @brief Add a dependency on this module
## @param[in] self (handle) Class handle
## @param[in] list ([string,...] or string) Name(s) of the modules dependency
## @return None
##
def add_depend(self, list):
tools.list_append_to(self._export_depends, list, True)
##
## @brief Add compilation flags
## @param[in] self (handle) Class handle
## @param[in] type (string) inclusion group name 'c', 'c++', 'java' ...
## @param[in] list ([string,...] or string) List of path to include
## @return None
##
def add_flag(self, type, list):
tools.list_append_to_2(self._export_flags, type, list)
##
## @brief Set version of the module
## @param[in] self (handle) Class handle
## @param[in] version_list ([int,...]) Ids of the version. ex: [1,2,5] or [0,8,"dev"]
## @return None
##
def set_version(self, version_list):
self._version = version_list
## @copydoc lutin.module.Target.add_action
def add_action(self, name_of_state="PACKAGE", level=5, name="no-name", action=None):
if name_of_state not in self._action_on_state:
self._action_on_state[name_of_state] = [[level, name, action]]
else:
# mulyiple imput in the list ...
for elem in list:
self.append_and_check(listout, elem, order)
def add_export_flag_LD(self, list):
self.append_to_internalList(self.export_flags_ld, list)
def add_export_flag_CC(self, list):
self.append_to_internalList(self.export_flags_cc, list)
def add_export_flag_XX(self, list):
self.append_to_internalList(self.export_flags_xx, list)
def add_export_flag_M(self, list):
self.append_to_internalList(self.export_flags_m, list)
def add_export_flag_MM(self, list):
self.append_to_internalList(self.export_flags_mm, list)
self._action_on_state[name_of_state].append([level, name, action])
## @copydoc lutin.module.Module.add_header_file
def add_header_file(self, list, destination_path=None, clip_path=None, recursive=False):
self._headers.append({
"list":list,
"dst":destination_path,
"clip":clip_path,
"recursive":recursive
})
##
## @brief Generate a string representing the class (for str(xxx))
## @param[in] self (handle) Class handle
## @return (string) string of str() convertion
##
def __repr__(self):
return "{lutin.System}"
##
## @brief Configure a module with internal datas
## @param[in] self (handle) Class handle
## @param[in] target (handle) @ref lutin.module.Target handle
## @param[in] module (handle) @ref lutin.module.Module handle
## @return None
##
def configure_module(self, target, module):
# add element flags to export
for elem in self._export_flags:
debug.verbose("add element :" + str(elem) + " elems=" + str(self._export_flags[elem]))
module.add_flag(elem, self._export_flags[elem], export=True)
# add module dependency
if self._export_depends != []:
module.add_depend(self._export_depends)
# add exporting sources
if self._export_src != []:
module.add_src_file(self._export_src)
# add export path
if self._export_path != []:
# no control on API
module._add_path(self._export_path, export=True)
# Export all actions ...
for elem in self._action_on_state:
level, name, action = self._action_on_state[elem]
target.add_action(elem, level, name, action)
for elem in self._headers:
module.add_header_file(
elem["list"],
destination_path=elem["dst"],
clip_path=elem["clip"],
recursive=elem["recursive"])
if self._version != None:
module.set_pkg("VERSION", self._version);
def createModuleFromSystem(target, dict):
myModule = module.Module(dict["path"], dict["name"], 'PREBUILD')
myModule.add_export_flag('c', dict["system"].export_flags_cc)
myModule.add_export_flag('link', dict["system"].export_flags_ld)
myModule.add_export_flag('c++', dict["system"].export_flags_xx)
myModule.add_export_flag('m', dict["system"].export_flags_m)
myModule.add_export_flag('mm', dict["system"].export_flags_mm)
# add the currrent module at the
return myModule
##
## @brief Create a @ref lutin.module.Module for the system list elements
## @param[in] target (handle) @ref lutin.target.Target handle
## @param[in] name (string) Name of the system module
##
def create_module_from_system(target, dict):
my_module = module.Module(dict["path"], dict["name"], 'PREBUILD')
dict["system"].configure_module(target, my_module)
return my_module
# Dictionnaire of Target name
# inside table of ["Name of the lib", "path of the lib", boolean loaded, module loaded]
systemList={}
__startSystemName="lutinSystem_"
__system_list={}
__start_system_name="System_"
##
## @brief Import all File that start with env.get_build_system_base_name() + __start_system_name + XXX and register in the list of System
## @param[in] path_list ([string,...]) List of file that start with env.get_build_system_base_name() in the running worktree (Parse one time ==> faster)
##
def import_path(path_list):
global __system_list
global_base = env.get_build_system_base_name()
debug.debug("SYSTEM: Init with Files list:")
for elem in path_list:
sys.path.append(os.path.dirname(elem))
# Get file name:
filename = os.path.basename(elem)
# Remove .py at the end:
filename = filename[:-3]
# Remove global base name:
filename = filename[len(global_base):]
# Check if it start with the local patern:
if filename[:len(__start_system_name)] != __start_system_name:
debug.extreme_verbose("SYSTEM: NOT-Integrate: '" + filename + "' from '" + elem + "' ==> rejected")
continue
# Remove local patern
system_name = filename[len(__start_system_name):]
system_type, system_name = system_name.split('_')
debug.verbose("SYSTEM: Integrate: '" + system_type + "':'" + system_name + "' from '" + elem + "'")
if system_type in __system_list:
__system_list[system_type].append({"name":system_name,
"path":elem,
"system":None,
"loaded":False,
"exist":False,
"module":None})
else:
__system_list[system_type] = [{"name":system_name,
"path":elem,
"system":None,
"loaded":False,
"exist":False,
"module":None}]
debug.verbose("New list system: ")
for elem in __system_list:
debug.verbose(" " + str(elem))
for val in __system_list[elem]:
debug.verbose(" " + str(val["name"]))
def import_path(path):
global targetList
matches = []
debug.debug('Start find sub File : "%s"' %path)
for root, dirnames, filenames in os.walk(path):
tmpList = fnmatch.filter(filenames, __startSystemName + "*.py")
# Import the module :
for filename in tmpList:
debug.verbose(' Find a file : "%s"' %os.path.join(root, filename))
sys.path.append(os.path.dirname(os.path.join(root, filename)) )
systemName = filename.replace('.py', '')
systemName = systemName.replace(__startSystemName, '')
targetType, systemName = systemName.split('_')
debug.debug("integrate system: '" + targetType + "':'" + systemName + "' from '" + os.path.join(root, filename) + "'")
if targetType in systemList:
systemList[targetType].append({"name":systemName,
"path":os.path.join(root, filename),
"system":None,
"loaded":False,
"exist":False,
"module":None})
else:
systemList[targetType] = [{"name":systemName,
"path":os.path.join(root, filename),
"system":None,
"loaded":False,
"exist":False,
"module":None}]
##
## @brief Display all the system binary that can be used
##
def display():
global systemList
for elementName in systemList:
debug.info("integrate system: '" + elementName +"'")
for data in systemList[elementName]:
debug.info(" '" + data["name"] +"' in " + data["path"])
global __system_list
for elementName in __system_list:
debug.info("SYSTEM: Integrate system: '" + elementName +"'")
for data in __system_list[elementName]:
debug.info("SYSTEM: '" + data["name"] +"' in " + data["path"])
def exist(lib_name, target_name) :
global systemList
if target_name not in systemList:
##
## @brief Check if a system Module is availlable for a specific target
## @param[in] lib_name (string) Name of the Library
## @param[in] list_target_name ([string,...]) list of name of the target (ordered by request order)
## @param[in] target (handle) Handle on the @ref Target build engine
## @return (bool) find the system lib or not
##
def exist(lib_name, list_target_name, target) :
global __system_list
debug.verbose("exist= " + lib_name + " in " + str(list_target_name))
find_target = False
for target_name in list_target_name:
if target_name in __system_list:
find_target = True
if find_target == False:
return False
for data in systemList[target_name]:
if data["name"] == lib_name:
# we find it in the List ==> need to check if it is present in the system :
if data["loaded"] == False:
debug.verbose("add to path: '" + os.path.dirname(data["path"]) + "'")
sys.path.append(os.path.dirname(data["path"]))
debug.verbose("import system : '" + data["name"] + "'")
theSystem = __import__(__startSystemName + target_name + "_" + data["name"])
#create the system module
try:
data["system"] = theSystem.System()
data["exist"] = data["system"].valid
except:
debug.debug("Not find: '" + data["name"] + "'")
return data["exist"]
for target_name in reversed(list_target_name):
if target_name not in __system_list:
continue
for data in __system_list[target_name]:
if data["name"] == lib_name:
# we find it in the List ==> need to check if it is present in the system :
if data["loaded"] == False:
debug.verbose("add to path: '" + os.path.dirname(data["path"]) + "'")
sys.path.append(os.path.dirname(data["path"]))
debug.verbose("import system : '" + data["name"] + "'")
the_system = __import__(env.get_build_system_base_name() + __start_system_name + target_name + "_" + data["name"])
#create the system module
debug.verbose("SYSTEM: request: " + str(data["name"]))
if "System" in dir(the_system):
data["system"] = the_system.System(target)
data["exist"] = data["system"].get_valid()
"""
if data["exist"] == False:
debug.warning("Can not Import: '" + data["name"] + "' ==> disabled")
"""
else:
debug.warning("Not find: '" + data["name"] + "' ==> get exception")
return data["exist"]
return False
def load(target, lib_name, target_name):
global systemList
if target_name not in systemList:
##
## @brief Load a system Module for a specific target
## @param[in] target (handle) Handle on the @ref Target build engine
## @param[in] lib_name (string) Name of the Library
## @param[in] list_target_name ([string,...]) list of name of the target (ordered by request order)
## @return None
##
def load(target, lib_name, list_target_name):
global __system_list
find_target = False
for target_name in list_target_name:
if target_name in __system_list:
find_target = True
if find_target == False:
debug.error("you must call this function after checking of the system exist() !1!")
for data in systemList[target_name]:
if data["name"] == lib_name:
if data["exist"] == False:
debug.error("you must call this function after checking of the system exist() !2!")
if data["module"] == None:
# create a module from the system interface...
data["module"] = createModuleFromSystem(target, data)
data["loaded"] = True
target.add_module(data["module"])
return
return
for target_name in reversed(list_target_name):
if target_name not in __system_list:
continue
for data in __system_list[target_name]:
if data["name"] == lib_name:
if data["exist"] == False:
debug.error("you must call this function after checking of the system exist() !2!")
if data["module"] == None:
# create a module from the system interface...
data["module"] = create_module_from_system(target, data)
data["loaded"] = True
target.add_module(data["module"])
return

View File

@ -1,25 +0,0 @@
#!/usr/bin/python
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license APACHE v2.0 (see license file)
##
from lutin import debug
from lutin import system
from lutin import tools
import os
class System(system.System):
def __init__(self):
system.System.__init__(self)
# create some HELP:
self.help="CoreAudio : Ios interface for audio (all time present, just system interface)"
self.valid = True
# todo : create a searcher of the presence of the library:
self.add_export_flag_LD("-framework CoreAudio")
self.add_export_flag_LD("-framework AudioToolbox")

View File

@ -1,29 +0,0 @@
#!/usr/bin/python
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license APACHE v2.0 (see license file)
##
from lutin import debug
from lutin import system
from lutin import tools
import os
class System(system.System):
def __init__(self):
system.System.__init__(self)
# create some HELP:
self.help="ALSA : Advanced Linux Sound Architecture\n Can be install with the package:\n - libasound2-dev"
# check if the library exist:
if not os.path.isfile("/usr/include/alsa/asoundlib.h") \
and not os.path.isfile("/usr/include/dssi/alsa/asoundlib.h"):
# we did not find the library reqiested (just return) (automaticly set at false)
return;
self.valid = True
# todo : create a searcher of the presence of the library:
self.add_export_flag_LD("-lasound")

View File

@ -1,28 +0,0 @@
#!/usr/bin/python
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license APACHE v2.0 (see license file)
##
from lutin import debug
from lutin import system
from lutin import tools
import os
class System(system.System):
def __init__(self):
system.System.__init__(self)
# create some HELP:
self.help="JACK : Jack Low-Latency Audio Server\n Can be install with the package:\n - libjack-jackd2-dev (new)\n - libjack-dev (old)"
# check if the library exist:
if not os.path.isfile("/usr/include/jack/jack.h"):
# we did not find the library reqiested (just return) (automaticly set at false)
return;
self.valid = True
# todo : create a searcher of the presence of the library:
self.add_export_flag_LD("-ljack")

View File

@ -1,28 +0,0 @@
#!/usr/bin/python
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license APACHE v2.0 (see license file)
##
from lutin import debug
from lutin import system
from lutin import tools
import os
class System(system.System):
def __init__(self):
system.System.__init__(self)
# create some HELP:
self.help="PULSE : The Linux PulseAudio\n Can be install with the package:\n - libpulse-dev"
# check if the library exist:
if not os.path.isfile("/usr/include/pulse/pulseaudio.h"):
# we did not find the library reqiested (just return) (automaticly set at false)
return;
self.valid = True
# todo : create a searcher of the presence of the library:
self.add_export_flag_LD(["-lpulse-simple", "-lpulse"])

View File

@ -1,24 +0,0 @@
#!/usr/bin/python
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license APACHE v2.0 (see license file)
##
from lutin import debug
from lutin import system
from lutin import tools
import os
class System(system.System):
def __init__(self):
system.System.__init__(self)
# create some HELP:
self.help="CoreAudio : MacOs interface for audio (all time present, just system interface)"
self.valid = True
# todo : create a searcher of the presence of the library:
self.add_export_flag_LD("-framework CoreAudio")
self.add_export_flag_LD("-framework CoreFoundation")

File diff suppressed because it is too large Load Diff

View File

@ -1,747 +0,0 @@
#!/usr/bin/python
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license APACHE v2.0 (see license file)
##
from lutin import debug
from lutin import target
from lutin import tools
from lutin import image
from lutin import multiprocess
from lutin import host
import os
import sys
class Target(target.Target):
def __init__(self, config):
#processor type selection (auto/arm/ppc/x86)
if config["arch"] == "auto":
config["arch"] = "arm"
#bus size selection (auto/32/64)
if config["bus-size"] == "auto":
config["bus-size"] = "32"
arch = ""#"ARMv7"
target.Target.__init__(self, "Android", config, arch)
self.folder_ndk = os.getenv('PROJECT_NDK', "AUTO")
self.folder_sdk = os.getenv('PROJECT_SDK', "AUTO")
# auto search NDK
if self.folder_ndk == "AUTO":
for folder in os.listdir("."):
if os.path.isdir(folder)==True:
if folder=="android":
self.folder_ndk = folder + "/ndk"
if self.folder_ndk == "AUTO":
self.folder_ndk = tools.get_run_folder() + "/../android/ndk"
# auto search SDK
if self.folder_sdk == "AUTO":
for folder in os.listdir("."):
if os.path.isdir(folder)==True:
if folder=="android":
self.folder_sdk = folder + "/sdk"
if self.folder_sdk == "AUTO":
self.folder_sdk = tools.get_run_folder() + "/../android/sdk"
if not os.path.isdir(self.folder_ndk):
debug.error("NDK path not set !!! set env : PROJECT_NDK on the NDK path")
if not os.path.isdir(self.folder_sdk):
debug.error("SDK path not set !!! set env : PROJECT_SDK on the SDK path")
tmpOsVal = "64"
gccVersion = "4.9"
if host.BUS_SIZE==64:
tmpOsVal = "_64"
if self.config["compilator"] == "clang":
self.set_cross_base(self.folder_ndk + "/toolchains/llvm-3.3/prebuilt/linux-x86_64/bin/")
else:
baseFolderArm = self.folder_ndk + "/toolchains/arm-linux-androideabi-" + gccVersion + "/prebuilt/linux-x86" + tmpOsVal + "/bin/"
baseFolderMips = self.folder_ndk + "/toolchains/mipsel-linux-android-" + gccVersion + "/prebuilt/linux-x86" + tmpOsVal + "/bin/"
baseFolderX86 = self.folder_ndk + "/toolchains/x86-" + gccVersion + "/prebuilt/linux-x86" + tmpOsVal + "/bin/"
self.set_cross_base(baseFolderArm + "arm-linux-androideabi-")
if not os.path.isdir(baseFolderArm):
debug.error("Gcc Arm path does not exist !!!")
if not os.path.isdir(baseFolderMips):
debug.info("Gcc Mips path does not exist !!!")
if not os.path.isdir(baseFolderX86):
debug.info("Gcc x86 path does not exist !!!")
arch = "ARMv7"
# for gcc :
# for clang :
self.folder_bin="/mustNotCreateBinary"
self.folder_lib="/data/lib/armeabi"
self.folder_data="/data/assets"
self.folder_doc="/doc"
self.suffix_package='.pkg'
# board id at 14 is for android 4.0 and more ...
self.boardId = 14
if arch == "ARMv5" or arch == "ARMv7":
self.global_include_cc.append("-I" + self.folder_ndk +"/platforms/android-" + str(self.boardId) + "/arch-arm/usr/include/")
elif arch == "mips":
self.global_include_cc.append("-I" + self.folder_ndk +"/platforms/android-" + str(self.boardId) + "/arch-mips/usr/include/")
elif arch == "x86":
self.global_include_cc.append("-I" + self.folder_ndk +"/platforms/android-" + str(self.boardId) + "/arch-x86/usr/include/")
if True:
if self.config["compilator"] == "clang":
self.global_include_cc.append("-I" + self.folder_ndk +"/sources/cxx-stl/llvm-libc++/libcxx/include/")
if arch == "ARMv5":
stdCppBasePath = self.folder_ndk +"/sources/cxx-stl/llvm-libc++/libcxx/libs/armeabi/"
self.global_include_cc.append("-I" + stdCppBasePath + "include/")
self.global_flags_ld.append( stdCppBasePath + "libc++_static.a")
elif arch == "ARMv7":
stdCppBasePath = self.folder_ndk +"/sources/cxx-stl/llvm-libc++/libcxx/libs/armeabi-v7a/"
self.global_include_cc.append("-I" + stdCppBasePath + "include/")
self.global_flags_ld.append( stdCppBasePath + "libc++_static.a")
elif arch == "mips":
stdCppBasePath = self.folder_ndk +"/sources/cxx-stl/llvm-libc++/libcxx/libs/mips/"
self.global_include_cc.append("-I" + stdCppBasePath + "include/")
self.global_flags_ld.append( stdCppBasePath + "libc++_static.a")
elif arch == "x86":
stdCppBasePath = self.folder_ndk +"/sources/cxx-stl/llvm-libc++/libcxx/libs/x86/"
self.global_include_cc.append("-I" + stdCppBasePath + "include/")
self.global_flags_ld.append( stdCppBasePath + "libc++_static.a")
else:
self.global_include_cc.append("-I" + self.folder_ndk +"/sources/cxx-stl/gnu-libstdc++/" + gccVersion + "/include/")
if arch == "ARMv5":
stdCppBasePath = self.folder_ndk +"/sources/cxx-stl/gnu-libstdc++/" + gccVersion + "/libs/armeabi/"
self.global_include_cc.append("-I" + stdCppBasePath + "include/")
self.global_flags_ld.append( stdCppBasePath + "thumb/libgnustl_static.a")
self.global_flags_ld.append( stdCppBasePath + "thumb/libsupc++.a")
elif arch == "ARMv7":
stdCppBasePath = self.folder_ndk +"/sources/cxx-stl/gnu-libstdc++/" + gccVersion + "/libs/armeabi-v7a/"
self.global_include_cc.append("-I" + stdCppBasePath + "include/")
self.global_flags_ld.append( stdCppBasePath + "thumb/libgnustl_static.a")
self.global_flags_ld.append( stdCppBasePath + "thumb/libsupc++.a")
elif arch == "mips":
stdCppBasePath = self.folder_ndk +"/sources/cxx-stl/gnu-libstdc++/" + gccVersion + "/libs/mips/"
self.global_include_cc.append("-I" + stdCppBasePath + "include/")
self.global_flags_ld.append( stdCppBasePath + "libgnustl_static.a")
self.global_flags_ld.append( stdCppBasePath + "libsupc++.a")
elif arch == "x86":
stdCppBasePath = self.folder_ndk +"/sources/cxx-stl/gnu-libstdc++/" + gccVersion + "/libs/x86/"
self.global_include_cc.append("-I" + stdCppBasePath + "include/")
self.global_flags_ld.append( stdCppBasePath + "libgnustl_static.a")
self.global_flags_ld.append( stdCppBasePath + "libsupc++.a")
else :
self.global_include_cc.append("-I" + self.folder_ndk +"/sources/cxx-stl/system/include/")
self.global_include_cc.append("-I" + self.folder_ndk +"/sources/cxx-stl/stlport/stlport/")
self.global_flags_ld.append(self.folder_ndk +"/platforms/android-" + str(self.boardId) + "/arch-arm/usr/lib/libstdc++.a")
self.global_sysroot = "--sysroot=" + self.folder_ndk +"/platforms/android-" + str(self.boardId) + "/arch-arm"
self.global_flags_cc.append("-D__ARM_ARCH_5__")
self.global_flags_cc.append("-D__ARM_ARCH_5T__")
self.global_flags_cc.append("-D__ARM_ARCH_5E__")
self.global_flags_cc.append("-D__ARM_ARCH_5TE__")
if self.arch == "ARM":
# -----------------------
# -- arm V5 :
# -----------------------
self.global_flags_cc.append("-march=armv5te")
self.global_flags_cc.append("-msoft-float")
else:
# -----------------------
# -- arm V7 (Neon) :
# -----------------------
self.global_flags_cc.append("-mfpu=neon")
self.global_flags_cc.append("-mfloat-abi=softfp")
self.global_flags_ld.append("-mfpu=neon")
self.global_flags_ld.append("-mfloat-abi=softfp")
self.global_flags_cc.append("-D__ARM_ARCH_7__")
self.global_flags_cc.append("-D__ARM_NEON__")
# the -mthumb must be set for all the android produc, some ot the not work coretly without this one ... (all android code is generated with this flags)
self.global_flags_cc.append("-mthumb")
# -----------------------
# -- Common flags :
# -----------------------
self.global_flags_cc.append("-fpic")
self.global_flags_cc.append("-ffunction-sections")
self.global_flags_cc.append("-funwind-tables")
self.global_flags_cc.append("-fstack-protector")
self.global_flags_cc.append("-Wno-psabi")
self.global_flags_cc.append("-mtune=xscale")
self.global_flags_cc.append("-fexceptions")
##self.global_flags_cc.append("-fno-exceptions")
self.global_flags_cc.append("-fomit-frame-pointer")
self.global_flags_cc.append("-fno-strict-aliasing")
self.global_flags_xx.append("-frtti")
self.global_flags_xx.append("-Wa,--noexecstack")
def check_right_package(self, pkgProperties, value):
for val in pkgProperties["RIGHT"]:
if value == val:
return True
return False
def get_staging_folder_data(self, binaryName):
return self.get_staging_folder(binaryName) + self.folder_data
def make_package(self, pkgName, pkgProperties, basePkgPath):
# http://alp.developpez.com/tutoriels/debian/creer-paquet/
debug.debug("------------------------------------------------------------------------")
debug.info("Generate package '" + pkgName + "'")
debug.debug("------------------------------------------------------------------------")
pkgNameApplicationName = pkgName
if self.config["mode"] == "debug":
pkgNameApplicationName += "debug"
# FINAL_FOLDER_JAVA_PROJECT
self.folder_javaProject= self.get_staging_folder(pkgName) \
+ "/src/" \
+ pkgProperties["COMPAGNY_TYPE"] \
+ "/" + pkgProperties["COMPAGNY_NAME2"] \
+ "/" + pkgNameApplicationName + "/"
#FINAL_FILE_ABSTRACTION
self.file_finalAbstraction = self.folder_javaProject + "/" + pkgNameApplicationName + ".java"
compleatePackageName = pkgProperties["COMPAGNY_TYPE"]+"."+pkgProperties["COMPAGNY_NAME2"]+"." + pkgNameApplicationName
if "ADMOD_ID" in pkgProperties:
pkgProperties["RIGHT"].append("INTERNET")
pkgProperties["RIGHT"].append("ACCESS_NETWORK_STATE")
debug.print_element("pkg", "absractionFile", "<==", "dynamic file")
# Create folder :
tools.create_directory_of_file(self.file_finalAbstraction)
# Create file :
tmpFile = open(self.file_finalAbstraction, 'w')
if pkgProperties["ANDROID_APPL_TYPE"]=="APPL":
tmpFile.write( "/**\n")
tmpFile.write( " * @author Edouard DUPIN, Kevin BILLONNEAU\n")
tmpFile.write( " * @copyright 2011, Edouard DUPIN, all right reserved\n")
tmpFile.write( " * @license APACHE v2.0 (see license file)\n")
tmpFile.write( " * @note This file is autogenerate ==> see documantation to generate your own\n")
tmpFile.write( " */\n")
tmpFile.write( "package "+ compleatePackageName + ";\n")
tmpFile.write( "import org.ewol.EwolActivity;\n")
if "ADMOD_ID" in pkgProperties:
tmpFile.write( "import com.google.android.gms.ads.AdRequest;\n")
tmpFile.write( "import com.google.android.gms.ads.AdSize;\n")
tmpFile.write( "import com.google.android.gms.ads.AdView;\n")
tmpFile.write( "import android.widget.LinearLayout;\n")
tmpFile.write( "import android.widget.Button;\n")
tmpFile.write( "public class " + pkgNameApplicationName + " extends EwolActivity {\n")
if "ADMOD_ID" in pkgProperties:
tmpFile.write( " /** The view to show the ad. */\n")
tmpFile.write( " private AdView adView;\n")
tmpFile.write( " private LinearLayout mLayout = null;\n")
tmpFile.write( " public void onCreate(android.os.Bundle savedInstanceState) {\n")
tmpFile.write( " super.onCreate(savedInstanceState);\n")
tmpFile.write( " initApkPath(\"" + pkgProperties["COMPAGNY_TYPE"]+"\", \""+pkgProperties["COMPAGNY_NAME2"]+"\", \"" + pkgNameApplicationName + "\");\n")
if "ADMOD_ID" in pkgProperties:
tmpFile.write( " mLayout = new LinearLayout(this);\n")
tmpFile.write( " mLayout.setOrientation(android.widget.LinearLayout.VERTICAL);\n")
tmpFile.write( " LinearLayout.LayoutParams paramsWindows = new LinearLayout.LayoutParams(\n")
tmpFile.write( " LinearLayout.LayoutParams.FILL_PARENT,\n")
tmpFile.write( " LinearLayout.LayoutParams.FILL_PARENT);\n")
tmpFile.write( " \n")
tmpFile.write( " setContentView(mLayout, paramsWindows);\n")
tmpFile.write( " \n")
tmpFile.write( " LinearLayout.LayoutParams paramsAdds = new LinearLayout.LayoutParams(\n")
tmpFile.write( " LinearLayout.LayoutParams.FILL_PARENT,\n")
tmpFile.write( " LinearLayout.LayoutParams.WRAP_CONTENT);\n")
tmpFile.write( " paramsAdds.weight = 0;\n")
tmpFile.write( " \n")
tmpFile.write( " LinearLayout.LayoutParams paramsGLView = new LinearLayout.LayoutParams(\n")
tmpFile.write( " LinearLayout.LayoutParams.FILL_PARENT,\n")
tmpFile.write( " LinearLayout.LayoutParams.FILL_PARENT);\n")
tmpFile.write( " paramsGLView.weight = 1;\n")
tmpFile.write( " paramsGLView.height = 0;\n")
tmpFile.write( " \n")
tmpFile.write( " mLayout.setGravity(android.view.Gravity.TOP);\n")
tmpFile.write( " \n")
tmpFile.write( " // Create an adds.\n")
tmpFile.write( " adView = new AdView(this);\n")
tmpFile.write( " adView.setAdSize(AdSize.SMART_BANNER);\n")
tmpFile.write( " adView.setAdUnitId(\"" + pkgProperties["ADMOD_ID"] + "\");\n")
tmpFile.write( " \n")
tmpFile.write( " // Create an ad request. Check logcat output for the hashed device ID to get test ads on a physical device.\n")
tmpFile.write( " AdRequest adRequest = new AdRequest.Builder()\n")
tmpFile.write( " .addTestDevice(AdRequest.DEVICE_ID_EMULATOR)\n")
tmpFile.write( " .build();\n")
tmpFile.write( " \n")
tmpFile.write( " // Add the AdView to the view hierarchy. The view will have no size until the ad is loaded.\n")
if "ADMOD_POSITION" in pkgProperties.keys() \
and pkgProperties["ADMOD_POSITION"] == "top":
tmpFile.write( " mLayout.addView(adView, paramsAdds);\n")
tmpFile.write( " mLayout.addView(mGLView, paramsGLView);\n")
else:
tmpFile.write( " mLayout.addView(mGLView, paramsGLView);\n")
tmpFile.write( " mLayout.addView(adView, paramsAdds);\n")
tmpFile.write( " \n")
tmpFile.write( " // Start loading the ad in the background.\n")
tmpFile.write( " adView.loadAd(adRequest);\n")
tmpFile.write( " }\n")
if "ADMOD_ID" in pkgProperties:
tmpFile.write( " @Override protected void onResume() {\n")
tmpFile.write( " super.onResume();\n")
tmpFile.write( " if (adView != null) {\n")
tmpFile.write( " adView.resume();\n")
tmpFile.write( " }\n")
tmpFile.write( " }\n")
tmpFile.write( " @Override protected void onPause() {\n")
tmpFile.write( " if (adView != null) {\n")
tmpFile.write( " adView.pause();\n")
tmpFile.write( " }\n")
tmpFile.write( " super.onPause();\n")
tmpFile.write( " }\n")
tmpFile.write( " @Override protected void onDestroy() {\n")
tmpFile.write( " // Destroy the AdView.\n")
tmpFile.write( " if (adView != null) {\n")
tmpFile.write( " adView.destroy();\n")
tmpFile.write( " }\n")
tmpFile.write( " super.onDestroy();\n")
tmpFile.write( " }\n")
tmpFile.write( "}\n")
else :
# wallpaper mode ...
tmpFile.write( "/**\n")
tmpFile.write( " * @author Edouard DUPIN, Kevin BILLONNEAU\n")
tmpFile.write( " * @copyright 2011, Edouard DUPIN, all right reserved\n")
tmpFile.write( " * @license APACHE v2.0 (see license file)\n")
tmpFile.write( " * @note This file is autogenerate ==> see documantation to generate your own\n")
tmpFile.write( " */\n")
tmpFile.write( "package "+ compleatePackageName + ";\n")
tmpFile.write( "import org.ewol.EwolWallpaper;\n")
tmpFile.write( "public class " + pkgNameApplicationName + " extends EwolWallpaper {\n")
tmpFile.write( " public static final String SHARED_PREFS_NAME = \"" + pkgNameApplicationName + "settings\";\n")
tmpFile.write( " public Engine onCreateEngine() {\n")
tmpFile.write( " Engine tmpEngine = super.onCreateEngine();\n")
tmpFile.write( " initApkPath(\"" + pkgProperties["COMPAGNY_TYPE"]+"\", \""+pkgProperties["COMPAGNY_NAME2"]+"\", \"" + pkgNameApplicationName + "\");\n")
tmpFile.write( " return tmpEngine;\n")
tmpFile.write( " }\n")
tmpFile.write( "}\n")
tmpFile.flush()
tmpFile.close()
tools.create_directory_of_file(self.get_staging_folder(pkgName) + "/res/drawable/icon.png");
if "ICON" in pkgProperties.keys() \
and pkgProperties["ICON"] != "":
image.resize(pkgProperties["ICON"], self.get_staging_folder(pkgName) + "/res/drawable/icon.png", 256, 256)
else:
# to be sure that we have all time a resource ...
tmpFile = open(self.get_staging_folder(pkgName) + "/res/drawable/plop.txt", 'w')
tmpFile.write('plop\n')
tmpFile.flush()
tmpFile.close()
if pkgProperties["ANDROID_MANIFEST"]!="":
debug.print_element("pkg", "AndroidManifest.xml", "<==", pkgProperties["ANDROID_MANIFEST"])
tools.copy_file(pkgProperties["ANDROID_MANIFEST"], self.get_staging_folder(pkgName) + "/AndroidManifest.xml", force=True)
else:
if "VERSION_CODE" not in pkgProperties:
pkgProperties["VERSION_CODE"] = "1"
debug.print_element("pkg", "AndroidManifest.xml", "<==", "package configurations")
tmpFile = open(self.get_staging_folder(pkgName) + "/AndroidManifest.xml", 'w')
tmpFile.write( '<?xml version="1.0" encoding="utf-8"?>\n')
tmpFile.write( '<!-- Manifest is autoGenerated with Ewol ... do not patch it-->\n')
tmpFile.write( '<manifest xmlns:android="http://schemas.android.com/apk/res/android" \n')
tmpFile.write( ' package="' + compleatePackageName + '" \n')
tmpFile.write( ' android:versionCode="'+pkgProperties["VERSION_CODE"]+'" \n')
tmpFile.write( ' android:versionName="'+pkgProperties["VERSION"]+'"> \n')
tmpFile.write( ' <uses-feature android:glEsVersion="0x00020000" android:required="true" />\n')
tmpFile.write( ' <uses-sdk android:minSdkVersion="' + str(self.boardId) + '" \n')
tmpFile.write( ' android:targetSdkVersion="' + str(self.boardId) + '" /> \n')
if pkgProperties["ANDROID_APPL_TYPE"]=="APPL":
tmpFile.write( ' <application android:label="' + pkgNameApplicationName + '" \n')
if "ICON" in pkgProperties.keys():
tmpFile.write( ' android:icon="@drawable/icon" \n')
if self.config["mode"] == "debug":
tmpFile.write( ' android:debuggable="true" \n')
tmpFile.write( ' >\n')
if "ADMOD_ID" in pkgProperties:
tmpFile.write( ' <meta-data android:name="com.google.android.gms.version" \n')
tmpFile.write( ' android:value="@integer/google_play_services_version"/>\n')
tmpFile.write( ' <activity android:name=".' + pkgNameApplicationName + '" \n')
tmpFile.write( ' android:label="' + pkgProperties['NAME'])
if self.config["mode"] == "debug":
tmpFile.write("-debug")
tmpFile.write( '"\n')
if "ICON" in pkgProperties.keys():
tmpFile.write( ' android:icon="@drawable/icon" \n')
tmpFile.write( ' android:hardwareAccelerated="true" \n')
tmpFile.write( ' android:configChanges="keyboard|keyboardHidden|orientation|screenSize"> \n')
tmpFile.write( ' <intent-filter> \n')
tmpFile.write( ' <action android:name="android.intent.action.MAIN" /> \n')
tmpFile.write( ' <category android:name="android.intent.category.LAUNCHER" /> \n')
tmpFile.write( ' </intent-filter> \n')
tmpFile.write( ' </activity> \n')
if "ADMOD_ID" in pkgProperties:
tmpFile.write( ' <activity android:name="com.google.android.gms.ads.AdActivity"\n')
tmpFile.write( ' android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>\n')
tmpFile.write( ' </application>\n')
else:
tmpFile.write( ' <application android:label="' + pkgNameApplicationName + '" \n')
tmpFile.write( ' android:permission="android.permission.BIND_WALLPAPER" \n')
if "ICON" in pkgProperties.keys():
tmpFile.write( ' android:icon="@drawable/icon"\n')
tmpFile.write( ' >\n')
tmpFile.write( ' <service android:name=".' + pkgNameApplicationName + '" \n')
tmpFile.write( ' android:label="' + pkgProperties['NAME'])
if self.config["mode"] == "debug":
tmpFile.write("-debug")
tmpFile.write( '"\n')
if "ICON" in pkgProperties.keys():
tmpFile.write( ' android:icon="@drawable/icon"\n')
tmpFile.write( ' >\n')
tmpFile.write( ' <intent-filter>\n')
tmpFile.write( ' <action android:name="android.service.wallpaper.WallpaperService" />\n')
tmpFile.write( ' </intent-filter>\n')
tmpFile.write( ' <meta-data android:name="android.service.wallpaper"\n')
tmpFile.write( ' android:resource="@xml/' + pkgNameApplicationName + '_resource" />\n')
tmpFile.write( ' </service>\n')
if len(pkgProperties["ANDROID_WALLPAPER_PROPERTIES"])!=0:
tmpFile.write( ' <activity android:label="Setting"\n')
tmpFile.write( ' android:name=".' + pkgNameApplicationName + 'Settings"\n')
tmpFile.write( ' android:theme="@android:style/Theme.Light.WallpaperSettings"\n')
tmpFile.write( ' android:exported="true"\n')
if "ICON" in pkgProperties.keys():
tmpFile.write( ' android:icon="@drawable/icon"\n')
tmpFile.write( ' >\n')
tmpFile.write( ' </activity>\n')
tmpFile.write( ' </application>\n')
# write package autorisations :
if True==self.check_right_package(pkgProperties, "WRITE_EXTERNAL_STORAGE"):
tmpFile.write( ' <permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> \n')
tmpFile.write( ' <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> \n')
if True==self.check_right_package(pkgProperties, "CAMERA"):
tmpFile.write( ' <permission android:name="android.permission.CAMERA" /> \n')
tmpFile.write( ' <uses-permission android:name="android.permission.CAMERA" /> \n')
if True==self.check_right_package(pkgProperties, "INTERNET"):
tmpFile.write( ' <permission android:name="android.permission.INTERNET" /> \n')
tmpFile.write( ' <uses-permission android:name="android.permission.INTERNET" /> \n')
if True==self.check_right_package(pkgProperties, "ACCESS_NETWORK_STATE"):
tmpFile.write( ' <permission android:name="android.permission.ACCESS_NETWORK_STATE" /> \n')
tmpFile.write( ' <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> \n')
if True==self.check_right_package(pkgProperties, "MODIFY_AUDIO_SETTINGS"):
tmpFile.write( ' <permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" /> \n')
tmpFile.write( ' <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" /> \n')
if True==self.check_right_package(pkgProperties, "READ_CALENDAR"):
tmpFile.write( ' <permission android:name="android.permission.READ_CALENDAR" /> \n')
tmpFile.write( ' <uses-permission android:name="android.permission.READ_CALENDAR" /> \n')
if True==self.check_right_package(pkgProperties, "READ_CONTACTS"):
tmpFile.write( ' <permission android:name="android.permission.READ_CONTACTS" /> \n')
tmpFile.write( ' <uses-permission android:name="android.permission.READ_CONTACTS" /> \n')
if True==self.check_right_package(pkgProperties, "READ_FRAME_BUFFER"):
tmpFile.write( ' <permission android:name="android.permission.READ_FRAME_BUFFER" /> \n')
tmpFile.write( ' <uses-permission android:name="android.permission.READ_FRAME_BUFFER" /> \n')
if True==self.check_right_package(pkgProperties, "READ_PROFILE"):
tmpFile.write( ' <permission android:name="android.permission.READ_PROFILE" /> \n')
tmpFile.write( ' <uses-permission android:name="android.permission.READ_PROFILE" /> \n')
if True==self.check_right_package(pkgProperties, "RECORD_AUDIO"):
tmpFile.write( ' <permission android:name="android.permission.RECORD_AUDIO" /> \n')
tmpFile.write( ' <uses-permission android:name="android.permission.RECORD_AUDIO" /> \n')
if True==self.check_right_package(pkgProperties, "SET_ORIENTATION"):
tmpFile.write( ' <permission android:name="android.permission.SET_ORIENTATION" /> \n')
tmpFile.write( ' <uses-permission android:name="android.permission.SET_ORIENTATION" /> \n')
if True==self.check_right_package(pkgProperties, "VIBRATE"):
tmpFile.write( ' <permission android:name="android.permission.VIBRATE" /> \n')
tmpFile.write( ' <uses-permission android:name="android.permission.VIBRATE" /> \n')
if True==self.check_right_package(pkgProperties, "ACCESS_COARSE_LOCATION"):
tmpFile.write( ' <permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> \n')
tmpFile.write( ' <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> \n')
if True==self.check_right_package(pkgProperties, "ACCESS_FINE_LOCATION"):
tmpFile.write( ' <permission android:name="android.permission.ACCESS_FINE_LOCATION" /> \n')
tmpFile.write( ' <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> \n')
tmpFile.write( '</manifest>\n\n')
tmpFile.flush()
tmpFile.close()
# end generating android manifest
if pkgProperties["ANDROID_APPL_TYPE"]!="APPL":
#create the Wallpaper sub files : (main element for the application
debug.print_element("pkg", pkgNameApplicationName + "_resource.xml", "<==", "package configurations")
tools.create_directory_of_file(self.get_staging_folder(pkgName) + "/res/xml/" + pkgNameApplicationName + "_resource.xml")
tmpFile = open(self.get_staging_folder(pkgName) + "/res/xml/" + pkgNameApplicationName + "_resource.xml", 'w')
tmpFile.write( "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n")
tmpFile.write( "<wallpaper xmlns:android=\"http://schemas.android.com/apk/res/android\"\n")
if len(pkgProperties["ANDROID_WALLPAPER_PROPERTIES"])!=0:
tmpFile.write( " android:settingsActivity=\""+compleatePackageName + "."+ pkgNameApplicationName + "Settings\"\n")
if "ICON" in pkgProperties.keys():
tmpFile.write( " android:thumbnail=\"@drawable/icon\"\n")
tmpFile.write( " />\n")
tmpFile.flush()
tmpFile.close()
# create wallpaper setting if needed (class and config file)
if len(pkgProperties["ANDROID_WALLPAPER_PROPERTIES"])!=0:
tools.create_directory_of_file(self.folder_javaProject + pkgNameApplicationName + "Settings.java")
debug.print_element("pkg", self.folder_javaProject + pkgNameApplicationName + "Settings.java", "<==", "package configurations")
tmpFile = open(self.folder_javaProject + pkgNameApplicationName + "Settings.java", 'w');
tmpFile.write( "package " + compleatePackageName + ";\n")
tmpFile.write( "\n")
tmpFile.write( "import " + compleatePackageName + ".R;\n")
tmpFile.write( "\n")
tmpFile.write( "import android.content.SharedPreferences;\n")
tmpFile.write( "import android.os.Bundle;\n")
tmpFile.write( "import android.preference.PreferenceActivity;\n")
tmpFile.write( "\n")
tmpFile.write( "public class " + pkgNameApplicationName + "Settings extends PreferenceActivity implements SharedPreferences.OnSharedPreferenceChangeListener\n")
tmpFile.write( "{\n")
tmpFile.write( " @Override protected void onCreate(Bundle icicle) {\n")
tmpFile.write( " super.onCreate(icicle);\n")
tmpFile.write( " getPreferenceManager().setSharedPreferencesName("+ pkgNameApplicationName + ".SHARED_PREFS_NAME);\n")
tmpFile.write( " addPreferencesFromResource(R.xml."+ pkgNameApplicationName + "_settings);\n")
tmpFile.write( " getPreferenceManager().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);\n")
tmpFile.write( " }\n")
tmpFile.write( " @Override protected void onResume() {\n")
tmpFile.write( " super.onResume();\n")
tmpFile.write( " }\n")
tmpFile.write( " @Override protected void onDestroy() {\n")
tmpFile.write( " getPreferenceManager().getSharedPreferences().unregisterOnSharedPreferenceChangeListener(this);\n")
tmpFile.write( " super.onDestroy();\n")
tmpFile.write( " }\n")
tmpFile.write( " public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,String key) { }\n")
tmpFile.write( "}\n")
tmpFile.flush()
tmpFile.close()
debug.print_element("pkg", self.get_staging_folder(pkgName) + "/res/xml/" + pkgNameApplicationName + "_settings.xml", "<==", "package configurations")
tools.create_directory_of_file(self.get_staging_folder(pkgName) + "/res/xml/" + pkgNameApplicationName + "_settings.xml")
tmpFile = open(self.get_staging_folder(pkgName) + "/res/xml/" + pkgNameApplicationName + "_settings.xml", 'w');
tmpFile.write( "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n")
tmpFile.write( "<PreferenceScreen xmlns:android=\"http://schemas.android.com/apk/res/android\"\n")
tmpFile.write( " android:title=\"Settings\"\n")
tmpFile.write( " android:key=\"" + pkgNameApplicationName + "_settings\">\n")
WALL_haveArray = False
for WALL_type, WALL_key, WALL_title, WALL_summary, WALL_other in pkgProperties["ANDROID_WALLPAPER_PROPERTIES"]:
debug.info("find : '" + WALL_type + "'");
if WALL_type == "list":
debug.info(" create : LIST");
tmpFile.write( " <ListPreference android:key=\"" + pkgNameApplicationName + "_" + WALL_key + "\"\n")
tmpFile.write( " android:title=\"" + WALL_title + "\"\n")
tmpFile.write( " android:summary=\"" + WALL_summary + "\"\n")
tmpFile.write( " android:entries=\"@array/" + pkgNameApplicationName + "_" + WALL_key + "_names\"\n")
tmpFile.write( " android:entryValues=\"@array/" + pkgNameApplicationName + "_" + WALL_key + "_prefix\"/>\n")
WALL_haveArray=True
elif WALL_type == "bool":
debug.info(" create : CHECKBOX");
tmpFile.write( " <CheckBoxPreference android:key=\"" + pkgNameApplicationName + "_" + WALL_key + "\"\n")
tmpFile.write( " android:title=\"" + WALL_title + "\"\n")
tmpFile.write( " android:summary=\"" + WALL_summary + "\"\n")
tmpFile.write( " android:summaryOn=\"" + WALL_other[0] + "\"\n")
tmpFile.write( " android:summaryOff=\"" + WALL_other[1] + "\"/>\n")
tmpFile.write( "</PreferenceScreen>\n")
tmpFile.flush()
tmpFile.close()
if WALL_haveArray==True:
for WALL_type, WALL_key, WALL_title, WALL_summary, WALL_other in pkgProperties["ANDROID_WALLPAPER_PROPERTIES"]:
if WALL_type == "list":
debug.print_element("pkg", self.get_staging_folder(pkgName) + "/res/values/" + WALL_key + ".xml", "<==", "package configurations")
tools.create_directory_of_file(self.get_staging_folder(pkgName) + "/res/values/" + WALL_key + ".xml")
tmpFile = open(self.get_staging_folder(pkgName) + "/res/values/" + WALL_key + ".xml", 'w');
tmpFile.write( "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n")
tmpFile.write( "<resources xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n")
tmpFile.write( " <string-array name=\"" + pkgNameApplicationName + "_" + WALL_key + "_names\">\n")
for WALL_subKey, WALL_display in WALL_other:
tmpFile.write( " <item>" + WALL_display + "</item>\n")
tmpFile.write( " </string-array>\n")
tmpFile.write( " <string-array name=\"" + pkgNameApplicationName + "_" + WALL_key + "_prefix\">\n")
for WALL_subKey, WALL_display in WALL_other:
tmpFile.write( " <item>" + WALL_subKey + "</item>\n")
tmpFile.write( " </string-array>\n")
tmpFile.write( "</resources>\n")
tmpFile.flush()
tmpFile.close()
#add properties on wallpaper :
# myModule.pkg_add("ANDROID_WALLPAPER_PROPERTIES", ["list", key, title, summary, [["key","value display"],["key2","value display 2"]])
# myModule.pkg_add("ANDROID_WALLPAPER_PROPERTIES", ["list", "testpattern", "Select test pattern", "Choose which test pattern to display", [["key","value display"],["key2","value display 2"]]])
# myModule.pkg_add("ANDROID_WALLPAPER_PROPERTIES", ["bool", key, title, summary, ["enable string", "disable String"])
# myModule.pkg_add("ANDROID_WALLPAPER_PROPERTIES", ["bool", "movement", "Motion", "Apply movement to test pattern", ["Moving test pattern", "Still test pattern"]
#copy needed resources :
for res_source, res_dest in pkgProperties["ANDROID_RESOURCES"]:
if res_source == "":
continue
tools.copy_file(res_source , self.get_staging_folder(pkgName) + "/res/" + res_dest + "/" + os.path.basename(res_source), force=True)
# Doc :
# http://asantoso.wordpress.com/2009/09/15/how-to-build-android-application-package-apk-from-the-command-line-using-the-sdk-tools-continuously-integrated-using-cruisecontrol/
debug.print_element("pkg", "R.java", "<==", "Resources files")
tools.create_directory_of_file(self.get_staging_folder(pkgName) + "/src/noFile")
androidToolPath = self.folder_sdk + "/build-tools/"
# find android tool version
dirnames = tools.get_list_sub_folder(androidToolPath)
if len(dirnames) != 1:
debug.error("an error occured when getting the tools for android")
androidToolPath += dirnames[0] + "/"
adModResouceFolder = ""
if "ADMOD_ID" in pkgProperties:
adModResouceFolder = " -S " + self.folder_sdk + "/extras/google/google_play_services/libproject/google-play-services_lib/res/ "
cmdLine = androidToolPath + "aapt p -f " \
+ "-M " + self.get_staging_folder(pkgName) + "/AndroidManifest.xml " \
+ "-F " + self.get_staging_folder(pkgName) + "/resources.res " \
+ "-I " + self.folder_sdk + "/platforms/android-" + str(self.boardId) + "/android.jar "\
+ "-S " + self.get_staging_folder(pkgName) + "/res/ " \
+ adModResouceFolder \
+ "-J " + self.get_staging_folder(pkgName) + "/src/ "
multiprocess.run_command(cmdLine)
#aapt package -f -M ${manifest.file} -F ${packaged.resource.file} -I ${path.to.android-jar.library}
# -S ${android-resource-directory} [-m -J ${folder.to.output.the.R.java}]
tools.create_directory_of_file(self.get_staging_folder(pkgName) + "/build/classes/noFile")
debug.print_element("pkg", "*.class", "<==", "*.java")
# more information with : -Xlint
# + self.file_finalAbstraction + " "\ # this generate ex: out/Android/debug/staging/tethys/src/com/edouarddupin/tethys/edn.java
#generate android java files:
filesString=""
for element in pkgProperties["ANDROID_JAVA_FILES"]:
if element=="DEFAULT":
filesString += self.folder_ewol + "/sources/android/src/org/ewol/EwolAudioTask.java "
filesString += self.folder_ewol + "/sources/android/src/org/ewol/EwolCallback.java "
filesString += self.folder_ewol + "/sources/android/src/org/ewol/EwolConstants.java "
filesString += self.folder_ewol + "/sources/android/src/org/ewol/Ewol.java "
filesString += self.folder_ewol + "/sources/android/src/org/ewol/EwolRendererGL.java "
filesString += self.folder_ewol + "/sources/android/src/org/ewol/EwolSurfaceViewGL.java "
filesString += self.folder_ewol + "/sources/android/src/org/ewol/EwolActivity.java "
filesString += self.folder_ewol + "/sources/android/src/org/ewol/EwolWallpaper.java "
else:
filesString += element + " "
if "ADMOD_ID" in pkgProperties:
filesString += self.folder_sdk + "/extras/google/google_play_services/libproject/google-play-services_lib/src/android/UnusedStub.java "
if len(pkgProperties["ANDROID_WALLPAPER_PROPERTIES"])!=0:
filesString += self.folder_javaProject + pkgNameApplicationName + "Settings.java "
adModJarFile = ""
if "ADMOD_ID" in pkgProperties:
adModJarFile = ":" + self.folder_sdk + "/extras/google/google_play_services/libproject/google-play-services_lib/libs/google-play-services.jar"
cmdLine = "javac " \
+ "-d " + self.get_staging_folder(pkgName) + "/build/classes " \
+ "-classpath " + self.folder_sdk + "/platforms/android-" + str(self.boardId) + "/android.jar" \
+ adModJarFile + " " \
+ filesString \
+ self.file_finalAbstraction + " " \
+ self.get_staging_folder(pkgName) + "/src/R.java "
multiprocess.run_command(cmdLine)
debug.print_element("pkg", ".dex", "<==", "*.class")
cmdLine = androidToolPath + "dx " \
+ "--dex --no-strict " \
+ "--output=" + self.get_staging_folder(pkgName) + "/build/" + pkgNameApplicationName + ".dex " \
+ self.get_staging_folder(pkgName) + "/build/classes/ "
if "ADMOD_ID" in pkgProperties:
cmdLine += self.folder_sdk + "/extras/google/google_play_services/libproject/google-play-services_lib/libs/google-play-services.jar "
multiprocess.run_command(cmdLine)
debug.print_element("pkg", ".apk", "<==", ".dex, assets, .so, res")
#builderDebug="-agentlib:jdwp=transport=dt_socket,server=y,address=8050,suspend=y "
builderDebug=""
# note : set -u not signed application...
#+ ":" + self.folder_sdk + "/extras/google/google_play_services/libproject/google-play-services_lib/libs/google-play-services.jar "
cmdLine = "java -Xmx128M " \
+ " -classpath " + self.folder_sdk + "/tools/lib/sdklib.jar " \
+ builderDebug \
+ " com.android.sdklib.build.ApkBuilderMain " \
+ self.get_staging_folder(pkgName) + "/build/" + pkgNameApplicationName + "-unalligned.apk " \
+ " -u " \
+ " -z " + self.get_staging_folder(pkgName) + "/resources.res " \
+ " -f " + self.get_staging_folder(pkgName) + "/build/" + pkgNameApplicationName + ".dex " \
+ " -rf " + self.get_staging_folder(pkgName) + "/data "
multiprocess.run_command(cmdLine)
# doc :
# http://developer.android.com/tools/publishing/app-signing.html
# Create a key for signing your application:
# keytool -genkeypair -v -keystore AndroidKey.jks -storepass Pass__AndroidDebugKey -alias alias__AndroidDebugKey -keypass PassKey__AndroidDebugKey -keyalg RSA -validity 36500
if self.config["mode"] == "debug":
debug.print_element("pkg", ".apk(signed debug)", "<==", ".apk (not signed)")
# verbose mode :
#debugOption = "-verbose -certs "
debugOption = ""
cmdLine = "jarsigner " \
+ debugOption \
+ "-keystore " + tools.get_current_path(__file__) + "/AndroidDebugKey.jks " \
+ " -sigalg SHA1withRSA -digestalg SHA1 " \
+ " -storepass Pass__AndroidDebugKey " \
+ " -keypass PassKey__AndroidDebugKey " \
+ self.get_staging_folder(pkgName) + "/build/" + pkgNameApplicationName + "-unalligned.apk " \
+ " alias__AndroidDebugKey"
multiprocess.run_command(cmdLine)
tmpFile = open("tmpPass.boo", 'w')
tmpFile.write("\n")
tmpFile.flush()
tmpFile.close()
else:
print("On release mode we need the file : and key an pasword to sign the application ...")
debug.print_element("pkg", ".apk(signed debug)", "<==", ".apk (not signed)")
cmdLine = "jarsigner " \
+ " -keystore " + basePkgPath + "/AndroidKey.jks " \
+ " -sigalg SHA1withRSA -digestalg SHA1 " \
+ self.get_staging_folder(pkgName) + "/build/" + pkgNameApplicationName + "-unalligned.apk " \
+ " " + pkgNameApplicationName
multiprocess.run_command(cmdLine)
cmdLine = "jarsigner " \
+ " -verify -verbose -certs " \
+ " -sigalg SHA1withRSA -digestalg SHA1 " \
+ self.get_staging_folder(pkgName) + "/build/" + pkgNameApplicationName + "-unalligned.apk "
multiprocess.run_command(cmdLine)
debug.print_element("pkg", ".apk(aligned)", "<==", ".apk (not aligned)")
tools.remove_file(self.get_staging_folder(pkgName) + "/" + pkgNameApplicationName + ".apk")
# verbose mode : -v
cmdLine = androidToolPath + "zipalign 4 " \
+ self.get_staging_folder(pkgName) + "/build/" + pkgNameApplicationName + "-unalligned.apk " \
+ self.get_staging_folder(pkgName) + "/" + pkgNameApplicationName + ".apk "
multiprocess.run_command(cmdLine)
# copy file in the final stage :
tools.copy_file(self.get_staging_folder(pkgName) + "/" + pkgNameApplicationName + ".apk",
self.get_final_folder() + "/" + pkgNameApplicationName + ".apk",
force=True)
def install_package(self, pkgName):
debug.debug("------------------------------------------------------------------------")
debug.info("Install package '" + pkgName + "'")
debug.debug("------------------------------------------------------------------------")
pkgNameApplicationName = pkgName
if self.config["mode"] == "debug":
pkgNameApplicationName += "debug"
cmdLine = self.folder_sdk + "/platform-tools/adb install -r " \
+ self.get_staging_folder(pkgName) + "/" + pkgNameApplicationName + ".apk "
multiprocess.run_command(cmdLine)
def un_install_package(self, pkgName):
debug.debug("------------------------------------------------------------------------")
debug.info("Un-Install package '" + pkgName + "'")
debug.debug("------------------------------------------------------------------------")
pkgNameApplicationName = pkgName
if self.config["mode"] == "debug":
pkgNameApplicationName += "debug"
cmdLine = self.folder_sdk + "/platform-tools/adb uninstall " + pkgNameApplicationName
Rmultiprocess.unCommand(cmdLine)
def Log(self, pkgName):
debug.debug("------------------------------------------------------------------------")
debug.info("logcat of android board")
debug.debug("------------------------------------------------------------------------")
debug.info("cmd: " + self.folder_sdk + "/platform-tools/adb shell logcat ")
cmdLine = self.folder_sdk + "/platform-tools/adb shell logcat "
multiprocess.run_command(cmdLine)

View File

@ -1,432 +0,0 @@
#!/usr/bin/python
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license APACHE v2.0 (see license file)
##
from lutin import debug
from lutin import target
from lutin import tools
from lutin import image
import os
import stat
from lutin import multiprocess
from lutin import host
import random
import re
class Target(target.Target):
def __init__(self, config):
if config["compilator"] == "gcc":
debug.info("compile only with clang for IOs");
config["compilator"] = "clang"
#processor type selection (auto/arm/ppc/x86)
if config["arch"] == "auto":
config["arch"] = "arm"
#bus size selection (auto/32/64)
if config["bus-size"] == "auto":
config["bus-size"] = "64"
# http://biolpc22.york.ac.uk/pub/linux-mac-cross/
# http://devs.openttd.org/~truebrain/compile-farm/apple-darwin9.txt
if config["simulation"] == True:
arch = "i386"
else:
arch="arm64" # for ipad air
#arch="armv7" # for Iphone 4
target.Target.__init__(self, "IOs", config, arch)
if self.config["simulation"] == True:
self.set_cross_base("/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/")
else:
self.set_cross_base("/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/")
# remove unneeded ranlib ...
self.ranlib=""
self.folder_bin=""
self.folder_data="/share"
self.folder_doc="/doc"
self.suffix_lib_static='.a'
self.suffix_lib_dynamic='.dylib'
self.suffix_binary=''
self.suffix_package=''
if self.sumulator == True:
self.sysroot = "-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.3.sdk"
self.global_flags_ld.append("-mios-simulator-version-min=8.0")
self.global_flags_cc.append("-mios-simulator-version-min=8.0")
else:
self.sysroot = "-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk"
self.global_flags_ld.append("-miphoneos-version-min=8.0")
self.global_flags_cc.append("-miphoneos-version-min=8.0")
self.global_flags_ld.append([
"-Xlinker",
"-objc_abi_version",
"-Xlinker 2",
"-Xlinker",
"-no_implicit_dylibs",
"-stdlib=libc++",
"-fobjc-arc",
"-fobjc-link-runtime"])
self.global_flags_m.append("-fobjc-arc")
#self.global_flags_m.append("-fmodules")
def get_staging_folder(self, binaryName):
return tools.get_run_folder() + self.folder_out + self.folder_staging + "/" + binaryName + ".app/"
def get_staging_folder_data(self, binaryName):
return self.get_staging_folder(binaryName) + self.folder_data + "/"
def make_package(self, pkgName, pkgProperties, basePkgPath):
debug.debug("------------------------------------------------------------------------")
debug.info("Generate package '" + pkgName + "'")
debug.debug("------------------------------------------------------------------------")
if "ICON" in pkgProperties.keys() \
and pkgProperties["ICON"] != "":
# Resize all icon needed for Ios ...
# TODO : Do not regenerate if source resource is not availlable
# TODO : Add a colored background ...
debug.print_element("pkg", "iTunesArtwork.png", "<==", pkgProperties["ICON"])
image.resize(pkgProperties["ICON"], self.get_staging_folder(pkgName) + "/iTunesArtwork.png", 512, 512)
debug.print_element("pkg", "iTunesArtwork@2x.png", "<==", pkgProperties["ICON"])
image.resize(pkgProperties["ICON"], self.get_staging_folder(pkgName) + "/iTunesArtwork@2x.png", 1024, 1024)
debug.print_element("pkg", "Icon-60@2x.png", "<==", pkgProperties["ICON"])
image.resize(pkgProperties["ICON"], self.get_staging_folder(pkgName) + "/Icon-60@2x.png", 120, 120)
debug.print_element("pkg", "Icon-76.png", "<==", pkgProperties["ICON"])
image.resize(pkgProperties["ICON"], self.get_staging_folder(pkgName) + "/Icon-76.png", 76, 76)
debug.print_element("pkg", "Icon-76@2x.png", "<==", pkgProperties["ICON"])
image.resize(pkgProperties["ICON"], self.get_staging_folder(pkgName) + "/Icon-76@2x.png", 152, 152)
debug.print_element("pkg", "Icon-Small-40.png", "<==", pkgProperties["ICON"])
image.resize(pkgProperties["ICON"], self.get_staging_folder(pkgName) + "/Icon-Small-40.png", 40, 40)
debug.print_element("pkg", "Icon-Small-40@2x.png", "<==", pkgProperties["ICON"])
image.resize(pkgProperties["ICON"], self.get_staging_folder(pkgName) + "/Icon-Small-40@2x.png", 80, 80)
debug.print_element("pkg", "Icon-Small.png", "<==", pkgProperties["ICON"])
image.resize(pkgProperties["ICON"], self.get_staging_folder(pkgName) + "/Icon-Small.png", 29, 29)
debug.print_element("pkg", "Icon-Small@2x.png", "<==", pkgProperties["ICON"])
image.resize(pkgProperties["ICON"], self.get_staging_folder(pkgName) + "/Icon-Small@2x.png", 58, 58)
debug.print_element("pkg", "PkgInfo", "<==", "APPL????")
infoFile = self.get_staging_folder(pkgName) + "/PkgInfo"
# Create the info file
tmpFile = open(infoFile, 'w')
tmpFile.write("APPL????")
tmpFile.flush()
tmpFile.close()
debug.print_element("pkg", "Info.plist", "<==", "Package properties")
# http://www.sandroid.org/imcross/#Deployment
dataFile = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
dataFile += "<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n"
dataFile += "<plist version=\"1.0\">\n"
dataFile += " <dict>\n"
dataFile += " <key>CFBundleDevelopmentRegion</key>\n"
dataFile += " <string>en</string>\n"
dataFile += " <key>CFBundleDisplayName</key>\n"
dataFile += " <string>" + pkgProperties["NAME"] + "</string>\n"
dataFile += " <key>CFBundleExecutable</key>\n"
dataFile += " <string>" + pkgName + "</string>\n"
dataFile += " <key>CFBundleIdentifier</key>\n"
dataFile += " <string>com." + pkgProperties["COMPAGNY_NAME2"] + "." + pkgName + "</string>\n"
dataFile += " <key>CFBundleIconFiles</key>\n"
dataFile += " <array>\n"
dataFile += " <string>Icon-60@2x.png</string>\n"
dataFile += " <string>Icon-76.png</string>\n"
dataFile += " <string>Icon-76@2x.png</string>\n"
dataFile += " <string>Icon-Small-40.png</string>\n"
dataFile += " <string>Icon-Small-40@2x.png</string>\n"
dataFile += " <string>Icon-Small.png</string>\n"
dataFile += " <string>Icon-Small@2x.png</string>\n"
dataFile += " <string>iTunesArtwork.png</string>\n"
dataFile += " <string>iTunesArtwork@2x.png</string>\n"
dataFile += " </array>\n"
dataFile += " <key>CFBundleInfoDictionaryVersion</key>\n"
dataFile += " <string>6.0</string>\n"
dataFile += " <key>CFBundleName</key>\n"
dataFile += " <string>" + pkgName + "</string>\n"
dataFile += " <key>CFBundlePackageType</key>\n"
dataFile += " <string>APPL</string>\n"
dataFile += " <key>CFBundleSignature</key>\n"
dataFile += " <string>????</string>\n"
dataFile += " <key>CFBundleSupportedPlatforms</key>\n"
dataFile += " <array>\n"
dataFile += " <string>iPhoneSimulator</string>\n"
dataFile += " </array>\n"
dataFile += " \n"
dataFile += " <key>CFBundleShortVersionString</key>\n"
dataFile += " <string>"+pkgProperties["VERSION"]+"</string>\n"
dataFile += " <key>CFBundleVersion</key>\n"
dataFile += " <string>"+pkgProperties["VERSION_CODE"]+"</string>\n"
dataFile += " \n"
dataFile += " <key>CFBundleResourceSpecification</key>\n"
dataFile += " <string>ResourceRules.plist</string>\n"
if self.sumulator == False:
dataFile += " <key>LSRequiresIPhoneOS</key>\n"
dataFile += " <true/>\n"
else:
dataFile += " <key>DTPlatformName</key>\n"
dataFile += " <string>iphonesimulator</string>\n"
dataFile += " <key>DTSDKName</key>\n"
dataFile += " <string>iphonesimulator7.0</string>\n"
dataFile += " \n"
dataFile += " <key>UIDeviceFamily</key>\n"
dataFile += " <array>\n"
dataFile += " <integer>1</integer>\n"
dataFile += " <integer>2</integer>\n"
dataFile += " </array>\n"
dataFile += " <key>UIRequiredDeviceCapabilities</key>\n"
dataFile += " <array>\n"
dataFile += " <string>armv7</string>\n"
dataFile += " </array>\n"
dataFile += " <key>UIStatusBarHidden</key>\n"
dataFile += " <true/>\n"
dataFile += " <key>UISupportedInterfaceOrientations</key>\n"
dataFile += " <array>\n"
dataFile += " <string>UIInterfaceOrientationPortrait</string>\n"
dataFile += " <string>UIInterfaceOrientationPortraitUpsideDown</string>\n"
dataFile += " <string>UIInterfaceOrientationLandscapeLeft</string>\n"
dataFile += " <string>UIInterfaceOrientationLandscapeRight</string>\n"
dataFile += " </array>\n"
dataFile += " <key>UISupportedInterfaceOrientations~ipad</key>\n"
dataFile += " <array>\n"
dataFile += " <string>UIInterfaceOrientationPortrait</string>\n"
dataFile += " <string>UIInterfaceOrientationPortraitUpsideDown</string>\n"
dataFile += " <string>UIInterfaceOrientationLandscapeLeft</string>\n"
dataFile += " <string>UIInterfaceOrientationLandscapeRight</string>\n"
dataFile += " </array>\n"
dataFile += " </dict>\n"
dataFile += "</plist>\n"
dataFile += "\n\n"
infoFile = self.get_staging_folder(pkgName) + "/Info.plist"
# Create the info file
tmpFile = open(infoFile, 'w')
tmpFile.write(dataFile)
tmpFile.flush()
tmpFile.close()
"""
infoFile = self.get_staging_folder(pkgName) + "/" + pkgName + "-Info.plist"
# Create the info file
tmpFile = open(infoFile, 'w')
tmpFile.write(dataFile)
tmpFile.flush()
tmpFile.close()
cmdLine = "builtin-infoPlistUtility "
cmdLine += " " + self.get_staging_folder(pkgName) + "/" + pkgName + "-Info.plist "
cmdLine += " -genpkginfo " + self.get_staging_folder(pkgName) + "/PkgInfo"
cmdLine += " -expandbuildsettings "
cmdLine += " -format binary "
if self.sumulator == False:
cmdLine += " -platform iphonesimulator "
else:
cmdLine += " -platform iphoneos "
cmdLine += " -o " + self.get_staging_folder(pkgName) + "/" + "Info.plist"
multiprocess.run_command(cmdLine)
"""
"""
/Users/edouarddupin/dev/exampleProjectXcode/projectName/projectName/projectName-Info.plist
-genpkginfo
/Users/edouarddupin/Library/Developer/Xcode/DerivedData/projectName-gwycnyyzohokcmalgodeucqppxro/Build/Products/Debug-iphonesimulator/projectName.app/PkgInfo
-expandbuildsettings
-format binary
-platform iphonesimulator
-additionalcontentfile /Users/edouarddupin/Library/Developer/Xcode/DerivedData/projectName-gwycnyyzohokcmalgodeucqppxro/Build/Intermediates/projectName.build/Debug-iphonesimulator/projectName.build/assetcatalog_generated_info.plist
-o /Users/edouarddupin/Library/Developer/Xcode/DerivedData/projectName-gwycnyyzohokcmalgodeucqppxro/Build/Products/Debug-iphonesimulator/projectName.app/Info.plist
-additionalcontentfile /Users/edouarddupin/Library/Developer/Xcode/DerivedData/zdzdzd-bjuyukzpzhnyerdmxohjyuxfdllv/Build/Intermediates/zdzdzd.build/Debug-iphoneos/zdzdzd.build/assetcatalog_generated_info.plist -o /Users/edouarddupin/Library/Developer/Xcode/DerivedData/zdzdzd-bjuyukzpzhnyerdmxohjyuxfdllv/Build/Products/Debug-iphoneos/zdzdzd.app/Info.plist
"""
#/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/dsymutil /Users/edouarddupin/Library/Developer/Xcode/DerivedData/projectName-gwycnyyzohokcmalgodeucqppxro/Build/Products/Debug-iphonesimulator/projectName.app/projectName -o /Users/edouarddupin/Library/Developer/Xcode/DerivedData/projectName-gwycnyyzohokcmalgodeucqppxro/Build/Products/Debug-iphonesimulator/projectName.app.dSYM
debug.print_element("pkg", "ResourceRules.plist", "<==", "Resources autorisation")
dataFile = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
dataFile += "<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n"
dataFile += "<plist version=\"1.0\">\n"
dataFile += " <dict>\n"
dataFile += " <key>rules</key>\n"
dataFile += " <dict>\n"
dataFile += " <key>.*</key>\n"
dataFile += " <true/>\n"
dataFile += " <key>Info.plist</key>\n"
dataFile += " <dict>\n"
dataFile += " <key>omit</key>\n"
dataFile += " <true/>\n"
dataFile += " <key>weight</key>\n"
dataFile += " <real>10</real>\n"
dataFile += " </dict>\n"
dataFile += " <key>ResourceRules.plist</key>\n"
dataFile += " <dict>\n"
dataFile += " <key>omit</key>\n"
dataFile += " <true/>\n"
dataFile += " <key>weight</key>\n"
dataFile += " <real>100</real>\n"
dataFile += " </dict>\n"
dataFile += " </dict>\n"
dataFile += " </dict>\n"
dataFile += "</plist>\n"
dataFile += "\n\n"
infoFile = self.get_staging_folder(pkgName) + "/ResourceRules.plist"
# Create the info file
tmpFile = open(infoFile, 'w')
tmpFile.write(dataFile)
tmpFile.flush()
tmpFile.close()
debug.print_element("pkg", "Entitlements.plist", "<==", "application mode")
dataFile = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
dataFile += "<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n"
dataFile += "<plist version=\"1.0\">\n"
dataFile += " <dict>\n"
dataFile += " <key>get-task-allow</key>\n"
dataFile += " <true/>\n"
dataFile += " </dict>\n"
dataFile += "</plist>\n"
dataFile += "\n\n"
infoFile = self.get_staging_folder(pkgName) + "/Entitlements.plist"
# Create the info file
tmpFile = open(infoFile, 'w')
tmpFile.write(dataFile)
tmpFile.flush()
tmpFile.close()
# Simulateur folder :
#~/Library/Application\ Support/iPhone\ Simulator/7.0.3/Applications/
# must have a 'uuidgen' UID generate value with this elemennt ...
# get the bundle path : ==> maybe usefull in MocOS ...
# NSLog(@"%@",[[NSBundle mainBundle] bundlePath]);
# Must create the tarball of the application
#cd $(TARGET_OUT_FINAL)/; tar -cf $(PROJECT_NAME).tar $(PROJECT_NAME).app
#cd $(TARGET_OUT_FINAL)/; tar -czf $(PROJECT_NAME).tar.gz $(PROJECT_NAME).app
if self.sumulator == False:
# Create the info file
tmpFile = open(self.get_build_folder(pkgName) + "/worddown.xcent", 'w')
tmpFile.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n")
tmpFile.write("<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n")
tmpFile.write("<plist version=\"1.0\">\n")
tmpFile.write(" <dict>\n")
tmpFile.write(" <key>application-identifier</key>\n")
tmpFile.write(" <string>" + pkgProperties["APPLE_APPLICATION_IOS_ID"] + "." + pkgProperties["COMPAGNY_TYPE"] + "." + pkgProperties["COMPAGNY_NAME2"] + "." + pkgName + "</string>\n")
tmpFile.write(" <key>get-task-allow</key>\n")
tmpFile.write(" <true/>\n")
tmpFile.write(" <key>keychain-access-groups</key>\n")
tmpFile.write(" <array>\n")
tmpFile.write(" <string>" + pkgProperties["APPLE_APPLICATION_IOS_ID"] + ".atriasoft.worddown</string>\n")
tmpFile.write(" </array>\n")
tmpFile.write(" </dict>\n")
tmpFile.write("</plist>\n")
tmpFile.flush()
tmpFile.close()
# application signing :
debug.print_element("pkg(signed)", "pkg", "<==", "Signing application")
iosDevelopperKeyFile = ".iosKey.txt"
if tools.file_size(iosDevelopperKeyFile) < 10:
debug.error("To sign an application we need to have a signing key in the file '" + iosDevelopperKeyFile + "' \n it is represented like: 'iPhone Developer: Francis DUGENOUX (YRRQE5KGTH)'\n you can obtain it with : 'certtool y | grep \"Developer\"'")
signatureKey = tools.file_read_data(iosDevelopperKeyFile)
signatureKey = re.sub('\n', '', signatureKey)
cmdLine = 'codesign --force --sign '
# to get this key ; certtool y | grep "Developer"
cmdLine += ' "' + signatureKey + '" '
cmdLine += ' --entitlements ' + self.get_build_folder(pkgName) + '/worddown.xcent'
cmdLine += ' ' + self.get_staging_folder(pkgName)
multiprocess.run_command(cmdLine)
# --force --sign "iPhone Developer: Edouard DUPIN (SDFGSDFGSDFG)"
# --resource-rules=/Users/edouarddupin/Library/Developer/Xcode/DerivedData/worddown-cmuvjchgtiteexdiacyqoexsyadg/Build/Products/Debug-iphoneos/worddown.app/ResourceRules.plist
# --entitlements /Users/edouarddupin/Library/Developer/Xcode/DerivedData/worddown-cmuvjchgtiteexdiacyqoexsyadg/Build/Intermediates/worddown.build/Debug-iphoneos/worddown.build/worddown.xcent
# /Users/edouarddupin/Library/Developer/Xcode/DerivedData/worddown-cmuvjchgtiteexdiacyqoexsyadg/Build/Products/Debug-iphoneos/worddown.app
def createRandomNumber(self, len):
out = ""
for iii in range(0,len):
out += random.choice(["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"])
return out
def install_package(self, pkgName):
debug.debug("------------------------------------------------------------------------")
debug.info("Install package '" + pkgName + "'")
debug.debug("------------------------------------------------------------------------")
if self.sumulator == False:
if tools.file_size("ewol/ios-deploy/ios-deploy") == 0:
debug.print_element("tool", "ios-deploy", "<==", "external sources")
cmdLine = 'cd ewol/ios-deploy ; make ; cd ../.. '
multiprocess.run_command(cmdLine)
if tools.file_size("ewol/ios-deploy/ios-deploy") == 0:
debug.error("Can not create ios-deploy external software ...")
debug.print_element("deploy", "iphone/ipad", "<==", "aplication")
cmdLine = './ewol/ios-deploy/ios-deploy --bundle ' + self.get_staging_folder(pkgName)
multiprocess.run_command(cmdLine)
else:
simulatorIdFile = ".iosSimutatorId_" + pkgName + ".txt"
if tools.file_size(simulatorIdFile) < 10:
#create the file:
tmpFile = open(simulatorIdFile, 'w')
tmpFile.write(self.createRandomNumber(8))
tmpFile.write("-")
tmpFile.write(self.createRandomNumber(4))
tmpFile.write("-")
tmpFile.write(self.createRandomNumber(4))
tmpFile.write("-")
tmpFile.write(self.createRandomNumber(4))
tmpFile.write("-")
tmpFile.write(self.createRandomNumber(12))
tmpFile.flush()
tmpFile.close()
simulatorId = tools.file_read_data(simulatorIdFile)
home = os.path.expanduser("~")
destinationFolderBase = home + "/Library/Application\\ Support/iPhone\\ Simulator/7.1/Applications/" + simulatorId
destinationFolder = home + "/Library/Application Support/iPhone Simulator/7.1/Applications/" + simulatorId + "/" + pkgName + ".app"
destinationFolder2 = home + "/Library/Application\\ Support/iPhone\\ Simulator/7.1/Applications/" + simulatorId + "/" + pkgName + ".app"
debug.info("install in simulator : " + destinationFolder)
tools.create_directory_of_file(destinationFolder + "/plop.txt")
cmdLine = "cp -rf " + self.get_staging_folder(pkgName) + " " + destinationFolder2
multiprocess.run_command(cmdLine)
cmdLine = "touch " + destinationFolderBase
multiprocess.run_command(cmdLine)
#sudo dpkg -i $(TARGET_OUT_FINAL)/$(PROJECT_NAME) + self.suffix_package
def un_install_package(self, pkgName):
debug.debug("------------------------------------------------------------------------")
debug.info("Un-Install package '" + pkgName + "'")
debug.debug("------------------------------------------------------------------------")
if self.sumulator == False:
debug.warning("not implemented")
else:
simulatorIdFile = ".iosSimutatorId_" + pkgName + ".txt"
if tools.file_size(simulatorIdFile) < 10:
debug.warning("Can not get simulation O_ID : " + simulatorIdFile)
#sudo dpkg -r $(TARGET_OUT_FINAL)/$(PROJECT_NAME) + self.suffix_package
def Log(self, pkgName):
debug.debug("------------------------------------------------------------------------")
debug.info("log of iOs board")
debug.debug("------------------------------------------------------------------------")
if self.sumulator == False:
if tools.file_size("ewol/ios-deploy/ios-deploy") == 0:
debug.print_element("tool", "ios-deploy", "<==", "external sources")
cmdLine = 'cd ewol/ios-deploy ; make ; cd ../.. '
multiprocess.run_command(cmdLine)
if tools.file_size("ewol/ios-deploy/ios-deploy") == 0:
debug.error("Can not create ios-deploy external software ...")
debug.print_element("deploy", "iphone/ipad", "<==", "aplication")
cmdLine = './ewol/ios-deploy/ios-deploy --debug --bundle ' + self.get_staging_folder(pkgName)
multiprocess.run_command(cmdLine)
else:
cmdLine = "tail -f ~/Library/Logs/iOS\ Simulator/7.1/system.log"
multiprocess.run_command(cmdLine)

View File

@ -1,139 +0,0 @@
#!/usr/bin/python
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license APACHE v2.0 (see license file)
##
from lutin import debug
from lutin import target
from lutin import tools
import os
import stat
import re
from lutin import host
class Target(target.Target):
def __init__(self, config):
#processor type selection (auto/arm/ppc/x86)
if config["arch"] == "auto":
config["arch"] = "x86"
#bus size selection (auto/32/64)
if config["bus-size"] == "auto":
config["bus-size"] = str(host.BUS_SIZE)
target.Target.__init__(self, "Linux", config, "")
if self.config["bus-size"] == "64":
# 64 bits
if host.BUS_SIZE != 64:
self.global_flags_cc.append("-m64")
else:
# 32 bits
if host.BUS_SIZE != 32:
self.global_flags_cc.append("-m32")
def generate_list_separate_coma(self, list):
result = ""
fistTime = True
for elem in list:
if fistTime == True:
fistTime = False
else:
result += ","
result += elem
return result
def make_package(self, pkgName, pkgProperties, basePkgPath):
# http://alp.developpez.com/tutoriels/debian/creer-paquet/
debianPkgName = re.sub("_", "-", pkgName)
debug.debug("------------------------------------------------------------------------")
debug.info("Generate package '" + debianPkgName + "' v"+pkgProperties["VERSION"])
debug.debug("------------------------------------------------------------------------")
self.get_staging_folder(pkgName)
targetOutFolderDebian = self.get_staging_folder(pkgName) + "/DEBIAN/"
finalFileControl = targetOutFolderDebian + "control"
finalFilepostRm = targetOutFolderDebian + "postrm"
# create the folders :
tools.create_directory_of_file(finalFileControl)
tools.create_directory_of_file(finalFilepostRm)
## Create the control file
tools.create_directory_of_file(finalFileControl)
tmpFile = open(finalFileControl, 'w')
tmpFile.write("Package: " + debianPkgName + "\n")
tmpFile.write("Version: " + pkgProperties["VERSION"] + "\n")
tmpFile.write("Section: " + self.generate_list_separate_coma(pkgProperties["SECTION"]) + "\n")
tmpFile.write("Priority: " + pkgProperties["PRIORITY"] + "\n")
tmpFile.write("Architecture: all\n")
tmpFile.write("Depends: bash\n")
tmpFile.write("Maintainer: " + self.generate_list_separate_coma(pkgProperties["MAINTAINER"]) + "\n")
tmpFile.write("Description: " + pkgProperties["DESCRIPTION"] + "\n")
tmpFile.write("\n")
tmpFile.flush()
tmpFile.close()
## Create the PostRm
tmpFile = open(finalFilepostRm, 'w')
tmpFile.write("#!/bin/bash\n")
tmpFile.write("touch ~/." + pkgName + "\n")
if pkgName != "":
tmpFile.write("touch ~/.local/share/" + pkgName + "\n")
tmpFile.write("rm -r ~/.local/share/" + pkgName + "\n")
tmpFile.write("\n")
tmpFile.flush()
tmpFile.close()
## Enable Execution in script
os.chmod(finalFilepostRm, stat.S_IRWXU + stat.S_IRGRP + stat.S_IXGRP + stat.S_IROTH + stat.S_IXOTH);
## Readme donumentation
readmeFileDest = self.get_staging_folder(pkgName) + "/usr/share/doc/"+ debianPkgName + "/README"
tools.create_directory_of_file(readmeFileDest)
if os.path.exists(basePkgPath + "/os-Linux/README")==True:
tools.copy_file(basePkgPath + "/os-Linux/README", readmeFileDest)
elif os.path.exists(basePkgPath + "/README")==True:
tools.copy_file(basePkgPath + "/README", readmeFileDest)
elif os.path.exists(basePkgPath + "/README.md")==True:
tools.copy_file(basePkgPath + "/README.md", readmeFileDest)
else:
debug.info("no file 'README', 'README.md' or 'os-Linux/README' ==> generate an empty one")
tmpFile = open(readmeFileDest, 'w')
tmpFile.write("No documentation for " + pkgName + "\n")
tmpFile.flush()
tmpFile.close()
## licence file
licenseFileDest = self.get_staging_folder(pkgName) + "/usr/share/doc/"+ debianPkgName + "/copyright"
tools.create_directory_of_file(licenseFileDest)
if os.path.exists(basePkgPath + "/license.txt")==True:
tools.copy_file(basePkgPath + "/license.txt", licenseFileDest)
else:
debug.info("no file 'license.txt' ==> generate an empty one")
tmpFile = open(licenseFileDest, 'w')
tmpFile.write("No license define by the developper for " + pkgName + "\n")
tmpFile.flush()
tmpFile.close()
##changeLog file
changeLogFileDest = self.get_staging_folder(pkgName) + "/usr/share/doc/"+ debianPkgName + "/changelog"
tools.create_directory_of_file(changeLogFileDest)
if os.path.exists(basePkgPath + "/changelog")==True:
tools.copy_file(basePkgPath + "/changelog", changeLogFileDest)
else:
debug.info("no file 'changelog' ==> generate an empty one")
tmpFile = open(changeLogFileDest, 'w')
tmpFile.write("No changelog data " + pkgName + "\n")
tmpFile.flush()
tmpFile.close()
## create the package :
debug.debug("package : " + self.get_staging_folder(pkgName) + "/" + debianPkgName + ".deb")
os.system("cd " + self.get_staging_folder("") + " ; dpkg-deb --build " + pkgName)
tools.create_directory_of_file(self.get_final_folder())
tools.copy_file(self.get_staging_folder("") + "/" + pkgName + self.suffix_package, self.get_final_folder() + "/" + pkgName + self.suffix_package)
def install_package(self, pkgName):
debug.debug("------------------------------------------------------------------------")
debug.info("Install package '" + pkgName + "'")
debug.debug("------------------------------------------------------------------------")
os.system("sudo dpkg -i " + self.get_final_folder() + "/" + pkgName + self.suffix_package)
def un_install_package(self, pkgName):
debug.debug("------------------------------------------------------------------------")
debug.info("Un-Install package '" + pkgName + "'")
debug.debug("------------------------------------------------------------------------")
os.system("sudo dpkg -r " + self.get_final_folder() + "/" + pkgName + self.suffix_package)

View File

@ -1,105 +0,0 @@
#!/usr/bin/python
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license APACHE v2.0 (see license file)
##
from lutin import debug
from lutin import target
from lutin import tools
from lutin import host
import os
import stat
class Target(target.Target):
def __init__(self, config):
#processor type selection (auto/arm/ppc/x86)
if config["arch"] == "auto":
config["arch"] = "x86"
#bus size selection (auto/32/64)
if config["bus-size"] == "auto":
config["bus-size"] = str(host.BUS_SIZE)
# http://biolpc22.york.ac.uk/pub/linux-mac-cross/
# http://devs.openttd.org/~truebrain/compile-farm/apple-darwin9.txt
target.Target.__init__(self, "MacOs", config, "")
self.folder_bin="/MacOS"
self.folder_lib="/lib"
self.folder_data="/Resources"
self.folder_doc="/doc"
self.suffix_lib_static='.a'
self.suffix_lib_dynamic='.dylib'
self.suffix_binary=''
self.suffix_package=''
def get_staging_folder(self, binaryName):
return tools.get_run_folder() + self.folder_out + self.folder_staging + "/" + binaryName + ".app/Contents/"
def get_staging_folder_data(self, binaryName):
return self.get_staging_folder(binaryName) + self.folder_data + "/"
def make_package(self, pkgName, pkgProperties, basePkgPath):
debug.debug("------------------------------------------------------------------------")
debug.info("Generate package '" + pkgName + "'")
debug.debug("------------------------------------------------------------------------")
if "ICON" in pkgProperties.keys() \
and pkgProperties["ICON"] != "":
tools.copy_file(pkgProperties["ICON"], self.get_staging_folder_data(pkgName) + "/icon.icns", force=True)
# http://www.sandroid.org/imcross/#Deployment
infoFile=self.get_staging_folder(pkgName) + "/Info.plist"
# Create the info file
tmpFile = open(infoFile, 'w')
tmpFile.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n")
tmpFile.write("<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n")
tmpFile.write("<plist version=\"1.0\">\n")
tmpFile.write(" <dict>\n")
tmpFile.write(" <key>CFBundleExecutableFile</key>\n")
tmpFile.write(" <string>"+pkgName+"</string>\n")
tmpFile.write(" <key>CFBundleName</key>\n")
tmpFile.write(" <string>"+pkgName+"</string>\n")
tmpFile.write(" <key>CFBundleIdentifier</key>\n")
tmpFile.write(" <string>" + pkgProperties["COMPAGNY_TYPE"] + "." + pkgProperties["COMPAGNY_NAME2"] + "." + pkgName + "</string>\n")
tmpFile.write(" <key>CFBundleSignature</key>\n")
tmpFile.write(" <string>????</string>\n")
tmpFile.write(" <key>CFBundleIconFile</key>\n")
tmpFile.write(" <string>icon.icns</string>\n")
tmpFile.write(" </dict>\n")
tmpFile.write("</plist>\n")
tmpFile.write("\n\n")
tmpFile.flush()
tmpFile.close()
infoFile=self.get_staging_folder(pkgName) + "/PkgInfo"
# Create the info file
tmpFile = open(infoFile, 'w')
tmpFile.write("APPL????")
tmpFile.flush()
tmpFile.close()
# Must create the tarball of the application
#cd $(TARGET_OUT_FINAL)/; tar -cf $(PROJECT_NAME).tar $(PROJECT_NAME).app
#cd $(TARGET_OUT_FINAL)/; tar -czf $(PROJECT_NAME).tar.gz $(PROJECT_NAME).app
def install_package(self, pkgName):
debug.debug("------------------------------------------------------------------------")
debug.info("Install package '" + pkgName + "'")
debug.debug("------------------------------------------------------------------------")
debug.warning(" ==> TODO")
#sudo dpkg -i $(TARGET_OUT_FINAL)/$(PROJECT_NAME) + self.suffix_package
def un_install_package(self, pkgName):
debug.debug("------------------------------------------------------------------------")
debug.info("Un-Install package '" + pkgName + "'")
debug.debug("------------------------------------------------------------------------")
debug.warning(" ==> TODO")
#sudo dpkg -r $(TARGET_OUT_FINAL)/$(PROJECT_NAME) + self.suffix_package

View File

@ -1,133 +0,0 @@
#!/usr/bin/python
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license APACHE v2.0 (see license file)
##
from lutin import debug
from lutin import target
from lutin import tools
from lutin import host
import os
import stat
import sys
from lutin import zip
class Target(target.Target):
def __init__(self, config):
if config["compilator"] != "gcc":
debug.error("Windows does not support '" + config["compilator"] + "' compilator ... availlable : [gcc]")
config["compilator"] = "gcc"
#processor type selection (auto/arm/ppc/x86)
if config["arch"] == "auto":
config["arch"] = "x86"
#bus size selection (auto/32/64)
if config["bus-size"] == "auto":
config["bus-size"] = str(host.BUS_SIZE)
target.Target.__init__(self, "Windows", config, "")
# on windows board the basic path is not correct
# TODO : get external PATH for the minGW path
# TODO : Set the cyngwin path ...
if host.OS == "Windows":
self.set_cross_base("c:\\MinGW\\bin\\")
sys.path.append("c:\\MinGW\\bin" )
os.environ['PATH'] += ";c:\\MinGW\\bin\\"
else:
if self.config["bus-size"] == "64":
# 64 bits
self.set_cross_base("x86_64-w64-mingw32-")
else:
# 32 bits
self.set_cross_base("i686-w64-mingw32-")
# force static link to prenvent many errors ...
self.global_flags_ld.append(["-static-libgcc",
"-static-libstdc++",
"-static"])
self.folder_bin=""
self.folder_lib="/lib"
self.folder_data="/data"
self.folder_doc="/doc"
self.suffix_lib_static='.a'
self.suffix_lib_dynamic='.dll'
self.suffix_binary='.exe'
self.suffix_package=''
def get_staging_folder_data(self, binaryName):
return self.get_staging_folder(binaryName) + self.folder_data
def make_package(self, pkgName, pkgProperties, basePkgPath):
debug.debug("------------------------------------------------------------------------")
debug.info("Generate package '" + pkgName + "'")
debug.debug("------------------------------------------------------------------------")
debug.print_element("zip", "data.zip", "<==", "data/*")
zipPath = self.get_staging_folder(pkgName) + "/data.zip"
zip.create_zip(self.get_staging_folder_data(pkgName), zipPath)
binPath = self.get_staging_folder(pkgName) + "/" + self.folder_bin + "/" + pkgName + self.suffix_binary
binSize = tools.file_size(binPath)
debug.info("binarysize : " + str(binSize/1024) + " ko ==> " + str(binSize) + " octets")
#now we create a simple bundle binary ==> all file is stored in one file ...
self.get_staging_folder(pkgName)
finalBin = self.get_final_folder() + "/" + pkgName + self.suffix_binary
tools.create_directory_of_file(finalBin);
debug.print_element("pkg", finalBin, "<==", pkgName + self.suffix_binary)
#open output file
tmpFile = open(finalBin, 'wb')
# read all executable binary
dataExecutable = tools.file_read_data(binPath, binary=True)
# wrte binary to the output
tmpFile.write(dataExecutable)
#align data in the 32 Bytes position (prevent zip align error)
residualToAllign = 32 + 32 - (len(dataExecutable) - int(len(dataExecutable)/32)*32)
for iii in range(0,residualToAllign):
tmpFile.write(b'\0');
positionOfZip = len(dataExecutable) + residualToAllign;
# write a control TAG
tmpFile.write(b'***START DATA***');
# write all the zip file
debug.print_element("pkg", finalBin, "<==", "data.zip")
dataData = tools.file_read_data(zipPath, binary=True)
tmpFile.write(dataData)
#align data in the 32 Bytes position (to be fun"
tmpLen = len(dataData) + positionOfZip
residualToAllign = 32 + 32 - (tmpLen - int(tmpLen/32)*32)
for iii in range(0,residualToAllign):
tmpFile.write(b'\0');
# write a control TAG
tmpFile.write(b'*** END DATA ***');
# reserved AREA (can be use later for extra value ...)
for iii in range(0,8):
tmpFile.write(b'\0');
# write the position of the zip file (TAG position)
h = '{0:016x}'.format(positionOfZip)
s = ('0'*(len(h) % 2) + h).decode('hex')
tmpFile.write(s)
# package is done
tmpFile.flush()
tmpFile.close()
debug.verbose("zip position=" + str(positionOfZip) + " = 0x" + h)
def install_package(self, pkgName):
debug.debug("------------------------------------------------------------------------")
debug.info("Install package '" + pkgName + "'")
debug.debug("------------------------------------------------------------------------")
debug.warning(" ==> TODO")
#sudo dpkg -i $(TARGET_OUT_FINAL)/$(PROJECT_NAME) + self.suffix_package
def un_install_package(self, pkgName):
debug.debug("------------------------------------------------------------------------")
debug.info("Un-Install package '" + pkgName + "'")
debug.debug("------------------------------------------------------------------------")
debug.warning(" ==> TODO")
#sudo dpkg -r $(TARGET_OUT_FINAL)/$(PROJECT_NAME) + self.suffix_package

View File

@ -1,25 +1,27 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license APACHE v2.0 (see license file)
## @license MPL v2.0 (see license file)
##
import os
import shutil
import errno
import fnmatch
import stat
# Local import
from . import debug
from realog import debug
from . import depend
import multiprocess
from . import env
"""
"""
def get_run_folder():
def get_run_path():
return os.getcwd()
"""
@ -29,26 +31,28 @@ def get_current_path(file):
return os.path.dirname(os.path.realpath(file))
def create_directory_of_file(file):
folder = os.path.dirname(file)
path = os.path.dirname(file)
try:
os.stat(folder)
os.stat(path)
except:
os.makedirs(folder)
os.makedirs(path)
def get_list_sub_folder(path):
def get_list_sub_path(path):
# TODO : os.listdir(path)
for dirname, dirnames, filenames in os.walk(path):
return dirnames
return []
def remove_folder_and_sub_folder(path):
def remove_path_and_sub_path(path):
if os.path.isdir(path):
debug.verbose("remove folder : '" + path + "'")
debug.verbose("remove path : '" + path + "'")
shutil.rmtree(path)
def remove_file(path):
if os.path.isfile(path):
os.remove(path)
elif os.path.islink(path):
os.remove(path)
def file_size(path):
if not os.path.isfile(path):
@ -57,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:
@ -67,10 +72,37 @@ def file_read_data(path, binary=False):
file.close()
return data_file
def file_write_data(path, data):
def version_to_string(version):
version_ID = ""
for id in version:
if len(version_ID) != 0:
if type(id) == str:
version_ID += "-"
else:
version_ID += "."
version_ID += str(id)
return version_ID
##
## @brief Write data in a specific path.
## @param[in] path Path of the data might be written.
## @param[in] data Data To write in the file.
## @param[in] only_if_new (default: False) Write data only if data is different.
## @return True Something has been copied
## @return False Nothing has been copied
##
def file_write_data(path, data, only_if_new=False):
if only_if_new == True:
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")
file.write(data)
file.close()
return True
def list_to_str(list):
if type(list) == type(str()):
@ -96,51 +128,369 @@ def add_prefix(prefix,list):
result.append(prefix+elem)
return result
def copy_file(src, dst, cmd_file=None, force=False):
##
## @brief Copy a specific file in a specific directory
## @param[in] src Input file path
## @param[in] dst Output file path
## @param[in] cmd_file (default None) Path of file to store the command line used
## @param[in] force (default False) Force copy of the file
## @param[in] force_identical (default False) Force file to be identical (read it in binary)
## @param[in,out] in_list (default None) Not real copy: set the request copy in the input list
## @return True Something has/must been copied
## @return False Nothing has/myst been copied
##
def copy_file(src, dst, cmd_file=None, force=False, force_identical=False, in_list=None):
if os.path.exists(src) == False:
debug.error("Request a copy a file that does not existed : '" + src + "'")
cmd_line = "copy \"" + src + "\" \"" + dst + "\""
if force == False \
and depend.need_re_build(dst, src, file_cmd=cmd_file , cmdLine=cmd_line) == False:
and depend.need_re_build(dst, src, file_cmd=cmd_file , cmd_line=cmd_line, force_identical=force_identical) == False:
debug.verbose("no need to copy ...")
if in_list != None:
if dst in in_list:
debug.verbose("replace copy file " + os.path.relpath(src) + " ==> " + os.path.relpath(dst))
else:
debug.verbose("append copy file " + os.path.relpath(src) + " ==> " + os.path.relpath(dst))
# update element in dictionnary:
in_list[dst] = {"src":src,
"cmd_file":cmd_file,
"need_copy":False}
return False
if in_list == None:
debug.print_element("copy file ", os.path.relpath(src), "==>", os.path.relpath(dst))
create_directory_of_file(dst)
shutil.copyfile(src, dst)
# copy property of the permition of the file ...
stat_info = os.stat(src)
os.chmod(dst, stat_info.st_mode)
store_command(cmd_line, cmd_file)
else:
debug.verbose("append copy file " + os.path.relpath(src) + " ==> " + os.path.relpath(dst))
# update element in dictionnary:
in_list[dst] = {"src":src,
"cmd_file":cmd_file,
"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
## @param[in] dst Output folder path
## @param[in] recursive (default False) Copy folder with all his dependency
## @param[in] force (default False) Force copy of the file
## @param[in,out] in_list (default None) Not real copy: set the request copy in the input list
##
def copy_anything(src, dst, recursive = False, force_identical=False, in_list=None):
debug.verbose(" copy anything : '" + str(src) + "'")
debug.verbose(" to : '" + str(dst) + "'")
if os.path.isdir(os.path.realpath(src)):
tmp_path = os.path.realpath(src)
tmp_rule = ""
else:
tmp_path = os.path.dirname(os.path.realpath(src))
tmp_rule = os.path.basename(src)
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
debug.verbose(" root='" + str(deltaRoot) + "'")
debug.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:
debug.verbose(" '" + cycleFile + "'")
debug.extreme_verbose("Might copy : '" + tmp_path + " " + deltaRoot + " " + cycleFile + "' ==> '" + dst + "'")
copy_file(os.path.join(tmp_path, deltaRoot, cycleFile),
os.path.join(dst, deltaRoot, cycleFile),
force_identical=force_identical,
in_list=in_list)
##
## @brief real copy of files in a specific dictionnary list
## @param[in] in_list Dictionnary of file to copy
## @return True Something has been copied
## @return False Nothing has been copied
##
def copy_list(in_list):
has_file_copied = False
for dst in in_list:
if in_list[dst]["need_copy"] == False:
continue
# note we force the copy to disable the check of needed of copy (already done)
copy_file(in_list[dst]["src"], dst, cmd_file=in_list[dst]["cmd_file"], force=True)
has_file_copied = True
return has_file_copied
##
## @brief Clean a path from all un-needed element in a directory
## @param[in] path Path to clean
## @param[in] normal_list List of all files/path in the path
## @return True Something has been removed
## @return False Nothing has been removed
##
def clean_directory(path, normal_list):
has_file_removed = False
# get a list of all element in the path:
for root, dirnames, filenames in os.walk(path):
for file in filenames:
file_name = os.path.join(root, file)
if file_name not in normal_list:
debug.print_element("remove file ", os.path.relpath(file_name), "==>", "---")
os.remove(file_name)
has_file_removed = True
return has_file_removed
def filter_extention(list_files, extentions, invert=False):
out = []
for file in list_files:
in_list = False
for ext in extentions:
if file[-len(ext):] == ext:
in_list = True
if in_list == True \
and invert == False:
out.append(file)
elif in_list == False \
and invert == True:
out.append(file)
return out
def move_if_needed(src, dst):
if not os.path.isfile(src):
debug.error("request move if needed, but file does not exist: '" + str(src) + "' to '" + str(dst) + "'")
return
debug.print_element("copy file", src, "==>", dst)
create_directory_of_file(dst)
shutil.copyfile(src, dst)
multiprocess.store_command(cmd_line, cmd_file)
src_data = file_read_data(src)
if os.path.isfile(dst):
# file exist ==> must check ...
dst_data = file_read_data(dst)
if src_data == dst_data:
# nothing to do ...
return
file_write_data(dst, src_data)
remove_file(src)
def store_command(cmd_line, file):
# write cmd line only after to prevent errors ...
if file == "" \
or file == None:
return;
debug.verbose("create cmd file: " + file)
# Create directory:
create_directory_of_file(file)
# Store the command Line:
file2 = open(file, "w")
file2.write(cmd_line)
file2.flush()
file2.close()
def store_warning(file, output, err):
# write warning line only after to prevent errors ...
if file == "" \
or file == None:
return;
if env.get_warning_mode() == False:
debug.verbose("remove warning file: " + file)
# remove file if exist...
remove_file(file);
return;
debug.verbose("create warning file: " + file)
# Create directory:
create_directory_of_file(file)
# Store the command Line:
file2 = open(file, "w")
file2.write("===== output =====\n")
file2.write(output)
file2.write("\n\n")
file2.write("===== error =====\n")
file2.write(err)
file2.write("\n\n")
file2.flush()
file2.close()
def get_type_string(in_type):
if type(in_type) == str:
return "string"
elif type(in_type) == list:
return "list"
elif type(in_type) == dict:
return "dict"
return "unknow"
## List tools:
def list_append_and_check(listout, newElement, order):
for element in listout:
if element==newElement:
return
listout.append(newElement)
if order == True:
if type(newElement) is not dict:
listout.sort()
def list_append_to(out_list, in_list, order=False):
if type(in_list) == str:
list_append_and_check(out_list, in_list, order)
elif type(in_list) == list:
# mulyiple imput in the list ...
for elem in in_list:
list_append_and_check(out_list, elem, order)
elif type(in_list) == dict:
list_append_and_check(out_list, in_list, order)
else:
debug.warning("can not add in list other than {list/dict/str} : " + str(type(in_list)))
def list_append_to_2(listout, module, in_list, order=False):
# sepcial cse of bool
if type(in_list) == bool:
listout[module] = in_list
return
# add list in the Map
if module not in listout:
listout[module] = []
# add elements...
list_append_to(listout[module], in_list, order)
def copy_anything(src, dst):
tmpPath = os.path.dirname(os.path.realpath(src))
tmpRule = os.path.basename(src)
for root, dirnames, filenames in os.walk(tmpPath):
debug.verbose(" root='" + str(root) + "' dir='" + str(dirnames) + "' filenames=" + str(filenames))
tmpList = filenames
if len(tmpRule)>0:
tmpList = fnmatch.filter(filenames, tmpRule)
# Import the module :
for cycleFile in tmpList:
#for cycleFile in filenames:
debug.verbose("Might copy : '" + tmpPath+cycleFile + "' ==> '" + dst + "'")
copy_file(tmpPath+"/"+cycleFile, dst+"/"+cycleFile)
##
## @brief The vertion number can be set in an external file to permit to have a singe position to change when create a vew version
## @param[in] path_module (string) Path of the module position
## @param[in] filename_or_version (string or list) Path of the version or the real version lint parameter
## @return (list) List of version number
##
def get_version_from_file_or_direct(path_module, filename_or_version):
# check case of iser set the version directly
if type(filename_or_version) == list:
return filename_or_version
# this use a version file
file_data = file_read_data(os.path.join(path_module, filename_or_version))
if len(file_data) == 0:
debug.warning("not enought data in the file version size=0 " + path_module + " / " + filename_or_version)
return [0,0,0]
lines = file_data.split("\n")
if len(lines) != 1:
debug.warning("More thatn one line in the file version ==> bas case use mode: 'XX', XX.YYY', 'XX.Y.ZZZ' or 'XX.Y-dev' : " + path_module + " / " + filename_or_version)
return [0,0,0]
line = lines[0]
debug.debug("Parse line: '" + line + "'")
#check if we have "-dev"
dev_mode = ""
list_tiret = line.split('-')
if len(list_tiret) > 2:
debug.warning("more than one '-' in version file " + str(filename_or_version) + " : '" + str(list_tiret) + "' in '" + path_module + "'")
if len(list_tiret) >= 2:
dev_mode = list_tiret[1]
line = list_tiret[0]
out = []
list_elem = line.split('.')
for elem in list_elem:
out.append(int(elem))
if dev_mode != "":
out.append(dev_mode)
debug.debug(" ==> " + str(out))
return out
##
## @brief Get the list of the authors frim an input list or a file
## @param[in] path_module (string) Path of the module position
## @param[in] filename_or_version (string or list) Path of the author file or the real list of authors
## @return (list) List of authors
##
def get_maintainer_from_file_or_direct(path_module, filename_or_author):
# check case of iser set the version directly
if type(filename_or_author) == list:
return filename_or_author
# this use a version file
file_data = file_read_data(os.path.join(path_module, filename_or_author))
if len(file_data) == 0:
debug.warning("not enought data in the file author size=0 " + path_module + " / " + filename_or_author)
return []
# One user by line and # for comment line
out = []
for elem in file_data.split('\n'):
if len(elem) == 0:
continue
if elem[0] == "#":
# comment ...
continue
out.append(elem)
return out
def remove_element(data, to_remove):
base_data = []
for elem in data:
if type(elem) == list:
for elem2 in elem:
base_data.append(elem2)
else:
base_data.append(elem)
base_remove = []
for elem in to_remove:
if type(elem) == list:
for elem2 in elem:
base_remove.append(elem2)
else:
base_remove.append(elem)
out = []
for elem in base_data:
if elem not in base_remove:
out.append(elem)
return out;
def copy_anything_target(target, src, dst):
tmpPath = os.path.dirname(os.path.realpath(src))
tmpRule = os.path.basename(src)
for root, dirnames, filenames in os.walk(tmpPath):
debug.verbose(" root='" + str(root) + "' dir='" + str(dirnames) + "' filenames=" + str(filenames))
tmpList = filenames
if len(tmpRule)>0:
tmpList = fnmatch.filter(filenames, tmpRule)
# Import the module :
for cycleFile in tmpList:
#for cycleFile in filenames:
newDst = dst
if len(newDst) != 0 and newDst[-1] != "/":
newDst += "/"
if root[len(src)-1:] != "":
newDst += root[len(src)-1:]
if len(newDst) != 0 and newDst[-1] != "/":
newDst += "/"
debug.verbose("Might copy : '" + root+"/"+cycleFile + "' ==> '" + newDst+cycleFile + "'" )
target.add_file_staging(root+"/"+cycleFile, newDst+cycleFile)

View File

@ -0,0 +1,9 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license MPL v2.0 (see license file)
##

View File

@ -0,0 +1,191 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license MPL v2.0 (see license file)
##
##
## Executable/binary builder
##
from lutin import multiprocess
from lutin import tools
from realog import debug
from lutin import depend
from lutin import env
import os
##
## Initialize the builder, if needed ... to get dependency between builder (for example)
##
def init():
pass
##
## Get the current builder type.
## Return the type of builder
##
def get_type():
return "linker"
##
## @brief Get builder input file type
## @return List of extention supported
##
def get_input_type():
return ["o"]
##
## @brief Get builder output file type
## @return List of extention supported
##
def get_output_type():
return ["", "exe", "bin"]
##
## @brief Get builder support multi-threading or not
## @return True Multithreading supported
## @return False Multithreading NOT supported
##
def get_support_multithreading():
return False
##
## @brief Commands for running gcc to link an executable.
##
def link(file, binary, target, depancy, flags, name, basic_path, static = False):
file_src = file
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
debug.extreme_verbose("list files = " + str(depancy.src))
list_static = []
list_dynamic = []
if static == True:
#get all parent static libs
list_static = depancy.src['static']
# get only parent shared that is not static
for elem in depancy.src['dynamic']:
lib_name = elem[:-len(target.suffix_lib_dynamic)] + target.suffix_lib_static
if lib_name not in depancy.src['static']:
list_dynamic.append(elem)
else:
#get all parent dynamic libs
list_dynamic = depancy.src['dynamic']
# get only parent shared that is not static
for elem in depancy.src['static']:
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 = [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:
cmd.append(target.xx)
else:
cmd.append(target.cc)
try:
cmd.append(target.arch)
except:
pass
try:
cmd.append(target.sysroot)
except:
pass
try:
cmd.append(["-o", file_dst])
except:
pass
try:
cmd.append(file_src)
except:
pass
try:
cmd.append(depancy.src['src'])
except:
pass
try:
cmd.append(list_static)
except:
pass
try:
for elem in list_dynamic:
lib_path = os.path.dirname(elem)
lib_name = elem[len(lib_path)+len(target.prefix_lib)+1:-len(target.suffix_lib_dynamic)]
cmd.append("-L" + lib_path)
cmd.append("-l" + lib_name)
if target.name != "MacOs" \
and target.name != "Android":
if len(list_dynamic) > 0:
cmd.append("-Wl,-R$ORIGIN/../lib/")
except:
pass
cmd.append("-Wl,-rpath,\"$ORIGIN/../lib\"")
try:
cmd.append(flags["local"]["link"])
except:
pass
try:
cmd.append(depancy.flags["link"])
except:
pass
try:
cmd.append(target.global_flags["link"])
except:
pass
for view in ["local", "export"]:
if view not in flags:
continue
for type in ["link-lib"]:
if type in flags[view]:
cmd.append([("-l" + sss).replace("-l/", "/") for sss in flags[view][type] ])
for type in ["link-bin"]:
if type in flags[view]:
cmd.append(flags[view][type])
for type in ["link-lib"]:
if type in depancy.flags:
cmd.append([("-l" + sss).replace("-l/", "/") for sss in depancy.flags[type] ])
for type in ["link-lib"]:
if type in target.global_flags:
cmd.append([("-l" + sss).replace("-l/", "/") for sss in target.global_flags[type] ])
for type in ["link-bin"]:
if type in target.global_flags:
cmd.append(target.global_flags[type])
if type in depancy.flags:
cmd.append(depancy.flags[type])
cmd_line = tools.list_to_str(cmd)
# check the dependency for this file :
if depend.need_re_package(file_dst, file_src, True, file_cmd=file_cmd, cmd_line=cmd_line) == False \
and depend.need_re_package(file_dst, depancy.src, False, file_cmd=file_cmd, cmd_line=cmd_line) == False:
return file_dst
tools.create_directory_of_file(file_dst)
debug.print_element("Executable", name, "==>", os.path.relpath(file_dst))
multiprocess.run_command(cmd_line, store_output_file=file_warning)
if target.config["mode"] == "release"\
or env.get_force_strip_mode() == True:
# get the file size of the non strip file
originSize = tools.file_size(file_dst);
debug.print_element("Executable(strip)", name, "", "")
cmd_lineStrip=tools.list_to_str([
target.strip,
file_dst])
multiprocess.run_command(cmd_lineStrip, store_output_file=file_warning)
# get the stip size of the binary
strip_size = tools.file_size(file_dst)
debug.debug("file reduce size : " + str(originSize/1024) + "ko ==> " + str(strip_size/1024) + "ko")
# write cmd line only after to prevent errors ...
tools.store_command(cmd_line, file_cmd)

View File

@ -0,0 +1,179 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license MPL v2.0 (see license file)
##
##
## C builder
##
from lutin import multiprocess
from lutin import tools
from realog import debug
from lutin import depend
from lutin import env
# C version:
default_version = 1989
default_version_gnu = False
##
## Initialize the builder, if needed ... to get dependency between builder (for example)
##
def init():
pass
##
## Get the current builder type.
## Return the type of builder
##
def get_type():
return "compiler"
##
## @brief Get builder input file type
## @return List of extention supported
##
def get_input_type():
return ["c", "C"]
##
## @brief Get builder output file type
## @return List of extention supported
##
def get_output_type():
return ["o"]
##
## @brief Get builder support multi-threading or not
## @return True Multithreading supported
## @return False Multithreading NOT supported
##
def get_support_multithreading():
return True
##
## @brief Commands for running gcc to compile a C file in object file.
##
def compile(file, binary, target, depancy, flags, path, name, basic_path, module_src):
file_src = target.get_full_name_source(basic_path, file)
file_cmd = target.get_full_name_cmd(name, basic_path, file)
file_dst = target.get_full_name_destination(name, basic_path, file, get_output_type())
file_depend = target.get_full_dependency(name, basic_path, file)
file_warning = target.get_full_name_warning(name, basic_path, file)
# 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,
target.sysroot]
for view in ["export", "local"]:
try:
cmd.append(tools.add_prefix("-I", path[view]["c"]))
except:
pass
try:
cmd.append(tools.add_prefix("-I", depancy.path["c"]))
except:
pass
cmd.append(target.global_include_cc)
try:
cmd.append(get_version_compilation_flags(flags, depancy.flags))
except:
pass
list_flags = [];
if "c" in target.global_flags:
list_flags.append(target.global_flags["c"])
if "c" in depancy.flags:
list_flags.append(depancy.flags["c"])
for view in ["local", "export"]:
if view in flags:
if "c" in flags[view]:
list_flags.append(flags[view]["c"])
# get blacklist of flags
list_flags_blacklist = [];
if "c-remove" in target.global_flags:
list_flags_blacklist.append(target.global_flags["c-remove"])
if "c-remove" in depancy.flags:
list_flags_blacklist.append(depancy.flags["c-remove"])
for view in ["local", "export"]:
if view in flags:
if "c-remove" in flags[view]:
list_flags_blacklist.append(flags[view]["c-remove"])
# apply blacklisting of data and add it on the cmdLine
clean_flags = tools.remove_element(list_flags, list_flags_blacklist)
#debug.warning("plop " + str(list_flags_blacklist) + " " + str(list_flags) + " --> " + str(clean_flags) )
cmd.append(clean_flags);
cmd.append("-c")
cmd.append("-MMD")
cmd.append("-MP")
cmd.append(file_src)
# Create cmd line
cmdLine=tools.list_to_str(cmd)
# check the dependency for this file :
if depend.need_re_build(file_dst, file_src, file_depend, file_cmd, cmdLine) == False:
return {"action":"add", "file":file_dst}
tools.create_directory_of_file(file_dst)
comment = ["c", name, "<==", file]
# process element
multiprocess.run_in_pool(cmdLine, comment, file_cmd, store_output_file=file_warning)
return {"action":"add", "file":file_dst}
def get_version_compilation_flags(flags, dependency_flags):
try:
version_local = flags["local"]["c-version"]["version"]
except:
version_local = default_version
try:
dependency_version = dependency_flags["c-version"]
except:
dependency_version = default_version
try:
is_gnu = flags["local"]["c-version"]["gnu"]
except:
is_gnu = default_version_gnu
version = max(version_local, dependency_version)
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__=2011"]
elif version == 1999:
if is_gnu ==True:
out = ["-std=gnu99", "-D__C_VERSION__=1999"]
else:
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__=1990"]
else:
if is_gnu ==True:
out = ["-std=gnu89", "-D__C_VERSION__=1989"]
else:
out = ["-std=c89", "-D__C_VERSION__=1989"]
return out

View File

@ -0,0 +1,185 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license MPL v2.0 (see license file)
##
##
## C++ builder
##
from lutin import multiprocess
from lutin import tools
from realog import debug
from lutin import depend
from lutin import env
# C++ default version:
default_version = 1999
default_version_gnu = False
##
## Initialize the builder, if needed ... to get dependency between builder (for example)
##
def init():
pass
##
## Get the current builder type.
## Return the type of builder
##
def get_type():
return "compiler"
##
## @brief Get builder input file type
## @return List of extention supported
##
def get_input_type():
return ["cpp", "CPP", "cxx", "CXX", "xx", "XX", "CC", "cc"]
##
## @brief Get builder output file type
## @return List of extention supported
##
def get_output_type():
return ["o"]
##
## @brief Get builder support multi-threading or not
## @return True Multithreading supported
## @return False Multithreading NOT supported
##
def get_support_multithreading():
return True
##
## @brief Commands for running gcc to compile a C++ file in object file.
##
def compile(file, binary, target, depancy, flags, path, name, basic_path, module_src):
file_src = target.get_full_name_source(basic_path, file)
file_cmd = target.get_full_name_cmd(name, basic_path, file)
file_dst = target.get_full_name_destination(name, basic_path, file, get_output_type())
file_depend = target.get_full_dependency(name, basic_path, file)
file_warning = target.get_full_name_warning(name, basic_path, file)
# 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,
target.sysroot
]
for view in ["export", "local"]:
for type in ["c", "c++"]:
try:
cmd.append(tools.add_prefix("-I",path[view][type]))
except:
pass
for type in ["c", "c++"]:
try:
cmd.append(tools.add_prefix("-I",depancy.path[type]))
except:
pass
cmd.append(target.global_include_cc)
try:
cmd.append(get_version_compilation_flags(flags, depancy.flags))
except:
pass
list_flags = [];
if "c" in target.global_flags:
list_flags.append(target.global_flags["c"])
if "c++" in target.global_flags:
list_flags.append(target.global_flags["c++"])
for type in ["c", "c++"]:
if type in depancy.flags:
list_flags.append(depancy.flags[type])
for view in ["local", "export"]:
if view in flags:
for type in ["c", "c++"]:
if type in flags[view]:
list_flags.append(flags[view][type])
# get blacklist of flags
list_flags_blacklist = [];
if "c-remove" in target.global_flags:
list_flags_blacklist.append(target.global_flags["c-remove"])
if "c++-remove" in target.global_flags:
list_flags_blacklist.append(target.global_flags["c++-remove"])
for type in ["c-remove", "c++-remove"]:
if type in depancy.flags:
list_flags_blacklist.append(depancy.flags[type])
for view in ["local", "export"]:
if view in flags:
for type in ["c-remove", "c++-remove"]:
if type in flags[view]:
list_flags_blacklist.append(flags[view][type])
# apply blacklisting of data and add it on the cmdLine
clean_flags = tools.remove_element(list_flags, list_flags_blacklist)
#debug.warning("plop " + str(list_flags_blacklist) + " " + str(list_flags) + " --> " + str(clean_flags) )
cmd.append(clean_flags);
cmd.append(["-c", "-MMD", "-MP"])
cmd.append(file_src)
# Create cmd line
cmdLine = tools.list_to_str(cmd)
# check the dependency for this file :
if depend.need_re_build(file_dst, file_src, file_depend, file_cmd, cmdLine) == False:
return {"action":"add", "file":file_dst}
tools.create_directory_of_file(file_dst)
comment = ["c++", name, "<==", file]
#process element
multiprocess.run_in_pool(cmdLine, comment, file_cmd, store_output_file=file_warning)
return {"action":"add", "file":file_dst}
def get_version_compilation_flags(flags, dependency_flags):
try:
version_local = flags["local"]["c++-version"]["version"]
except:
version_local = default_version
try:
dependency_version = dependency_flags["c++-version"]
except:
dependency_version = default_version
try:
is_gnu = flags["local"]["c++-version"]["gnu"]
except:
is_gnu = default_version_gnu
version = max(version_local, dependency_version)
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"]
elif version == 2014:
if is_gnu == True:
out = ["-std=gnu++14", "-D__CPP_VERSION__=2014"]
else:
out = ["-std=c++14", "-D__CPP_VERSION__=2014"]
elif version == 2011:
if is_gnu == True:
out = ["-std=gnu++11", "-D__CPP_VERSION__=2011"]
else:
out = ["-std=c++11", "-D__CPP_VERSION__=2011"]
elif version == 2003:
if is_gnu == True:
out = ["-std=gnu++03", "-D__CPP_VERSION__=2003"]
else:
out = ["-std=c++03", "-D__CPP_VERSION__=2003"]
else:
if is_gnu == True:
out = ["-std=gnu++98", "-D__CPP_VERSION__=1999"]
else:
out = ["-std=c++98", "-D__CPP_VERSION__=1999"]
return out

View File

@ -0,0 +1,96 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license MPL v2.0 (see license file)
##
##
## Dynamic library builder
##
from lutin import multiprocess
from lutin import tools
from realog import debug
from lutin import depend
from lutin import env
import os
##
## Initialize the builder, if needed ... to get dependency between builder (for example)
##
def init():
pass
##
## Get the current builder type.
## Return the type of builder
##
def get_type():
return "linker"
##
## @brief Get builder input file type
## @return List of extention supported
##
def get_input_type():
return ["class"]
##
## @brief Get builder output file type
## @return List of extention supported
##
def get_output_type():
return ["jar"]
##
## @brief Get builder support multi-threading or not
## @return True Multithreading supported
## @return False Multithreading NOT supported
##
def get_support_multithreading():
return False
##
## @brief Commands for running gcc to link a shared library.
##
def link(file, binary, target, depancy, flags, name, basic_path):
file_src = file
file_dst = os.path.join(target.get_build_path(name), name + ".jar")
file_depend = file_dst + target.suffix_dependence
file_cmd = file_dst + target.suffix_cmd_line
file_warning = file_dst + target.suffix_warning
#create command Line
cmd = [
target.jar,
"cf", file_dst,
]
for file in file_src:
path = ""
for elem in ["org/", "com/"]:
pos = file.find(elem);
if pos > 0:
path = file[:pos]
file = file[pos:]
cmd.append("-C")
cmd.append(path)
cmd.append(file)
cmdLine=tools.list_to_str(cmd)
"""
# check the dependency for this file :
if depend.need_re_package(file_dst, file_src, True, file_cmd, cmdLine) == False:
return tmpList[1]
"""
tools.create_directory_of_file(file_dst)
debug.print_element("jar", name, "==>", file_dst)
multiprocess.run_command(cmdLine, store_output_file=file_warning)
# write cmd line only after to prevent errors ...
tools.store_command(cmdLine, file_cmd)
#debug.print_element("SharedLib", self.name, "==>", tmpList[1])
return file_dst

View File

@ -0,0 +1,141 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license MPL v2.0 (see license file)
##
##
## Java builder
##
from lutin import multiprocess
from lutin import tools
from realog import debug
from lutin import depend
##
## Initialize the builder, if needed ... to get dependency between builder (for example)
##
def init():
pass
##
## Get the current builder type.
## Return the type of builder
##
def get_type():
return "compiler"
##
## @brief Get builder input file type
## @return List of extention supported
##
def get_input_type():
return ["java"]
##
## @brief Get builder output file type
## @return List of extention supported
##
def get_output_type():
return ["class"]
##
## @brief Get builder support multi-threading or not
## @return True Multithreading supported
## @return False Multithreading NOT supported
##
def get_support_multithreading():
return False
def create_dependency_files(target, src, heritage_src, basic_path):
depend = []
for elem in src:
extention = elem.split('.')[-1]
if extention == 'jar' \
or extention == 'java':
debug.extreme_verbose("add java depedence ... " + elem)
depend.append(target.get_full_name_source(basic_path, elem))
for elem in heritage_src:
extention = elem.split('.')[-1]
if extention == 'jar' \
or extention == 'java':
debug.extreme_verbose("add java depedence ... " + elem)
depend.append(elem)
return depend
##
## @brief Commands for running gcc to compile a C++ file in object file.
##
def compile(file, binary, target, depancy, flags, path, name, basic_path, module_src):
file_src = target.get_full_name_source(basic_path, file)
file_cmd = target.get_full_name_cmd(name, basic_path, file)
file_dst = target.get_full_name_destination(name, basic_path, file, get_output_type(), remove_suffix=True)
file_depend = target.get_full_dependency(name, basic_path, file)
file_warning = target.get_full_name_warning(name, basic_path, file)
depend_files = create_dependency_files(target, module_src, depancy.src['src'], basic_path)
"""
debug.warning("file_src = " + file_src)
debug.warning("file_cmd = " + file_cmd)
debug.warning("file_dst = " + file_dst)
debug.warning("file_depend = " + file_depend)
debug.warning("file_warning = " + file_warning)
"""
# create the command line befor requesting start:
cmd = [
target.java,
"-d", target.get_build_path_object(name)
]
# add source dependency:
list_sources_path = []
for view in ["export", "local"]:
try:
list = path[view]["java"]
for elem in list:
list_sources_path.append(elem)
except:
pass
if len(list_sources_path) > 0:
cmd.append("-sourcepath")
out = ""
for elem in list_sources_path:
if len(out) > 0:
out += ":"
out += elem
cmd.append(out)
class_extern = []
upper_jar = tools.filter_extention(depancy.src['src'], ["jar"])
#debug.warning("ploppppp = " + str(upper_jar))
for elem in upper_jar:
class_extern.append(elem)
if len(class_extern) > 0:
cmd.append("-classpath")
out = ""
for elem in class_extern:
if len(out) > 0:
out += ":"
out += elem
cmd.append(out)
cmd.append(file_src)
# Create cmd line
cmdLine=tools.list_to_str(cmd)
# check the dependency for this file :
if depend.need_re_build(file_dst, file_src, file_depend, file_cmd, cmdLine) == False:
return {"action":"add", "file":file_dst}
tools.create_directory_of_file(file_dst)
comment = ["java", name, "<==", file]
#process element
multiprocess.run_in_pool(cmdLine,
comment,
file_cmd,
store_output_file = file_warning,
depend_data = {"file":file_depend,
"data":depend_files})
return {"action":"add", "file":file_dst}

View File

@ -0,0 +1,113 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license MPL v2.0 (see license file)
##
##
## Java builder
##
from lutin import multiprocess
from lutin import tools
from realog import debug
from lutin import depend
##
## Initialize the builder, if needed ... to get dependency between builder (for example)
##
def init():
pass
##
## Get the current builder type.
## Return the type of builder
##
def get_type():
return "compiler"
##
## @brief Get builder input file type
## @return List of extention supported
##
def get_input_type():
return ["javah"]
##
## @brief Get builder output file type
## @return List of extention supported
##
def get_output_type():
return ["h"]
##
## @brief Get builder support multi-threading or not
## @return True Multithreading supported
## @return False Multithreading NOT supported
##
def get_support_multithreading():
return False
def create_dependency_files(target, src, heritage_src, basic_path):
depend = []
for elem in src:
extention = elem.split('.')[-1]
if extention == 'jar' \
or extention == 'java':
debug.extreme_verbose("add java depedence ... " + elem)
depend.append(target.get_full_name_source(basic_path, elem))
for elem in heritage_src:
extention = elem.split('.')[-1]
if extention == 'jar' \
or extention == 'java':
debug.extreme_verbose("add java depedence ... " + elem)
depend.append(elem)
return depend
##
## @brief Commands for running gcc to compile a C++ file in object file.
##
def compile(file, binary, target, depancy, flags, path, name, basic_path, module_src):
# file_src = target.get_full_name_source(basic_path, file)
file_cmd = target.get_full_name_cmd(name, basic_path, file)
# file_dst = target.get_full_name_destination(name, basic_path, file, get_output_type())
file_depend = target.get_full_dependency(name, basic_path, file)
file_warning = target.get_full_name_warning(name, basic_path, file)
depend_files = create_dependency_files(target, module_src, depancy.src['src'], basic_path)
# create the command line befor requesting start:
cmd = [
target.javah,
"-d", target.get_build_path(name) + target.path_generate_code
]
if debug.get_level() >= 5:
cmd.append("-verbose")
cmd.append("-classpath")
cmd.append(target.get_build_path_object(name))
class_to_build = file[:-6]
cmd.append(class_to_build)
# Create cmd line
cmd_line = tools.list_to_str(cmd)
file_dst = target.get_build_path(name) + "/generate_header/" + class_to_build.replace(".", "_") + ".h"
# check the dependency for this file :
if depend.need_re_build(file_dst, None, file_depend, file_cmd, cmd_line) == False:
return {"action":"path", "path":target.get_build_path(name) + target.path_generate_code}
#tools.create_directory_of_file(file_dst)
comment = ["javah", class_to_build.replace(".", "_") + ".h", "<==", class_to_build]
#process element
multiprocess.run_in_pool(cmd_line,
comment,
file_cmd,
store_output_file = file_warning,
depend_data = {"file":file_depend,
"data":depend_files})
debug.verbose("file= " + file_dst)
#return file_dst
return {"action":"path", "path":target.get_build_path(name) + target.path_generate_code}

View File

@ -0,0 +1,188 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license MPL v2.0 (see license file)
##
##
## Dynamic library builder
##
from lutin import multiprocess
from lutin import tools
from realog import debug
from lutin import depend
from lutin import env
import os
##
## Initialize the builder, if needed ... to get dependency between builder (for example)
##
def init():
pass
##
## Get the current builder type.
## Return the type of builder
##
def get_type():
return "linker"
##
## @brief Get builder input file type
## @return List of extention supported
##
def get_input_type():
return ["o", "a"]
##
## @brief Get builder output file type
## @return List of extention supported
##
def get_output_type():
return ["so", "dynlib", "dll"]
##
## @brief Get builder support multi-threading or not
## @return True Multithreading supported
## @return False Multithreading NOT supported
##
def get_support_multithreading():
return False
##
## @brief Commands for running gcc to link a shared library.
##
def link(file, binary, target, depancy, flags, name, basic_path, static=False):
file_src = file
file_dst = target.get_build_file_dynamic(name)
file_depend = file_dst + target.suffix_dependence
file_cmd = file_dst + target.suffix_cmd_line
file_warning = file_dst + target.suffix_warning
debug.extreme_verbose("file_dst = " + file_dst)
debug.extreme_verbose("file_depend = " + file_depend)
debug.extreme_verbose("file_cmd = " + file_cmd)
debug.extreme_verbose("file_warning = " + file_warning)
list_static = []
list_dynamic = []
if static == True:
#get all parent static libs
list_static = depancy.src['static']
# get only parent shared that is not static
for elem in depancy.src['dynamic']:
lib_name = elem[:-len(target.suffix_lib_dynamic)] + target.suffix_lib_static
if lib_name not in depancy.src['static']:
list_dynamic.append(elem)
else:
#get all parent dynamic libs
list_dynamic = depancy.src['dynamic']
# get only parent shared that is not static
for elem in depancy.src['static']:
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 = [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:
cmd.append(target.xx)
else:
cmd.append(target.cc)
cmd.append(["-o", file_dst])
try:
cmd.append(target.sysroot)
except:
pass
try:
cmd.append(target.arch)
except:
pass
cmd.append("-shared")
try:
cmd.append(file_src)
except:
pass
try:
cmd.append(list_static)
except:
pass
for view in ["local", "export"]:
if view not in flags:
continue
for type in ["link", "link-dynamic"]:
if type in flags[view]:
cmd.append(flags[view][type])
for type in ["link", "link-dynamic"]:
if type in depancy.flags:
cmd.append(depancy.flags[type])
for type in ["link", "link-dynamic"]:
if type in target.global_flags:
cmd.append(target.global_flags[type])
if 'src' in depancy.src:
cmd.append(tools.filter_extention(depancy.src['src'], get_input_type()))
try:
for elem in list_dynamic:
lib_path = os.path.dirname(elem)
lib_name = elem[len(lib_path)+len(target.prefix_lib)+1:-len(target.suffix_lib_dynamic)]
cmd.append("-L" + lib_path)
cmd.append("-l" + lib_name)
if target.name != "MacOs" \
and target.name != "Android":
if len(list_dynamic) > 0:
cmd.append("-Wl,-R$ORIGIN/../lib/")
except:
pass
for view in ["local", "export"]:
if view not in flags:
continue
for type in ["link-lib"]:
if type in flags[view]:
cmd.append([("-l" + sss).replace("-l/", "/") for sss in flags[view][type] ])
for type in ["link-lib"]:
if type in depancy.flags:
cmd.append([("-l" + sss).replace("-l/", "/") for sss in depancy.flags[type] ])
for type in ["link-lib"]:
if type in target.global_flags:
cmd.append([("-l" + sss).replace("-l/", "/") for sss in target.global_flags[type] ])
cmdLine=tools.list_to_str(cmd)
# check the dependency for this file :
if depend.need_re_package(file_dst, file_src, True, file_cmd, cmdLine) == False \
and depend.need_re_package(file_dst, depancy.src, False, file_cmd, cmdLine) == False:
return file_dst
tools.create_directory_of_file(file_dst)
debug.print_element("SharedLib", name, "==>", os.path.relpath(file_dst))
multiprocess.run_command(cmdLine, store_output_file=file_warning)
# strip the output file:
if target.config["mode"] == "release" \
or env.get_force_strip_mode() == True:
# get the file size of the non strip file
originSize = tools.file_size(file_dst);
debug.print_element("SharedLib(strip)", name, "", "")
if "MacOs" in target.get_type():
cmdLineStrip=tools.list_to_str([
target.strip,
"-u",
file_dst])
else:
cmdLineStrip=tools.list_to_str([
target.strip,
file_dst])
multiprocess.run_command(cmdLineStrip, store_output_file=file_warning)
# get the stip size of the binary
stripSize = tools.file_size(file_dst)
debug.debug("file reduce size : " + str(originSize/1024) + "ko ==> " + str(stripSize/1024) + "ko")
# write cmd line only after to prevent errors ...
tools.store_command(cmdLine, file_cmd)
#debug.print_element("SharedLib", self.name, "==>", tmpList[1])
return file_dst

View File

@ -1,9 +1,19 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license MPL v2.0 (see license file)
##
##
## Static library builder
##
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
@ -26,7 +36,7 @@ def get_type():
## @return List of extention supported
##
def get_input_type():
return ["o"]
return ["o", "a"]
##
## @brief Get builder output file type
@ -35,17 +45,39 @@ def get_input_type():
def get_output_type():
return ["a"]
##
## @brief Get builder support multi-threading or not
## @return True Multithreading supported
## @return False Multithreading NOT supported
##
def get_support_multithreading():
return False
##
## @brief Commands for running ar.
##
def link(file, binary, target, depancy, name, basic_folder):
file_src, file_dst, file_depend, file_cmd = target.generate_file(binary, name, basic_folder, file, "lib-static")
#$(Q)$(TARGET_AR) $(TARGET_GLOBAL_ARFLAGS) $(PRIVATE_ARFLAGS) $@ $(PRIVATE_ALL_OBJECTS)
def link(file, binary, target, depancy, flags, name, basic_path):
file_src = file
file_dst = target.get_build_file_static(name)
file_depend = file_dst + target.suffix_dependence
file_cmd = file_dst + target.suffix_cmd_line
file_warning = file_dst + target.suffix_warning
debug.extreme_verbose("file_dst = " + file_dst)
debug.extreme_verbose("file_depend = " + file_depend)
debug.extreme_verbose("file_cmd = " + file_cmd)
debug.extreme_verbose("file_warning = " + file_warning)
# set ccache interface:
compilator_ccache = ""
if env.get_ccache() == True:
compilator_ccache = "ccache"
cmd = [
compilator_ccache,
target.ar
]
try:
cmd.append(target.global_flags_ar)
cmd.append(target.global_flags["ar"])
except:
pass
try:
@ -65,18 +97,19 @@ def link(file, binary, target, depancy, name, basic_folder):
if depend.need_re_package(file_dst, file_src, True, file_cmd, cmdLine) == False \
and depend.need_re_package(file_dst, depancy.src, False, file_cmd, cmdLine) == False:
return file_dst
tools.create_directory_of_file(file_dst)
debug.print_element("StaticLib", name, "==>", file_dst)
debug.print_element("StaticLib", name, "==>", os.path.relpath(file_dst))
# explicitly remove the destination to prevent error ...
if os.path.exists(file_dst) and os.path.isfile(file_dst):
os.remove(file_dst)
multiprocess.run_command(cmdLine)
multiprocess.run_command(cmdLine, store_output_file=file_warning)
#$(Q)$(TARGET_RANLIB) $@
if target.ranlib != "":
cmdLineRanLib=tools.list_to_str([
target.ranlib,
file_dst ])
multiprocess.run_command(cmdLineRanLib)
multiprocess.run_command(cmdLineRanLib, store_output_file=file_warning)
# write cmd line only after to prevent errors ...
multiprocess.store_command(cmdLine, file_cmd)
tools.store_command(cmdLine, file_cmd)
return file_dst

View File

@ -0,0 +1,140 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license MPL v2.0 (see license file)
##
##
## Objective-C builder
##
from lutin import multiprocess
from lutin import tools
from lutin import builder
from realog import debug
from lutin import depend
from lutin import env
local_ref_on_builder_c = None
##
## Initialize the builder, if needed ... to get dependency between builder (for example)
##
def init():
global local_ref_on_builder_c
debug.debug("m builder get dependency on the C builder")
local_ref_on_builder_c = builder.get_builder("c")
##
## Get the current builder type.
## Return the type of builder
##
def get_type():
return "compiler"
##
## @brief Get builder input file type
## @return List of extention supported
##
def get_input_type():
return ["m", "M"]
##
## @brief Get builder output file type
## @return List of extention supported
##
def get_output_type():
return ["o"]
##
## @brief Get builder support multi-threading or not
## @return True Multithreading supported
## @return False Multithreading NOT supported
##
def get_support_multithreading():
return True
##
## @brief Commands for running gcc to compile a m file in object file.
##
def compile(file, binary, target, depancy, flags, path, name, basic_path, module_src):
file_src = target.get_full_name_source(basic_path, file)
file_cmd = target.get_full_name_cmd(name, basic_path, file)
file_dst = target.get_full_name_destination(name, basic_path, file, get_output_type())
file_depend = target.get_full_dependency(name, basic_path, file)
file_warning = target.get_full_name_warning(name, basic_path, file)
# 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,
target.sysroot,
target.global_include_cc]
for view in ["export", "local"]:
for type in ["c", "m"]:
try:
cmd.append(tools.add_prefix("-I",path[view][type]))
except:
pass
for type in ["c", "m"]:
try:
cmd.append(tools.add_prefix("-I",depancy.path[type]))
except:
pass
try:
cmd.append(local_ref_on_builder_c.get_version_compilation_flags(flags, depancy.flags))
except:
pass
list_flags = [];
if "c" in target.global_flags:
list_flags.append(target.global_flags["c"])
if "m" in target.global_flags:
list_flags.append(target.global_flags["m"])
for type in ["c", "m"]:
if type in depancy.flags:
list_flags.append(depancy.flags[type])
for view in ["local", "export"]:
if view in flags:
for type in ["c", "m"]:
if type in flags[view]:
list_flags.append(flags[view][type])
# get blacklist of flags
list_flags_blacklist = [];
if "c-remove" in target.global_flags:
list_flags_blacklist.append(target.global_flags["c-remove"])
if "m-remove" in target.global_flags:
list_flags_blacklist.append(target.global_flags["m-remove"])
for type in ["c-remove", "m-remove"]:
if type in depancy.flags:
list_flags_blacklist.append(depancy.flags[type])
for view in ["local", "export"]:
if view in flags:
for type in ["c-remove", "m-remove"]:
if type in flags[view]:
list_flags_blacklist.append(flags[view][type])
# apply blacklisting of data and add it on the cmdLine
clean_flags = tools.remove_element(list_flags, list_flags_blacklist)
#debug.warning("plop " + str(list_flags_blacklist) + " " + str(list_flags) + " --> " + str(clean_flags) )
cmd.append(clean_flags);
cmd.append("-c -MMD -MP")
cmd.append("-x objective-c")
cmd.append(file_src)
# Create cmd line
cmdLine=tools.list_to_str(cmd)
# check the dependency for this file :
if depend.need_re_build(file_dst, file_src, file_depend, file_cmd, cmdLine) == False:
return {"action":"add", "file":file_dst}
tools.create_directory_of_file(file_dst)
comment = ["m", name, "<==", file]
#process element
multiprocess.run_in_pool(cmdLine, comment, file_cmd, store_output_file=file_warning)
return {"action":"add", "file":file_dst}

View File

@ -0,0 +1,147 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license MPL v2.0 (see license file)
##
##
## Objective C++ builder
##
from lutin import multiprocess
from lutin import tools
from lutin import builder
from realog import debug
from lutin import depend
from lutin import env
local_ref_on_builder_cpp = None
##
## Initialize the builder, if needed ... to get dependency between builder (for example)
##
def init():
global local_ref_on_builder_cpp
debug.debug("mm builder get dependency on the CPP builder")
local_ref_on_builder_cpp = builder.get_builder("cpp")
##
## Get the current builder type.
## Return the type of builder
##
def get_type():
return "compiler"
##
## @brief Get builder input file type
## @return List of extention supported
##
def get_input_type():
return ["mm", "MM"]
##
## @brief Get builder output file type
## @return List of extention supported
##
def get_output_type():
return ["o"]
##
## @brief Get builder support multi-threading or not
## @return True Multithreading supported
## @return False Multithreading NOT supported
##
def get_support_multithreading():
return True
##
## @brief Commands for running gcc to compile a m++ file in object file.
##
def compile(file, binary, target, depancy, flags, path, name, basic_path, module_src):
file_src = target.get_full_name_source(basic_path, file)
file_cmd = target.get_full_name_cmd(name, basic_path, file)
file_dst = target.get_full_name_destination(name, basic_path, file, get_output_type())
file_depend = target.get_full_dependency(name, basic_path, file)
file_warning = target.get_full_name_warning(name, basic_path, file)
# 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,
target.sysroot,
target.global_include_cc]
for view in ["export", "local"]:
for type in ["c", "c++", "m", "mm"]:
try:
cmd.append(tools.add_prefix("-I",path[view][type]))
except:
pass
for type in ["c", "c++", "m", "mm"]:
try:
cmd.append(tools.add_prefix("-I",depancy.path[type]))
except:
pass
try:
cmd.append(local_ref_on_builder_cpp.get_version_compilation_flags(flags, depancy.flags))
except:
pass
list_flags = [];
if "c" in target.global_flags:
list_flags.append(target.global_flags["c"])
if "c++" in target.global_flags:
list_flags.append(target.global_flags["c++"])
if "m" in target.global_flags:
list_flags.append(target.global_flags["m"])
if "mm" in target.global_flags:
list_flags.append(target.global_flags["mm"])
for type in ["c", "c++", "m", "mm"]:
if type in depancy.flags:
list_flags.append(depancy.flags[type])
for view in ["local", "export"]:
if view in flags:
for type in ["c", "c++", "m", "mm"]:
if type in flags[view]:
list_flags.append(flags[view][type])
# get blacklist of flags
list_flags_blacklist = [];
if "c-remove" in target.global_flags:
list_flags_blacklist.append(target.global_flags["c-remove"])
if "c++-remove" in target.global_flags:
list_flags_blacklist.append(target.global_flags["c++-remove"])
if "m-remove" in target.global_flags:
list_flags_blacklist.append(target.global_flags["m-remove"])
if "mm-remove" in target.global_flags:
list_flags_blacklist.append(target.global_flags["mm-remove"])
for type in ["c-remove", "c++-remove","m-remove", "mm-remove"]:
if type in depancy.flags:
list_flags_blacklist.append(depancy.flags[type])
for view in ["local", "export"]:
if view in flags:
for type in ["c-remove", "c++-remove","m-remove", "mm-remove"]:
if type in flags[view]:
list_flags_blacklist.append(flags[view][type])
# apply blacklisting of data and add it on the cmdLine
clean_flags = tools.remove_element(list_flags, list_flags_blacklist)
#debug.warning("plop " + str(list_flags_blacklist) + " " + str(list_flags) + " --> " + str(clean_flags) )
cmd.append(clean_flags);
cmd.append("-c -MMD -MP")
cmd.append("-x objective-c++")
cmd.append(file_src)
# Create cmd line
cmdLine=tools.list_to_str(cmd)
# check the dependency for this file :
if False==depend.need_re_build(file_dst, file_src, file_depend, file_cmd, cmdLine):
return {"action":"add", "file":file_dst}
tools.create_directory_of_file(file_dst)
comment = ["m++", name, "<==", file]
#process element
multiprocess.run_in_pool(cmdLine, comment, file_cmd, store_output_file=file_warning)
return {"action":"add", "file":file_dst}

View File

@ -0,0 +1,111 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license MPL v2.0 (see license file)
##
##
## ASM builder
##
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)
##
def init():
pass
##
## Get the current builder type.
## Return the type of builder
##
def get_type():
return "compiler"
##
## @brief Get builder input file type
## @return List of extention supported
##
def get_input_type():
return ["s", "S"]
##
## @brief Get builder output file type
## @return List of extention supported
##
def get_output_type():
return ["o"]
##
## @brief Get builder support multi-threading or not
## @return True Multithreading supported
## @return False Multithreading NOT supported
##
def get_support_multithreading():
return True
##
## @brief Commands for running gcc to compile a C file in object file.
##
def compile(file, binary, target, depancy, flags, path, name, basic_path, module_src):
file_src = target.get_full_name_source(basic_path, file)
file_cmd = target.get_full_name_cmd(name, basic_path, file)
file_dst = target.get_full_name_destination(name, basic_path, file, get_output_type())
file_depend = target.get_full_dependency(name, basic_path, file)
file_warning = target.get_full_name_warning(name, basic_path, file)
# 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,
target.sysroot]
for view in ["export", "local"]:
try:
cmd.append(tools.add_prefix("-I", path[view]["c"]))
except:
pass
try:
cmd.append(tools.add_prefix("-I", depancy.path["c"]))
except:
pass
cmd.append(target.global_include_cc)
try:
cmd.append(target.global_flags["c"])
except:
pass
try:
cmd.append(depancy.flags["c"])
except:
pass
for view in ["local", "export"]:
try:
cmd.append(flags[view]["c"])
except:
pass
cmd.append("-c")
cmd.append("-MMD")
cmd.append("-MP")
cmd.append(file_src)
# Create cmd line
cmdLine=tools.list_to_str(cmd)
# check the dependency for this file :
if depend.need_re_build(file_dst, file_src, file_depend, file_cmd, cmdLine) == False:
return {"action":"add", "file":file_dst}
tools.create_directory_of_file(file_dst)
comment = ["s", name, "<==", file]
# process element
multiprocess.run_in_pool(cmdLine, comment, file_cmd, store_output_file=file_warning)
return {"action":"add", "file":file_dst}

View File

@ -0,0 +1,9 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license MPL v2.0 (see license file)
##

View File

@ -0,0 +1,117 @@
#!/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("ADMOD: Android SDK ad-mod interface (auto-create interface for admod)\n")
# todo : Check if present ...
self.set_valid(True)
# todo : create a searcher of the presence of the library:
self.add_sources(target.path_sdk + "/extras/google/google_play_services/libproject/google-play-services_lib/libs/google-play-services.jar")
self.add_action("PACKAGE", 10, "admod-auto-wrapper", tool_generate_main_java_class)
##################################################################
##
## Android specific section
##
##################################################################
def tool_generate_main_java_class(target, module, package_name):
if "ADMOD_ID" not in module.package_prop:
debug.warning("Missing parameter ADMOD_ID wen you resuested dependency of ADMOD")
return
module.package_prop["RIGHT"].append("INTERNET")
module.package_prop["RIGHT"].append("ACCESS_NETWORK_STATE")
module.pkg_add("GENERATE_SECTION__IMPORT", [
"import com.google.android.gms.ads.AdRequest;",
"import com.google.android.gms.ads.AdSize;",
"import com.google.android.gms.ads.AdView;",
"import android.widget.LinearLayout;",
"import android.widget.Button;"
])
module.pkg_add("GENERATE_SECTION__DECLARE", [
"/** The view to show the ad. */",
"private AdView adView;",
"private LinearLayout mLayout = null;"
])
list_create = [
"mLayout = new LinearLayout(this);"
"mLayout.setOrientation(android.widget.LinearLayout.VERTICAL);",
"LinearLayout.LayoutParams paramsWindows = new LinearLayout.LayoutParams(",
" LinearLayout.LayoutParams.FILL_PARENT,",
" LinearLayout.LayoutParams.FILL_PARENT);",
"",
"setContentView(mLayout, paramsWindows);",
"",
"LinearLayout.LayoutParams paramsAdds = new LinearLayout.LayoutParams(",
" LinearLayout.LayoutParams.FILL_PARENT,",
" LinearLayout.LayoutParams.WRAP_CONTENT);",
"paramsAdds.weight = 0;",
"",
"LinearLayout.LayoutParams paramsGLView = new LinearLayout.LayoutParams(",
" LinearLayout.LayoutParams.FILL_PARENT,",
" LinearLayout.LayoutParams.FILL_PARENT);",
"paramsGLView.weight = 1;",
"paramsGLView.height = 0;",
"",
"mLayout.setGravity(android.view.Gravity.TOP);",
"",
"// Create an adds.",
"adView = new AdView(this);",
"adView.setAdSize(AdSize.SMART_BANNER);",
"adView.setAdUnitId(\"" + module.package_prop["ADMOD_ID"] + "\");",
"",
"// Create an ad request. Check logcat output for the hashed device ID to get test ads on a physical device.",
"AdRequest adRequest = new AdRequest.Builder()",
" .addTestDevice(AdRequest.DEVICE_ID_EMULATOR)",
" .build();",
"",
"// Add the AdView to the view hierarchy. The view will have no size until the ad is loaded."]
if "ADMOD_POSITION" in module.package_prop \
and module.package_prop["ADMOD_POSITION"] == "top":
list_create.append("mLayout.addView(adView, paramsAdds);")
list_create.append("mLayout.addView(mGLView, paramsGLView);")
else:
list_create.append("mLayout.addView(mGLView, paramsGLView);")
list_create.append("mLayout.addView(adView, paramsAdds);")
list_create.append("")
list_create.append("// Start loading the ad in the background.")
list_create.append("adView.loadAd(adRequest);")
module.pkg_add("GENERATE_SECTION__ON_CREATE", list_create)
module.pkg_add("GENERATE_SECTION__ON_RESUME", [
"if (adView != null) {",
" adView.resume();",
"}"
])
module.pkg_add("GENERATE_SECTION__ON_PAUSE", [
"if (adView != null) {",
" adView.pause();",
"}"
])
module.pkg_add("GENERATE_SECTION__ON_DESTROY", [
"// Destroy the AdView.",
"if (adView != null) {",
" adView.destroy();",
"}"
])

View File

@ -0,0 +1,32 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license MPL v2.0 (see license file)
##
from realog import debug
from lutin import system
from lutin import tools
from lutin import env
import os
class System(system.System):
def __init__(self, target):
system.System.__init__(self)
# create some HELP:
self.set_help("SDK: Android SDK basic interface java")
# jar file:
jar_file_path=os.path.join(target.path_sdk, "platforms", "android-" + str(target.board_id), "android.jar")
# TODO : Check if the android sdk android.jar is present ...
self.set_valid(True)
# todo : create a searcher of the presence of the library:
self.add_sources(jar_file_path)
self.add_flag("link-lib", "dl")
self.add_flag("link-lib", "log")
self.add_flag("link-lib", "android")

View File

@ -0,0 +1,23 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license MPL v2.0 (see license file)
##
from realog import debug
from lutin import system
from lutin import tools
from lutin import env
import os
class System(system.System):
def __init__(self, target):
system.System.__init__(self)
# create some HELP:
self.set_help("C: Generic C library")
self.set_valid(True)

View File

@ -0,0 +1,77 @@
#!/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("CXX: Generic C++ library")
self.set_valid(True)
if target.config["compilator"] == "clang":
if target.board_id < 21:
debug.error("Clang work only with the board wersion >= 21 : android 5.x.x")
self.valid = False
return
self.add_flag("c++", "-D__STDCPP_LLVM__")
# llvm is BSD-like licence
self.add_path(os.path.join(target.path_ndk, "sources", "cxx-stl", "llvm-libc++", "libcxx", "include"))
if target.type_arch == "armv5":
stdCppBasePath = os.path.join(target.path_ndk, "sources", "cxx-stl", "llvm-libc++", "libcxx", "libs", "armeabi")
self.add_path( os.path.join(stdCppBasePath, "include"))
self.add_flag("link", os.path.join(stdCppBasePath, "libc++_static.a"))
elif target.type_arch == "armv7":
stdCppBasePath = os.path.join(target.path_ndk, "sources", "cxx-stl", "llvm-libc++", "libs", "armeabi-v7a")
self.add_path( os.path.join(stdCppBasePath + "include"))
self.add_flag("link", os.path.join(stdCppBasePath, "thumb", "libc++_static.a"))
elif target.type_arch == "mips":
stdCppBasePath = os.path.join(target.path_ndk, "sources", "cxx-stl", "llvm-libc++", "libcxx", "libs", "mips")
self.add_path( os.path.join(stdCppBasePath + "include"))
self.add_flag("link", os.path.join(stdCppBasePath + "libc++_static.a"))
elif target.type_arch == "x86":
stdCppBasePath = os.path.join(target.path_ndk, "sources", "cxx-stl", "llvm-libc++", "libcxx", "libs", "x86")
self.add_path( os.path.join(stdCppBasePath, "include"))
self.add_flag("link", os.path.join(stdCppBasePath, "libc++_static.a"))
else:
debug.warning("unknow architecture: '" + str(target.arch) + "'");
else:
self.add_flag("c++", "-D__STDCPP_GNU__")
self.add_flag("c++-remove","-nostdlib")
self.add_flag("need-libstdc++", True)
# GPL v3 (+ exception link for gcc compilator)
self.add_path(os.path.join(target.path_ndk, "sources", "cxx-stl", "gnu-libstdc++", target.compilator_version, "include"))
if target.type_arch == "armv5":
stdCppBasePath = os.path.join(target.path_ndk, "sources", "cxx-stl", "gnu-libstdc++", target.compilator_version, "libs", "armeabi")
self.add_path( os.path.join(stdCppBasePath, "include"))
self.add_flag("link", os.path.join(stdCppBasePath, "thumb", "libgnustl_static.a"))
self.add_flag("link", os.path.join(stdCppBasePath, "thumb", "libsupc++.a"))
elif target.type_arch == "armv7":
stdCppBasePath = os.path.join(target.path_ndk, "sources", "cxx-stl", "gnu-libstdc++", target.compilator_version, "libs", "armeabi-v7a")
self.add_path( os.path.join(stdCppBasePath, "include"))
self.add_flag("link", os.path.join(stdCppBasePath, "thumb", "libgnustl_static.a"))
self.add_flag("link", os.path.join(stdCppBasePath, "thumb", "libsupc++.a"))
elif target.type_arch == "mips":
stdCppBasePath = os.path.join(target.path_ndk, "sources", "cxx-stl", "gnu-libstdc++", target.compilator_version, "libs", "mips")
self.add_path( os.path.join(stdCppBasePath, "include/"))
self.add_flag("link", os.path.join(stdCppBasePath, "libgnustl_static.a"))
self.add_flag("link", os.path.join(stdCppBasePath, "libsupc++.a"))
elif target.type_arch == "x86":
stdCppBasePath = os.path.join(target.path_ndk, "sources", "cxx-stl", "gnu-libstdc++", target.compilator_version, "libs", "x86")
self.add_path( os.path.join(stdCppBasePath, "include"))
self.add_flag("link", os.path.join(stdCppBasePath, "libgnustl_static.a"))
self.add_flag("link", os.path.join(stdCppBasePath, "libsupc++.a"))
else:
debug.warning("unknow architecture: '" + str(target.arch) + "'");
debug.warning("plop")

View File

@ -0,0 +1,27 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license MPL v2.0 (see license file)
##
from realog import debug
from lutin import system
from lutin import tools
from lutin import env
import os
class System(system.System):
def __init__(self, target):
system.System.__init__(self)
# create some HELP:
self.set_help("M : m library \n base of std libs (availlagle in GNU C lib and bionic")
# No check ==> on the basic std libs:
self.set_valid(True)
# todo : create a searcher of the presence of the library:
self.add_flag("link-lib", "m")

View 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_header_file([
"/usr/include/GL/*"
],
destination_path="GL",
recursive=True)
"""
self.add_flag('link-lib', "GLESv3")

View File

@ -1,33 +1,35 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license APACHE v2.0 (see license file)
## @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
import os
class System(system.System):
def __init__(self):
def __init__(self, target):
system.System.__init__(self)
# create some HELP:
self.help="BOOST : Boost interface (need when we have not all c++ feature\n Can be install with the package:\n - libboost-all-dev"
self.set_help("pthread : Generic multithreading system\n Can be install with the package:\n - pthread-dev")
# check if the library exist:
if not os.path.isfile("/usr/include/boost/chrono.hpp"):
"""
if not os.path.isfile("/usr/include/pthread.h"):
# we did not find the library reqiested (just return) (automaticly set at false)
return;
self.valid = True
"""
self.set_valid(True)
# todo : create a searcher of the presence of the library:
self.add_export_flag_LD([
"-lboost_system",
"-lboost_thread",
"-lboost_chrono"
#self.add_flag("link-lib", "pthread")
self.add_depend([
'c'
])

View File

@ -4,25 +4,26 @@
##
## @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
import os
class System(system.System):
def __init__(self):
def __init__(self, target):
system.System.__init__(self)
# create some HELP:
self.help="Z : z library \n Can be install with the package:\n - zlib1g-dev"
self.set_help("Z : z library \n Can be install with the package:\n - zlib1g-dev")
# check if the library exist:
if not os.path.isfile("/usr/include/zlib.h"):
# we did not find the library reqiested (just return) (automaticly set at false)
return;
self.valid = True
self.set_valid(True)
# todo : create a searcher of the presence of the library:
self.add_export_flag_LD(["-lz"])
self.add_flag("link-lib", "z")

View File

@ -0,0 +1,27 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license MPL v2.0 (see license file)
##
from realog import debug
from lutin import system
from lutin import tools
from lutin import env
import os
class System(system.System):
def __init__(self, target):
system.System.__init__(self)
# create some HELP:
self.set_help("CoreAudio : Ios interface for audio (all time present, just system interface)")
self.set_valid(True)
# todo : create a searcher of the presence of the library:
self.add_flag("link", "-framework CoreAudio")
self.add_flag("link", "-framework AudioToolbox")

View File

@ -0,0 +1,27 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license MPL v2.0 (see license file)
##
from realog import debug
from lutin import system
from lutin import tools
from lutin import env
import os
class System(system.System):
def __init__(self, target):
system.System.__init__(self)
# create some HELP:
self.set_help("CoreAudio : Ios interface for core graphic (all time present, just system interface)")
self.set_valid(True)
# todo : create a searcher of the presence of the library:
self.add_flag("link", "-framework CoreGraphics")
self.add_depend("UIKit")

View File

@ -0,0 +1,27 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license MPL v2.0 (see license file)
##
from realog import debug
from lutin import system
from lutin import tools
from lutin import env
import os
class System(system.System):
def __init__(self, target):
system.System.__init__(self)
# create some HELP:
self.set_help("CoreAudio : Ios interface for fundation (all time present, just system interface)")
self.set_valid(True)
# todo : create a searcher of the presence of the library:
self.add_flag("link", "-framework Foundation")
self.add_depend("QuartzCore")

View File

@ -0,0 +1,27 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license MPL v2.0 (see license file)
##
from realog import debug
from lutin import system
from lutin import tools
from lutin import env
import os
class System(system.System):
def __init__(self, target):
system.System.__init__(self)
# create some HELP:
self.set_help("CoreAudio : Ios interface for openGL (all time present, just system interface)")
self.set_valid(True)
# todo : create a searcher of the presence of the library:
self.add_flag("link", "-framework GLKit")
self.add_depend("Foundation")

View File

@ -0,0 +1,26 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license MPL v2.0 (see license file)
##
from realog import debug
from lutin import system
from lutin import tools
from lutin import env
import os
class System(system.System):
def __init__(self, target):
system.System.__init__(self)
# create some HELP:
self.set_help("CoreAudio : Ios interface for core application (all time present, just system interface)")
self.set_valid(True)
# todo : create a searcher of the presence of the library:
self.add_flag("link", "-framework QuartzCore")

View File

@ -0,0 +1,27 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license MPL v2.0 (see license file)
##
from realog import debug
from lutin import system
from lutin import tools
from lutin import env
import os
class System(system.System):
def __init__(self, target):
system.System.__init__(self)
# create some HELP:
self.set_help("CoreAudio : Ios interface for graphic UX (all time present, just system interface)")
self.set_valid(True)
# todo : create a searcher of the presence of the library:
self.add_flag("link", "-framework UIKit")
self.add_depend("GLKit")

View File

@ -0,0 +1,24 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license MPL v2.0 (see license file)
##
from realog import debug
from lutin import system
from lutin import tools
from lutin import env
import os
class System(system.System):
def __init__(self, target):
system.System.__init__(self)
# create some HELP:
self.set_help("C: Generic C library")
self.add_flag("c-remove","-nodefaultlibs")
self.set_valid(True)

View File

@ -0,0 +1,28 @@
#!/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("CXX: Generic C++ library")
self.set_valid(True)
# no check needed ==> just add this:
self.add_flag("c++", "-D__STDCPP_LLVM__")
self.add_flag("c++-remove", "-nostdlib")
self.add_flag("need-libstdc++", True)

View File

@ -0,0 +1,27 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license MPL v2.0 (see license file)
##
from realog import debug
from lutin import system
from lutin import tools
from lutin import env
import os
class System(system.System):
def __init__(self, target):
system.System.__init__(self)
# create some HELP:
self.set_help("M : m library \n base of std libs (availlagle in GNU C lib and bionic")
# No check ==> on the basic std libs:
self.set_valid(True)
# todo : create a searcher of the presence of the library:
self.add_flag("link-lib", "m")

View File

@ -0,0 +1,30 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license MPL v2.0 (see license file)
##
from realog import debug
from lutin import system
from lutin import tools
from lutin import env
import os
class System(system.System):
def __init__(self, target):
system.System.__init__(self)
# create some HELP:
self.set_help("OpenGL: Generic graphic library")
self.set_valid(True)
# no check needed ==> just add this:
self.add_depend([
'c'
])
self.add_flag('link', [
"-framework OpenGLES"])

View File

@ -0,0 +1,44 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license MPL v2.0 (see license file)
##
from realog import debug
from lutin import system
from lutin import tools
from lutin import env
import os
class System(system.System):
def __init__(self, target):
system.System.__init__(self)
# create some HELP:
self.set_help("pthread : Generic multithreading system\n Can be install with the package:\n - pthread-dev")
# check if the library exist:
"""
if not os.path.isfile("/usr/include/pthread.h"):
# we did not find the library reqiested (just return) (automaticly set at false)
return;
"""
self.set_valid(True)
# todo : create a searcher of the presence of the library:
self.add_flag("link-lib", "pthread")
self.add_depend([
'c'
])
"""
if env.get_isolate_system() == True:
self.add_header_file([
"/usr/include/sched.h",
"/usr/include/pthread.h"
],
clip_path="/usr/include/")
"""

View File

@ -0,0 +1,46 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license MPL v2.0 (see license file)
##
from realog import debug
from lutin import system
from lutin import tools
from lutin import env
import os
class System(system.System):
def __init__(self, target):
system.System.__init__(self)
# create some HELP:
self.set_help("SDL: SDL Gui abstraction")
# check if the library exist:
if not os.path.isfile("/usr/include/SDL/SDL.h"):
# we did not find the library reqiested (just return) (automaticly set at false)
return;
self.set_valid(True)
self.add_depend([
'opengl',
'c'
])
self.add_flag("link-lib", "SDL")
if env.get_isolate_system() == True:
self.add_header_file([
"/usr/include/SDL/*",
],
destination_path="SDL",
recursive=True)
self.add_header_file([
"/usr/include/SDL/*",
],
destination_path="",
recursive=True)
else:
self.add_path("/usr/include/SDL/")

View File

@ -0,0 +1,35 @@
#!/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("X11: Basic interface of Linux Graphic interface")
self.set_valid(True)
# no check needed ==> just add this:
self.add_depend(['c'])
self.add_flag('link-lib', 'Xv')
self.add_flag('link-lib', 'Xt')
self.add_flag('link-lib', 'X11')
if env.get_isolate_system() == True:
self.add_header_file([
"/usr/include/X11/*"
],
destination_path="X11",
recursive=True)

View 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("ALSA : Advanced Linux Sound Architecture\n Can be install with the package:\n - libasound2-dev")
# check if the library exist:
if not os.path.isfile("/usr/include/alsa/asoundlib.h") \
and not os.path.isfile("/usr/include/dssi/alsa/asoundlib.h"):
# we did not find the library reqiested (just return) (automaticly set at false)
return;
self.set_valid(True)
if env.get_isolate_system() == False:
self.add_flag("link-lib", "asound")
else:
self.add_flag("link-lib", "asound")
self.add_header_file([
"/usr/include/alsa/*",
],
destination_path="alsa",
recursive=True)
self.add_header_file([
"/usr/include/dssi/*",
],
destination_path="dssi",
recursive=True)
self.add_depend([
'c'
])

View File

@ -0,0 +1,41 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license MPL v2.0 (see license file)
##
from realog import debug
from lutin import system
from lutin import tools
from lutin import env
import os
class System(system.System):
def __init__(self, target):
system.System.__init__(self)
# create some HELP:
self.set_help("rpc : generic RPC library (developed by oracle)")
# check if the library exist:
if not os.path.isfile("/usr/include/arpa/ftp.h"):
# we did not find the library reqiested (just return) (automaticly set at false)
return;
# No check ==> on the basic std libs:
self.set_valid(True)
if env.get_isolate_system() == True:
#self.add_flag("link-lib", "xns")
self.add_header_file([
"/usr/include/arpa/*"
],
destination_path="arpa",
recursive=True)
self.add_depend([
'c'
])

View File

@ -0,0 +1,45 @@
#!/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("BOOST : Boost interface (need when we have not all c++ feature\n Can be install with the package:\n - libboost-all-dev")
# check if the library exist:
if not os.path.isfile("/usr/include/boost/chrono.hpp"):
# we did not find the library reqiested (just return) (automaticly set at false)
return;
self.set_valid(True)
if env.get_isolate_system() == False:
# todo : create a searcher of the presence of the library:
self.add_flag("link-lib", [
"boost_system",
"boost_thread",
"boost_chrono"
])
else:
self.add_header_file([
"/usr/include/boost/*"
],
destination_path="boost",
recursive=True)
self.add_depend([
'cxx'
])

View File

@ -0,0 +1,182 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license MPL v2.0 (see license file)
##
from realog import debug
from lutin import system
from lutin import tools
from lutin import env
import os
class System(system.System):
def __init__(self, target):
system.System.__init__(self)
# create some HELP:
self.set_help("C: Generic C library")
self.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/*
self.add_header_file([
'/usr/include/aio.h*',
'/usr/include/aliases.h*',
'/usr/include/alloca.h*',
'/usr/include/ansidecl.h*',
'/usr/include/argp.h*',
'/usr/include/argz.h*',
'/usr/include/ar.h*',
'/usr/include/assert.h*',
'/usr/include/byteswap.h*',
'/usr/include/complex.h*',
'/usr/include/cpio.h*',
'/usr/include/ctype.h*',
'/usr/include/dirent.h*',
'/usr/include/dlfcn.h*',
'/usr/include/elf.h*',
'/usr/include/endian.h*',
'/usr/include/envz.h*',
'/usr/include/err.h*',
'/usr/include/errno.h*',
'/usr/include/error.h*',
'/usr/include/execinfo.h*',
'/usr/include/fcntl.h*',
'/usr/include/features.h*',
'/usr/include/fenv.h*',
'/usr/include/fmtmsg.h*',
'/usr/include/fnmatch.h*',
'/usr/include/fpu_control.h*',
'/usr/include/fts.h*',
'/usr/include/ftw.h*',
'/usr/include/gconv.h*',
'/usr/include/getopt.h*',
'/usr/include/glob.h*',
'/usr/include/gnu-versions.h*',
'/usr/include/grp.h*',
'/usr/include/gshadow.h*',
'/usr/include/iconv.h*',
'/usr/include/ieee754.h*',
'/usr/include/ifaddrs.h*',
'/usr/include/inttypes.h*',
'/usr/include/langinfo.h*',
'/usr/include/libgen.h*',
'/usr/include/libintl.h*',
'/usr/include/libio.h*',
'/usr/include/limits.h*',
'/usr/include/link.h*',
'/usr/include/locale.h*',
'/usr/include/malloc.h*',
'/usr/include/mcheck.h*',
'/usr/include/memory.h*',
'/usr/include/mntent.h*',
'/usr/include/monetary.h*',
'/usr/include/mqueue.h*',
'/usr/include/netdb.h*',
'/usr/include/nl_types.h*',
'/usr/include/nss.h*',
'/usr/include/obstack.h*',
'/usr/include/printf.h*',
'/usr/include/pthread.h*',
'/usr/include/pty.h*',
'/usr/include/pwd.h*',
'/usr/include/re_comp.h*',
'/usr/include/regex.h*',
'/usr/include/regexp.h*',
'/usr/include/sched.h*',
'/usr/include/search.h*',
'/usr/include/semaphore.h*',
'/usr/include/setjmp.h*',
'/usr/include/sgtty.h*',
'/usr/include/shadow.h*',
'/usr/include/signal.h*',
'/usr/include/spawn.h*',
'/usr/include/stdc-predef.h*',
'/usr/include/stdint.h*',
'/usr/include/stdio_ext.h*',
'/usr/include/stdio.h*',
'/usr/include/stdlib.h*',
'/usr/include/string.h*',
'/usr/include/strings.h*',
'/usr/include/stropts.h*',
'/usr/include/tar.h*',
'/usr/include/termios.h*',
'/usr/include/tgmath.h*',
'/usr/include/thread_db.h*',
'/usr/include/time.h*',
'/usr/include/uchar.h*',
'/usr/include/ucontext.h*',
'/usr/include/ulimit.h*',
'/usr/include/unistd.h*',
'/usr/include/utime.h*',
'/usr/include/utmp.h*',
'/usr/include/utmpx.h*',
'/usr/include/values.h*',
'/usr/include/wchar.h*',
'/usr/include/wctype.h*',
'/usr/include/wordexp.h*',
'/usr/include/xlocale.h*',
],
destination_path="")
self.add_header_file([
'/usr/include/poll.h*',
'/usr/include/unistdio.h*',
'/usr/include/syslog.h*',
'/usr/include/_G_config.h*',
],
destination_path="")
self.add_header_file([
"/usr/include/sys/*",
],
destination_path="sys",
recursive=True)
self.add_header_file([
"/usr/include/bits/*",
],
destination_path="bits",
recursive=True)
self.add_header_file([
"/usr/include/gnu/*",
],
destination_path="gnu",
recursive=True)
self.add_header_file([
"/usr/include/linux/*",
],
destination_path="",
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)
# 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")

View File

@ -0,0 +1,50 @@
#!/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 multiprocess
from lutin import env
import os
class System(system.System):
def __init__(self, target):
system.System.__init__(self)
# create some HELP:
self.set_help("CXX: Generic C++ library")
self.set_valid(True)
# no check needed ==> just add this:
self.add_depend([
'c',
'm',
'pthread'
])
self.add_flag("c++", "-D__STDCPP_GNU__")
if env.get_isolate_system() == False:
self.add_flag("c++-remove", "-nostdlib")
self.add_flag("need-libstdc++", True)
else:
self.add_flag("link-lib", "stdc++")
compilator_gcc = "g++"
if target.config["compilator-version"] != "":
compilator_gcc = compilator_gcc + "-" + target.config["compilator-version"]
#get g++ compilation version :
version_cpp = multiprocess.run_command_direct(compilator_gcc + " -dumpversion");
if version_cpp == False:
debug.error("Can not get the g++ version ...")
self.add_header_file([
"/usr/include/c++/" + version_cpp + "/*"
],
recursive=True)

View 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)

View 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)

View File

@ -0,0 +1,39 @@
#!/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("JACK : Jack Low-Latency Audio Server\n Can be install with the package:\n - libjack-jackd2-dev (new)\n - libjack-dev (old)")
# check if the library exist:
if not os.path.isfile("/usr/include/jack/jack.h"):
# we did not find the library reqiested (just return) (automaticly set at false)
return;
self.set_valid(True)
self.add_depend([
'uuid',
'c'
])
self.add_flag("link-lib", "jack")
if env.get_isolate_system() == True:
self.add_header_file([
"/usr/include/jack/*",
],
destination_path="jack",
recursive=True)

View 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)

View File

@ -0,0 +1,37 @@
#!/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("M : m library \n base of std libs (availlagle in GNU C lib and bionic")
# No check ==> on the basic std libs:
self.set_valid(True)
# todo : create a searcher of the presence of the library:
self.add_flag("link-lib", "m")
self.add_depend([
'c'
])
if env.get_isolate_system() == True:
self.add_header_file([
"/usr/include/math.h"
],
clip_path="/usr/include",
recursive=False)

View 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/");

View 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', 'GL')
if env.get_isolate_system() == True:
self.add_header_file([
"/usr/include/GL/*"
],
destination_path="GL",
recursive=True)

View File

@ -1,30 +1,32 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license APACHE v2.0 (see license file)
## @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
import os
class System(system.System):
def __init__(self):
def __init__(self, target):
system.System.__init__(self)
# create some HELP:
self.help="OSS : Linux Open Sound System\n Can be install with the package:\n - ... TODO ..."
self.set_help("OSS : Linux Open Sound System\n Can be install with the package:\n - ... TODO ...")
# check if the library exist:
"""
if not os.path.isfile("/usr/include/jack/jack.h"):
# we did not find the library reqiested (just return) (automaticly set at false)
return;
self.valid = True
self.set_valid(True)
# todo : create a searcher of the presence of the library:
self.add_export_flag_CC("-ljack")
self.add_flag("link-lib", "oss")
"""

View File

@ -0,0 +1,39 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license MPL v2.0 (see license file)
##
from realog import debug
from lutin import system
from lutin import tools
from lutin import env
import os
class System(system.System):
def __init__(self, target):
system.System.__init__(self)
# create some HELP:
self.set_help("pthread : Generic multithreading system\n Can be install with the package:\n - pthread-dev")
# check if the library exist:
if not os.path.isfile("/usr/include/pthread.h"):
# we did not find the library reqiested (just return) (automaticly set at false)
return;
self.set_valid(True)
# todo : create a searcher of the presence of the library:
self.add_flag("link-lib", "pthread")
self.add_depend([
'c'
])
if env.get_isolate_system() == True:
self.add_header_file([
"/usr/include/sched.h",
"/usr/include/pthread.h"
],
clip_path="/usr/include/")

View File

@ -0,0 +1,81 @@
#!/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("PULSE : The Linux PulseAudio\n Can be install with the package:\n - libpulse-dev")
# check if the library exist:
if not os.path.isfile("/usr/include/pulse/pulseaudio.h"):
# we did not find the library reqiested (just return) (automaticly set at false)
return;
dst_data = tools.file_read_data("/usr/include/pulse/version.h")
lines = dst_data.split("\n")
patern = "#define pa_get_headers_version() (\"" # " #corect edn error parsing
version = None
for line in lines:
if line[:len(patern)] == patern:
#Find the version line
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:
debug.warning("Can not det version of Pulseaudio ... ==> remove it")
return
self.set_version([int(version),int(version2)])
self.set_valid(True)
self.add_depend([
'c'
])
if env.get_isolate_system() == False:
self.add_flag("link-lib", [
"pulse-simple",
"pulse"
])
else:
# todo : create a searcher of the presence of the library:
"""
self.add_flag("link-lib", [
"-l/lib/pulseaudio/libpulsecommon-" + version + ".0.so"
])
"""
self.add_flag("link-lib", [
"pulsecommon-" + version + ".0",
"pulse-mainloop-glib",
"pulse-simple",
"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/*",
],
destination_path="pulse",
recursive=True)

View File

@ -0,0 +1,38 @@
#!/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("rpc : generic RPC library (developed by oracle)")
# No check ==> on the basic std libs:
self.set_valid(True)
self.add_depend([
'c'
])
# todo : create a searcher of the presence of the library:
#self.add_flag("link-lib", "rpcsvc")
if env.get_isolate_system() == True:
self.add_header_file([
"/usr/include/rpc/*"
],
destination_path="rpc",
recursive=True)

Some files were not shown because too many files have changed in this diff Show More