Commit 85aa518981a71d8b758cad1ae30745302841242c
1 parent
6dfd59d6
options to enable or disable -Werror. Enable -Werror for builds from CVS by default
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3618 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
16 additions
and
0 deletions
configure
@@ -213,6 +213,13 @@ else | @@ -213,6 +213,13 @@ else | ||
213 | source_path_used="yes" | 213 | source_path_used="yes" |
214 | fi | 214 | fi |
215 | 215 | ||
216 | +# generate compile errors on warnings for development builds | ||
217 | +if grep cvs $source_path/VERSION > /dev/null 2>&1 ; then | ||
218 | +werror="yes"; | ||
219 | +else | ||
220 | +werror="no" | ||
221 | +fi | ||
222 | + | ||
216 | for opt do | 223 | for opt do |
217 | optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'` | 224 | optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'` |
218 | case "$opt" in | 225 | case "$opt" in |
@@ -306,6 +313,10 @@ for opt do | @@ -306,6 +313,10 @@ for opt do | ||
306 | *) echo "undefined SPARC architecture. Exiting";exit 1;; | 313 | *) echo "undefined SPARC architecture. Exiting";exit 1;; |
307 | esac | 314 | esac |
308 | ;; | 315 | ;; |
316 | + --enable-werror) werror="yes" | ||
317 | + ;; | ||
318 | + --disable-werror) werror="no" | ||
319 | + ;; | ||
309 | esac | 320 | esac |
310 | done | 321 | done |
311 | 322 | ||
@@ -319,6 +330,9 @@ fi | @@ -319,6 +330,9 @@ fi | ||
319 | # default flags for all hosts | 330 | # default flags for all hosts |
320 | CFLAGS="$CFLAGS -Wall -O2 -g -fno-strict-aliasing" | 331 | CFLAGS="$CFLAGS -Wall -O2 -g -fno-strict-aliasing" |
321 | LDFLAGS="$LDFLAGS -g" | 332 | LDFLAGS="$LDFLAGS -g" |
333 | +if test "$werror" = "yes" ; then | ||
334 | +CFLAGS="$CFLAGS -Werror" | ||
335 | +fi | ||
322 | 336 | ||
323 | # | 337 | # |
324 | # If cpu ~= sparc and sparc_cpu hasn't been defined, plug in the right | 338 | # If cpu ~= sparc and sparc_cpu hasn't been defined, plug in the right |
@@ -378,6 +392,7 @@ echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc." | @@ -378,6 +392,7 @@ echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc." | ||
378 | echo " --make=MAKE use specified make [$make]" | 392 | echo " --make=MAKE use specified make [$make]" |
379 | echo " --install=INSTALL use specified install [$install]" | 393 | echo " --install=INSTALL use specified install [$install]" |
380 | echo " --static enable static build [$static]" | 394 | echo " --static enable static build [$static]" |
395 | +echo " --disable-werror disable compilation abort on warning" | ||
381 | echo " --disable-sdl disable SDL" | 396 | echo " --disable-sdl disable SDL" |
382 | echo " --enable-cocoa enable COCOA (Mac OS X only)" | 397 | echo " --enable-cocoa enable COCOA (Mac OS X only)" |
383 | echo " --enable-mingw32 enable Win32 cross compilation with mingw32" | 398 | echo " --enable-mingw32 enable Win32 cross compilation with mingw32" |
@@ -684,6 +699,7 @@ echo "target list $target_list" | @@ -684,6 +699,7 @@ echo "target list $target_list" | ||
684 | echo "gprof enabled $gprof" | 699 | echo "gprof enabled $gprof" |
685 | echo "profiler $profiler" | 700 | echo "profiler $profiler" |
686 | echo "static build $static" | 701 | echo "static build $static" |
702 | +echo "-Werror enabled $werror" | ||
687 | if test "$darwin" = "yes" ; then | 703 | if test "$darwin" = "yes" ; then |
688 | echo "Cocoa support $cocoa" | 704 | echo "Cocoa support $cocoa" |
689 | fi | 705 | fi |