Commit f3d08ee6aeb6cc85928dda4ec5e972b85cda495d

Authored by Paul Brook
1 parent aca312af

Add --enable-debug

New configure option for debug builds.

Signed-off-by: Paul Brook <paul@codesourcery.com>
Showing 1 changed file with 15 additions and 1 deletions
configure
... ... @@ -157,6 +157,7 @@ case &quot;$cpu&quot; in
157 157 esac
158 158 gprof="no"
159 159 debug_tcg="no"
  160 +debug="no"
160 161 sparse="no"
161 162 strip_opt="yes"
162 163 bigendian="no"
... ... @@ -411,6 +412,12 @@ for opt do
411 412 ;;
412 413 --disable-debug-tcg) debug_tcg="no"
413 414 ;;
  415 + --enable-debug)
  416 + # Enable debugging options that aren't excessively noisy
  417 + debug_tcg="yes"
  418 + debug="yes"
  419 + strip_opt="no"
  420 + ;;
414 421 --enable-sparse) sparse="yes"
415 422 ;;
416 423 --disable-sparse) sparse="no"
... ... @@ -504,7 +511,10 @@ for opt do
504 511 done
505 512  
506 513 # default flags for all hosts
507   -CFLAGS="$CFLAGS -O2 -g -fno-strict-aliasing"
  514 +CFLAGS="$CFLAGS -g -fno-strict-aliasing"
  515 +if test "$debug" = "no" ; then
  516 + CFLAGS="$CFLAGS -O2"
  517 +fi
508 518 CFLAGS="$CFLAGS -Wall -Wundef -Wendif-labels -Wwrite-strings -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls"
509 519 LDFLAGS="$LDFLAGS -g"
510 520 if test "$werror" = "yes" ; then
... ... @@ -589,6 +599,7 @@ echo &quot; --install=INSTALL use specified install [$install]&quot;
589 599 echo " --static enable static build [$static]"
590 600 echo " --enable-debug-tcg enable TCG debugging"
591 601 echo " --disable-debug-tcg disable TCG debugging (default)"
  602 +echo " --disable-debug enable common debug build options"
592 603 echo " --enable-sparse enable sparse checker"
593 604 echo " --disable-sparse disable sparse checker (default)"
594 605 echo " --disable-strip disable stripping binaries"
... ... @@ -1492,6 +1503,9 @@ esac
1492 1503 if test "$debug_tcg" = "yes" ; then
1493 1504 echo "#define DEBUG_TCG 1" >> $config_h
1494 1505 fi
  1506 +if test "$debug" = "yes" ; then
  1507 + echo "#define DEBUG_EXEC 1" >> $config_h
  1508 +fi
1495 1509 if test "$sparse" = "yes" ; then
1496 1510 echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_mak
1497 1511 echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_mak
... ...