LINUX-QT development environment Building and compiling image

Source: Internet
Author: User

To build the LINUX-QT development environment, you need to build an android build environment, and then build on the Android build Environment , then LINUX-QT The compilation environment.

First: the compiler.

Second: Set environment variables. After setting the environment variable, the system can find the compiler when it is compiled.

Third: the library file. The complex steps are simple and effective when you install the library files by executing simple script commands during the build process.

IV: Source code.

Using the "Set up Ubuntu image", only need to change the environment variables, the system inside the tool and library files have been installed.

1 Compilation of Uboot

the Uboot Source code of Uboot and Android4.0.3 in the LINUX-QT system is universal, The compilation environment is the same as the compilation method .

2 Compilation of the Linux kernel

Linux-qtin the systemLinuxKernel andAndroid4.0.3in theLinuxThe kernel source code is the same, the compilation environment and the compilation method is the same. A configuration file that is used only when compiling". config"not the same. Unzip out the kernel source folder "itop4412_kernel_3.0". Then you need to useQTconfiguration file for the kernel "Config_for_linux"WillAndroid4.0.3configuration files for the kernel". config"overwrite, can be compiled after overwritingQTthe kernel. Here's how:

In the Ubuntu command line, execute the following command:

CP config_for_linux. config

Make

After you finish compiling the command, in the folder "itop4412_kernel_3.0" -"Arch" -"Arm" -"Boot"will be generated next."Zimage"file,"Zimage"The file is the kernel file that is available for download. If the user wants to revert toAndroid4.0.3of theLinuxkernel, in the kernel source folder, use the file "config_for_android"Overwrite". config"The file is ready." Here's how:

In the Ubuntu command line, execute the following command:

CP config_for_android. config

3 LINUX-QT compiled environment and compilation

3.1 installation of compiler and base library files

Qtthe file system compiler andAndroid4.0.3compiler is not the same,QTThe compiler is included in the compressed package "ARM-LINUX-4.4.1.TAR.G, copy the compressed package toUbuntusystem, then unzip the package toUbuntuSystem's Folder "usr" -"Local" -"Arm"Under, Unzip the build folder"4.4.1". Then installX11of theSDKLibrary, the following are the specific operations:

In the Ubuntu command line, execute the following command:

Apt-get Install Libx11-dev Libxext-dev Libxtst-dev

Then modify the environment variables, modify the environment variables, the following actions:

In the Ubuntu command line, execute the following command:

Cd

Vim. BASHRC

After opening the environment variable file ". BASHRC" Using the Vim editor, modify The path of the QT compiler and add the following to the file ". the last line of BASHRC ". export path= $PATH:/usr/local/arm/4.4.1/bin in the environment variable file, there are compile Android4.0.3 Use the path of the compiler, this path with the # comment out can be, such as:

Save Exit ". BASHRC" File after modification is complete. To update the environment variables, on the Ubuntu command line, execute the following command:

source. BASHRC

To test if the compiler is installed correctly, on the Ubuntu command line, execute the following command:

Arm-none-linux-gnueabi-gcc-v

