summaryrefslogtreecommitdiff
path: root/nt/configure.bat
diff options
context:
space:
mode:
authorJuanma Barranquero <lekktu@gmail.com>2008-06-23 21:34:24 +0000
committerJuanma Barranquero <lekktu@gmail.com>2008-06-23 21:34:24 +0000
commit540c2a333961e8758250e185e59ce59391b39b76 (patch)
treedb11c30b72eacd4e4d7ec1b7e4424512d0c08a13 /nt/configure.bat
parent400aaed216cfb09e5876dbe551775aa366c53ee8 (diff)
downloademacs-540c2a333961e8758250e185e59ce59391b39b76.tar.gz
* 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.
Diffstat (limited to 'nt/configure.bat')
-rwxr-xr-xnt/configure.bat18
1 files changed, 17 insertions, 1 deletions
diff --git a/nt/configure.bat b/nt/configure.bat
index 957ed14b949..3dd9a7fcc24 100755
--- a/nt/configure.bat
+++ b/nt/configure.bat
@@ -319,11 +319,26 @@ echo The failed program was: >>config.log
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 @@ rem
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