yajl_s library not found when crosscompiling addon

  • When trying to crosscompile a pvr addon with yajl as dependency I get the following error:

    After some investigation I found that the compiler was looking for the static library based on this line in the cmake file:

    Code
    find_library(YAJL_LIBRARY NAMES yajl_sPATHS ${PC_YAJL_LIBDIR})

    so after doing the following it works:

    Code
    cp build.LibreELEC-RPi2.arm-9.0-devel/yajl-2.1.0/.armv7ve-libreelec-linux-gnueabi/yajl-2.1.0/lib/libyajl_s.a build.LibreELEC-RPi2.arm-9.0-devel/toolchain/armv7ve-libreelec-linux-gnueabi/sysroot/usr/lib/

    However I would like solve the problem in a more elegant way, and not have to repeat the above each time I build the addon.
    How to achieve this?
    Any help is greatly appreciated.

  • I assume it is something with your host system (which is?) because it works for everybody else.

    Also parts of log doesn't help much to fix issues.

  • Hi sorry my host system is:

    Code
    14:15:55 ⌁ [ijr:~/LibreELEC.tv] master(+2/-1,-8)* 1 ± uname -a
    Linux archxps 4.9.11-1-ARCH #1 SMP PREEMPT Sun Feb 19 13:45:52 UTC 2017 x86_64 GNU/Linux


    here the complete log:

  • In pvr.zattoo/package.mk file add this function which will change library name from libyajl_s.a to libyajl.a

    Code
    post_unpack() {
      sed -i 's|YAJL_LIBRARY NAMES yajl_s|YAJL_LIBRARY NAMES yajl|' $PKG_BUILD/FindYajl.cmake
    }
  • Sure, but this way I won't pick up the static library.
    What I want is to use yajl_s, (not yajl) in order to prevent a loop.
    Unfortunately yajl_s is not present in the toolchain path, only yajl is there.

  • What? I just tried this and addon was build successfully.

    From what I see only static library is available in toolchain with name libyajl.a. It is renamed from original name libyajl_s.a here. If you still want original name then copy file in packages/devel/yajl/package.mk.

  • ahha, ok got it!

    btw, I had already built the addon successfuly by manually changing "yajl_s" to "yajl" in FindYajl.cmake.
    Still I wanted to pick yajl_s and not yajl, because I didn't know it was the same.
    But thanks to you now I know!

    So, thanks a lot vpeter, you helped me as always!