CN109032604A - A kind of generation method in the library Qt that may operate in android system - Google Patents
A kind of generation method in the library Qt that may operate in android system Download PDFInfo
- Publication number
- CN109032604A CN109032604A CN201810714849.3A CN201810714849A CN109032604A CN 109032604 A CN109032604 A CN 109032604A CN 201810714849 A CN201810714849 A CN 201810714849A CN 109032604 A CN109032604 A CN 109032604A
- Authority
- CN
- China
- Prior art keywords
- library
- qmake
- file
- module
- compiling
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The present invention provides a kind of generation method in library Qt that may operate in android system, step S1, replicates Qt frame source code into Android source code;Step S2, the Android Makefile file qmake.mk for compiling qmake is created, qmake executable file is compiled;Step S3, creation compiles the library Qt and is generated in the system file system of Android using the Android.mk file in the qmake executable file compiling library Qt.The method of the present invention is the compiling system using Android, compiles out qmake, then compiles out the library Qt again using qmake, to easily generate the library Qt in android system.
Description
Technical field
The present invention relates to a kind of android system, in particular to a kind of method for compiling Qt on Android and going out frame.
Background technique
Android system passes through development in 10 years, and function is highly developed and perfect.However the cost of its perfect in shape and function
It is exactly the huge consumption to storage resource.On the hardware platform of some storage resource anxieties, the operation of android system is showed
It is unsatisfactory, or even be unable to run.Therefore, it is a kind of cleverly solution that Qt is run in the android system of cutting.But
It is that Android and Qt are two independent frames, while they possess respective compiling system, if it is desired on Android
Compiling Qt goes out frame, and in the prior art, there are no a kind of ready-made solutions.
Summary of the invention
The technical problem to be solved in the present invention is to provide a kind of generation in library Qt that may operate in android system
Method compiles out qmake using the compiling system of Android, then the library Qt is compiled out again using qmake, to easily exist
The library Qt is generated in android system.
The present invention is implemented as follows: a kind of generation method in the library Qt that may operate in android system, comprising:
Step S1, duplication Qt frame source code is into Android source code;
Step S2, the AndroidMakefile file qmake.mk for compiling qmake is created, compiling qmake is executable
File;
Step S3, creation compiles the library Qt and generates using the Android.mk file in the qmake executable file compiling library Qt
Into the system file system of Android.
Further, the step S1 is specifically: downloading Google AOSP source code creates Qt in Google's AOSP source code
File is pressed from both sides as the host file of Qt frame source code and dependent compilation file;Then Qtbase source code is downloaded again to Qt text
In part folder.
Further, the step S2 is specifically:
Step S21, the compiling rule file qmake.mk of qmake and its attached compilation tool is created in Qt file;
Step S22, the entitled qmake of module needed for defining AOSP compiling system;Definition qmake module is classified as to hold
Style of writing part;Definition qmake module is HOST module;Define the dependence of qmake module;Into Qt/Qtbase file;It holds
Row configure order, compiles out qmake executable file;
Step S23, attached compilation tool is traversed in Qt/Qtbase/src/tools/ file, generates compilation information,
Make order is executed, and then compiles out the attached compilation tool of qmake;
Step S24, the qmake executable file that above-mentioned compiling configuration generates is stored in Qt/Qtbase/bin/ file
Under, the qmake file destination that modification AOSP compiling system defines adds echo " #!/ bin/sh " and exec $ (pwd)/Qt/
Qtbase/bin/qmake'$@', to guarantee that AOSP compiling system can be correctly found qmake executable file.
Further, in the step S22, the dependence for defining qmake module is to define the dynamic chain of qmake dependence
Library is connect, which includes libEGL, libicuuc, libicui18n, libm, libgui, liblog, libstdc++,
libbinder,libstlport,libGLESv1_CM,libGLESv2,$(TARGET_CRTBEGIN_SO_O),$(TARGET_
CRTBEGIN_DYNAMIC_O), $ (TARGET_CRTEND_SO_O), $ (TARGET_CRTEND_O) $ (TARGET_LIBGCC),
The above dynamic link library, which is denoted as, relies on library 1, passes through $ (LOCAL_BUILT_MODULE): relying on library 1 indicates.
Further, the configure command parameter of the compiling qmake executable file in step S22 include :-
Xplatform unsupported/android-g++ ,-opensource-confirm-license ,-no-
Accessibility ,-prefix/system/.
Further, the step S3 is specifically:
Step S31, the compiling rule file Android.mk in the library Qt is created;
Step S32, the entitled specific Qt library name of module needed for defining compiling system;Define libQtCore module
It is classified as dynamic link library;Define the source code path of libQtCore module;Define the definitive document name of libQtCore module;
Define the dependence of libQtCore module;Define the path qmake;Compile the library libQtCoree;
Step S33, the library libQtCore is installed to the library archive used for AOSP compiling system by AOSP compiling system
In, complete the generating process that may operate at the library Qt on Android.
Further, in the step S32, the dependence for defining libQtCore module is specifically: libEGL,
Libicuuc, libicui18n, libgui, liblog, libstdc++, libm, libstlport, libGLESv1_CM,
libGLESv2;The above dynamic link library, which is denoted as, relies on library 2, passes through $ (LOCAL_BUILT_MODULE): relying on library 2 indicates.
Further, in the step S32, the process for compiling libQtCore is specifically:
(1) catalogue for the intermediate file that creation AOSP compiling system needs;
(2) enter the source code directory of libQtCore module;
(3) qmake executable file is executed, the makefile of libQtCore module is generated;
(4) make order is executed, the library libQtCore is compiled out;
(5) library libQtCore compiled out is copied to the catalogue for the intermediate file that the AOSP compiling system needs.
The present invention has the advantage that the method for the present invention is the compiling system using Android, qmake is compiled out, then
The process for being compiled out the library Qt again using qmake, can be run in android system, can be on original basis Android SDK
On, Rapid transplant Qt frame to save development cost using a large amount of existing Qt application, while can save a large amount of system
Resource, to guarantee the smooth operation of entry level equipment.
Detailed description of the invention
The present invention is further illustrated in conjunction with the embodiments with reference to the accompanying drawings.
Fig. 1 is the method for the present invention execution flow chart.
Specific embodiment
Refering to Figure 1, the general thought of the generation method in the library Qt of the present invention is the compiling system using Android,
Qmake is compiled out, then compiles out the library Qt again using qmake, in order to support to compile the library Qt in Android, most crucial is
Bridge the compiling system of Android and the qmake compiling system of Qt.The method of the present invention includes:
Step S1, duplication Qt frame source code is into Android source code;Google AOSP source code (net is downloaded on the internet
Location https: //source.android.com/setup/downloading) Qt file, is created in Google's AOSP source code
Folder is pressed from both sides as the host file of Qt frame source code and dependent compilation file;Then again from https: //github.com/qt/
Qtbase downloads Qtbase source code into Qt file.
Step S2, the AndroidMakefile file qmake.mk for compiling qmake is created, compiling qmake is executable
File;That is compiling rule of the creation qmake at Android, enables AOSP source code to compile out qmake and its attached compiling
Tool, specifically:
Step S21, the compiling rule file qmake.mk of qmake and its attached compilation tool is created in Qt file;
Step S22, it is defined as follows information, to realize the purpose for compiling out qmake in AOSP source code:
1) module needed for defining AOSP compiling system entitled qmake, LOCAL_MODULE:=qmake;
2) executable file that is classified as of qmake module, LOCAL_MODULE_CLASS:=EXECUTABLES are defined;
3) defining qmake module is HOST module, that is, is served only for compiling host and uses,
LOCAL_IS_HOST_MODULE:=true, LOCAL_MODULE_SUFFIX:=
$ (HOST_EXECUTABLE_SUFFIX), include
$(BUILD_SYSTEM)/binary.mk;
4) dependence of qmake module is defined, so that compiling system can smoothly compile out qmake according to dependence
Executable file;When compiling qmake executable file, into Qt/Qtbase file;Configure order is executed, is compiled out
Qmake executable file;
Wherein, the dependence for defining qmake module is the dynamic link library for defining qmake dependence, the dynamic link library
Include:
libEGL,libicuuc,libicui18n,libm,libgui,liblog,libstdc++,libbinder,
libstlport,libGLESv1_CM,libGLESv2,$(TARGET_CRTBEGIN_SO_O),$(TARGET_CRTBEGIN_
DYNAMIC_O),$(TARGET_CRTEND_SO_O),$(TARGET_CRTEND_O)$(TARGET_LIBGCC);
The above dynamic link library, which is denoted as, relies on library 1, passes through $ (LOCAL_BUILT_MODULE): relying on library 1 indicates.
The parameter of the configure order includes :-xplatform unsupported/android-g++ ,-
Opensource-confirm-license ,-no-accessibility ,-prefix/system/.
Step S23, attached compilation tool is traversed in Qt/Qtbase/src/tools/ file, step includes: entrance
Qt/qtbase/src/tools/ file;../../bin/qmake-r is executed to come in the automatic above-mentioned file of recursive traversal
Attached compilation tool, and generate compilation information;Compilation information is generated, executes make order, and then compile out the attached compiling of qmake
Tool;
Step S24, the qmake executable file that above-mentioned compiling configuration generates is stored in Qt/Qtbase/bin/ file
Under, can not be directly found by AOSP compiling system, need to solve by following steps: modification AOSP compiling system defines
Qmake file destination adds echo " #!/ bin/sh " and exec $ (pwd)/Qt/Qtbase/bin/qmake'$@', to guarantee
AOSP compiling system can be correctly found qmake executable file.
Step S3, creation compiles the library Qt and generates using the Android.mk file in the qmake executable file compiling library Qt
Into the system file system of Android.Specifically:
Step S31, the compiling rule file Android.mk in the library Qt is created;
Step S32, it is defined as follows information, to realize the purpose for compiling out the library qt in AOSP compiling system:
1) the entitled specific Qt library name of module needed for defining compiling system, using libQtCore as example, LOCAL_
MODULE:=libQtCore;
2) dynamic link library that is classified as of libQtCore module, LOCAL_MODULE_CLASS:=SHARED_ are defined
LIBRARIES;
3) the source code path of libQtCore module, QT_MODULE_SOURCE:=qt/qtbase/src/ are defined
corelib;
4) the definitive document name of libQtCore module, QT_BUILT_MODULE:=qt/qtbase/lib/ are defined
libQtCore.so.5.0.0;
5) dependence of libQtCore module is defined, so that compiling system can smoothly compile out according to dependence
The library libQtCore;
The dependence for defining libQtCore module is specifically: libEGL, libicuuc, libicui18n, libgui,
Liblog, libstdc++, libm, libstlport, libGLESv1_CM, libGLESv2;The above dynamic link library be denoted as according to
Rely library 2, pass through $ (LOCAL_BUILT_MODULE): relying on library 2 indicates.
6) path qmake, QMAKE:=$ (abspath out/host/linux-x86/bin/qmake) are defined;
7) library libQtCore is compiled, detailed process is:
(1) catalogue for the intermediate file that creation AOSP compiling system needs;
(2) enter the source code directory of libQtCore module;
(3) qmake executable file is executed, the makefile of libQtCore module is generated;
(4) make order is executed, the library libQtCore is compiled out, Make order is the general utility tool of program compiling;
(5) library libQtCore compiled out is copied to the catalogue for the intermediate file that the AOSP compiling system needs.
Step S33, the library libQtCore is installed to the library archive used for AOSP compiling system by AOSP compiling system
In, complete the generating process that may operate at the library Qt on Android.
The present invention has the advantage that can be run in android system, can on the basis of original Android SDK,
Rapid transplant Qt frame to save development cost using a large amount of existing Qt application, while can save a large amount of system money
Source, to guarantee the smooth operation of entry level equipment.
Although specific embodiments of the present invention have been described above, those familiar with the art should be managed
Solution, we are merely exemplary described specific embodiment, rather than for the restriction to the scope of the present invention, it is familiar with this
The technical staff in field should be covered of the invention according to modification and variation equivalent made by spirit of the invention
In scope of the claimed protection.
Claims (8)
1. a kind of generation method in the library Qt that may operate in android system, it is characterised in that: include:
Step S1, duplication Qt frame source code is into Android source code;
Step S2, the AndroidMakefile file qmake.mk for compiling qmake, the executable text of compiling qmake are created
Part;
Step S3, creation compiles the library Qt and is generated to using the Android.mk file in the qmake executable file compiling library Qt
In the system file system of Android.
2. a kind of generation method in library Qt that may operate in android system according to claim 1, feature exist
In: the step S1 is specifically: downloading Google AOSP source code creates Qt file, as Qt in Google's AOSP source code
The host file of frame source code and dependent compilation file folder;Then Qtbase source code is downloaded again into Qt file.
3. a kind of generation method in library Qt that may operate in android system according to claim 2, feature exist
In: the step S2 is specifically:
Step S21, the compiling rule file qmake.mk of qmake and its attached compilation tool is created in Qt file;
Step S22, the entitled qmake of module needed for defining AOSP compiling system;Define qmake module is classified as executable text
Part;Definition qmake module is HOST module;Define the dependence of qmake module;Into Qt/Qtbase file, execute
Configure order compiles out qmake executable file;
Step S23, attached compilation tool is traversed in Qt/Qtbase/src/tools/ file, generates compilation information, is executed
Make order, and then compile out the attached compilation tool of qmake;
Step S24, qmake executable file is stored under Qt/Qtbase/bin/ file, modification AOSP compiling system is fixed
The qmake file destination of justice adds echo " #!/ bin/sh " and exec $ (pwd)/Qt/Qtbase/bin/qmake'$@'.
4. a kind of generation method in library Qt that may operate in android system according to claim 3, feature exist
In: in the step S22, the dependence for defining qmake module is the dynamic link library for defining qmake dependence, the dynamic chain
Connecing library includes libEGL, libicuuc, libicui18n, libm, libgui, liblog, libstdc++, libbinder,
libstlport,libGLESv1_CM,libGLESv2,$(TARGET_CRTBEGIN_SO_O),$(TARGET_CRTBEGIN_
DYNAMIC_O), $ (TARGET_CRTEND_SO_O), $ (TARGET_CRTEND_O) $ (TARGET_LIBGCC), the above dynamic
Chained library, which is denoted as, relies on library 1, passes through $ (LOCAL_BUILT_MODULE): relying on library 1 indicates.
5. a kind of generation method in library Qt that may operate in android system according to claim 1, feature exist
Include: in: the configure command parameter of the compiling qmake executable file in step S22-
Xplatformunsupported/android-g++ ,-opensource-confirm-license ,-no-
Accessibility ,-prefix/system/.
6. a kind of generation method in library Qt that may operate in android system according to claim 1, feature exist
In: the step S3 is specifically:
Step S31, the compiling rule file Android.mk in the library Qt is created;
Step S32, the entitled specific Qt library name of module needed for defining compiling system;Define the classification of libQtCore module
For dynamic link library;Define the source code path of libQtCore module;Define the definitive document name of libQtCore module;Definition
The dependence of libQtCore module;Define the path qmake;Compile the library libQtCoree;
Step S33, the library libQtCore is installed in the library archive used for AOSP compiling system by AOSP compiling system,
Completion may operate at the generating process in the library Qt on Android.
7. a kind of generation method in library Qt that may operate in android system according to claim 6, feature exist
In: in the step S32, the dependence for defining libQtCore module is specifically: libEGL, libicuuc,
Libicui18n, libgui, liblog, libstdc++, libm, libstlport, libGLESv1_CM, libGLESv2;With
Upper dynamic link library, which is denoted as, relies on library 2, passes through $ (LOCAL_BUILT_MODULE): relying on library 2 indicates.
8. a kind of generation method in library Qt that may operate in android system according to claim 6, feature exist
In: in the step S32, the process in the compiling library libQtCore is specifically:
(1) catalogue for the intermediate file that creation AOSP compiling system needs;
(2) enter the source code directory of libQtCore module;
(3) qmake executable file is executed, the makefile of libQtCore module is generated;
(4) make order is executed, the library libQtCore is compiled out;
(5) library libQtCore compiled out is copied to the catalogue for the intermediate file that the AOSP compiling system needs.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810714849.3A CN109032604B (en) | 2018-07-03 | 2018-07-03 | Method for generating Qt library capable of running on Android system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810714849.3A CN109032604B (en) | 2018-07-03 | 2018-07-03 | Method for generating Qt library capable of running on Android system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109032604A true CN109032604A (en) | 2018-12-18 |
CN109032604B CN109032604B (en) | 2022-02-22 |
Family
ID=65521348
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810714849.3A Active CN109032604B (en) | 2018-07-03 | 2018-07-03 | Method for generating Qt library capable of running on Android system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109032604B (en) |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101944061A (en) * | 2010-09-15 | 2011-01-12 | 青岛海信移动通信技术股份有限公司 | Method and device for debugging codes |
CN102214102A (en) * | 2011-07-06 | 2011-10-12 | 上海智翔信息科技股份有限公司 | System for transplanting C++ graphical user interface library (QT) to advanced RISC machine (ARM) |
CN102254397A (en) * | 2011-06-20 | 2011-11-23 | 西安电子科技大学 | Several personal belonging RFID antitheft alarm device based on mobile phone and alarm method thereof |
CN104361089A (en) * | 2014-11-17 | 2015-02-18 | 哈尔滨理工大学 | Cross-platform document management system based on Qt |
CN104375872A (en) * | 2014-12-08 | 2015-02-25 | 福州瑞芯微电子有限公司 | Quick startup method and device of Android system |
CN105260196A (en) * | 2015-11-27 | 2016-01-20 | 山东超越数控电子有限公司 | Method for making Android system support QT APP |
US20160134924A1 (en) * | 2014-11-07 | 2016-05-12 | Roku, Inc. | System and method for collecting data |
CN105824654A (en) * | 2015-01-06 | 2016-08-03 | 广州翼锋信息科技有限公司 | Method and device for pre-installing APP software in intelligent terminal |
CN107818588A (en) * | 2016-09-12 | 2018-03-20 | 深圳市鸿合创新信息技术有限责任公司 | The apparatus and method that android system calls Qt drawing based on JNI multithreadings |
-
2018
- 2018-07-03 CN CN201810714849.3A patent/CN109032604B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101944061A (en) * | 2010-09-15 | 2011-01-12 | 青岛海信移动通信技术股份有限公司 | Method and device for debugging codes |
CN102254397A (en) * | 2011-06-20 | 2011-11-23 | 西安电子科技大学 | Several personal belonging RFID antitheft alarm device based on mobile phone and alarm method thereof |
CN102214102A (en) * | 2011-07-06 | 2011-10-12 | 上海智翔信息科技股份有限公司 | System for transplanting C++ graphical user interface library (QT) to advanced RISC machine (ARM) |
US20160134924A1 (en) * | 2014-11-07 | 2016-05-12 | Roku, Inc. | System and method for collecting data |
CN104361089A (en) * | 2014-11-17 | 2015-02-18 | 哈尔滨理工大学 | Cross-platform document management system based on Qt |
CN104375872A (en) * | 2014-12-08 | 2015-02-25 | 福州瑞芯微电子有限公司 | Quick startup method and device of Android system |
CN105824654A (en) * | 2015-01-06 | 2016-08-03 | 广州翼锋信息科技有限公司 | Method and device for pre-installing APP software in intelligent terminal |
CN105260196A (en) * | 2015-11-27 | 2016-01-20 | 山东超越数控电子有限公司 | Method for making Android system support QT APP |
CN107818588A (en) * | 2016-09-12 | 2018-03-20 | 深圳市鸿合创新信息技术有限责任公司 | The apparatus and method that android system calls Qt drawing based on JNI multithreadings |
Non-Patent Citations (2)
Title |
---|
A ASWIN: "Android application using Qt for shannon-fano-elias decoding", 《2016 INTERNATIONAL CONFERENCE ON COMMUNICATION AND SIGNAL PROCESSING (ICCSP)》 * |
曹龙: "基于Qt on Android平台的空气质量监测系统手机客户端设计", 《电子技术与软件工程》 * |
Also Published As
Publication number | Publication date |
---|---|
CN109032604B (en) | 2022-02-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Anand et al. | CertiCoq: A verified compiler for Coq | |
CN104714788B (en) | A kind of method and device that software installation packet automatically generates | |
EP3204849B1 (en) | Systems and methods to update source code files | |
US10534590B2 (en) | Dynamic recompilation techniques for machine learning programs | |
US10042637B1 (en) | Computerized software development environment including customized presentation of source code | |
CN112799677B (en) | Method, device, equipment and storage medium for hook of compiling period | |
CN111176654B (en) | Internet of things application online compiling method based on multi-user cache | |
CN110058861B (en) | Source code processing method and device, storage medium and electronic equipment | |
CN105260169A (en) | Cross-platform python program transplanting method and device | |
CN111309327A (en) | Automatic compiling method of application program and computer readable storage medium | |
US10521209B2 (en) | Machine-based normalization of machine instructions | |
WO2015003452A1 (en) | Methods and systems for file processing | |
Hardt et al. | Ant build maintenance with formiga | |
CN108304184B (en) | Compiling method and device | |
CN109032604A (en) | A kind of generation method in the library Qt that may operate in android system | |
CN103064722A (en) | Method and system for unified compiling of programs | |
CN113360156B (en) | IOS compiling method and related equipment | |
KR20190059701A (en) | Method and apparatus for generating DEVS based simulation model and code | |
Pinto et al. | Pegasus: performance engineering for software applications targeting hpc systems | |
Rástočný et al. | Automated change propagation from source code to sequence diagrams | |
CN107563025B (en) | Verification platform management method and device | |
US20150277868A1 (en) | Declared variable ordering and optimizing compiler | |
Abate et al. | Bootstrapping software distributions | |
CN107562430B (en) | Compiling method for file processing function of mobile pi-calculus language | |
CN113260976A (en) | Techniques for scheduling instructions in compiled source code |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB02 | Change of applicant information | ||
CB02 | Change of applicant information |
Address after: 350000 building 18, 89 software Avenue, Gulou District, Fuzhou City, Fujian Province Applicant after: Ruixin Microelectronics Co.,Ltd. Address before: 350000 building 18, 89 software Avenue, Gulou District, Fuzhou City, Fujian Province Applicant before: FUZHOU ROCKCHIP ELECTRONICS Co.,Ltd. |
|
GR01 | Patent grant | ||
GR01 | Patent grant |