summaryrefslogtreecommitdiff
path: root/rules
diff options
context:
space:
mode:
Diffstat (limited to 'rules')
-rwxr-xr-xrules13
1 files changed, 11 insertions, 2 deletions
diff --git a/rules b/rules
index 8e33df7c..6efd4992 100755
--- a/rules
+++ b/rules
@@ -11,6 +11,15 @@ ifeq (,$(findstring noopt, ${DEB_BUILD_OPTIONS}))
CFLAGS += -O2
endif
+DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+
+ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
+ conf_args = --build $(DEB_BUILD_GNU_TYPE)
+else
+ conf_args = --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
+endif
+
LC_COLLATE=C
export LC_COLLATE
@@ -38,8 +47,8 @@ build-stamp:
configure: patch configure-stamp
configure-stamp:
cd $(BUILD_TREE) && \
- ./configure --sysconfdir=/etc --prefix=/usr --enable-static \
- --enable-shared \
+ ./configure $(conf_args) \
+ --sysconfdir=/etc --prefix=/usr --enable-static --enable-shared \
--mandir=/usr/share/man --infodir=/usr/share/info --libdir=/lib \
--sbindir=/sbin --enable-docdir=/usr/share/doc/libpam-doc \
--with-mailspool=/var/mail