User Tools

Site Tools


library-install-sources

Build and install the library from sources

The first sub-section is for native build on Unix-like systems, the next ones for other platforms and cross-compilation.

This procedure is for versions >= 1.6.0 only. Older versions are not supported any more.

FIXME a shelr screencast would be great

Native build on Unix-like systems

The instructions hereafter are for native build on Unix-like systems, such as Linux, FreeBSD, or OpenBSD. See next sections for other targets (Microsoft Windows, cross-compilation…).

  1. Log in as normal user on the system on which you want to install the ROHC library.
  2. Retrieve the sources:
    • preferred way: download the source archive of the lastest ROHC release on the download page:
      $ wget https://rohc-lib.org/download/rohc-latest.tar.xz
      $ wget https://rohc-lib.org/download/rohc-latest.tar.xz.sha256
      $ wget https://rohc-lib.org/download/rohc-latest.tar.xz.asc
      $ sha256sum -c rohc-latest.tar.xz.sha256   # verify the file integrity
      rohc-latest.tar.xz.sha256: OK
      $ gpg --recv-keys 008E8DAD                 # retrieve GPG key, first time only
      $ gpg --verify rohc-latest.tar.xz.asc      # verify the file authenticity
      $ tar xvJf rohc-latest.tar.xz              # OpenBSD note: use gtar instead of tar
      $ cd rohc-X.Y.Z                            # replace X.Y.Z by the release number
    • OR retrieve the latest development version:
      $ git clone --depth 10 https://github.com/didier-barvaux/rohc.git
      $ cd rohc
  3. Configure the library:
    $ ./configure --prefix=/usr
    • Run ./autogen.sh script instead of ./configure script if you use a development version from GIT. For ./autogen.sh script use the following build tool versions autoconf >= 2.68, automake >= 1.11.2 and libtool >= 2.2.2
    • Add optional configure options to customize the behaviour of the ROHC library and/or build additional tools.
  4. Build the code:
    $ make all
  5. Run non-regression tests (optional):
    $ make check

    For more details, see how to run the library tests.

  6. Install the library as root:
    $ su
    # make install
    # exit

The library is now installed on your system in subdirectories of /usr. In case you want to change the installation path, run ./configure --prefix=/path/to/your/directory at step 4.

The ROHC library is installed, you may now test it and/or use it:

Cross-compilation for ARM/PowerPC on Unix-like systems

The instructions hereafter are for building the ROHC library for other CPU architectures on Unix-like systems. See previous section for native build on Unix-like systems.

  1. Install or build one ARM/PowerPC cross-compiler. The installation of the cross-compiler is outside the scope of this small document, however here are some instructions to build a ARM/PowerPC cross-compiler on Gentoo.
  2. Follow the instructions given for Unix-like systems except for the following steps:
    1. step 4:
      $ ./configure --prefix=/usr --host=<target-tuple>
      • target-tuple is the ARCH-VENDOR-OS-LIBC tuple of your cross-compiler, eg. arm-softfloat-linux-gnueabi or powerpc-softfloat-linux-gnu.
      • You can enable tests with --enable-rohc-tests if you have the libpcap and cmocka libraries and their headers cross-compiled for the target system, and the Qemu tools installed on your system. Tests are then run with make check as usual.
      • Running tests within Valgrind's memcheck is untested.
      • You can enable applications with --enable-rohc-apps as usual.
    2. step 7:
      $ make install DESTDIR=/path/to/target/root/

Cross-compilation for Android ARM on Unix-like systems

