<meter id="pryje"><nav id="pryje"><delect id="pryje"></delect></nav></meter>
          <label id="pryje"></label>

          新聞中心

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

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

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

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

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

           

          2.         過程分析

          下載的穩(wěn)定版本,configure已經(jīng)存在,直接進(jìn)行配置:

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

                           

          出現(xiàn)了如下錯誤:

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

           

          前面檢查arm-linux-gcc都通過了,怎么還說沒有找到呢?花了點時間看configure的腳本,太復(fù)雜了,又結(jié)合configure.ac看了一下。原來是要設(shè)置config_TARGET_CC和config_BUILD_CC兩個環(huán)境變量。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

           

          出現(xiàn)了如下錯誤:

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

           

          readline我們已經(jīng)編譯過了,readline.h是肯定存在,沒有必要檢查。還是施展我們欺騙大法吧,在cache文件里設(shè)置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

           

          有的機器上會出現(xiàn)下列錯誤:

          libtool: compile: unable to infer tagged configuration

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

           

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

           

          OK,經(jīng)過幾番周折,終于編譯過去了。

           

          3.         構(gòu)建處方

          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相關(guān)文章:linux教程




          評論


          相關(guān)推薦

          技術(shù)專區(qū)

          關(guān)閉
          看屁屁www成人影院,亚洲人妻成人图片,亚洲精品成人午夜在线,日韩在线 欧美成人 (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();