Package: pwgen
Version: 2.06-1
Severity: normal
Tags: patch
User: crossbu...@debian.org
Usertags: cross

pwgen fails to cross-build because it uses the native compiler rather
than the appropriate cross-compiler.

There is a straightforward fix for the time being: set CC.  This is
technically wrong since this package uses autoconf, so we should be
using --build and --host.  Unfortunately the configure script was built
with autoconf 2.13, which did not support cross-compiling properly.  If
you want to do this more correctly, then I recommend making a new
upstream release built with current autotools, and then passing --build
and --host to configure as recommended in
/usr/share/doc/autotools-dev/README.Debian.gz.

  * Use correct compiler when cross-building.

--- pwgen-2.06.orig/debian/rules
+++ pwgen-2.06/debian/rules
@@ -4,11 +4,20 @@
 
 package=pwgen
 
+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
        ./configure --prefix=/usr --mandir=/usr/share/man
-       $(MAKE) CFLAGS="-O2 -g -Wall"
+       $(MAKE) CFLAGS="-O2 -g -Wall" $(CROSS)
        touch build-stamp
 
 clean:

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