Fix mangOH build error with variable LEGATO=1


#1

I downloaded the mangOH and Legato source and configured the environment to build with:
make red_wp76xx LEGATO=1 or make red_wp76xx /LEGATO=1 by default in Makefile/

error coming out:

legatoAF/legato/framework/include/legato.h:146:20: fatal error: unistd.h: No such file or directory

The root cause is that the LEGATO_SYSROOT was not set during building legato project, e.g my project is: WP76XX_SYSROOT variable, the LEGATO_SYSROOT=WP76XX_SYSROOT, the LEGATO_ROOT and WP76XX_SYSROOT were set in your ~/.bashrc according to the doc.
Note: XXXX_SYSROOT should be the project that the one your are developing.

The following patch can fix the above error and build legato + mangoOH successfully.
/your_project_path/mangOH/Makefile
=====================================================================


#2

Are you trying to build against a Legato version <= 18.02.0?


#3

According to the mangOH git submit log:

Use sdef “componentSearch” feature

By using the componentSearch feature, more of the build requirements can
be specified in the SDEF instead of the Makefile.  componentSearch is a
Legato 18.04.0 feature.

which means the master branch of mangOH requires that the Legato should be 18.04.0 above.

If you wanna use the Legato whose version is below 18.04.0, you should back the mangOH to the git head before the submit of “Use sdef “componentSearch” feature”