星期五, 5月 11, 2007

安裝cross compiler (toolchain)

為了讓一般的 C 或 C++ 的程式可以在不同的機器平台上執行,所以需要 cross compiler 將 C 或 C++ 的程式編譯成不同格式的執行檔。
首先可至這下載 http://www.handhelds.org/downloads.html

接著輸入

[root@localhost Toolchain]# cp hybus-arm-linux-R1.1.tar.gz /usr/local/
[root@localhost Toolchain]# cd /usr/local/
[root@localhost local]# tar zxvf hybus-arm-linux-R1.1.tar.gz
[root@localhost local]# vi ~/.bash_profile


將hybus-arm-linux-R1.1.tar.gz 移動至/usr/local解壓縮。


# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin:=/usr/local/hybus-arm-linux-R1.1/bin:.

export PATH
unset USERNAME

用vi開啟~/.bash_profile,並加入PATH=/usr/local/hybus-arm-linux-R1.1/bin此路徑。陷在則可以在任何目錄下開啟/usr/local/hybus-arm-linux-R1.1/bin。


[root@localhost local]# source ~/.bash_profile

沒有留言: