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,6 +157,7 @@ case &quot;$cpu&quot; in
157 esac 157 esac
158 gprof="no" 158 gprof="no"
159 debug_tcg="no" 159 debug_tcg="no"
  160 +debug="no"
160 sparse="no" 161 sparse="no"
161 strip_opt="yes" 162 strip_opt="yes"
162 bigendian="no" 163 bigendian="no"
@@ -411,6 +412,12 @@ for opt do @@ -411,6 +412,12 @@ for opt do
411 ;; 412 ;;
412 --disable-debug-tcg) debug_tcg="no" 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 --enable-sparse) sparse="yes" 421 --enable-sparse) sparse="yes"
415 ;; 422 ;;
416 --disable-sparse) sparse="no" 423 --disable-sparse) sparse="no"
@@ -504,7 +511,10 @@ for opt do @@ -504,7 +511,10 @@ for opt do
504 done 511 done
505 512
506 # default flags for all hosts 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 CFLAGS="$CFLAGS -Wall -Wundef -Wendif-labels -Wwrite-strings -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls" 518 CFLAGS="$CFLAGS -Wall -Wundef -Wendif-labels -Wwrite-strings -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls"
509 LDFLAGS="$LDFLAGS -g" 519 LDFLAGS="$LDFLAGS -g"
510 if test "$werror" = "yes" ; then 520 if test "$werror" = "yes" ; then
@@ -589,6 +599,7 @@ echo &quot; --install=INSTALL use specified install [$install]&quot; @@ -589,6 +599,7 @@ echo &quot; --install=INSTALL use specified install [$install]&quot;
589 echo " --static enable static build [$static]" 599 echo " --static enable static build [$static]"
590 echo " --enable-debug-tcg enable TCG debugging" 600 echo " --enable-debug-tcg enable TCG debugging"
591 echo " --disable-debug-tcg disable TCG debugging (default)" 601 echo " --disable-debug-tcg disable TCG debugging (default)"
  602 +echo " --disable-debug enable common debug build options"
592 echo " --enable-sparse enable sparse checker" 603 echo " --enable-sparse enable sparse checker"
593 echo " --disable-sparse disable sparse checker (default)" 604 echo " --disable-sparse disable sparse checker (default)"
594 echo " --disable-strip disable stripping binaries" 605 echo " --disable-strip disable stripping binaries"
@@ -1492,6 +1503,9 @@ esac @@ -1492,6 +1503,9 @@ esac
1492 if test "$debug_tcg" = "yes" ; then 1503 if test "$debug_tcg" = "yes" ; then
1493 echo "#define DEBUG_TCG 1" >> $config_h 1504 echo "#define DEBUG_TCG 1" >> $config_h
1494 fi 1505 fi
  1506 +if test "$debug" = "yes" ; then
  1507 + echo "#define DEBUG_EXEC 1" >> $config_h
  1508 +fi
1495 if test "$sparse" = "yes" ; then 1509 if test "$sparse" = "yes" ; then
1496 echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_mak 1510 echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_mak
1497 echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_mak 1511 echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_mak