[SOLVED] Compile package linphone: stdlib.h: No such file or directory

  • I'm trying to build linphone as a package for LibreELEC (Odroid C2), following Adding a Package - LibreELEC , so I can use my smartphone as wireless speakers for my beamer in the bedroom.

    Source: Smartphone As WiFi Headphone (for Kodi): 7 Steps

    Linphone and it's dependencies can be found at Belledonne Communications · GitHub

    1 dependency (belr) fails with this error:

    How can I fix this? The file is present in multiple locations:

  • I didn't use any patches.

    packages/ELECtronLibre/belr/package.mk:

    Where should I add those flags?

  • OK, so I did this:

    linphone/package.mk:

    bctoolbox/package.mk:

    bcunit/package.mk:

    belcard/package.mk:

    belle-sip/package.mk:

    belr/package.mk:

    libosip2/package.mk:

    mbedtls/package.mk:

    mediastreamer2/package.mk:

    ortp/package.mk:

    But belr still fails with the above stdlib.h error.

    belr docs mention:

    Quote

    Note for packagers

    Our CMake scripts may automatically add some paths into research paths of generated binaries. To ensure that the installed binaries are striped of any rpath, use -DCMAKE_SKIP_INSTALL_RPATH=ON while you invoke cmake.

    Could this be the reason for the error? If so, how do I add that to my package.mk?

    Your help is really appreciated. I hope that, with your guidance, I can turn this into an addon.

  • Thank vpeter, that gets me a few steps further.

    I'm now at building belle-sip, but it has kind of a "strange" dependecy: antlr3.

    Quote

    Build-time dependencies

    These are required to generate a C sourcefile from SIP grammar using antlr3 generator:

    Runtime dependencies

    • libantlr3c version 3.2 or 3.4
    • bctoolbox

    It should be build with Maven, but I don't know if this is possible within the LE buildsystem?

  • Well, you need to satisfy dependencies somehow :P

    Maybe you could run part of build process on normal Linux distro with all dependencies and then pack already generated files to be used in libreelec build environment.

    Or run antlr3 usage from your host system and not from libreelec build environment?

    I already fighting with some other package and doesn't have real time to look into this.

  • I did find this:

    Quote

    Belle sip needs antlr.jar to generate parser code. A prebuilt jar is available from the antlr git and should be manually install using the following command:

    git clone -b linphone git://http://git.linphone.org/antlr3

    sudo mkdir /usr/local/share/java

    sudo cp antlr3/antlr-3.4-complete.jar /usr/local/share/java/antlr.jar

    Following this I made antlr3 available to my build host, but how do I make it available to the LE build system?

    Code
    HOST
    
    builder@compileeraap:~/LibreELEC.tv$ antlr3
    ANTLR Parser Generator  Version 3.5.2
    Code
    LE build system
    
      Could NOT find Antlr3 (missing: ANTLR3C_INCLUDE_DIRS ANTLR3C_LIBRARIES
      ANTLR3_COMMAND)
  • Something like

    Code
    PKG_CMAKE_OPTS_TARGET="-DCMAKE_NO_SYSTEM_FROM_IMPORTED=ON -DANTLR3_COMMAND=/path/to/antlr3 -DANTLR3C_INCLUDE_DIRS=/some/path ANTLR3C_LIBRARIES=/some/path"
  • Code
    PKG_CMAKE_OPTS_TARGET="-DCMAKE_NO_SYSTEM_FROM_IMPORTED=ON -DANTLR3_COMMAND=/usr/bin/antlr3 -DANTLR3C_INCLUDE_DIRS=/usr/include -DANTLR3C_LIBRARIES=/usr/lib"

    Did the trick.

    Of course I'm rewarded with another error:

    Which I do not understand because:

    Code
    builder@compileeraap:~/LibreELEC.tv$ locate antlr3.h
    /usr/include/antlr3.h

    and

    Code
    -DANTLR3C_INCLUDE_DIRS=/usr/include
  • I think you will have to at least copy include and lib to some other folder because /usr/include is removed from usage.

    And this is hack more and more... Expect more and more troubles in this case :) Real le packages works better.

  • I've copied related files to another dir and tried with -DANTLR3C_INCLUDE_DIRS=/home/builder/antlr3/include -DANTLR3C_LIBRARIES=/home/builder/antlr3/lib and I was almost happy:

    So yes this is becoming more and more hacking. Way above my capabilities.

    I did find a precompiled aarch64 belle-sip from an arch linux port:

    belle-sip-1.6.1-1-aarch64.pkg.tar.xz

    Can I use that? If yes, how?

  • Mission accomplished. Linphone and dependencies have been successful built for the Odroid C2.

    I'll continue my work in about 2 weeks.

    Thank you for you help vpeter! Please let me know how I can buy you a beer.