Bug#250225: grub: Patch for FTBFS on amd64

Andreas Jochens Andreas Jochens <aj@andaco.de>, 250225@bugs.debian.org
Thu, 30 Sep 2004 22:05:35 +0200


tags 250225 + patch
thanks

When trying to build 'grub' on amd64, I currently get the following error:

checking for x86_64-linux-gcc... x86_64-linux-gcc
checking for x86_64-linux-gcc... (cached) x86_64-linux-gcc
checking for C compiler default output file name... configure: error: C compiler cannot create executables
See `config.log' for more details.
make: *** [configure-stamp] Error 77

With the attached patch 'grub' can be compiled on amd64.

This patch adds 'ia32-libs-dev [amd64]' to the 'Build-Depends' and
'amd64' to the 'Architecture:' fields in debian/control. It also
generalizes several explicit instances of 'i386' in debian/rules
and debian/grub-floppy so that the amd64/x86_64 case is handled properly.

Regards
Andreas Jochens

diff -urN ../tmp-orig/grub-0.95+cvs20040624/debian/control ./debian/control
--- ../tmp-orig/grub-0.95+cvs20040624/debian/control	2004-09-30 21:51:22.597286192 +0200
+++ ./debian/control	2004-09-30 21:51:23.570138296 +0200
@@ -3,12 +3,12 @@
 Priority: optional
 Maintainer: Grub Maintainers <pkg-grub-devel@lists.alioth.debian.org>
 Uploaders: Jason Thomas <jason@debian.org>, Robert Millan <rmh@debian.org>
-Build-Depends: debhelper (>= 4.0.0), automake1.8, autoconf, texinfo, libncurses5-dev | libncurses-dev, type-handling (>= 0.2.0)
+Build-Depends: debhelper (>= 4.0.0), automake1.8, autoconf, texinfo, libncurses5-dev | libncurses-dev, type-handling (>= 0.2.0), ia32-libs-dev [amd64]
 Build-Depends-Indep: texi2html, e2tools, e2fsprogs, mkisofs
 Standards-Version: 3.6.1.0
 
 Package: grub
-Architecture: darwin-i386 freebsd-i386 hurd-i386 kfreebsd-i386 knetbsd-i386 i386 netbsd-i386 openbsd-i386
+Architecture: amd64 darwin-i386 freebsd-i386 hurd-i386 kfreebsd-i386 knetbsd-i386 i386 netbsd-i386 openbsd-i386
 Depends: ${shlibs:Depends}
 Suggests: grub-doc, grubconf
 Description: GRand Unified Bootloader
diff -urN ../tmp-orig/grub-0.95+cvs20040624/debian/control.in ./debian/control.in
--- ../tmp-orig/grub-0.95+cvs20040624/debian/control.in	2004-09-30 21:51:22.606284824 +0200
+++ ./debian/control.in	2004-09-30 21:51:20.653581680 +0200
@@ -3,12 +3,12 @@
 Priority: optional
 Maintainer: Grub Maintainers <pkg-grub-devel@lists.alioth.debian.org>
 Uploaders: Jason Thomas <jason@debian.org>, Robert Millan <rmh@debian.org>
-Build-Depends: debhelper (>= 4.0.0), automake1.8, autoconf, texinfo, libncurses5-dev | libncurses-dev, type-handling (>= 0.2.0)
+Build-Depends: debhelper (>= 4.0.0), automake1.8, autoconf, texinfo, libncurses5-dev | libncurses-dev, type-handling (>= 0.2.0), ia32-libs-dev [amd64]
 Build-Depends-Indep: texi2html, e2tools, e2fsprogs, mkisofs
 Standards-Version: 3.6.1.0
 
 Package: grub
-Architecture: @i386@
+Architecture: amd64 @i386@
 Depends: ${shlibs:Depends}
 Suggests: grub-doc, grubconf
 Description: GRand Unified Bootloader
diff -urN ../tmp-orig/grub-0.95+cvs20040624/debian/grub-floppy ./debian/grub-floppy
--- ../tmp-orig/grub-0.95+cvs20040624/debian/grub-floppy	2004-09-30 21:51:22.608284520 +0200
+++ ./debian/grub-floppy	2004-09-30 21:48:52.070169792 +0200
@@ -18,8 +18,9 @@
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 
 # Initialize some variables.
+DEB_BUILD_GNU_CPU=`dpkg-architecture -qDEB_BUILD_GNU_CPU`
 dd=`which dd`
-pkglibdir=/lib/grub/i386-pc
+pkglibdir=/lib/grub/$DEB_BUILD_GNU_CPU-pc
 stage1=$pkglibdir/stage1
 stage2=$pkglibdir/stage2
 
diff -urN ../tmp-orig/grub-0.95+cvs20040624/debian/rules ./debian/rules
--- ../tmp-orig/grub-0.95+cvs20040624/debian/rules	2004-09-30 21:51:22.606284824 +0200
+++ ./debian/rules	2004-09-30 21:45:54.007239472 +0200
@@ -178,7 +178,7 @@
 
 	# grub-disk
 	mkdir -p $(CURDIR)/debian/tmp/root/boot/grub
-	cp $(CURDIR)/debian/grub/lib/grub/i386-*/{stage1,e2fs_stage1_5,stage2} \
+	cp $(CURDIR)/debian/grub/lib/grub/$(DEB_BUILD_GNU_CPU)-*/{stage1,e2fs_stage1_5,stage2} \
 		$(CURDIR)/docs/menu.lst \
 		$(CURDIR)/debian/tmp/root/boot/grub
 	tar -C $(CURDIR)/debian/tmp/root \
@@ -189,9 +189,8 @@
 		-f $(CURDIR)/debian/tmp/grub.tar.gz
 
 	rm -f $(CURDIR)/debian/tmp/root/boot/grub/*stage*
-	cp $(CURDIR)/debian/grub/lib/grub/i386-*/stage2_eltorito \
+	cp $(CURDIR)/debian/grub/lib/grub/$(DEB_BUILD_GNU_CPU)-*/stage2_eltorito \
 		$(CURDIR)/debian/tmp/root/boot/grub
-
 	mkisofs \
 		-b boot/grub/stage2_eltorito \
 		-no-emul-boot -boot-load-size 4 -boot-info-table \
@@ -222,11 +221,11 @@
 	# Cleanup filesystems not used natively in Debian.
 	# (non-native filesystems are supported via stage2)
 	mkdir debian/grub/lib/grub/tmp/
-	mv debian/grub/lib/grub/i386-*/*_stage1_5 \
+	mv debian/grub/lib/grub/$(DEB_BUILD_GNU_CPU)-*/*_stage1_5 \
 		debian/grub/lib/grub/tmp/
 	for i in $(filesystems) ; do \
 		mv debian/grub/lib/grub/tmp/$${i}_stage1_5 \
-		debian/grub/lib/grub/i386-*/ ; \
+		debian/grub/lib/grub/$(DEB_BUILD_GNU_CPU)-*/ ; \
 	done
 	rm -rf debian/grub/lib/grub/tmp/