Makefile cleanup - more generic support of 32 bit compilation on x86_64


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3937 c046a42c-6fe2-441c-8c8c-71466251a162
diff --git a/configure b/configure
index 96cf1d1..b8b3681 100755
--- a/configure
+++ b/configure
@@ -115,7 +115,6 @@
 CYGWIN*)
 mingw32="yes"
 OS_CFLAGS="-mno-cygwin"
-VL_OS_LDFLAGS="-mno-cygwin"
 if [ "$cpu" = "i386" ] ; then
     kqemu="yes"
 fi
@@ -349,7 +348,7 @@
 # If cpu ~= sparc and  sparc_cpu hasn't been defined, plug in the right
 # ARCH_CFLAGS/ARCH_LDFLAGS (assume sparc_v8plus for 32-bit and sparc_v9 for 64-bit)
 #
-case $cpu in
+case "$cpu" in
     sparc) if test -z "$sparc_cpu" ; then
                ARCH_CFLAGS="-m32 -mcpu=ultrasparc -D__sparc_v8plus__"
                ARCH_LDFLAGS="-m32"
@@ -369,19 +368,16 @@
     s390)
            ARCH_CFLAGS="-march=z900"
            ;;
+    i386)
+           ARCH_CFLAGS="-m32"
+           ARCH_LDFLAGS="-m32"
+           ;;
+    x86_64)
+           ARCH_CFLAGS="-m64"
+           ARCH_LDFLAGS="-m64"
+           ;;
 esac
 
-if [ "$solaris" = "yes" -a  "$cpu" = "x86_64" ] ; then
-    CFLAGS="${CFLAGS} -m64"
-    OS_CFLAGS="${OS_CFLAGS} -m64"
-    OS_LDFLAGS="${OS_LDFLAGS} -m64"
-fi
-
-if [ "$solaris" = "yes" -a  "$cpu" = "i386" ] ; then
-    CFLAGS="${CFLAGS} -m32"
-    OS_CFLAGS="${OS_CFLAGS} -m32"
-fi
-
 if test x"$show_help" = x"yes" ; then
 cat << EOF
 
@@ -794,9 +790,11 @@
 echo "HOST_CC=$host_cc" >> $config_mak
 echo "AR=$ar" >> $config_mak
 echo "STRIP=$strip -s -R .comment -R .note" >> $config_mak
+# XXX: only use CFLAGS and LDFLAGS ?  
+# XXX: should export HOST_CFLAGS and HOST_LDFLAGS for cross
+# compilation of dyngen tool (useful for win32 build on Linux host)
 echo "OS_CFLAGS=$OS_CFLAGS" >> $config_mak
 echo "OS_LDFLAGS=$OS_LDFLAGS" >> $config_mak
-echo "VL_OS_LDFLAGS=$VL_OS_LDFLAGS" >> $config_mak
 echo "ARCH_CFLAGS=$ARCH_CFLAGS" >> $config_mak
 echo "ARCH_LDFLAGS=$ARCH_LDFLAGS" >> $config_mak
 echo "CFLAGS=$CFLAGS" >> $config_mak