How to setup a cross compile environment on linux machine
1. Install linux on host machine
2. Enable tftp, nfs,and samba service--do it with root account
2.1 Set up tftp server for downloading image to target, append sudo prefix if sudoer list is setup
to window machine so that we can use window editor to edit the application files .
3. Add current user wli to sudo list account, /etc/sudoers
wli ALL=(ALL) NOPASSWD: ALL
4. Install cross compile tool, like crosstool on /opt directory
cd /opt
sudo mkdir /opt/crosstool
sudo chown $USER /opt/crosstool /make sure you're on the sudoer list. if not, use su command
wget http://kegel.com/crosstool/crosstool-0.43.tar.gz
tar xvfz crosstool-0l43.tar.gz
cd /opt/crosstool-0.43
vi demo-powerpc-603.sh ---uncomment the following line
eval `cat powerpc-603.dat gcc-4.1.0-glibc-2.3.6-tls.dat` sh all.sh --notest
sh demo-powerpc-603.sh
.........................
this will download and install tool chain on /opt/crosstool directory
/opt/crosstool/gcc-4.1.0-glibc-2.3.6/
.............................
3.1 Add the compilers to the PATH environment
vi ~/.bash_profile
PATH=$PATH:$HOME/bin:/opt/crosstool/gcc-4.1.0-glibc-2.3.6/powerpc-603-linux-gnu/bin
export PATH
export CROSS_COMPILE=powerpc-603-linux-gnu
3.2 source the new bash_profile
source ~/.bash_profile
you're ready to go at this moring. Test drive a hello.c program.
4. You may need mkimage as well if you want to build uImage. You can either copy it from ELDK or get the source and compile it.
copy them to /opt/crosstool/gcc-xx-glibc-xxx/powerpc-405-linux-gnu/bin
2. Enable tftp, nfs,and samba service--do it with root account
2.1 Set up tftp server for downloading image to target, append sudo prefix if sudoer list is setup
- Edit /etc/xinet.d/tftp to enable tftp service, set disable=no
- Reload xinet serivice, /sbin/service xinetd reload
- Edit /etc/exports, add the following line
- Restart NFS service, /sbin/service nfs restart
to window machine so that we can use window editor to edit the application files .
- Edit /etc/samba/smb.conf
- Add an entry there to allow sharing of home directory to window
[wli]
comment = Wende's stuff
path = /localhome/wli
valid users = wli
public = no
writable = yes
printable = no
create mask = 0765
comment = Wende's stuff
path = /localhome/wli
valid users = wli
public = no
writable = yes
printable = no
create mask = 0765
- Add samba user and setup passwd
smbpasswd -a wli
restart smb service
/sbin/service smb restart
/sbin/service smb restart
That's all, using window browser to log in to the server.
3. Add current user wli to sudo list account, /etc/sudoers
wli ALL=(ALL) NOPASSWD: ALL
4. Install cross compile tool, like crosstool on /opt directory
cd /opt
sudo mkdir /opt/crosstool
sudo chown $USER /opt/crosstool /make sure you're on the sudoer list. if not, use su command
wget http://kegel.com/crosstool/crosstool-0.43.tar.gz
tar xvfz crosstool-0l43.tar.gz
cd /opt/crosstool-0.43
vi demo-powerpc-603.sh ---uncomment the following line
eval `cat powerpc-603.dat gcc-4.1.0-glibc-2.3.6-tls.dat` sh all.sh --notest
sh demo-powerpc-603.sh
.........................
this will download and install tool chain on /opt/crosstool directory
/opt/crosstool/gcc-4.1.0-glibc-2.3.6/
.............................
3.1 Add the compilers to the PATH environment
vi ~/.bash_profile
PATH=$PATH:$HOME/bin:/opt/crosstool/gcc-4.1.0-glibc-2.3.6/powerpc-603-linux-gnu/bin
export PATH
export CROSS_COMPILE=powerpc-603-linux-gnu
3.2 source the new bash_profile
source ~/.bash_profile
you're ready to go at this moring. Test drive a hello.c program.
4. You may need mkimage as well if you want to build uImage. You can either copy it from ELDK or get the source and compile it.
copy them to /opt/crosstool/gcc-xx-glibc-xxx/powerpc-405-linux-gnu/bin
0 Comments:
Post a Comment
<< Home