[Buildroot] Common header files / code between packages

Arnout Vandecappelle arnout at mind.be
Thu Aug 5 10:15:58 UTC 2021



On 05/08/2021 09:15, Jacques Samoun wrote:
> Hello,
> 
> my development consists of a kernel driver and an companion user space layer.
> They are build each in 2 separate packages. Using external tree build.
> 
> The problem is, i would like to share some include files between both
> package (kernel driver and user space layer).
> So far, i solved that by adding a common folder containing the include files,
> and making it part of each package, so it builds OK.

 I think a more common way is for the kernel module package to also install the
shared include files (to $(STAGING_DIR)/usr/include/linux). cryptodev-linux is
an example of that.

 It's even possible to make the kernel module package build the kernel module
only if a kernel is built, and make it to install the headers regardless of
whether a kernel is built. That way, you can have a buildroot configuration that
only builds the userspace without kernel. fwts is an example of that (it doesn't
install headers though).



> 
> Now, a third package, whose code is completely outside the first 2 is willing
> also to use this include file. The only way i found so far, is to put explicit
> relative path referring from one package to the one other, but this is ugly.
> Moreover, the path depends on the version of the packages, so can break easily.
> There must be a better way (STAGING DIR ?)  but i couldn't find.

 Install the headers to $(STAGING_DIR)/usr/include/linux (or /usr/include if
that is more appropriate).


 Regards,
 Arnout

> 
> Can anybody give me an hint ?
> Thanks,
> Jacques
> 
> 
> 
> 
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
> 


More information about the buildroot mailing list