1. 把编译好的工具链放到相应目录下,我的是/aesop/cross/
2.
gedit ~/.bash_profile
add the content:
PATH=$PATH:/aesop/cross/bin
source ~/.bash_profile
/* On Ubuntu */
vim ~/.bashrc
add at the end of file
PATH=$PATH:/aesop/cross/bin
export PATH
/* So that , you do not need to source every time */
try it:
arm-linux-gcc -v
3. test helloworld.
root@ubuntu:/aesop/rootfs/root# arm-linux-gcc hello.c -o hello
/aesop/cross/bin/../lib/gcc/arm-linux/4.2.1/../../../../arm-linux/bin/ld.real:找不到 /usr/local/arm-linux/lib/libc.so.6
collect2: ld returned 1 exit status
solution:
cd /usr/local/
ln -s /aesop/cross/arm-linux arm-linux
2010-03-22
REF http://www.mediacollege.com/linux/red-hat/path-variable.html
How to set the $PATH variable in Redhat 9.0
The $PATH variable is a list of which directories Redhat will look in for executable files.
To see what the current path is, type...
echo $PATH
You should get something like the following...
/usr/local/bin:/bin:/usr/bin:/home/myname/bin
This means that when you try to run a program or script (eg: ping, ftp or vi etc), Redhat will look in /usr/local/bin then /bin , /usr/bin and finally in /home/myname/bin to find it.
You can change the path to suit your needs.
EXAMPLE:
To add /sbin to the path, type
export PATH=$PATH:/sbin
To see the result, type...
echo $PATH
/usr/local/bin:/bin:/usr/bin:/home/myname/bin:/sbin
我机子上的示例:
[root@localhost root]# echo $PATH
/root/bin
[root@localhost root]# export PATH=$PATH:/usr/local/bin:/bin:/usr/bin:
[root@localhost root]# echo $PATH
/root/bin:/usr/local/bin:/bin:/usr/bin: