chroot环境安装Qt 4.7.2

1. 解压到chroot环境目录

[root@linux root]# time tar zxf /mnt/hgfs/hostshare/qt-everywhere-opensource-src-4.7.2.tar.gz -C .

real    1m8.723s
user    0m2.680s
sys     0m41.992s


2. 进入chroot环境config

[root@linux qt-everywhere-opensource-src-4.7.2]# time ./configure -prefix-install -release -opensource -shared -fast -no-largefile -no-qt3support -no-webkit -no-javascript-jit -no-scripttools -platform linux-g++ -no-openssl -nomake tools -nomake examples -nomake demos -nomake docs -continue -silent -no-nis -no-cups -glib -no-exceptions

根据提示输入yes

Do you accept the terms of either license? yes

Creating qmake. Please wait...

…………

  893 projects found.

Creating makefiles. Please wait...

Qt is now configured for building. Just run 'gmake'.
Once everything is built, you must run 'gmake install'.
Qt will be installed into /usr/local/Trolltech/Qt-4.7.2

To reconfigure, run 'gmake confclean' and 'configure'.


real    3m8.261s
user    0m47.278s
sys     1m56.991s

3. 编译

在编译前,先查看一下chroot环境的gcc版本吧

[root@linux qt-everywhere-opensource-src-4.7.2]# g++ -v
Using built-in specs.
Target: i386-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,java,f95,ada --enable-java-awt=gtk --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --host=i386-redhat-linux
Thread model: posix
gcc version 4.0.2 20051125 (Red Hat 4.0.2-8)


[root@linux qt-everywhere-opensource-src-4.7.2]# time gmake

…………

real    37m3.627s
user    18m53.572s
sys     11m5.649s

4. 安装

[root@linux qt-everywhere-opensource-src-4.7.2]# time gmake install

…………

real    2m28.033s
user    0m1.474s
sys     0m21.138s


5. 卸载

如果需要卸载Qt可以在原编译环境使用如下命令卸载:

[root@linux qt-everywhere-opensource-src-4.7.2]# gmake uninstall

6. 备份已编译好的目录

由于编译时间较长,即使以后卸载也要用到编译环境,所以最好还是备份一下编译环境。

tar jcf  qt-everywhere-opensource-src-4.7.2.tar.bz2  ./qt-everywhere-opensource-src-4.7.2/

你可能感兴趣的:(java,linux,gcc,qt,tools,gtk)