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/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值