changeset 96211:fde585d63804

* gmake.defs (DEBUG_FLAG, DEBUG_LINK) [!NODEBUG]: Don't hardcode -gstabs+, use DEBUG_INFO. * configure.bat (gccdebug): Check for DWARF-2 support in GCC. Default to stabs if the compiler does not support DWARF-2. (genmakefiles): Write new variable DEBUG_INFO to config.settings.
author Juanma Barranquero <lekktu@gmail.com>
date Mon, 23 Jun 2008 21:34:24 +0000
parents 008bacb7a779
children f2e3f3882eda
files nt/ChangeLog nt/configure.bat nt/gmake.defs
diffstat 3 files changed, 29 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/nt/ChangeLog	Mon Jun 23 21:08:22 2008 +0000
+++ b/nt/ChangeLog	Mon Jun 23 21:34:24 2008 +0000
@@ -1,3 +1,13 @@
+2008-06-23  Juanma Barranquero  <lekktu@gmail.com>
+	    Eli Zaretskii  <eliz@gnu.org>
+
+	* gmake.defs (DEBUG_FLAG, DEBUG_LINK) [!NODEBUG]:
+	Don't hardcode -gstabs+, use DEBUG_INFO.
+
+	* configure.bat (gccdebug): Check for DWARF-2 support in GCC.
+	Default to stabs if the compiler does not support DWARF-2.
+	(genmakefiles): Write new variable DEBUG_INFO to config.settings.
+
 2008-05-14  Jason Rumney  <jasonr@gnu.org>
 
 	* configure.bat: Remove code dealing with --disable-font-backend.
--- a/nt/configure.bat	Mon Jun 23 21:08:22 2008 +0000
+++ b/nt/configure.bat	Mon Jun 23 21:34:24 2008 +0000
@@ -319,11 +319,26 @@
 type junk.c >>config.log
 set mf=-mcpu=i686
 rm -f junk.c junk.o
-goto compilercheckdone
+goto gccdebug
 :gccMtuneOk
 echo GCC supports -mtune=pentium4 >>config.log
 set mf=-mtune=pentium4
 rm -f junk.c junk.o
+:gccdebug
+rem Check for DWARF-2 debug info support, else default to stabs
+echo main(){} >junk.c
+echo gcc -c -gdwarf-2 -g3 junk.c >>config.log
+gcc -c -gdwarf-2 -g3 junk.c >>config.log 2>&1
+if not errorlevel 1 goto gccdwarf
+echo The failed program was: >>config.log
+type junk.c >>config.log
+set dbginfo=-gstabs+
+rm -f junk.c junk.o
+goto compilercheckdone
+:gccdwarf
+echo GCC supports DWARF-2 >>config.log
+set dbginfo=-gdwarf-2 -g3
+rm -f junk.c junk.o
 goto compilercheckdone
 
 :clOk
@@ -474,6 +489,7 @@
 echo # Start of settings from configure.bat >config.settings
 echo COMPILER=%COMPILER%>>config.settings
 if not "(%mf%)" == "()" echo MCPU_FLAG=%mf%>>config.settings
+if not "(%dbginfo%)" == "()" echo DEBUG_INFO=%dbginfo%>>config.settings
 if (%nodebug%) == (Y) echo NODEBUG=1 >>config.settings
 if (%noopt%) == (Y) echo NOOPT=1 >>config.settings
 if (%nocygwin%) == (Y) echo NOCYGWIN=1 >>config.settings
--- a/nt/gmake.defs	Mon Jun 23 21:08:22 2008 +0000
+++ b/nt/gmake.defs	Mon Jun 23 21:34:24 2008 +0000
@@ -262,8 +262,8 @@
 DEBUG_FLAG =
 DEBUG_LINK =
 else
-DEBUG_FLAG = -gstabs+ -g3
-DEBUG_LINK = -gstabs+ -g3
+DEBUG_FLAG = $(DEBUG_INFO)
+DEBUG_LINK = $(DEBUG_INFO)
 endif
 
 ifdef NOCYGWIN