wiki:crosscompiling

Cross compiling OSCAM

For general information on how to build OSCAM, see BuildingOscam page. This page contains information about cross compilation.

Toolchains / Cross compilers

A toolchain contains compiler, libraries (libc, openssl, others..) and headers needed for compilation of programs for a system different than the one you are building on, the so called target system. Target system is the architecture/CPU for which the cross compiler can build binaries. For example SH4 cross compiler can build binaries for SH4 architecture. Building a toolchain is not an easy process and is outside of the scope of this page.

If you are using toolchain/cross compiler to build OSCAM that is not linked here, please share it with us.

The pre-built toolchains listed here can be run on any 32-bit Linux distro or on 64-bit Linux with with 32-bit compat libraries. These toolchains are provided with ready made instructions how to download, install and use them to compile your own OSCAM. Basically (minus the details), the procedure is:

  • Download and install toolchain.
  • Download or checkout OSCAM source code from SVN, see GettingOscam page for details.
  • Cross compile OSCAM by using
    make CROSS=/my-toolchain/bin/arch-platform-
    

For more cross compilation examples see the end of http://www.streamboard.tv/oscam/browser/trunk/README.build

Available cross compilers

MIPSEL Router / DD-WRT toolchain

How to install the toolchain

Run the following commands as NORMAL (non-root user).

