Package: file
Version: 4.23-1
Severity: wishlist
Tags: patch
User: [EMAIL PROTECTED]
Usertags: crossbuilt

In line with the other cross-building support bugs:
http://lists.debian.org/debian-devel/2007/11/msg00116.html

This patch is necessary to allow file to cross-build in Debian,
following recommendations in autotools-dev, including not passing --host
unless it differs from --build. The patch is a little more involved than
others because $(CC) also needs to be overridden when crossbuilding.


*** ../crossbuild.diff
--- file-4.23.debian/debian/rules 
+++ file-4.23.emdebian/debian/rules 
@@ -9,6 +9,12 @@
 # from having to guess our platform (since we know it already)
 DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
+CROSS= --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) \
+ CC=$(DEB_HOST_GNU_TYPE)-gcc LD=$(DEB_HOST_GNU_TYPE)-ld
+else
+CROSS= --build=$(DEB_BUILD_GNU_TYPE)
+endif
 
 # HOWMANY is the number of bytes looked at by file
 CFLAGS = -DHOWMANY=0x18000
@@ -29,7 +35,7 @@
        # Configuring package
        mv config.sub config.sub.upstream && ln -s /usr/share/misc/config.sub
        mv config.guess config.guess.upstream && ln -s 
/usr/share/misc/config.guess
-       CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) 
--build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --datadir=\$${prefix}/share 
--mandir=\$${prefix}/share/man --enable-fsect-man5
+       CFLAGS="$(CFLAGS)" ./configure $(CROSS) --prefix=/usr 
--datadir=\$${prefix}/share --mandir=\$${prefix}/share/man --enable-fsect-man5
        rm config.sub && mv config.sub.upstream config.sub
        rm config.guess && mv config.guess.upstream config.guess
 


-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.24-1-amd64 (SMP w/1 CPU core)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages file depends on:
ii  libc6                         2.7-6      GNU C Library: Shared libraries
ii  libmagic1                     4.23-1     File type determination library us

file recommends no packages.

-- no debconf information

Attachment: signature.asc
Description: Digital signature

Reply via email to