I've now improved the cross-building patch and tested it with a normal
Debian build. Attached.

The changes are simply to replace gcc with a variable in each case and
then set that variable if cross-compiling detected.

-- 


Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/

--- bzip2.old/debian/rules 
+++ bzip2-1.0.3/debian/rules 
@@ -13,6 +13,13 @@
 DEB_HOST_GNU_TYPE	:= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 DEB_HOST_ARCH		:= $(shell dpkg-architecture -qDEB_HOST_ARCH)
 DEB_HOST_ARCH_OS	:= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
+ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
+        CROSS=CC=$(DEB_HOST_GNU_TYPE)-gcc
+        CC=$(DEB_HOST_GNU_TYPE)-gcc
+else
+        CROSS=CC=gcc
+        CC=gcc
+endif
 
 DEBCFLAGS:=
 DEBSTRIP:=strip
@@ -30,7 +37,7 @@
 
 ifneq (,$(findstring /$(DEB_HOST_ARCH)/,/i386/powerpc/sparc/s390/))
 	build64-stamp := build64-stamp
-	CC64=gcc -m64
+	CC64=$(CC) -m64
 endif
 ifeq ($(DEB_HOST_ARCH),i386)
 	CC64 += -march=x86-64 -mtune=x86-64
@@ -68,7 +75,7 @@
 	rm -rf 32
 	mkdir 32
 	cp -p *.h *.c Makefile 32/
-	$(MAKE) -C 32 CC="gcc -m32" DEBCFLAGS="$(DEBCFLAGS)"
+	$(MAKE) -C 32 "$(CROSS) -m32" DEBCFLAGS="$(DEBCFLAGS)"
 	touch build32-stamp
 
 build64: build64-stamp

Attachment: pgpiGVKkpgnZA.pgp
Description: PGP signature

Reply via email to