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 | 213 | source_path_used="yes" |
214 | 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 | 223 | for opt do |
217 | 224 | optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'` |
218 | 225 | case "$opt" in |
... | ... | @@ -306,6 +313,10 @@ for opt do |
306 | 313 | *) echo "undefined SPARC architecture. Exiting";exit 1;; |
307 | 314 | esac |
308 | 315 | ;; |
316 | + --enable-werror) werror="yes" | |
317 | + ;; | |
318 | + --disable-werror) werror="no" | |
319 | + ;; | |
309 | 320 | esac |
310 | 321 | done |
311 | 322 | |
... | ... | @@ -319,6 +330,9 @@ fi |
319 | 330 | # default flags for all hosts |
320 | 331 | CFLAGS="$CFLAGS -Wall -O2 -g -fno-strict-aliasing" |
321 | 332 | LDFLAGS="$LDFLAGS -g" |
333 | +if test "$werror" = "yes" ; then | |
334 | +CFLAGS="$CFLAGS -Werror" | |
335 | +fi | |
322 | 336 | |
323 | 337 | # |
324 | 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 | 392 | echo " --make=MAKE use specified make [$make]" |
379 | 393 | echo " --install=INSTALL use specified install [$install]" |
380 | 394 | echo " --static enable static build [$static]" |
395 | +echo " --disable-werror disable compilation abort on warning" | |
381 | 396 | echo " --disable-sdl disable SDL" |
382 | 397 | echo " --enable-cocoa enable COCOA (Mac OS X only)" |
383 | 398 | echo " --enable-mingw32 enable Win32 cross compilation with mingw32" |
... | ... | @@ -684,6 +699,7 @@ echo "target list $target_list" |
684 | 699 | echo "gprof enabled $gprof" |
685 | 700 | echo "profiler $profiler" |
686 | 701 | echo "static build $static" |
702 | +echo "-Werror enabled $werror" | |
687 | 703 | if test "$darwin" = "yes" ; then |
688 | 704 | echo "Cocoa support $cocoa" |
689 | 705 | fi | ... | ... |