使用OpenEmbedded構建交叉編譯環境 [轉]

使用OpenEmbedded構建交叉編譯環境      CSDN Blog推出文章指數概念,文章指數是對Blog文章綜合評分後推算出的,綜合評分項分別是該文章的點擊量,回覆次數,被網摘收錄數量,文章長度和文章類型;滿分100,每個月更新一次. http://blog.csdn.net/leo_cao/archive/2007/08/06/1728122.aspx 1,選擇 /opt作爲存放openembedded的文件系統。 2,設置環境變量: export OEDIR=/opt/openembedded export PATH=$OEDIR/bitbake/bin:$PATH export BBPATH=$OEDIR/build:$OEDIR/org.openembedded.dev 3,創建 「/opt/openembedded」目錄,這是根 4,構建環境,先安裝軟件包,debian系統testing branch: http://www.openembedded.org/wiki/RequiredSoftware http://www.openembedded.org/wiki/OEandYourDistro 5,接下,獲取bitbake svn co svn://svn.berlios.de/bitbake/branches/bitbake-1.8/ bitbake 而後,安裝monotone 0.32版本,獲取OE的數據庫: wget http://www.openembedded.org/snapshots/OE.mtn.bz2 bunzip2 <OE.mtn.bz2 >OE.mtn 而後更新 mtn --db=OE.mtn db migrate mtn --db=OE.mtn pull monotone.openembedded.org org.openembedded.dev 而後獲取 openembedded的源代碼 mtn --db=OE.mtn checkout --branch=org.openembedded.dev 6,建立配置文件 cp org.openembedded.dev/conf/local.conf.sample build/conf/local.conf 修改後的格式: DL_DIR = "${OEDIR}/sources" BBFILES := "${OEDIR}/org.openembedded.dev/packages/*/*.bb" #BBMASK = "" # Select between multiple alternative providers, if more than one is eligible. PREFERRED_PROVIDERS = "virtual/qte:qte virtual/libqpe:libqpe-opie" PREFERRED_PROVIDERS += " virtual/libsdl:libsdl-x11" PREFERRED_PROVIDERS += " virtual/${TARGET_PREFIX}gcc-initial:gcc-cross-initial" PREFERRED_PROVIDERS += " virtual/${TARGET_PREFIX}gcc:gcc-cross" PREFERRED_PROVIDERS += " virtual/${TARGET_PREFIX}g++:gcc-cross" MACHINE = "qemuarm" TARGET_ARCH = "arm" TARGET_OS = "linux" DISTRO = "generic" MACHINE_KERNEL_VERSION = "2.6" IMAGE_FSTYPES = "jffs2 tar" BBDEBUG = "yes" # PARALLEL_MAKE = "-j 4" BBINCLUDELOGS = "yes" 7,得到交叉編譯工具鏈 bitbake gcc 8,使用交叉編譯工具 交叉編譯工具在tmp/cross/bin/下,能夠用它們編譯一個 hello, world。 9,運行編譯好的目標程序 這就須要用qemu這樣的模擬程序了,或者用開發板。
相關文章
相關標籤/搜索