1、下載 SQLite3源碼
地址:http://www.sqlite.org/download.html
完整版: sqlite-src-3200100.zip (PS: sqlite-autoconf-3200100.tar.gz可以直接configure編譯通過, 這裏下載完整版編譯是爲了比較產生的sqlite3.c文件之間的差異)
2、編譯
2.1 解碼
cd
cd rookie
mkdir 3.20.1-full
cp 源碼目錄/sqlite-src-3200100.zip ./3.20.1-full
unzip -x sqlite-src-3200100.zip
2.2 配置
然後,在unzip出來的源碼目錄中
mkdir ../install #創建安裝目錄
./configure --disable-tcl --host=arm-none-linux-gnueabi --prefix=/coral/rookie/3.20.1-full/install
其中,
--host: 指定交叉編譯工具,一般爲arm-linux、arm-linux-gnueabihf、arm-none-linux-gnueabi等,具體要和板子用的交叉編譯工具對應。
--prefix: 指定安裝目錄,編譯後的文件會全部放在安裝目錄中。必須是絕對路徑
2.3 編譯
make
報告如下錯誤:
tclsh /coral/rookie/3.20.1-full/tool/mksqlite3h.tcl /coral/rookie/3.20.1-full >sqlite3.h
gcc -g -o mkkeywordhash /coral/rookie/3.20.1-full/tool/mkkeywordhash.c
./mkkeywordhash >keywordhash.h
gcc -g -o lemon /coral/rookie/3.20.1-full/tool/lemon.c
cp /coral/rookie/3.20.1-full/tool/lempar.c .
cp /coral/rookie/3.20.1-full/src/parse.y .
rm -f parse.h
./lemon parse.y
mv parse.h parse.h.temp
tclsh /coral/rookie/3.20.1-full/tool/addopcodes.tcl parse.h.temp >parse.h
illegal access mode "rb"
while executing
"open [lindex $argv 0] rb"
invoked from within
"set in [open [lindex $argv 0] rb]"
(file "/coral/rookie/3.20.1-full/tool/addopcodes.tcl" line 9)
make: *** [parse.c] 錯誤 1
2.4 錯誤分析
檢查ubuntu10.04的環境,確認tcl/tk沒有安裝
3.安裝tcl
3.1 參考博文:ubuntu12.04.4安裝tcl/tk和Tkinter( http://blog.csdn.net/cryhelyxx/article/details/22514871 )
./configure
make
報告#pragma GCC錯誤,按以下方式解決:
3.2 參考博文: http://blog.chinaunix.net/uid-31343710-id-5758107.html ( 貌似是編譯器版本太低了,所以我直接將cJSON_AddItemToObjectCS函數中的#pragma GCC註釋掉了,沒有任何影響 )
註釋掉#pragma GCC,編譯通過
make
make install
4.再次編譯sqlite3.20.1,通過
UBUNTU 10.04環境下交叉編譯sqlite3.20.1源碼
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章
阿里雲Ubuntu服務器搭建Javaweb開發環境
只修电脑不过夜
2018-08-27 20:03:20
gcc, vc 編譯輸出頭文件包含順序
hylaking
2020-07-07 12:48:50
Centos7 搭建qemu模擬器模擬arm-vexpress-a9開發板
hylaking
2020-06-26 06:10:36
打造像github的Apache在線PHP版markdown、C、Java文件閱讀器
hylaking
2020-06-26 06:10:36
跨平臺編程之Windows模擬Linux dirent API
hylaking
2020-06-26 06:10:25
以root帳戶登錄UBUNTU及VMware掛載共享目錄
hylaking
2020-06-26 06:10:25
sleep, usleep 函數延時的問題
hylaking
2020-05-22 07:17:14
嵌入式arm開發C語言調用棧回溯實戰
hylaking
2020-05-14 19:04:26
在 QEMU 中運行 ubuntu 16.04 armhf 填坑記
hylaking
2019-03-25 23:23:22
Centos7 搭建qemu模擬器模擬arm開發板
hylaking
2019-03-12 20:48:30
Centos7上安裝docker筆記
hylaking
2019-02-27 21:52:22
打造像github的Apache在線PHP版markdown閱讀器(續)—— 側邊欄顯示自動產生的書籤
hylaking
2019-01-17 21:19:10
Apache搭建Windows代理服務器
hylaking
2019-01-07 22:10:11
Windows7 (x86) 配置Go語言IDE開發環境, 編譯loraserver手記
hylaking
2018-11-23 06:16:54
vc2010編譯openssl時cl.exe報告0xC0000135錯誤的解決
hylaking
2018-11-04 07:08:02