build: set arch specific -m switches in tests-m*32/Makefile.am files properly

* tests/Makefile.am (ARCH_MFLAGS, AM_LDFLAGS): New variables.
(AM_CPPFLAGS): Use ARCH_MFLAGS.
* bootstrap: In tests-m32/Makefile.am and tests-mx32/Makefile.am,
add -m32 and -mx32, respectively, to ARCH_MFLAGS instead of AM_CFLAGS.
diff --git a/bootstrap b/bootstrap
index cb90260..1044ce2 100755
--- a/bootstrap
+++ b/bootstrap
@@ -4,7 +4,7 @@
 	tests=tests-$m
 	rm -rf $tests
 	mkdir $tests
-	sed "s/@arch@/@arch_$m@/;s/^AM_CFLAGS[[:space:]]*=.*/& -$m/" \
+	sed "s/@arch@/@arch_$m@/;s/^ARCH_MFLAGS[[:space:]]*=.*/& -$m/" \
 		tests/Makefile.am > $tests/Makefile.am
 	for f in tests/*; do
 		case "${f##*/}" in
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 71c8130..f0deb60 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -2,13 +2,16 @@
 
 OS = linux
 ARCH = @arch@
+ARCH_MFLAGS =
 AM_CFLAGS = $(WARN_CFLAGS)
-AM_CPPFLAGS = -I$(top_builddir)/$(OS)/$(ARCH) \
+AM_CPPFLAGS = $(ARCH_MFLAGS) \
+	      -I$(top_builddir)/$(OS)/$(ARCH) \
 	      -I$(top_srcdir)/$(OS)/$(ARCH) \
 	      -I$(top_builddir)/$(OS) \
 	      -I$(top_srcdir)/$(OS) \
 	      -I$(top_builddir) \
 	      -I$(top_srcdir)
+AM_LDFLAGS = $(ARCH_MFLAGS)
 
 check_PROGRAMS = \
 	adjtimex \