The instructions hereafter are for building the ROHC library for Android systems on Unix-like systems. See previous section for native build on Unix-like systems.

  1. Go get the Android NDK. Example (change x86_64 to match your build platform):
    $ wget http://dl.google.com/android/ndk/android-ndk-r10e-linux-x86_64.bin
  2. Install the Android NDK (full instructions):
    $ chmod +x android-ndk-r10e-linux-x86_64.bin
    $ ./android-ndk-r10e-linux-x86_64.bin
  3. Setup environment for using the NDK (change x86_64 to match your build platform):
    $ export NDK=$PWD/android-ndk-r10e
    $ export SYSROOT=$NDK/platforms/android-21/arch-arm/
    $ export TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/
    $ export ANDROID_CC="$TOOLCHAIN/bin/arm-linux-androideabi-gcc --sysroot=$SYSROOT"
  4. If you use a release archive, configure the library as follow:
    $ CC=$ANDROID_CC LD=$ANDROID_CC \
      ./configure --host=arm-linux-androideabi \
                  --enable-static --disable-shared \
                  --enable-examples
  5. If you use a GIT branch, configure the library as follow:
    $ CC=$ANDROID_CC LD=$ANDROID_CC \
      ./autogen.sh --host=arm-linux-androideabi \
                   --enable-static --disable-shared \
                   --disable-rohc-tests --disable-doc \
                   --disable-app-fuzzer --disable-app-performance \
                   --disable-app-sniffer --disable-app-stats \
                   --disable-linux-kernel-module
  6. Build the library:
    $ CC=$ANDROID_CC LD=$ANDROID_CC make clean all
  7. You now have static ROHC libraries (and a simple application to test the library):
    $ file src/.libs/librohc.a
    src/.libs/librohc.a: current ar archive
    $ file examples/simple_rohc_program examples/print_rohc_version examples/example_rohc_decomp examples/rtp_detection                                   
    examples/simple_rohc_program: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /system/bin/linker, not stripped
    examples/print_rohc_version:  ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /system/bin/linker, not stripped
    examples/example_rohc_decomp: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /system/bin/linker, not stripped
    examples/rtp_detection:       ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /system/bin/linker, not stripped

Build tested only. Last fully tested on real Android target with NDK 8e and Android 2.3.

Cross-compilation for Microsoft Windows on Unix-like systems

The instructions hereafter are for building the ROHC library for Microsoft Windows on Unix-like systems. See previous section for native build on Unix-like systems.

  1. Install or build the MinGW cross-compiler. The installation of MinGW is outside the scope of this small document, however here are some instructions to build a MinGW cross-compiler on Gentoo.
  2. Follow the instructions given for Unix-like systems except for the following steps:
    1. step 4:
      $ ./configure --prefix=/usr --host=i686-pc-mingw32
      • You can enable tests with --enable-rohc-tests if you have the WinPcap library and the Wine tool installed on your system. Tests are then run with make check as usual.
      • You can enable tests within Valgrind's memcheck tool, but they will fail because Wine causes many memory warnings unrelated to the ROHC library itself.
      • You cannot enable applications with --enable-app-* yet.
    2. step 7:
      $ make install DESTDIR=/path/to/windows/root/

Build for Microsoft Windows with Cygwin

The instructions hereafter are to build the ROHC library for Microsoft Windows with Cygwin. See this section for cross-compilation for Windows on Unix-like systems.

  1. If not already done, download the Cygwin installer and install the Cygwin environment with (at least) the following packages selected:
    • bash
    • make
    • binutils
    • libtool
    • gcc4
    • coreutils
    • gawk
    • grep
    • sed
    • tar
    • bzip2
    • GIT (only if you retrieve sources from the GIT repository, ignore otherwise)
    • ca-certificates (only if you retrieve sources from the GIT repository, ignore otherwise) TBC
    • autoconf (only if you retrieve sources from the GIT repository, ignore otherwise)
    • automake (only if you retrieve sources from the GIT repository, ignore otherwise)
    • doxygen (only if –enable-doc, ignore otherwise)
  2. Start the Cygwin Terminal from the Start Menu. Next steps are all run in the Cygwin Terminal.
  3. Follow the instructions given for Unix-like systems starting from step 3, and except for the following steps:
    1. step 4:
      $ ./configure --prefix=/usr 

What to do next?

Once the ROHC library is installed, you may:

library-install-sources.txt · Last modified: 2016/07/03 14:02 by didier