[libbsd] How to install machine header files?

Jan.Sommer at dlr.de Jan.Sommer at dlr.de
Thu Apr 1 09:58:32 UTC 2021


> -----Original Message-----
> From: Chris Johns <chrisj at rtems.org>
> Sent: Thursday, April 1, 2021 6:25 AM
> To: Sommer, Jan <Jan.Sommer at dlr.de>; devel at rtems.org
> Subject: Re: [libbsd] How to install machine header files?
> 
> On 1/4/21 6:37 am, Jan.Sommer at dlr.de wrote:
> > Hello,
> >
> > I stumbled upon some include path problems in libbsd while looking at
> Chris' ptpd port and I am not sure what is the recommended way to solve it.
> > It starts with "freebsd/sys/sys/bus.h" including "machine/_bus.h".
> > Currently, this will be the one from within "rtemsbd" which will redirect to
> "rtemsbsd/include/machine/bus.h" which is amd64 specific.
> > For the pc686 BSP this will create a compile error for applications which
> include "<sys/bus.h>".
> 
> OK.
> 
> > I tried to solve it by removing the "_bus.h" in rtemsbsd and installing the
> correct one from "freebsd/sys/i386/include/machine/_bus.h", but I am not
> sure how to tell waf to install the file.
> > Is there a way to add a single architecture specific header to the install
> headers?
> 
> Yes ....
> 
> https://git.rtems.org/rtems-libbsd/tree/libbsd.py#n111
> https://git.rtems.org/rtems-libbsd/tree/libbsd.py#n2903
> 
> > I could add a corresponding path and wildcard to the "header-paths" in
> libbsd.py, but I am not sure if this is the right place.
> 
> I think the PCI module is the place to handle this. I am sorry but I cannot see
> the issue clear at the moment and I cannot invest time performing a build.
> 

Thank you for taking a look at it.
The main problem is, that the header files added there are not copied to the prefix with "waf install".
To me it looks like only the files matched with header-paths (https://git.rtems.org/rtems-libbsd/tree/libbsd.py#n123) are installed.
I checked today with the pc686 and zedboard builds and the header files which end up in PREFIX/lib/include/machine are only the ones from within the rtemsbsd directory and none from the freebsd/sys/$ARCH/include/machine.

> The addCPUDependentFreeBSDHeaderFiles() on line 2931 of libbsd.py in the
> PCI module looks a little suspect because there is no list of archs provided.
> Could the issue be as simple as the list of archs is not there and the list is
> empty?
> 

It looks like only some of the add* functions take an archs list.
addCPUDependentFreeBSDHeaderFiles() only takes the header file list.
I dug around in the waf_libbsd.py, but I couldn't figure out what happens to the header files added by this function.

Best regards,

    Jan

> Chris


More information about the devel mailing list