You can see that the system displays ARM-GCC  gcc version 4.4.1 ". In front of the ANDROID4.0.3  GCC  version", But the previous " GCC " is x86  compiler (by command #gcc   -v  can view its version). Here the " GCC " the compiler is arm  compilers, so they are two completely different compilers.

3.2 QT source files and patch files

In the Ubuntu Environment,Create a new folder "Yizhi" in the "root" directory, as follows, in ubuntu command line, execute the following command:

Cd/root

mkdir Yizhi

Then compress the package "arm-qtopia-free-src-2.2.0.tar.gz"Copy to the previous new"Yizhi"folder, extract the compressed package and get the source file"qtopia-free-src-2.2.0.tar.gz"and Documents"Build". Copy Compressed Package "tslib.tar.gz"toUbuntusystem, then unzip toUbuntuSystem of "usr" -"Local"folder, unzip the resulting folder"Tslib".

3.3 library files and compiling QT

CompileQTThe file also requires some additional6a library file, which6library files are all on the user CD "Linux" -"Patch"folder. These six library files are:libxext.so.6.4.0, libxmu.so.6.2.0,libsm.so.6.0.1, libice.so.6.3.0, libxt.so.6.0.0, libuuid.so.1.3.0one of the5a library file, including thelibxext.so.6.4.0","libxmu.so.6.2.0","libsm.so.6.0.1","libice.so.6.3.0","libxt.so.6.0.0", copy all toUbuntuSystem's Folder "usr"

--"lib32". Then create the linked file, as follows, into the Ubuntu system Folder "usr"--" Lib32 "under, and then in Ubuntu command line, execute the following command:

Ln-s libxext.so.6.4.0 libxext.so.6

Create a linked file libxext.so.6

Ln-s libxext.so.6 libxext.so

Create a linked file libxext.so

Ln-s libxmu.so.6.2.0 libxmu.so.6

Create a linked file libxmu.so.6

Ln-s libxmu.so.6 libxmu.so

Create a linked file libxmu.so

Ln-s libsm.so.6.0.1 libsm.so.6

Create a linked file libsm.so.6

Ln-s libsm.so.6 libsm.so

Create a linked file libsm.so

Ln-s libice.so.6.3.0 libice.so.6

Create a linked file libice.so.6

Ln-s libice.so.6 libice.so

Create a linked file libice.so

Ln-s libxt.so.6.0.0 libxt.so.6

Create a linked file libxt.so.6

Ln-s libxt.so.6 libxt.so

Create a linked file libxt.so

Copy the remaining files "libuuid.so.1.3.0" to the "lib32" folder in the Ubuntu system and In the Ubuntu command line, execute the following command:

Ln-s libuuid.so.1.3.0 libuuid.so.1

Create a linked file libuuid.so.1

Ln-s libuuid.so.1 libuuid.so

Create a linked file libuuid.so

Library file processing Complete, then you can compile QT Source code, the specific operation is as follows, in the Ubuntu command line, execute the following command:

Cd/root/yizhi

./build

Compile QT  UBUNTU  system Folder " root " -->, yizhi "Generate Folder" qtopia-free-2.2.0 ", This folder is the compiled QT  file. In the compiled QT  folder, We need to proceed with the font file. The operation is as follows, in UBUNTU  command line, Execute the following command:

Cp-r/root/yizhi/qtopia-free-2.2.0/qt2/lib/fonts/helvetica*/root/yizhi/qtopia-free-2.2.0/qtopia/image/opt/ qtopia/lib/fonts/ Then we copy the folder "Qtopia" to the opt folder of the Ubuntu system. , in the Ubuntu command line, execute the following command:

Cp-r/root/yizhi/qtopia-free-2.2.0/qtopia/image/opt/qtopia/opt

3.4 third-party library files

The third-party library file "3rdpart-lib-for-qtopia2.2.0.tar.gz" was used when compiling the above. Since this library file is directly included in the supplied compiler package "arm-linux-4.4.1.tar.gz", the library file has been extracted directly to Ubuntu when the compiler tarball is unzipped. system, so when compiling qt , the user can directly compile and build qt file system without additional processing.

3.5 generating system.img

To generate a downloadablesystem.imgfile requires Tools "Mkimage", this tool is on the user CD"Tools"Compressed package under Folder"linux_tools.tgz". Copy the compressed package toUbuntuSystem of "/"directory, note is"/", and then unzip the compressed package. In theUbuntuthe user directory"Topeet"Next, create a new "LINUX+QT"folder. Copy Compressed Package "root.tar.gz"to the new"LINUX+QT"folder, then unzip, unzip and generate folder"Root". Then put the generated folder in the previous compilation "Qtopia"Copy it to the extracted."optfolder, do the following in theUbuntucommand line, execute the following command:

Cp-r/root/yizhi/qtopia-free-2.2.0/qtopia/image/opt/qtopia/home/topeet/linux+qt/root/opt

The red topeet is the user folder, and if you set up your own environment, you need to replace it with your own user name.

After performing the above operation, finally execute the command to generate the binaries, on the Ubuntu command line, perform the following

Command :

Cd/home/topeet/linux+qt

Make_ext4fs-s-L 314572800-a root-l Linux system.img root

After you perform this step, the "system.img" file is generated in the "linux+qt" folder. Finally the QT system also needs a mirror file "ramdisk-uboot.img", this image file is generic, can be directly with the compiled image.

At this point, all the mirrors needed by LINUX-QT have been made.

LINUX-QT development environment Building and compiling image

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.