[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#798064: glibc: please find kfreebsd-kernel-headers in multiarch path



Hi!

Helmut Grohne wrote:
> So maybe we could find a way that works for both the "dpkg-cross" way
> (at least in theory) and the multiarch way.
> 
> For linux this is not sorted out either yet. The relevant code here is
> in debian/sysdeps/linux.mk:
> |   ifeq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
> |     LINUX_HEADERS := /usr/include
> |   else
> |     LINUX_HEADERS := /usr/$(DEB_HOST_GNU_TYPE)/include
> |   endif
> |   LINUX_ARCH_HEADERS := /usr/include/$(DEB_HOST_MULTIARCH)

Actually... that looks like it should already work.  The files in
LINUX_ARCH_HEADERS are used in preference to LINUX_HEADERS, if they
are available.

We can just do the same in kfreebsd.mk, using multiarch headers if
they're found, or the old locations as a fallback.

It also means glibc can apply this patch before kfreebsd-kernel-headers
has made the change;  no need to bump the Build-Depends version now.

> Using target variables is wrong here. It might work (because target
> defaults to host), but it doesn't make sense semantically. This must be
> DEB_HOST_MULTIARCH here. Target variables are only relevant for
> compilers, but glibc isn't a compiler.

I've corrected this too in the new version of the patch, attached.
Thanks again for your help!

Regards,
-- 
Steven Chamberlain
steven@pyro.eu.org
--- debian/sysdeps/kfreebsd.mk.orig	2015-07-09 12:28:06.000000000 +0000
+++ debian/sysdeps/kfreebsd.mk	2015-09-05 16:29:00.655101849 +0000
@@ -16,6 +16,7 @@
   else
     KFREEBSD_HEADERS := /usr/$(DEB_HOST_GNU_TYPE)/include
   endif
+  KFREEBSD_ARCH_HEADERS := /usr/include/$(DEB_HOST_MULTIARCH)
 else
   KFREEBSD_HEADERS := $(KFREEBSD_SOURCE)/sys
 endif
@@ -27,18 +28,14 @@
 $(stamp)mkincludedir:
 	rm -rf debian/include
 	mkdir debian/include
-	for file in bsm net netatalk netipx nfs osreldate.h sys x86 vm ; do \
-	    if test -e $(KFREEBSD_HEADERS)/$$file ; then \
+	for file in bsm machine machine-i386 net netatalk netipx nfs osreldate.h sys x86 vm ; do \
+	    if test -e $(KFREEBSD_ARCH_HEADERS)/$$file ; then \
+	        ln -s $(KFREEBSD_ARCH_HEADERS)/$$file debian/include ; \
+	    elif test -e $(KFREEBSD_HEADERS)/$$file ; then \
 	        ln -s $(KFREEBSD_HEADERS)/$$file debian/include ; \
 	    fi ; \
 	done
 
-        # Link all machine directories.  We can't just link machine
-        # because of explicit references to <machine-amd64/*> and
-	# <machine-i386/*>.
-	find $(KFREEBSD_HEADERS) -maxdepth 1 -xtype d -name machine\* \
-		-exec ln -s '{}' debian/include ';'
-
 	# To make configure happy if libc0.1-dev is not installed.
 	touch debian/include/assert.h
 

Attachment: signature.asc
Description: Digital signature


Reply to: