diff options
| author | Paul Eggert | 2012-08-25 21:37:40 -0700 |
|---|---|---|
| committer | Paul Eggert | 2012-08-25 21:37:40 -0700 |
| commit | 6e8aca60a8a3efaf397eab15d8b0cff3720e83b1 (patch) | |
| tree | a7ebdd943e1ab521b7caf387af0db3bfa9ef705d | |
| parent | 2db8bdfcc89dafc7b273bcc9b5eba2233d1148b6 (diff) | |
| download | emacs-6e8aca60a8a3efaf397eab15d8b0cff3720e83b1.tar.gz emacs-6e8aca60a8a3efaf397eab15d8b0cff3720e83b1.zip | |
* configure.ac (CFLAGS): Prefer -g3 to -g if -g3 works
and if the user has not specified CFLAGS. -g3 simplifies
debugging, since it makes macros visible to the debugger.
| -rw-r--r-- | ChangeLog | 6 | ||||
| -rw-r--r-- | configure.ac | 28 |
2 files changed, 34 insertions, 0 deletions
| @@ -1,3 +1,9 @@ | |||
| 1 | 2012-08-26 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | * configure.ac (CFLAGS): Prefer -g3 to -g if -g3 works | ||
| 4 | and if the user has not specified CFLAGS. -g3 simplifies | ||
| 5 | debugging, since it makes macros visible to the debugger. | ||
| 6 | |||
| 1 | 2012-08-25 Juanma Barranquero <lekktu@gmail.com> | 7 | 2012-08-25 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 8 | ||
| 3 | * lib/makefile.w32-in ($(BLD)/execinfo.$(O)): Update dependencies. | 9 | * lib/makefile.w32-in ($(BLD)/execinfo.$(O)): Update dependencies. |
diff --git a/configure.ac b/configure.ac index b10cb24bab6..71ec98390aa 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -577,6 +577,34 @@ fi | |||
| 577 | # Initialize gnulib right after choosing the compiler. | 577 | # Initialize gnulib right after choosing the compiler. |
| 578 | gl_EARLY | 578 | gl_EARLY |
| 579 | 579 | ||
| 580 | # It's helpful to have C macros available to GDB, so prefer -g3 to -g | ||
| 581 | # if -g3 works and the user does not specify CFLAGS. | ||
| 582 | # This test must follow gl_EARLY; otherwise AC_LINK_IFELSE complains. | ||
| 583 | if test "$ac_test_CFLAGS" != set; then | ||
| 584 | case $CFLAGS in | ||
| 585 | '-g') | ||
| 586 | emacs_g3_CFLAGS='-g3';; | ||
| 587 | '-g -O2') | ||
| 588 | emacs_g3_CFLAGS='-g3 -O2';; | ||
| 589 | *) | ||
| 590 | emacs_g3_CFLAGS='';; | ||
| 591 | esac | ||
| 592 | if test -n "$emacs_g3_CFLAGS"; then | ||
| 593 | emacs_save_CFLAGS=$CFLAGS | ||
| 594 | CFLAGS=$emacs_g3_CFLAGS | ||
| 595 | AC_CACHE_CHECK([whether $CC accepts $emacs_g3_CFLAGS], | ||
| 596 | [emacs_cv_prog_cc_g3], | ||
| 597 | [AC_LINK_IFELSE([AC_LANG_PROGRAM()], | ||
| 598 | [emacs_cv_prog_cc_g3=yes], | ||
| 599 | [emacs_cv_prog_cc_g3=no])]) | ||
| 600 | if test $emacs_cv_prog_cc_g3 = yes; then | ||
| 601 | CFLAGS=$emacs_g3_CFLAGS | ||
| 602 | else | ||
| 603 | CFLAGS=$emacs_save_CFLAGS | ||
| 604 | fi | ||
| 605 | fi | ||
| 606 | fi | ||
| 607 | |||
| 580 | AC_ARG_ENABLE([gcc-warnings], | 608 | AC_ARG_ENABLE([gcc-warnings], |
| 581 | [AS_HELP_STRING([--enable-gcc-warnings], | 609 | [AS_HELP_STRING([--enable-gcc-warnings], |
| 582 | [turn on lots of GCC warnings. This is intended for | 610 | [turn on lots of GCC warnings. This is intended for |