Cross compile PJSIP for Colibri iMX6

I want to install pjsip on Colibri i.MX6, the issue I’m having seems to be the same issue as in this post
https://www.toradex.com/community/questions/10382/installing-pjsip-colibri-imx7.html

I created a layer for pjsip and used the pjsip.bb in the answer from this similar question:
https://www.toradex.com/community/questions/9917/cross-compile-pjsip-colibri-imx7.html

Here is the error I get when I try $bitbake pjsip

| make[2]: Leaving directory '/home/aaron/oe-core/build/tmp-glibc/work/armv7at2hf-neon-mx6qdl-angstrom-linux-gnueabi/pjsip/2.6-r0/pjproject-2.6/pjsip-apps/build' 
| make[1]: Leaving directory '/home/aaron/oe-core/build/tmp-glibc/work/armv7at2hf-neon-mx6qdl-angstrom-linux-gnueabi/pjsip/2.6-r0/pjproject-2.6/pjsip-apps/build' 
| NOTE: make 
| python setup.py build 
| running build 
| running build_py 
| running build_ext 
| error: invalid Python installation: unable to open /home/aaron/oe-core/build/tmp-glibc/work/armv7at2hf-neon-mx6qdl-angstrom-linux-gnueabi/pjsip/2.6-r0/recipe-sysroot/usr/lib/python2.7/config/Makefile (No such file or directory) 
| Makefile:2: recipe for target 'all' failed 
| make: *** [all] Error 1 | ERROR: oe_runmake failed 
| WARNING: /home/aaron/oe-core/build/tmp-glibc/work/armv7at2hf-neon-mx6qdl-angstrom-linux-gnueabi/pjsip/2.6-r0/temp/run.do_compile.25391:1 exit 1 from 'exit 1' 
| ERROR: Function failed: do_compile (log file is located at /home/aaron/oe-core/build/tmp-glibc/work/armv7at2hf-neon-mx6qdl-angstrom-linux-gnueabi/pjsip/2.6-r0/temp/log.do_compile.25391) ERROR: Task (/home/aaron/oe-core/build/../layers/meta-pjsip/recipes-pjsip/pjsip/pjsip_2.6.bb:do_compile) failed with exit code '1' NOTE: Tasks Summary: Attempted 1817 tasks of which 1816 didn't need to be rerun and 1 failed. NOTE: Writing buildhistory

Summary: 1 task failed: /home/aaron/oe-core/build/../layers/meta-pjsip/recipes-pjsip/pjsip/pjsip_2.6.bb:do_compile

I’m not clear on how I add python. The answer from the first question was this:
"I would create a base image (which has the sources defined etc, e.g. pjsip.inc) and then create one recipe for the main app (pjsip_$VER.bb) and one for the Python module (e.g. pjsip-python_$VER.bb). The latter would then include distutils and set the source directory directly to where setup.py is located (something like `S = “${WORKDIR}/pjsip-apps/src/python/” or similar). That said, I did not test that approach, the detail and whether that approach really works depends on various factors, such as whether the Python module has dependencies to the rest of the source… "

This is the meta-pjsip I created:

meta-pjsip/
├── conf
│   └── layer.conf
└── recipes-pjsip
    └── pjsip
        └── pjsip_2.6.bb

Do I add python in recipes-pjsip and create the .bb there?

meta-pjsip/
├── conf
│   ├── layer.conf
└── recipes-pjsip
    ├── pjsip
    │   ├── pjsip_2.6.bb
    └── pysip-python_2.7

How do I set the work directory to avoid the error above?

| error: invalid Python installation: unable to open /home/aaron/oe-core/build/tmp-glibc/work/armv7at2hf-neon-mx6qdl-angstrom-linux-gnueabi/pjsip/2.6-r0/recipe-sysroot/usr/lib/python2.7/config/Makefile (No such file or directory)

Hi

This may have to do with the layer versions you are using (and did not mention in your post).

Max

I started with the instructions from this page to install Toradex BSP version 2.8
https://developer.toradex.com/knowledge-base/board-support-package/openembedded-(core)

$ repo init -u http://git.toradex.com/toradex-bsp-platform.git -b LinuxImageV2.8

The only changes I made were to build/conf/local.conf

  1. set the machine name, comment the current machine and uncomment this line:
    MACHINE ?= “colibri-imx6”
  2. set NXP/Freescale license acceptance (you can put it on the next line after MACHINE).
    ACCEPT_FSL_EULA=”1”

I created the directory structure shown above and this layer.conf in oe-core/layers/meta-pjsip/conf/

# We have a conf and classes directory, append to BBPATH
BBPATH .= ":${LAYERDIR}"

# We have a recipes directory, add to BBFILES
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb ${LAYERDIR}/recipes-*/*/*.bbappend"

BBFILE_COLLECTIONS += "pjsip-layer"
BBFILE_PATTERN_pjsip-layer := "^${LAYERDIR}/"
BBFILE_PRIORITY_pjsip-layer = "7"

LAYERVERSION_pjsip-layer = "1"

Then I added this line to oe-core/build/conf/bblayers.conf after the similar line with ‘meta-toradex-demos’
${TOPDIR}/…/layers/meta-pjsip \

Hi

One change between the 2.7 BSP (morty) and 2.8 BSP (rocko) is that with rocko each recipe gets its own native and target sysroot (recipe-sysroot-native, recipe-sysroot).

The DEPENDS variable and inherit does set the actual content. Now pjsip seems to look for a python provided Makefile in the target sysroot which doesn’t exist.

I expect that adding python to DEPENDS in the recipe fixes the issue you see.

DEPENDS = "alsa-lib libv4l openssl python util-linux"

Max