Package: pmake
Version: 1.111-3.2
Severity: normal
Tags: patch
User: [email protected]
Usertags: cross

pmake fails to cross-build because it uses the native compiler rather
than the appropriate cross-compiler.  This is very simple to fix by
setting CC; patch follows.

  * Use correct compiler when cross-building.

diff -Nru pmake-1.111/debian/rules pmake-1.111/debian/rules
--- pmake-1.111/debian/rules    2011-05-29 15:08:02.000000000 +0100
+++ pmake-1.111/debian/rules    2012-12-02 00:37:39.000000000 +0000
@@ -11,10 +11,18 @@
        -DHAVE_VSNPRINTF \
        -D_GNU_SOURCE -Wno-unused"
 
+DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
+CROSS :=
+else
+CROSS := CC=$(DEB_HOST_GNU_TYPE)-gcc
+endif
+
 build: build-stamp
 build-stamp:
        dh_testdir
-       $(MAKE) -f Makefile.boot CFLAGS=$(CFLAGS)
+       $(MAKE) -f Makefile.boot CFLAGS=$(CFLAGS) $(CROSS)
        touch build-stamp
 
 clean:

Thanks,

-- 
Colin Watson                                       [[email protected]]


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to