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

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



Sorry, that was wrong.  Required headers could be located in
/usr/include/sys and /usr/include/$(DEB_HOST_MULTIARCH)/sys at the same
time.  It is necessary to split debian/include/sys/ and link to
individual headers (or subdirectories) wherever they are located.

I think I have a patch now that meets all the requirements.

Firstly it will look for headers at the new multiarch location,
/usr/include/$(DEB_HOST_MULTIARCH).  Those could be native headers, or
foreign-architecture headers if you've installed those for
cross-building.

But otherwise it will fall back to using headers from the original
locations: /usr/include for native builds;
/usr/$(DEB_HOST_GNU_TYPE)/include for old-style cross builds.

I've tested this with successful native kfreebsd-amd64 builds (including
multilib), having kernel headers in either the original or the new
(multiarch) locations.

Thank you,
Regards,
-- 
Steven Chamberlain
steven@pyro.eu.org
--- glibc-2.19/debian/sysdeps/kfreebsd.mk	2015-07-09 13:28:06.000000000 +0100
+++ glibc-2.19/debian/sysdeps/kfreebsd.mk	2015-09-05 20:23:27.708048223 +0100
@@ -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,17 +28,25 @@
 $(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 \
+
+	# Link to any headers found at the new multiarch location,
+	# otherwise look for them in the old locations
+	for file in bsm machine machine-amd64 machine-i386 net netatalk netipx nfs osreldate.h 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 ';'
+	mkdir -p debian/include/sys
+	# Link to any headers found in the old locations first
+	find $(KFREEBSD_HEADERS)/sys -mindepth 1 \
+		-exec ln -sf '{}' debian/include/sys ';'
+	# Link to any headers found at the new multiarch location,
+	# replacing any existing links
+	find $(KFREEBSD_ARCH_HEADERS)/sys -mindepth 1 \
+		-exec ln -sf '{}' debian/include/sys ';'
 
 	# To make configure happy if libc0.1-dev is not installed.
 	touch debian/include/assert.h

Attachment: signature.asc
Description: Digital signature


Reply to: