diff --git a/configure.ac b/configure.ac
index 9a1d0f8ae5461da8cba3f4ef7f3d5e1c20e8a8e1..47778bda0cb0046cdf2fbb9c3c381125b3f9b71a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -68,7 +68,16 @@ PKG_CHECK_MODULES([LIBELF], [libelf >= 0.152], [have_libelf=yes], [
     LIBELF_LIBS=-lelf
 ])
 
-PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])
+AC_ARG_WITH([glib],
+  [AS_HELP_STRING([--with-glib=yes/no],
+    [use GLib for better test coverage [default=yes]])],
+  [],
+  [with_glib=auto])
+AS_IF([test "$with_glib" != no],
+  [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])],
+  [have_glib=no])
+AS_IF([test "$with_glib" = yes && test "$have_glib" = no],
+  [AC_MSG_ERROR([GLib required but not found])])
 AM_CONDITIONAL([HAVE_GLIB], [test "x$have_glib" = xyes])
 
 AC_ARG_ENABLE([host-prefix],
diff --git a/debian/control b/debian/control
index e3e48cb5a8c5b93a69f1e0c36ddd09b78b2e70b3..9e1b3a197c28dd588174fcb806649e2610240cbe 100644
--- a/debian/control
+++ b/debian/control
@@ -13,7 +13,8 @@ Build-Depends:
  gtk-doc-tools,
  libelf-dev,
  libipc-run-perl,
- libglib2.0-dev,
+ libglib2.0-0 <!nocheck>,
+ libglib2.0-dev [amd64],
  libjpeg62-turbo <!nocheck> | libjpeg62 (>= 6b1) <!nocheck>,
  perl:any,
  xsltproc,
diff --git a/debian/rules b/debian/rules
index e70d30761292c45a95fb342c2890af68eed55d20..2e46a0e0d62745bc1436ba6a581274f70eca3bcf 100755
--- a/debian/rules
+++ b/debian/rules
@@ -11,6 +11,12 @@ confflags = \
 	--libexecdir=\$${exec_prefix}/lib/libcapsule \
 	$(NULL)
 
+ifeq ($(DEB_HOST_ARCH),amd64)
+confflags += --with-glib
+else
+confflags += --without-glib
+endif
+
 override_dh_auto_configure:
 	dh_auto_configure -- $(confflags)