diff --git a/configure b/configure
index 119c985c450d5a183f1941abc541d7ba3814b291..dd5be9febbd35f377b48239fb4d6e2ca0031d070 100755
--- a/configure
+++ b/configure
@@ -2225,10 +2225,10 @@ case $host in
   x86_64*linux*)
     if test "x$enable_win64" != "xyes"
     then
-      test -n "$CC" || CC="gcc -m32"
-      test -n "$CXX"|| CXX="g++ -m32"
-      test -n "$LD" || LD="ld -m elf_i386"
-      test -n "$AS" || AS="as --32"
+      CC="${CC:-gcc} -m32"
+      CXX="${CXX:-g++} -m32"
+      LD="${LD:-ld} -m elf_i386"
+      AS="${AS:-as} --32"
       host_cpu="i386"
     fi
     ;;
diff --git a/configure.ac b/configure.ac
index 91850de048bc1f4224724be23edff730f1e825d7..0bbe49668cf7995c123787a37690fa87f0f3b84b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -84,10 +84,10 @@ case $host in
   x86_64*linux*)
     if test "x$enable_win64" != "xyes"
     then
-      test -n "$CC" || CC="gcc -m32"
-      test -n "$CXX"|| CXX="g++ -m32"
-      test -n "$LD" || LD="ld -m elf_i386"
-      test -n "$AS" || AS="as --32"
+      CC="${CC:-gcc} -m32"
+      CXX="${CXX:-g++} -m32"
+      LD="${LD:-ld} -m elf_i386"
+      AS="${AS:-as} --32"
       host_cpu="i386"
     fi
     ;;