Package: newt
Version: 0.52.2-11.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 newt to cross-build in Debian,
following recommendations from autotools-dev.


*** ../crossbuild.diff
--- newt-0.52.2.debian/debian/rules 
+++ newt-0.52.2.emdebian/debian/rules 
@@ -12,6 +12,16 @@
 DEB_BUILD_GNU_SYSTEM = $(shell dpkg-architecture -qDEB_BUILD_GNU_SYSTEM)
 DEB_BUILD_GNU_CPU = $(shell dpkg-architecture -qDEB_BUILD_GNU_CPU)
 
+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)
+CROSSCC=$(DEB_HOST_GNU_TYPE)-gcc
+else
+CROSS=
+CROSSCC=gcc
+endif
+
 VERSION=0.52.2
 SONAME=0.52
 PYVERS=$(shell pyversions -vr debian/control)
@@ -72,14 +82,14 @@
        cp newt.spec $(BUILD_TREE)
        rm -f $(BUILD_TREE)/.depend
        ( cd $(BUILD_TREE) && autoconf --force -i )
-       ( cd $(BUILD_TREE) && ./configure $(GPMSUPPORT) $(NOSTRIP) )
+       ( cd $(BUILD_TREE) && ./configure $(GPMSUPPORT) $(NOSTRIP) $(CROSS) )
        touch $@
 
 build: $(build-stamp)
 $(build-stamp): $(configure-stamp)
        dh_testdir
        ( cd $(BUILD_TREE) && sgmltools --backend html tutorial.sgml )
-       $(MAKE) -C $(BUILD_TREE)
+       CC=$(CROSSCC) $(MAKE) -C $(BUILD_TREE)
        ( cd $(BUILD_TREE) && ar cqv libnewt_pic.a shared/*.o )
        # build POT file for translators
        make -C $(BUILD_TREE)/po newt.pot
@@ -105,7 +115,7 @@
        dh_installdirs -p $@ 
        dh_install -p $@ --sourcedir=$(BUILD_TREE)
        chmod +x $(BUILD_TREE)/mkinstalldirs
-       $(MAKE) -C $(BUILD_TREE)/po prefix=/usr  \
+       CC=$(CROSSCC) $(MAKE) -C $(BUILD_TREE)/po prefix=/usr  \
                DESTDIR=../../../debian/$@ HAVE_XGETTEXT=yes install
        dh_strip -p $@
        dh_makeshlibs -p $@


-- 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

Attachment: signature.asc
Description: Digital signature

Reply via email to