Friday, August 12, 2011

Cross Compiling Linphone(2)

It is time to compile the linphone. Command line argument list is quite long this case:

$ ./configure --prefix=$PREFIX --host=$HOSTTPL --with-gnu-ld \
        --disable-static --disable-glib --enable-gtk_ui=no \
        --enable-sdl --disable-x11 --disable-libv4l \
        --with-osip=$INSTALLDIR/usr/local \
        --with-readline=$INSTALLDIR/usr/local \
        SPEEX_CFLAGS="-I$INSTALLDIR/usr/local/include" \
        SPEEX_LIBS="-L$INCLUDEDIR/usr/local/lib -lspeex" \
        FFMPEG_CFLAGS="-I$INSTALLDIR/usr/local/include" \
        FFMPEG_LIBS="-L$INCLUDEDIR/usr/local/lib -lavcodec" \
        SWSCALE_CFLAGS="-I$INSTALLDIR/usr/local/include" \
        SWSCALE_LIBS="-L$INCLUDEDIR/usr/local/lib -lswscale" \
        SDL_CFLAGS="-I$INSTALLDIR/usr/local/include" \
        SDL_LIBS="-L$INCLUDEDIR/usr/local/lib -lSDL"

Still there are some Makefiles and a source file we have to fix before we build them.

mediastreamer2/tests/Makefile

Find the LIBS variable and change it as:

LIBS = -pthread -lpthread -lrt -lvorbisenc -lvorbis -logg -lspeexdsp


mediastreamer2/coreapi/Makefile

Find the LIBS variable and change it as:

LIBS = -losip2 -lspeex -lSDL -lvorbis -lvorbisenc -lspeexdsp -logg -lavutil


mediastreamer2/coreapi/help/Makefile

Find the LIBS variable and change it as:

LIBS = -leXosip2 -lspeex -lSDL -lvorbisenc -losipparser2 -losip2 -lvorbis \
        -lspeexdsp -logg

And find the helloworld_LADD variable and add $(EXOSIP_LIBS) as:

helloworld_LDADD = $(top_builddir)/coreapi/liblinphone.la \
        $(EXOSIP_LIBS) \
        $(MEDIASTREAMER_LIBS) \
        $(ORTP_LIBS)


mediastreamer2/console/Makefile

Find the LIBS variable and change it as:

LIBS = -leXosip2 -losip2 -lSDL -lvorbis -lvorbisenc -lspeexdsp -logg -losipparser2

And find linphonecsh_LDADD variable and change it as:

linphonecsh_LDADD = $(ORTP_LIBS) -L/home/user/linphone/install/usr/local/lib


mediastreamer2/src/videoout.c

This file contains some obsolete function calls such as ms_sws_freeContext, ms_sws_getContext and, so on. So it won't compile unless we fix them (replace them with correct function calls). Details are here:
https://bugs.gentoo.org/attachment.cgi?id=269363&action=diff
Finally, we are ready to build linphone. What you need is a good luck now.

$ make
$ make install DESTDIR=$INSTALLDIR

8 comments:

  1. when i cross compile linphone can i use it to make voip calls as i can use then the kit as ip phone ?

    ReplyDelete
  2. In that case, you may need to find a service provider who allow you to connect their server.

    ReplyDelete
  3. I am using
    linphone 3.4.3
    codesourcey compiler - arm-2011.09

    When I compile, I receive such error:

    make[4]: Enter dir home/user/linphone/linphone-3.4.3/mediastreamer2/tests
    CCLD mediastream
    /opt/arm-2011.09/bin/../arm-none-linux-gnueabi/libc/lib/libm.so.6: could not read symbols: Invalid operation

    ReplyDelete
    Replies
    1. It looks like math library is not included:

      https://aur.archlinux.org/packages.php?ID=53801

      Delete
    2. Bless you!!!!!!!

      I added LIBS=-lm

      Delete
  4. Maybe you even know, thy linphone can't find soundcard on:
    http://www.variscite.com/products/item/32-var-som-am35-ti-sitara-am3517-am3505
    http://www.variscite.com/products/item/48-var-dvk-am35

    Aplay and arecord works fine. Alsamixer also works fine. Alsamixer shows "Card: am3517evm"

    But when I launch linphone, I get this error:

    ortp-error : no suitable soundcard detected

    I compiled linphone with --enable-alsa option

    List of sound devices:
    root@am3517-evm:~# cd /dev/snd
    root@am3517-evm:/dev/snd# ls
    controlC0 pcmC0D0c pcmC0D0p timer

    There is also no /dev/dsp folder.

    ReplyDelete
  5. While configuring Linphone, I notice this messages:

    checking alsa/asoundlib.h usability... no
    checking alsa/asoundlib.h presence... no
    checking for alsa/asoundlib.h... no

    But libasound-dev is installed, and there is folder wth files /usr/include/alsa

    ReplyDelete
  6. I am cross compiling with same version you mentioned for only audio so I have not included that part of configuration after SPEEX_LIBS , I have also not compiled libav, SDL, libvorbis as I want to compile only for audio.

    But configuration gives error with could not find eXosip2 library with version >=3.0.2 where I am using 3.5.0.
    Can you point what may be wrong ?

    ReplyDelete