Admin Administrateur
Offline
Joined: 12 May 2007 Posts: 132
|
Posted: Mon 7 Apr - 20:33 Post subject: compilation complete |
|
|
Steps to Build a Cross-environment for Triple Dragon
"A cross compiler is a compiler capable of creating executable code for a platform other than the one on which the compiler is run. Cross compiler tools are generally found in use to generate compiles for embedded system or multiple platforms. It is a tool that one must use for a platform where it is inconvenient or impossible to compile on that platform, like microcontrollers that run with a minimal amount of memory for their own purpose. It has become more common to use this tool for paravirtualization where a system may have one or more platforms in use."
http://en.wikipedia.org/wiki/Cross_compiler
Requirements:
- Linux-installation with Development tools
- fast internet connection for downloading sources
Install the required Development tools:
----------------------------------------------------------------------------
Notes about automake:
The minimum required version of automake is 1.7.x
If you have installed automake's version 1.8.x, you should downgrade to version
1.7.x or upgrade to 1.9.x. Version 1.8 is known to have multiple bugs, so
compiling may fail completely.
Debian and Ubuntu install:
Code:
sudo apt-get update
sudo apt-get install subversion
sudo apt-get install gcc-3.3
sudo apt-get install gcc-3.3-base
sudo apt-get install libc6-dev
sudo apt-get install autoconf
sudo apt-get install automake1.9
sudo apt-get install make
sudo apt-get install sed
sudo apt-get install libtool
sudo apt-get install libglib2.0-dev
sudo apt-get install pkg-configIf you are missing packages, use this command to find the correct name of the packages:
apt-cache search nameofpackage
RPM format (RedHat, Fedora, SuSe, etc...:
Code:
sudo rpm update
sudo rpm -ivh subversion-*.rpm
sudo rpm -ivh gcc-3*.rpm
sudo rpm -ivh libc*dev*.rpm
sudo rpm -ivh autoconf*.rpm
sudo rpm -ivh automake*1.9*.rpm
sudo rpm -ivh make*.rpm
sudo rpm -ivh sed*.rpm
sudo rpm -ivh libtool*.rpm
sudo rpm -ivh libglib*2.0*.rpm
sudo rpm -ivh pkg-config*.rpm
Fix gcc:
--------------------------------
just in case
i noticed on a new kubuntu install, gcc -> gcc-4.1
a workaround is to delete the symlink and and make a new one pointed to gcc-3.3
Code:
cd /usr/bin
sudo rm -f gcc
sudo ln -s /usr/bin/gcc-3.3 /usr/bin/gcc
Download SVN:
--------------------------------------------
Code:
svn co http://www.triple-dragon.org/tdsvn-enter PC personal password "xxxxxx"
-enter SVN username "dragon"
-enter SVN password "dragon"
Prepare Directories:
----------------------------------------------------
Code:
sudo mkdir /stb
sudo chmod 755 /stb
sudo chown $USER /stb
sudo mkdir /opt
- may already exist -
sudo mkdir /opt/db3000
sudo chmod 755 /opt/db3000
sudo chown $USER /opt/db3000
Edit demo-ppc405.sh:
-------------------------------------------------------
Code:
cd $HOME/tdsvn/ARMAS/cross-enivroment-build/crosstool-0.28-rc28
nano -w demo-ppc405.shedit the 3rd line and add this: $HOME/tdsvn/ARMAS/cross-enivroment-build/crosstool-0.28-rc28
Code:
#!/bin/sh
set -ex
TARBALLS_DIR=$HOME/tdsvn/ARMAS/cross-enivroment-build/crosstool-0.28-rc28
RESULT_TOP=/opt/db3000/cross
export TARBALLS_DIR RESULT_TOP
GCC_LANGUAGES="c,c++"
export GCC_LANGUAGES
# Really, you should do the mkdir before running this,
# and chown /opt/crosstool to yourself so you don't need to run as root.
mkdir -p $RESULT_TOP
# Build the toolchain. Takes a couple hours and a couple gigabytes.
#eval `cat powerpc-405.dat gcc-3.3-glibc-2.2.5.dat` sh all.sh --notest
#eval `cat powerpc-405.dat gcc-3.3-glibc-2.3.2.dat` sh all.sh --notest
#eval `cat powerpc-405.dat gcc-3.2.3-glibc-2.2.5.dat` sh all.sh --notest
#eval `cat powerpc-405.dat gcc-3.3.2-glibc-2.3.2.dat` sh all.sh --notest
#eval `cat powerpc-405.dat gcc-3.3.2-glibc-2.3.2.dat` sh all.sh --notest
#eval `cat powerpc-405.dat gcc-3.3.3-glibc-2.3.2.dat` sh all.sh --notest
#eval `cat powerpc-405.dat gcc-3.4.0-glibc-2.3.2.dat` sh all.sh --notest
eval `cat powerpc-405.dat gcc-3.4.1-glibc-2.3.2.dat` sh all.sh --notest
# eval `cat powerpc-405.dat gcc-4.0.0-glibc-2.3.5.dat` sh all.sh --notest
echo Done.
to exit type Ctrl x
to save type Y and then hit enter
Note to Ubuntu users:
Change dash to bash:
-------------------------------------------------------
Your build will fail if using dash shell. Changing to bash will correct the issue and allow a successful build!!
Code:
ls -al /bin/shif you see the following:
Code:
lrwxrwxrwx 1 root root 4 2007-11-10 10:59 /bin/sh -> dash
then:
Code:
sudo ln -sf /bin/bash /bin/sh
ls -al /bin/sh
now it should look like this:
Code:
lrwxrwxrwx 1 root root 9 2007-11-10 16:08 /bin/sh -> /bin/bash
Run demo-ppc405.sh script:
-----------------------------------------------------------------
you should still be in this directory:
/tdsvn/ARMAS/cross-enivroment-build/crosstool-0.28-rc28$
then:
Code:
./demo-ppc405.shnote: runtime of this script will vary
4.5hrs+ on 800mhz AMD
2hrs+ on 2Ghz intel
39minutes on 3.8Ghz intel
when build is complete you will see the following:
Code:
+ test '' = 1
+ test 1 = ''
+ echo Done.
Done.
then copy directory:
Code:
sudo cp -R $HOME/tdsvn/ARMAS/cross-enivroment-build/stb /
Edit Path:
------------------------------------
Code:
nano -w $HOME/.bashrcadd this to the bottom of .bashrc
Code:
PATH="${PATH}":/opt/db3000/cross/powerpc-405-linux-gnu/gcc-3.4.1-glibc-2.3.2/bin
export PATHto exit type Ctrl x
to save type Y and then hit enter
logout and log back in for new path to take effect
Code:
echo $PATHyou should now see the changes to the path
Code:
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games:/opt/db3000/cross/powerpc-405-linux-gnu/gcc-3.4.1-glibc-2.3.2/bin
Example Plugin to Compile:
-----------------------------------------------------------
Code:
cd ~/tdsvn/ARMAS/applications/plugins/libvplay
./ppc-cross-configure
make
sudo make install
you will find the compiled plugin in the following directory: /stb/lib/dvb2001
Code:
cd /stb/lib/dvb2001
ls -al _________________ triple-dragon,dreambox 7020si tuner alps,tm9101,aston xena 1800hd,module astondual viaccess et mediaguard
|
|