debian: Don't use dietlibc on platforms that don't support it

Addresses-Debian-Bug: #459475

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
diff --git a/debian/control b/debian/control
index 9e6e9ed..1b1c0f3 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@
 Section: admin
 Priority: required
 Maintainer: Theodore Y. Ts'o <tytso@mit.edu>
-Build-Depends: texi2html (>= 1.76), gettext, texinfo, dc, pkg-config, dietlibc-dev [!hurd-i386 !kfreebsd-i386 !kfreebsd-amd64], libsepol1-dev [!hurd-i386 !kfreebsd-i386 !kfreebsd-amd64], libdevmapper-dev [!hurd-i386 !kfreebsd-i386 !kfreebsd-amd64], libselinux1-dev [!hurd-i386 !kfreebsd-i386 !kfreebsd-amd64], debhelper (>= 4)
+Build-Depends: texi2html (>= 1.76), gettext, texinfo, dc, pkg-config, dietlibc-dev [alpha amd64 arm hppa i386 ia64 mips mipsel powerpc ppc64 s390 sparc], libsepol1-dev [!hurd-i386 !kfreebsd-i386 !kfreebsd-amd64], libdevmapper-dev [!hurd-i386 !kfreebsd-i386 !kfreebsd-amd64], libselinux1-dev [!hurd-i386 !kfreebsd-i386 !kfreebsd-amd64], debhelper (>= 4)
 Standards-Version: 3.7.3.0
 
 Package: e2fsck-static
diff --git a/debian/rules b/debian/rules
index fe42a52..b5c00e7 100755
--- a/debian/rules
+++ b/debian/rules
@@ -112,7 +112,7 @@
 	--disable-nls --disable-imager \
 	--disable-uuidd --disable-tls \
 	--disable-e2initrd-helper \
-	--with-diet-libc --with-ccopts=-fno-stack-protector
+	--with-ccopts=-fno-stack-protector
 
 MIPS_NOPIC_CONF_FLAGS = --with-ccopts="${CCOPTS}" \
 	--disable-nls \
@@ -180,6 +180,9 @@
 
 	mkdir -p ${staticbuilddir}
 ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
+	if type diet > /dev/null  2>&1 ; then \
+		STATIC_CONF_FLAGS="$STATIC_CONF_FLAGS --with-diet-libc"; \
+	fi
 	cd ${staticbuilddir} && AWK=/usr/bin/awk \
 		${topdir}/configure ${STATIC_CONF_FLAGS}
 else