[EXPERIMENTAL] Makefile: EXTRA_APPS_LIBS and EXTRA_APPS_INCPATHS vars
The variables are to be used to mainly by the export rule to export external libraries (.a files) and respective include paths.
The exported external libraries are packed together in the libapps.a library (basically, every .o files are extracted and then packed together).
Signed-off-by: Stepan Pressl [email protected]
Summary
Improving the build system with these variables so all the symbols from the external libraries can be packed together within the libapps.a library. This is particularly useful, when we'd like to use this external library and all of its symbols in the nuttx export.
I'm not expecting to be this merged, yet. But I'd like to start a debate over possible solutions and discuss other solutions and improvements. I'm thinking about generalizing the variables over multiple Makefiles, so any directory in the NuttX project would have some kind of a variable. Or possibly only one variable.
A different way of doing this is to just all of these libraries separately, and not withing libapps.a, etc.
Also, external libraries are, in the current state, linked using the EXTRA_LIBS variable. But that is done only in the last stage of the build and the linker only picks symbols that are needed. In the end, the exported library only has a subset of all the symbols.
Also cmake support must be added.
@zdebanos I suggest converting it to Draft until we have an equivalent support to CMakefile to avoid build system asymmetry.
Thanks @zdebanos, converted PR to Draft as suggested by @acassis, when all is set we will mark it ready for review :-)
I also forgot to mention one problem I've come accross. I've found out that the $(AR) variable in the nuttx build system is set to ar rcs on Unix. Shouldn't it be rather ar, only? In this commit, i need to use ar x.
Currently in this commit, ar is used directly. But that makes it compatible only with Unix. What do you think?
The simplest fix is to create a new variable $(ARX), which will be ar x and $(AR) just stays ar rcs, so we don't break anything.
Yup, the same for SED it is set to just sed. It works on Linux, but on BSD sed is "bsd sed" and gsed (GNU sed compatible with Linux one), we should also add SED variable for sed :D Can you make one please if you work on this already? ./tools/configure.sh switch can be used to set SED=gsed if -B switch is present, and SED=sed otherwise :-)
Does Nuttx actually support the export target in cmake as of today?
@zdebanos: Does Nuttx actually support the
exporttarget in cmake as of today?
I am Make user, sorry, maybe @raiden00pl will know? :-)
Does Nuttx actually support the
exporttarget in cmake as of today?
I think it is not supported yet, cmake is relatively new on NuttX and it is not the official building system (maybe it could become in the future or maybe not) :-)