QT4.8.5 源码编译记录

  • 今天想将以前的虚拟机的 QT4.8.5 集成到一个虚拟机里面,所以就重新编译了一次 QT4.8.5的源码
  • 走了一点点小弯路,特此记录。
  • 一、交叉编译器,不能直接从原来的虚拟机里面拷贝,必须使用官网的交叉编译器
    // 链接从下面的链接俩面找
    http://www.deyisupport.com/question_answer/dsp_arm/sitara_arm/f/25/p/113233/308047.aspx#308047
  • 二、 交叉编译器的解压和环境变量就不多描述了,基本上的都会。
  • 三、 要把 tslib 编译好也添加进去。
  • 四、 将 qt4.8.5 的源码解压后
    1. 复制一份  qt-everywhere-opensource-src-4.8.5/mkspecs/qws/linux-arm-gnueabi-g++ 
        为 qt-everywhere-opensource-src-4.8.5/mkspecs/qws/linux-arm-gnueabihf-g++
    
    2. 修改上述复制文件夹里面的 qmake.conf 为下面内容
    #                                                                               
    # qmake configuration for building with arm-none-linux-gnueabi-g++              
    #                                                                               
                                                                                
    include(../../common/linux.conf)                                                
    include(../../common/gcc-base-unix.conf)                                        
    include(../../common/g++-unix.conf)                                             
    include(../../common/qws.conf)                                                  
                                                                                
    # modifications to g++.conf                                                     
    QMAKE_CC                = arm-linux-gnueabihf-gcc   -lts                        
    QMAKE_CXX               = arm-linux-gnueabihf-g++   -lts                        
    QMAKE_LINK              = arm-linux-gnueabihf-g++   -lts                        
                                                                                    
    # modifications to linux.conf                                                   
    QMAKE_AR                = arm-linux-gnueabihf-ar cqs                            
    QMAKE_OBJCOPY           = arm-linux-gnueabihf-objcopy                           
    QMAKE_STRIP             = arm-linux-gnueabihf-strip  
                                                                                
    QMAKE_INCDIR            = /home/SBC_7109_QT/aplex/tslib/include                 
    QMAKE_LIBDIR            = /home/SBC_7109_QT/aplex/tslib/lib                     
                                                                                
    load(qt_config)   

    3.  修改 qt-everywhere-opensource-src-4.8.5/mkspecs/common/linux.conf
    QMAKE_LIBS_THREAD     = -lpthread  -lts       // 添加 -lts      

    4.  在  qt-everywhere-opensource-src-4.8.5 里面添加配置文件 my.sh
    #!/bin/sh                                                                       
                                                                                
    ./configure \                                                               
        -opensource \                                                               
        -prefix /home/SBC_7109_QT/aplex/qtlib_output \                              
        -confirm-license \                                                          
        -release \                                                                  
        -shared \                                                                   
        -embedded arm \                                                             
        -force-pkg-config \                                                         
        -xplatform qws/linux-arm-gnueabihf-g++ \                                    
        -depths 16,18,24,32 \                                                       
        -fast \                                                                     
        -optimized-qmake \                                                          
        -no-pch \                                                                   
        -qt-sql-sqlite \                                                            
        -qt-libjpeg \                                                               
        -qt-zlib \                                                                  
        -qt-libpng \                                                                
        -qt-freetype \                                                              
        -little-endian -host-little-endian \   
        -no-qt3support \                                                            
        -qt-libtiff -qt-libmng \                                                    
        -make translations \                                                        
        -qt-gfx-linuxfb -qt-gfx-transformed -qt-gfx-multiscreen \                   
        -no-gfx-vnc -no-gfx-qvfb -qt-kbd-linuxinput \                               
        -no-kbd-qvfb -armfpa  \                                                     
        -no-mouse-qvfb \                                                            
        -no-opengl \                                                                
        -no-mmx -no-sse -no-sse2 \                                                  
        -no-3dnow \                                                                 
        -no-openssl \                                                               
        -webkit \                                                                   
        -no-qvfb \                                                                  
        -no-phonon \                                                                
        -no-nis \                                                                   
        -no-opengl \                                                                
        -no-cups \                                                                  
        -no-glib \                                                                  
        -no-xcursor -no-xfixes -no-xrandr -no-xrender \                             
        -no-separate-debug-info \                                                   
        -nomake examples -make tools -make docs \                                   
        -qt-mouse-tslib -DQT_QLOCALE_USES_FCVT \                                    
        -I/home/SBC_7109_QT/aplex/tslib/include \                                   
        -L/home/SBC_7109_QT/aplex/tslib/lib                                                                                            
  • 五、 给 my.sh 添加执行权限 ./my.sh
    make -j4 
    make install

转载于:https://www.cnblogs.com/chenfulin5/p/6958560.html

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值