openwrt的交叉編譯


默認情況下,openwrt編譯腳本會自動從Internet上獲取所需要的軟件包源代碼,並把下載的源碼包存放在當前目錄的 dl/ 目錄中;  
在 build_dir/ 目錄中存放編譯中使用的軟件包,  
在 staging_dir/ 目錄用於存放構建目標系統鏡像的工具軟件,包括: 宿主系統使用的工具,存放在 staging_dir/host/ 目錄下 
目標系統使用的軟件包,存放在 staging_dir/target-mips_r2_uClibc-0.9.30.1/ 目錄下 
交叉編譯工具鏈,存放在 staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/ 目錄下

[opwrt@localhost openwrt-dreambox]$ ls
bin build_dir default_configs docs feeds.conf.default LICENSE package rules.mk staging_dir tmp tools
BSDmakefile Config.in dl feeds include Makefile README scripts target toolchain
[opwrt@localhost openwrt-dreambox]$ cd staging_dir/
[opwrt@localhost staging_dir]$ ls
host target-mips_r2_uClibc-0.9.30.1 toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1
[opwrt@localhost staging_dir]$ cd toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/
[opwrt@localhost toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1]$ ls
bin info.mk lib sbin stamp usr
[opwrt@localhost toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1]$ cd usr/
[opwrt@localhost usr]$ ls
bin include info lib libexec man mips-openwrt-linux mips-openwrt-linux-uclibc share
[opwrt@localhost usr]$ cd bin/
[opwrt@localhost bin]$ ls
ldd mips-openwrt-linux-gcov mips-openwrt-linux-uclibc-addr2line mips-openwrt-linux-uclibc-gprof
mips-openwrt-linux-addr2line mips-openwrt-linux-gprof mips-openwrt-linux-uclibc-ar mips-openwrt-linux-uclibc-ld
mips-openwrt-linux-ar mips-openwrt-linux-ld mips-openwrt-linux-uclibc-as mips-openwrt-linux-uclibc-nm
mips-openwrt-linux-as mips-openwrt-linux-nm mips-openwrt-linux-uclibc-c++ mips-openwrt-linux-uclibc-objcopy
mips-openwrt-linux-c++ mips-openwrt-linux-objcopy mips-openwrt-linux-uclibc-c++filt mips-openwrt-linux-uclibc-objdump
mips-openwrt-linux-c++filt mips-openwrt-linux-objdump mips-openwrt-linux-uclibc-cpp mips-openwrt-linux-uclibc-ranlib
mips-openwrt-linux-cpp mips-openwrt-linux-ranlib mips-openwrt-linux-uclibc-g++ mips-openwrt-linux-uclibc-readelf
mips-openwrt-linux-g++ mips-openwrt-linux-readelf mips-openwrt-linux-uclibc-gcc mips-openwrt-linux-uclibc-size
mips-openwrt-linux-gcc mips-openwrt-linux-size mips-openwrt-linux-uclibc-gcc-4.3.3 mips-openwrt-linux-uclibc-strings
mips-openwrt-linux-gcc-4.3.3 mips-openwrt-linux-strings mips-openwrt-linux-uclibc-gccbug mips-openwrt-linux-uclibc-strip
mips-openwrt-linux-gccbug mips-openwrt-linux-strip mips-openwrt-linux-uclibc-gcov

[opwrt@localhost capwap-0.93.3]$ vim /home/opwrt/.bash_profile 

PATH=$PATH:/home/opwrt/openwrt-dreambox/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/bin

[opwrt@localhost capwap-0.93.3]$ make CC=mips-openwrt-linux-uclibc-gcc

 

./configure --host=mips-openwrt-linux   --prefix=/tmp

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM