chiark / gitweb /
Fix FTCBFS: Use triplet-prefixed build tools. Patch from Helmut Grohne. Closes:...
[authbind.git] / debian / rules
index c0c4482..625f4b1 100755 (executable)
 #
 # $Id$
 
-CC= gcc
+-include /usr/share/dpkg/architecture.mk
+ifneq ($(DEB_HOST_GNU_TYPE),)
+TOOL_PREFIX=$(DEB_HOST_GNU_TYPE)-
+endif
+ifeq ($(origin CC),default)
+CC=$(TOOL_PREFIX)gcc
+endif
 SHELL=/bin/bash
 
 package=authbind
@@ -45,8 +51,8 @@ CFLAGS += -g
 LDFLAGS += -g 
 
 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
-INSTALL_PROGRAM += -s
-STRIP=strip
+STRIP=$(TOOL_PREFIX)strip
+INSTALL_PROGRAM += -s --strip-program=$(STRIP)
 else
 STRIP=:
 endif
@@ -62,7 +68,7 @@ export STRIP
 
 
 build: 
-       $(MAKE) prefix=/usr
+       $(MAKE) prefix=/usr CC='$(CC)' LD='$(TOOL_PREFIX)ld'
 
 clean: 
        $(MAKE) distclean