• <li id="00i08"><input id="00i08"></input></li>
  • <sup id="00i08"><tbody id="00i08"></tbody></sup>
    <abbr id="00i08"></abbr>
  • 新聞中心

    EEPW首頁 > 嵌入式系統 > 交叉編譯場景分析(arm-linux)(七)

    交叉編譯場景分析(arm-linux)(七)

    ——
    作者: 時間:2007-04-18 來源:http://blog.csdn.net/absurd 收藏
    編譯sqlite
    1. 基本信息:

    軟件名稱
     sqlite
     
    功能簡述
     sqlite是一個針對設計的數據庫管理系統(DBMS),實現了SQL92的基本功能,ARM版的可執行文件約300K.
     
    下載地址
     http://www.sqlite.org/
     
    軟件版本
     sqlite-3.3.4.tar.gz
     
    依賴關系
     默認

    readline
     
    前置條件
     源文件位置:$(WORK_DIR)/ sqlite-3.3.4
     

     

    2.         過程分析

    下載的穩定版本,configure已經存在,直接進行配置:

    [root@linux sqlite-3.3.4]# ./configure --host=$ARCH-linux --prefix=$ROOTFS_DIR/usr

                     

    出現了如下錯誤:

    configure: error: unable to find a compiler for building build tools

     

    前面檢查arm-linux-gcc都通過了,怎么還說沒有找到呢?花了點時間看configure的腳本,太復雜了,又結合configure.ac看了一下。原來是要設置config_TARGET_CC和config_BUILD_CC兩個環境變量。config_TARGET_CC是交叉,config_BUILD_CC是主機。重來:

    [root@linux sqlite-3.3.4]# export config_BUILD_CC=gcc

    [root@linux sqlite-3.3.4]# export config_TARGET_CC=arm-linux-gcc

    [root@linux sqlite-3.3.4]# ./configure --host=$ARCH-linux --prefix=$ROOTFS_DIR/usr

     

    出現了如下錯誤:

    checking for /usr/include/readline.h... configure: error: cannot check for file existence when cross compiling

     

    readline我們已經編譯過了,readline.h是肯定存在,沒有必要檢查。還是施展我們欺騙大法吧,在cache文件里設置ac_cv_header_readline_h=yes,騙過configure腳本:

    [root@linux sqlite-3.3.4]# echo ac_cv_header_readline_h=yes >$ARCH-linux.cache

    [root@linux sqlite-3.3.4]#./configure --host=$ARCH-linux --prefix=$ROOTFS_DIR/usr --cache-file=$ARCH-linux.cache

     

    這回配置成功了,編譯:

    [root@linux sqlite-3.3.4]# make && make install

     

    有的機器上會出現下列錯誤:

    libtool: compile: unable to infer tagged configuration

    libtool: compile: specify a tag with `--tag'

     

    這時檢查一下libtool里的CC變量是否設置為arm-linux-gcc,如果不是,可以手工改過來,或者設置環境變量lt_compiler=arm-linux-gcc,重新配置一下。

     

    OK,經過幾番周折,終于編譯過去了。

     

    3.         構建處方

    l         sqlite.mk

    SQLITE_DIR="sqlite-3.3.4"

     

    all: clean config build

     

    config:

        @cd $(SQLITE_DIR) && 

        export config_BUILD_CC=gcc && 

        export config_TARGET_CC=arm-linux-gcc && 

        echo ac_cv_header_readline_h=yes >$$ARCH-linux.cache && 

        ./configure --host=$$ARCH-linux --prefix=$$ROOTFS_DIR/usr --cache-file=$$ARCH-linux.cache && 

        echo "config done"

        

    build:

        @cd $(SQLITE_DIR) && 

        make && make install && 

        echo "build done"

        

    clean:

        @cd $(SQLITE_DIR) && 

        if [ -e Makefile ]; then make distclean; fi && 

    echo "clean done" 

     

    linux相關文章:linux教程




    評論


    相關推薦

    技術專區

    關閉
    主站蜘蛛池模板: 东台市| 临湘市| 开平市| 齐河县| 治县。| 惠安县| 林西县| 淮阳县| 延庆县| 深州市| 辽中县| 肇东市| 团风县| 荆门市| 宁阳县| 阿坝县| 承德市| 和静县| 江油市| 丹江口市| 义马市| 昌平区| 南江县| 抚顺市| 喀什市| 洛川县| 巢湖市| 双峰县| 东乌珠穆沁旗| 筠连县| 南川市| 呼伦贝尔市| 贵阳市| 乌拉特中旗| 乌拉特后旗| 盘锦市| 吉安市| 阳东县| 怀集县| 九江县| 南充市|