Package: libedit
Version: 2.11-20080614-5
Severity: normal
Tags: patch
User: crossbu...@debian.org
Usertags: cross

In order to cross-build libedit sanely in a multiarch world, we need to
mark pmake Multi-Arch: foreign (I've filed a separate bug for that) so
that we get a pmake binary that we're guaranteed to be able to execute.
However, this does mean that we need to override pmake's default
architecture, otherwise it tries to install the built library to the
wrong place and fails because the directory doesn't exist.  The
following patch cleans this up; I've verified that it works with the
native-architecture version of pmake installed.

  * Fix cross-building: set RANLIB as well as CC/LD, and set MACHINE_ARCH
    and MACHINE_MULTIARCH correctly to allow for use of a foreign pmake
    binary.

diff -Nru libedit-2.11-20080614/debian/rules libedit-2.11-20080614/debian/rules
--- libedit-2.11-20080614/debian/rules  2012-06-01 01:09:13.000000000 +0100
+++ libedit-2.11-20080614/debian/rules  2012-12-02 00:41:48.000000000 +0000
@@ -27,15 +27,21 @@
 
 DEB_HOST_GNU_TYPE      ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 DEB_BUILD_GNU_TYPE     ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+DEB_HOST_ARCH          ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
 DEB_HOST_MULTIARCH     ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
 
-ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
-CROSS=CC=$(DEB_HOST_GNU_TYPE)-gcc LD=$(DEB_HOST_GNU_TYPE)-ld
+# Workaround for pmake fussiness
+ifeq (mips,$(DEB_HOST_ARCH))
+PMAKE_ARCH := mipseb
+else
+PMAKE_ARCH := $(DEB_HOST_ARCH)
 endif
 
-# Workaround for pmake fussiness
-ifeq (mips-linux,$(DEB_HOST_GNU_TYPE))
-PMAKE_ARGS += MACHINE_ARCH=mipseb
+ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
+CROSS=CC=$(DEB_HOST_GNU_TYPE)-gcc LD=$(DEB_HOST_GNU_TYPE)-ld 
RANLIB=$(DEB_HOST_GNU_TYPE)-ranlib
+PMAKE_ARGS += MACHINE_ARCH=$(PMAKE_ARCH) 
MACHINE_MULTIARCH=$(DEB_HOST_MULTIARCH)
+else ifneq ($(PMAKE_ARCH),$(DEB_HOST_ARCH))
+PMAKE_ARGS += MACHINE_ARCH=$(PMAKE_ARCH)
 endif
 
 build: build-arch build-indep

Thanks,

-- 
Colin Watson                                       [cjwat...@ubuntu.com]


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to