> > It would be nice if these fitted to each others

It would also be correct. This came to my attention after a discussion
on debian-mentors.

> Isn't the only difference the fact that the document conditionally 
> sets the --host flag

No, it can cause problems because the "native" build tries to use a
cross-compiler. Instead of running gcc, the build runs
i486-linux-gnu-gcc or powerpc-linux-gnu-gcc. Equally, omitting --build
entirely is also incorrect to ensure the correct build is specified.

> I'm not sure if that makes a big difference, though I could easily be
> wrong.

IMHO, yes this is wrong and in line with the other cross-building
support bugs,
(http://lists.debian.org/debian-devel/2007/11/msg00116.html) I have
created a patch that correctly handles the --build and --host
statements within dh_make.

Therefore, as discussed on debian-devel, please fix dh-make to
implement the correct cross building support in new packages.

-- 

Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/
--- dh-make-0.44/dh_make 
+++ dh-make.new/dh_make 
@@ -498,12 +498,16 @@
 			 "ifneq \"\$(wildcard /usr/share/misc/config.guess)\" \"\"\n".
 			 "\tcp -f /usr/share/misc/config.guess config.guess\n".
 			 "endif\n".
-			 "\t".'./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info CFLAGS="$(CFLAGS)" LDFLAGS="-Wl,-z,defs"'."\n";
+			 "\t".'./configure $(CROSS) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info CFLAGS="$(CFLAGS)" LDFLAGS="-Wl,-z,defs"'."\n";
   $DPKG_ARCH="# These are used for cross-compiling and for saving the configure script\n".
              "# from having to guess our platform (since we know it already)\n".
 			 'DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)'."\n".
-			 'DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)'."\n";
-
+			 'DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)'."\n".
+			 'ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))'."\n".
+			 'CROSS= --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)'."\n".
+			 'else'."\n".
+			 'CROSS= --build $(DEB_BUILD_GNU_TYPE)'."\n".
+			 'endif'."\n";
 
   # If it is automaked, use DESTDIR insteadof prefix
   if ( -f 'Makefile.am' ) {

Attachment: pgpN0ovflSUKw.pgp
Description: PGP signature

Reply via email to