diff -r ca36b7b88df2 configure --- a/configure Mon Dec 18 18:57:19 2006 -0600 +++ b/configure Mon Dec 18 20:18:01 2006 -0600 @@ -22,6 +22,7 @@ static="no" static="no" cross_prefix="" cc="gcc" +gcc3_list="gcc32 gcc33 gcc34 gcc-3.2 gcc-3.3 gcc-3.4" host_cc="gcc" ar="ar" make="make" @@ -311,6 +312,41 @@ if test "$mingw32" = "yes" ; then oss="no" if [ "$cpu" = "i386" ] ; then kqemu="yes" + fi +fi + +# Check for gcc4, error if pre-gcc4 +if test "$check_gcc" = "yes" ; then + cat > $TMPC <&/dev/null + return $? + } + + if check_cc "$cc" ; then + echo "WARNING: \"$cc\" looks like gcc 4.x" + echo "Looking for gcc 3.x" + found_compat_cc="no" + for compat_cc in $gcc3_list ; do + if check_cc "$compat_cc" ; then + echo "Found \"$compat_cc\"" + cc="$compat_cc" + found_compat_cc="yes" + break + fi + done + if test "$found_compat_cc" = "no" ; then + echo "gcc 3.x not found!" + echo "QEMU is known to have problems when compiled with gcc 4.x" + echo "It is recommended that you use gcc 3.x to build QEMU" + echo "To use this compiler anyway, configure with --disable-gcc-check" + exit 1; + fi fi fi @@ -414,23 +450,6 @@ have_gcc3_options="no" have_gcc3_options="no" if $cc -fno-reorder-blocks -fno-optimize-sibling-calls -o $TMPO $TMPC 2> /dev/null ; then have_gcc3_options="yes" -fi - -# Check for gcc4, error if pre-gcc4 -if test "$check_gcc" = "yes" ; then - cat > $TMPC </dev/null ; then - echo "ERROR: \"$cc\" looks like gcc 4.x" - echo "QEMU is known to have problems when compiled with gcc 4.x" - echo "It is recommended that you use gcc 3.x to build QEMU" - echo "To use this compiler anyway, configure with --disable-gcc-check" - exit 1; - fi fi ##########################################