Howto: Mediatomb under Solaris Express

  • Andreas

    Andreas - 2011-11-07

    Hi guys,

    recently I compiled and installed the newest version of Mediatomb under Solalis Express. As this was really hard to achieve in terms of compilation, I want to share my experiences here with you. The notes below are just the notes I made, and should serve as hints.

    I hope they are useful for some of you.

    Before starting with the actual installation, some prerequisites are required.

    Some general hints:

    Install some basic tools

    a) GCC4
      pkgutil -i gcc4
      (installs to /opt/csw/gcc4/bin)
      add gcc4 bin to path
      LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/csw/gcc4/lib:/usr/local/lib; export LD_LIBRARY_PATH
       You can also install gcc-3 with "pkg install gcc-3"
    b) Recent version of binutils  (wit GCC4)

    Availaibale versions do not work properly

    # export SHELL=/bin/bash
    # SHELL=/bin/bash ./configure -prefix=/opt/binutils
    # SHELL=/bin/bash gmake
    # SHELL=/bin/bash gmake install

    Hint: Issue was that /bin/sh was used as shell, which does not work on solaris!

    c) Autoconf 2.13
      NOTE: installation might require to renam /usr/bin/m4 to /usr/bin/m4.solaris
    tar -xvzf autoconf-2.13.tar.gz
    cd autoconf-2.13/
    ./configure -program-suffix=2.13
    sudo make install

    Recommended Path and LD path setting

    # export PATH=/opt/csw/gcc4/bin:/opt/csw/bin:/opt/binutils/bin:/usr/ccs/bin:/usr/bin:/usr/local/bin
    # export LD_LIBRARY_PATH=/opt/csw/gcc4/lib:/opt/csw/lib:/opt/binutils/lib:/usr/local/lib:/usr/lib

    Now we can start:

    1) Install some packages using Blastwave pkgutil

    # /opt/csw/bin/pkgutil -i sqlite3
    # /opt/csw/bin/pkgutil -i libiconv
    # /opt/csw/bin/pkgutil -i curl
    # /opt/csw/bin/pkgutil -i mysql5
    # /opt/csw/bin/pkgutil -i CSWtaglibgcc
    # /opt/csw/bin/pkgutil -i pkgconfig
    # /opt/csw/bin/pkgutil -i yasm

    2) Install libmagic (contained in file)


    tar zxvf file-5.09.tar.gz
    cd file-5.09
    ./configure -prefix=/usr/local
    make install

    3) Install ffmpeg

    Install new binary, e.g.ffmpeg 0.8.3 or use simpler option with older binary

    a) unzip the archive and cd to directory
    # export PATH=/usr/xpg6/bin:/usr/xpg4/bin:/usr/ccs/bin:/usr/ucb:/usr/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/sfw/bin:/opt/sfw/bin:/opt/csw/bin
    # ./configure -enable-shared -prefix=/usr/ffmpeg-08 -extra-cflags="-fPIC" -disable-mmx -disable-protocol=udp -disable-encoder=nellymoser
    # gmake
    gnu install needs to be used! (make backup)
    ln -s /usr/bin/ginstall /usr/sbin/install
    # gmake install

    b) If this does not work, use the prebuild binary from

    $ cat ffmpeg-0.6-sol10-x86-local.bz2.part* > ffmpeg-0.6-sol10-x86-local.bz2
    $ cksum ffmpeg-0.6*
    4226251160 12783589 ffmpeg-0.6-sol10-x86-local.bz2
    2104845841 5000000 ffmpeg-0.6-sol10-x86-local.bz2.part1
    3886626179 5000000 ffmpeg-0.6-sol10-x86-local.bz2.part2
    249278810 2783589 ffmpeg-0.6-sol10-x86-local.bz2.part3
    $ bunzip2 ffmpeg-0.6-sol10-x86-local.bz2
    $ su
    # pkgadd -d ffmpeg-0.6-sol10-x86-local
    cd /usr/local/bin
    ldd ffplay

    4) Install ffmpegthumbnailer

    Use GCC4 (export to path)
    # LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/csw/gcc4/lib:/usr/local/lib; export LD_LIBRARY_PATH

    # PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ PKG_CONFIG_LIBDIR=/usr/local/lib FFMPEG_LIBS=/usr/local/lib/ ./configure -prefix=/usr/local
    REM ./configure -prefix=/usr/local
    gmake install

    5) Install Spidermonkey JS Lib

    Get decent version of libmozjs from

    Tested with

    !Make sure gcc4 and the new gld are on path and used!
    => it might be necessary to create a symbolic link in /usr/bin
    i.e. ln -s /opt/binutils/bin/ld /usr/bin/ld (!!make backup)

    # export PATH=/opt/csw/gcc4/bin:/opt/csw/bin:/opt/binutils/bin:usr/ccs/bin:/usr/bin:/usr/local/bin
    # export LD_LIBRARY_PATH=/opt/csw/gcc4/lib:/opt/csw/lib:/opt/binutils/lib:/usr/local/lib

    -  With JS185 (does not work)
      mkdir mozilla
      cd mozilla
      tar xzf js185-1.0.0.tar.gz
      cd js/src
      ./configure -prefix=/opt/js185
      gmake install 

      In install dir create symbolic link: ln -s /opt/js185/lib/ /opt/js185/lib/  

    6) Curl

    ./configure -prefix=/opt/curl
    make install

    7) Edit mediatomb
    Uncomment using C-style comments (/* … */).

    #ifdef SOLARIS


    8) Edit configure script

    If you see something like the following in config.log

    configure:24644: result: yes
    configure:24998: Will search for libmagic libs in /usr/local/lib
    configure:25008: checking for magic_load in -lmagic
    configure:25043: g++ -o conftest -g -O2    -lrt -L/usr/local/lib conftest.cpp -lmagic   >&5
    /usr/local/lib/ undefined reference to `inflate@SUNW_1.1'
    /usr/local/lib/ undefined reference to `inflateInit2_@SUNW_1.1'
    /usr/local/lib/ undefined reference to `inflateEnd@SUNW_1.1'
    collect2: ld returned 1 exit status

    you have to adapt the configure script. The issue is that libmagic require libz

    In configure (line ~25014)
    - LIBS=" -lmagic  $LIBS"
    + LIBS=" -lz -lmagic  $LIBS"

    In configure (line ~25075)
    - mt_libmagic_libs="-lmagic"
    - mt_libmagic_ldflags="-L$mt_libmagic_search_libs"
    + mt_libmagic_libs="-lz -lmagic"
    +mt_libmagic_ldflags="-L/usr/lib -L$mt_libmagic_search_libs"

    Install mediatomb

    PATH: /opt/csw/gcc4/bin:/opt/csw/bin:/opt/binutils/bin:/usr/ccs/bin:/usr/bin:/usr/local/bin
    LD_LIBRARY_PATH: /opt/csw/gcc4/lib:/opt/csw/lib:/opt/binutils/lib:/usr/local/lib:/usr/lib

    ./configure -prefix=/opt/mediatomb -enable-iconv-lib -enable-libmagic -with-libmagic-h=/usr/local/include -with-libmagic-libs=/usr/local/lib -with-mysql-cfg=/opt/csw/mysql5/bin/i386/mysql_config -enable-protocolinfo-extension -with-js-h=/opt/libmozjs192/include/js -with-js-libs=/opt/libmozjs192/lib -with-iconv-h=/opt/csw/include -with-iconv-libs=/opt/csw/lib -with-curl-cfg=/opt/curl/bin/curl-config

    Result should be something like


    sqlite3               : yes
    mysql                 : yes
    libjs                 : yes
    libmagic              : yes
    inotify               : missing
    libexif               : yes
    id3lib                : disabled
    taglib                : yes
    libmp4v2              : missing
    ffmpeg                : yes
    ffmpegthumbnailer     : yes
    lastfmlib             : missing
    external transcoding  : yes
    curl                  : yes
    YouTube               : yes
    libextractor          : disabled
    db-autocreate         : yes

    # make
    # make install

    Preparing mysql5

    # /opt/csw/mysql5/share/mysql/quick_start-csw
    # svcadm clear cswmysql5
    # svcadm enable cswmysql5
    # /opt/csw/mysql5/bin/mysql_secure_installation
    # svcadm restart cswmysql5

    Connect to database and create mediatomb dbs
    # mysql -p
    # > CREATE DATABASE mediatomb;
    # > GRANT ALL ON mediatomb.* TO 'mediatomb'@'localhost';
    # > SET PASSWORD FOR 'mediatomb'@'localhost' = PASSWORD('mediatomb');

    Adjust configuration in ~/.mediatomb/config.cfg

    <mysql enabled="yes">

    Running mediatomb (basic)

    export LD_LIBRARY_PATH=/usr/local/lib:/opt/csw/lib:/opt/libmozjs192/lib/:/opt/csw/mysql5/lib/mysql


  • Isi

    Isi - 2012-11-05

    Hi Andreas,

    Thanks for the detailed info. Did you manage to compile this on Solaris 11 (not Express)?

    Thanks in advance.



Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks