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 in our forum.

forum: http://www.streamboard.tv/wbb2/portal.php Note: Registration Needed

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

Android

Building OSCam for Android is quite easy. Just follow these instructions: Before Beginning some steps say {releasenumber} change it for your NDK release Ex:. 16b,14b,13b,...

OSCam can be compiled on Android since commit r8339.

Download Android NDK (Native Development Kit)

  1. Download Android NDK from https://developer.android.com/ndk/downloads/ or use this command below to download the latest NDK, please read the Note marked below before anything or use tested NDK r13b or r14b.
cd /
wget https://dl.google.com/android/repository/android-ndk-r16b-linux-x86_64.zip

Note: Tested in r13b and r14b so if something go wrong at one step because you are using above r14b, download one of this version below and clean all folders created and repeat the steps below, the reason why versions above r14b don't work check 'Very important note...' below.

NDK 14b

cd / 
wget https://dl.google.com/android/repository/android-ndk-r14b-linux-x86_64.zip

NDK 13b

cd /
wget https://dl.google.com/android/repository/android-ndk-r13b-linux-x86_64.zip

Very Important Note for NDK above 14b and 14b included :

All versions above NDK 14b use Clang to Compile out of the box (Standalone Toolchain) since you need to import the openssl you need to deploy the android ndk toolchain using clang. Issue reported in GithubAndroid-NDK and the issue are been reported two times in Openssl Github one in Openssl github issue #3826 reported by deveee and the 2nd in Openssl Github issue #6879 reported by Screamfox, Google says they don't fix this issue since gcc is deprecated read here Google Changelog r14b i belive this can be solved with a workaround and if some one have found a workaround please notice us in our forum (Link on the top of page) or edit correctly this wiki page [Registration Required].

You can continue compiling OpenSSL with NDK r13b/r14b if you have any version below 14b you can continue this tutorial.

Install the Toolchain (NDK)

  1. Unzip the NDK.
unzip android-ndk-r{releasenumber}-linux-x86_64.zip

Note: Install Unzip required, install it using: apt install unzip.

  1. Go to the NDK directory after decompressed(Unziped).
cd /android-ndk-r{releasenumber}
  1. Inside the NDK directory go to the /android-ndk-r{releasenumber}/build/tools
cd build/tools
  1. Inside the build/tools directory export toolchain,
export TOOLCHAIN=/android-toolchain
  1. Still in the same directory (/android-ndk-r{releasenumber}/build/tools) and type this to install the toolchain,
./make_standalone_toolchain.py --arch arm --api 21 --install-dir /android-toolchain

Note: change --api 21 if needed (This is depending the Android version your are compiling) so api 21 is for Android Version 5.0 see table below for more info. You can click any where here to jump to the table refereed before.

Download and Install OpenSSl

  1. Download OpenSSL
cd /
wget http://www.openssl.org/source/openssl-1.0.1g.tar.gz

Note: not tested in latest version please test it in newest version and say in forum if it's working on latest version or edit the OpenSSL link above and edit tar -xf command and cd command below (Next steps "8,9") to the version you have tested to keep this tutorial up to date.

  1. Extract the tar.gz
tar -xf openssl-1.0.1g.tar.gz
  1. Go to the directory you extracted.
cd openssl-1.0.1g
  1. Export the gcc in the Android Toolchain.
export CC=/android-toolchain/bin/arm-linux-androideabi-gcc
  1. Export the Ran Library to Android Toolchain.
export RANLIB=/android-toolchain/bin/arm-linux-androideabi-ranlib
  1. type ./configure to before make and make instal_sw, this step is to set configuration before done and install the OpenSSL.
./Configure --prefix=/android-toolchain/sysroot/usr android
make
make install_sw

Download the latest SVN and Cross Compile for Android Devices

  1. Download the latest SVN from Oscam/trunk repo.
cd /
svn checkout http://www.streamboard.tv/svn/oscam/trunk oscam-svn
cd oscam-svn
./config.sh --enable WEBIF WITH_SSL IPV6SUPPORT

  1. Cross Compile OSCam with Android Toolchain
make static EXTRA_FLAGS="-pie" LIB_RT= LIB_PTHREAD= CROSS=/android-toolchain/bin/arm-linux-androideabi-

Table about the Android Versions and API

Note: Change the parameter in step 6 if needed " --api 21 " to the version of your device look table below.

Android Code Name Version NumberLinux Kernel VersionInitial Release DateAPI LEVELSecurity Patches
(No codename)1.0?September 23, 20081Unsupported
Petit Four1.12.6.XFebruary 9, 20092Unsupported
Cupcake1.52.6.27April 27, 20093Unsupported
Donut1.62.6.29September 15, 20094Unsupported
Eclair2.0 – 2.12.6.29October 26, 20095 – 7Unsupported
Froyo2.2 – 2.2.32.6.32May 20, 20108Unsupported
Gingerbread2.3 – 2.3.72.6.35December 6, 20109 – 10Unsupported
Honeycomb3.0 – 3.2.62.6.36February 22, 201111 – 13Unsupported
Ice Cream Sandwich4.0 – 4.0.43.0.1October 18, 201114 – 15Unsupported
Jelly Bean4.1 – 4.3.13.0.31 to 3.4.39July 9, 201216 – 18Unsupported
KitKat?4.4 – 4.4.43.10October 31, 201319 – 20Unsupported
Lollipop5.0 – 5.1.13.16.1November 12, 201421 – 22Unsupported
Marshmallow6.0 – 6.0.13.18.10October 5, 201523Supported
Nougat7.0 – 7.1.24.4.1August 22, 201624 – 25Supported
Oreo8.0 – 8.14.10August 21, 201726 – 27Supported
Android P9.0?July 25, 2018 (beta 4)28In beta, not yet supported

Edit a APK and join the OSCam Binary Cross Compiled before.

Coming Soon..

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 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" 

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"

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

BROADCOM ARM (and MIPSEL)

https://docs.broadcom.com/docs/12358538

For VU+ Solo4K (ARM based) use: /opt/cross/stbgcc-4.8-1.5/bin/arm-linux-gnueabihf-

Last modified 3 weeks ago Last modified on Sep 4, 2018, 3:07:04 PM

Attachments (1)

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

Download all attachments as: .zip