Package: unifdef
Version: 2.10-1
Severity: normal
Tags: patch
User: [email protected]
Usertags: cross
unifdef fails to cross-build because it uses the native compiler rather
than the appropriate cross-compiler. The simplest fix is just to pass
an appropriate CC= when cross-building. It also needs to honour
DEB_BUILD_OPTIONS=nocheck for this to work, as in the general case it
won't be able to execute the built binaries.
* Support cross-building.
diff -Nru unifdef-2.10/debian/rules unifdef-2.10/debian/rules
--- unifdef-2.10/debian/rules 2014-01-23 08:55:30.000000000 +0000
+++ unifdef-2.10/debian/rules 2014-07-02 16:16:14.000000000 +0100
@@ -1,5 +1,13 @@
#!/usr/bin/make -f
+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-arch build-indep
build-indep: build-stamp
@@ -7,8 +15,10 @@
build-arch: build-stamp
build-stamp:
- $(MAKE) $(shell dpkg-buildflags --export=cmdline)
+ $(MAKE) $(CROSS) $(shell dpkg-buildflags --export=cmdline)
+ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
$(MAKE) test
+endif
touch build-stamp
clean:
Thanks,
--
Colin Watson [[email protected]]
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]