cd /tmp
wget http://www.streamboard.de.vu/wbb2/tut-pics/toolchains/Toolchain_MIPS-Router-uclib-0.9.28.bz2
tar -xvf Toolchain_MIPS-Router-uclib-0.9.28.bz2
sudo mkdir -p /opt/cross/mipsel
sudo mv toolchains/* /opt/cross/mipsel

How to install openssl/libcrypto

Run the following commands as NORMAL (non-root user).

cd /tmp
wget http://openssl.org/source/openssl-0.9.8x.tar.gz
tar -xf openssl-0.9.8x.tar.gz
cd openssl-0.9.8x
export TOOLCHAIN=/opt/cross/mipsel/4.1.0-uclibc-0.9.28
export CC=$TOOLCHAIN/bin/mipsel-linux-uclibc-gcc
export RANLIB=$TOOLCHAIN/bin/mipsel-linux-uclibc-ranlib
./Configure --prefix=/ linux-generic32 shared
make
sudo make INSTALL_PREFIX=$TOOLCHAIN install_sw

How to install libusb

Run the following commands as NORMAL (non-root user).

cd /tmp
wget http://downloads.sourceforge.net/project/libusb/libusb-1.0/libusb-1.0.9/libusb-1.0.9.tar.bz2
tar -xf libusb-1.0.9.tar.bz2
cd libusb-1.0.9
export TOOLCHAIN=/opt/cross/mipsel/4.1.0-uclibc-0.9.28
export PATH="$TOOLCHAIN/bin/:$PATH"
./configure --prefix=/ --host=mipsel-linux-uclibc
make
sudo make DESTDIR=$TOOLCHAIN install

How to use cross compile OSCAM

Run the following commands as your regular user in the directory where OSCAM source is. See GettingOscam.

# Set this variable to the root directory of your toolchain
export TOOLCHAIN=/opt/cross/mipsel/4.1.0-uclibc-0.9.28
# Default compilation
make CROSS=$TOOLCHAIN/bin/mipsel-linux-uclibc-

# Cross compile with SSL (and libcrypto) support
make CROSS=$TOOLCHAIN/bin/mipsel-linux-uclibc- USE_SSL=1

# Cross compile libusb (smartreader) support
make CROSS=$TOOLCHAIN/bin/mipsel-linux-uclibc- USE_LIBUSB=1

# Cross compile with static libusb (smartreader) support
make CROSS=$TOOLCHAIN/bin/mipsel-linux-uclibc- USE_LIBUSB=1 LIBUSB_LIB="$TOOLCHAIN/lib/libusb-1.0.a" 

Dreambox 800/8000/7025 (MIPSEL)

How to install the toolchain

Run the following commands as NORMAL (non-root user).

cd /tmp
sudo mkdir -p /opt/cross
wget http://www.streamboard.de.vu/wbb2/tut-pics/toolchains/Toolchain_mipsel-tuxbox-linux.Dreambox.tar.bz2
sudo tar -xf Toolchain_mipsel-tuxbox-linux.Dreambox.tar.bz2 -C /opt/cross

How to install openssl/libcrypto

Run the following commands as NORMAL (non-root user).

cd /tmp
wget http://www.openssl.org/source/openssl-1.0.1g.tar.gz
tar -xf openssl-1.0.1g.tar.gz
cd openssl-1.0.1g
export TOOLCHAIN=/opt/cross/mipsel-unknown-linux-gnu
export CC=$TOOLCHAIN/bin/mipsel-unknown-linux-gnu-gcc
export RANLIB=$TOOLCHAIN/bin/mipsel-unknown-linux-gnu-ranlib
./Configure --prefix=$TOOLCHAIN/mipsel-unknown-linux-gnu/sys-root/usr/ linux-generic32 shared
make
sudo make install

How to install libusb

Run the following commands as NORMAL (non-root user).

cd /tmp
wget http://downloads.sourceforge.net/project/libusb/libusb-1.0/libusb-1.0.9/libusb-1.0.9.tar.bz2
tar -xf libusb-1.0.9.tar.bz2
cd libusb-1.0.9
export TOOLCHAIN=/opt/cross/mipsel-unknown-linux-gnu
export PATH="$TOOLCHAIN/bin:$PATH"
./configure --prefix=$TOOLCHAIN/mipsel-unknown-linux-gnu/sys-root/usr/ --host=mipsel-unknown-linux-gnu --enable-shared=no
make
make install

How to install pcsc

Run the following commands as NORMAL (non-root user).

cd /tmp
wget http://downloads.sourceforge.net/project/libusb/libusb-1.0/libusb-1.0.9/libusb-1.0.9.tar.bz2
tar -xf libusb-1.0.9.tar.bz2
cd libusb-1.0.9
export TOOLCHAIN=/opt/cross/mipsel-unknown-linux-gnu
export PATH="$TOOLCHAIN/bin:$PATH"
./configure --prefix=$TOOLCHAIN/mipsel-unknown-linux-gnu/sys-root/usr --host=mipsel-unknown-linux-gnu
make
make install
cd /tmp
wget https://alioth.debian.org/frs/download.php/3757/pcsc-lite-1.8.6.tar.bz2
tar -xf pcsc-lite-1.8.6.tar.bz2
cd pcsc-lite-1.8.6
./configure CC=$TOOLCHAIN/bin/mipsel-unknown-linux-gnu-gcc-4.3.2 --disable-libudev --host=mipsel-unknown-linux-gnu --prefix=$TOOLCHAIN/mipsel-unknown-linux-gnu/sys-root/usr --exec-prefix=$TOOLCHAIN/mipsel-unknown-linux-gnu/sys-root/usr --disable-shared LIBUSB_LIBS="-L$TOOLCHAIN/mipsel-unknown-linux-gnu/sys-root/usr/lib -lusb-1.0" LIBUSB_CFLAGS="-I$TOOLCHAIN/mipsel-unknown-linux-gnu/sys-root/usr/include/libusb-1.0"
make
make install

How to use cross compile OSCAM

Run the following commands as your regular user in the directory where OSCAM source is. See GettingOscam.

# Set this variable to the root directory of your toolchain
export TOOLCHAIN=/opt/cross/mipsel-unknown-linux-gnu
# Default compilation
make CROSS=$TOOLCHAIN/bin/mipsel-unknown-linux-gnu-

# Cross compile with SSL (and libcrypto) support
make CROSS=$TOOLCHAIN/bin/mipsel-unknown-linux-gnu- USE_SSL=1

# Cross compile libusb (smartreader) support
make CROSS=$TOOLCHAIN/bin/mipsel-unknown-linux-gnu- USE_LIBUSB=1

# Cross compile with static libusb (smartreader) support
make CROSS=$TOOLCHAIN/bin/mipsel-unknown-linux-gnu- USE_LIBUSB=1 LIBUSB_LIB="$TOOLCHAIN/mipsel-unknown-linux-gnu/sys-root/usr/lib/libusb-1.0.a -lrt"

# Cross compile with pcsc support
make CROSS=$TOOLCHAIN/bin/mipsel-unknown-linux-gnu- USE_PCSC=1 EXTRA_FLAGS="-I$TOOLCHAIN/mipsel-unknown-linux-gnu/sys-root/usr/include/PCSC"

# Cross compile with static libusb, pcsc, SSL support
make CROSS=$TOOLCHAIN/bin/mipsel-unknown-linux-gnu- CONF_DIR=/etc/tuxbox/config/ USE_LIBUSB=1 LIBUSB_LIB="$TOOLCHAIN/mipsel-unknown-linux-gnu/sys-root/usr/lib/libusb-1.0.a -lrt" USE_PCSC=1 USE_SSL=1 EXTRA_FLAGS="-I$TOOLCHAIN/mipsel-unknown-linux-gnu/sys-root/usr/include/PCSC"

Mipsel PLI4 Dreambox HD800E,8000 VU+

How to install the Mipsel Pli4 toolchain

Run the following commands as NORMAL (non-root user).

cd /tmp
sudo mkdir /opt/cross
wget -O Mipsel-Tuxbox-Pli4-gcc481-libc217-openssl101g-libusb109-pcsclite1811.tar.bz2 https://www.dropbox.com/s/3hczxy3u189kgfa/Mipsel-Tuxbox-Pli4-gcc481-libc217-openssl101g-libusb109-pcsclite1811.tar.bz2?dl=1
sudo tar xf Mipsel-Tuxbox-Pli4-gcc481-libc217-openssl101g-libusb109-pcsclite1811.tar.bz2 -C /opt/cross  !!Note: do not use tar -xf but tar xf !!

How to use cross compile OSCAM

Run the following commands as your regular user in the directory where OSCAM source is. See GettingOscam.

# Set this variable to the root directory of your toolchain
export TOOLCHAIN=/opt/cross/mipsel-tuxbox-linux-gnu
export PATH="$TOOLCHAIN/bin:$PATH"
# Default compilation
make CROSS=$TOOLCHAIN/bin/mipsel-tuxbox-linux-gnu-

# Cross compile with SSL (and libcrypto) support
make CROSS=$TOOLCHAIN/bin/mipsel-tuxbox-linux-gnu- USE_SSL=1

# Cross compile libusb (smartreader) support
make CROSS=$TOOLCHAIN/bin/mipsel-tuxbox-linux-gnu- USE_LIBUSB=1

# Cross compile with static libusb (smartreader) support
make CROSS=$TOOLCHAIN/bin/mipsel-tuxbox-linux-gnu- USE_LIBUSB=1 LIBUSB_LIB="$TOOLCHAIN/mipsel-tuxbox-linux-gnu/sysroot/usr/lib/libusb-1.0.a"

# Cross compile with pcsc support
make CROSS=$TOOLCHAIN/bin/mipsel-tuxbox-linux-gnu- USE_PCSC=1 EXTRA_FLAGS="-I$TOOLCHAIN/mipsel-tuxbox-linux-gnu/sysroot/usr/include/PCSC"

# Cross compile with libusb, pcsc, SSL support
make CROSS=$TOOLCHAIN/bin/mipsel-tuxbox-linux-gnu- CONF_DIR=/etc/tuxbox/config/ USE_LIBUSB=1 USE_PCSC=1 USE_SSL=1 EXTRA_FLAGS="-I$TOOLCHAIN/mipsel-tuxbox-linux-gnu/sysroot/usr/include/PCSC"

# Cross compile with static libusb, pcsc, SSL support
make CROSS=$TOOLCHAIN/bin/mipsel-tuxbox-linux-gnu- CONF_DIR=/etc/tuxbox/config/ USE_LIBUSB=1 LIBUSB_LIB="$TOOLCHAIN/mipsel-tuxbox-linux-gnu/sysroot/usr/lib/libusb-1.0.a -lrt" USE_PCSC=1 USE_SSL=1 EXTRA_FLAGS="-I$TOOLCHAIN/mipsel-tuxbox-linux-gnu/sysroot/usr/include/PCSC"

Android

Building OSCam for Android is quite easy. Just follow these instructions:

  1. Download Android NDK from https://developer.android.com/tools/sdk/ndk/index.html
  2. Unarchive the NDK.
  3. Go to NDK directory and run (this will create Android toolchain): build/tools/make-standalone-toolchain.sh --install-dir=/tmp/android
  4. Go to OSCam source directory and run: make LIB_PTHREAD= CROSS=/tmp/android/bin/arm-linux-androideabi-

OSCam can be compiled on Android since commit r8339.

Available toolchains

MIPS Router / OpenWRT

Little endian Kernel 2.4x - http://downloads.openwrt.org/kamikaze/7.09/brcm-2.4/OpenWrt-SDK-brcm-2.4-for-Linux-i686.tar.bz2

Little endian Kernel 2.6x - http://downloads.openwrt.org/kamikaze/7.09/brcm47xx-2.6/OpenWrt-SDK-brcm47xx-2.6-for-Linux-i686.tar.bz2

MIPS Router / Fonera

http://downloads.openwrt.org/kamikaze/7.09/atheros-2.6/OpenWrt-SDK-atheros-2.6-for-Linux-i686.tar.bz2

MIPS Router Fritzbox

http://www.streamboard.de.vu/wbb2/tut-pics/toolchains/Toolchain_MIPS-Router-Fritzbox-uclib-0.9.29.tar.bz2

SH4

http://streamboard.de.vu/wbb2/tut-pics/toolchains/toolchain-sh4-tuxbox.bz2

TDT Tuxbox Toolchain, built on Ubuntu 10.4 with alborland´s easybuild script. For better supported toolchain you should install http://stlinux.com/

Dreambox 500 /DM500 and DM500-S/ and Dbox2 (PPC Tuxbox Old)

http://streamboard.de.vu/wbb2/tut-pics/toolchains/Toolchain_powerpc-tuxbox-linux_dm500.tar.bz2

Dreambox 600/7000/7020 (PPC Tuxbox)

http://www.streamboard.de.vu/wbb2/tut-pics/toolchains/Toolchain_powerpc-tuxbox-linux_DreamboxPPC.tar.bz2

With SSL support: http://www.streamboard.de.vu/wbb2/tut-pics/toolchains/Toolchain_powerpc-tuxbox-linux_DreamboxPPC.SSL.tar.bz2

ARM NSLU2 UNSLUG

http://www.streamboard.de.vu/wbb2/tut-pics/toolchains/Toolchain_armv5b-softfloat-linux_Unslug.tar.bz2

ARM NSLU2 OpenWRT

http://downloads.openwrt.org/kamikaze/7.09/ixp4xx-2.6/OpenWrt-SDK-ixp4xx-2.6-for-Linux-i686.tar.bz2

COOLSTREAM ARM

http://streamboard.de.vu/wbb2/tut-pics/toolchains/Toolchain-cross-arm-cx2450x-linux-gnueabi.tar.bz2

DOCKSTAR

http://streamboard.de.vu/wbb2/tut-pics/toolchains/Toolchain-armv5te_uclibc_eabi-dockstar.tar.bz2

Last modified 3 months ago Last modified on 04/26/14 00:59:13

Attachments (1)

  • libnxp.so.gz (70.2 KB) - added by dingo35 5 years ago. When compiling for Coolstream, you will add this library file for internal reader support.

Download all attachments as: .zip