Origin: https://git.kernel.org/pub/scm/libs/klibc/klibc.git/commit?id=
8d6ee65cc8bd75bba8f51589c667ff7c5fd9b3b5
Bug-Debian: https://bugs.debian.org/
1004465
In an out-of-tree build we currently only install the kernel UAPI
headers and the generated <klibc/havesyscall.h>. Add an extra
command to copy headers from the source tree in an out-of-tree
build.
References: https://bugs.debian.org/
1004465
Reported-by: Thorsten Glaser <tg@mirbsd.de>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Gbp-Pq: Name 0001-klibc-Fix-header-installation-from-out-of-tree-build.patch
$(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)lib
$(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)bin
$(Q)cp -rfL $(KLIBCKERNELSRC)/include/. $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include/.
+ifneq ($(srctree),$(objtree))
+ $(Q)cp -rf $(srctree)/usr/include/. $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include/.
+endif
$(Q)cp -rf usr/include/. $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include/.
$(Q)chmod -R a+rX,go-w $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include
$(Q)$(install-data) $(srctree)/klcc/klcc.1 $(INSTALLROOT)$(mandir)/man1/$(KCROSS)klcc.1