星期日, 10月 15, 2006

Scatchbox : 讓cross-compile的動作變成native.

一樣,從hemi上看到jserv摘的,所以到原網站看一下,真是不錯的東西,TS看到應該會很高興吧。
一般作embedded system的人要作:
  • install cross -tools
  • cross compile library
  • cross compile application
tool install 還好,因為target不多,而且大部分都有人已經做好package 了,apt-get或是tar一下,follow 一般application 安裝步驟就可以做得很好。

library 也差不多,常用的library 也都可以職些安裝,有些甚至在安裝cross tool 時,就會一併把library都build好。

所以,作embedded system 花最多時間的就是在 cross compile自己需要的application上。

一般都是這樣:
  • 找自己要的applicaion,download source
  • run config 產生make file
  • 修改makefile ,讓他改用cross compile和target的environment
  • test build -- 如果不成功,修改makefile,直到build ok為止
  • 拿到 target system上run,看看跟library link得怎麼樣,需要的/etc 設定當是否OK
其中改makefile那一段真是花時間呀。常常都會希望能像native build一樣,run "make config" 就ㄎ可以自動將makefile中各項參數config好。

Scratchbox 這個專案就是這個用途,他是用chroot的方式,模擬出一個target system的環境,所以在裡面 autoconfig的detect function都可以正確使用,detect出target system的參數i。

Scratchbox中build target 的application,就像native build一樣簡單了。

沒有留言:

網誌存檔