Commit 1aff381f59b508a422f6fe03965fbc3728d3c45a

Authored by bellard
1 parent 9903da21

gcc4 warning (Paul Brook)


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1596 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 20 additions and 0 deletions
configure
@@ -88,6 +88,7 @@ kqemu="no" @@ -88,6 +88,7 @@ kqemu="no"
88 kernel_path="" 88 kernel_path=""
89 cocoa="no" 89 cocoa="no"
90 check_gfx="yes" 90 check_gfx="yes"
  91 +check_gcc="yes"
91 92
92 # OS specific 93 # OS specific
93 targetos=`uname -s` 94 targetos=`uname -s`
@@ -200,6 +201,8 @@ for opt do @@ -200,6 +201,8 @@ for opt do
200 ;; 201 ;;
201 --disable-gfx-check) check_gfx="no" 202 --disable-gfx-check) check_gfx="no"
202 ;; 203 ;;
  204 + --disable-gcc-check) check_gcc="no"
  205 + ;;
203 esac 206 esac
204 done 207 done
205 208
@@ -277,6 +280,23 @@ if $cc -fno-reorder-blocks -fno-optimize-sibling-calls -o $TMPO $TMPC 2> /dev/nu @@ -277,6 +280,23 @@ if $cc -fno-reorder-blocks -fno-optimize-sibling-calls -o $TMPO $TMPC 2> /dev/nu
277 have_gcc3_options="yes" 280 have_gcc3_options="yes"
278 fi 281 fi
279 282
  283 +# Check for gcc4
  284 +if test "$check_gcc" = "yes" ; then
  285 + cat > $TMPC <<EOF
  286 +#if __GNUC__ >= 4
  287 +#error gcc4
  288 +#endif
  289 +int main(){return 0;}
  290 +EOF
  291 + if ! $cc -o $TMPO $TMPC 2>/dev/null ; then
  292 + echo "ERROR: \"$cc\" looks like gcc 4.x"
  293 + echo "QEMU is known to have problems when compiled with gcc 4.x"
  294 + echo "It is recommended that you use gcc 3.x to build QEMU"
  295 + echo "To use this compiler anyway, configure with --disable-gcc-check"
  296 + exit 1;
  297 + fi
  298 +fi
  299 +
280 ########################################## 300 ##########################################
281 # SDL probe 301 # SDL probe
282 302