[klibc] Fix header installation from out-of-tree build
authorBen Hutchings <ben@decadent.org.uk>
Sun, 30 Jan 2022 22:59:18 +0000 (23:59 +0100)
committerBen Hutchings <benh@debian.org>
Sun, 30 Jan 2022 23:28:16 +0000 (23:28 +0000)
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

scripts/Kbuild.install

index c2b63f10b7e7c94655af5e6c1fb291ec9ec69001..0788637f8bd33e653ed8f0e2daaff3e6ee8fae0d 100644 (file)
@@ -103,6 +103,9 @@ header:
        $(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