summaryrefslogtreecommitdiff
path: root/win32/Makefile
diff options
context:
space:
mode:
authorSteve Hay <steve.m.hay@googlemail.com>2015-02-12 14:18:06 +0000
committerSteve Hay <steve.m.hay@googlemail.com>2015-02-12 18:23:08 +0000
commit31c916d28f0179fb2b0458e871263c606181b025 (patch)
treef1df7bb9b05a3c5b9c4af66b5ea8f7edbc7afcfc /win32/Makefile
parent8b523b63de9d345e1a95eb95ff44652618f2fd08 (diff)
downloadperl-31c916d28f0179fb2b0458e871263c606181b025.tar.gz
Add new DebugSymbols and DebugFull CFG options to Windows makefiles
This commit implements the suggestion from perl #123439 of adding a CFG=DebugSymbols option for a debug mode build without enabling perl's -DDEBUGGING code, and also adds a CFG=DebugFull option for a debug mode build which uses the debug version of the CRT and enables -D_DEBUG code (in perl and in the CRT) such as extra assertions and invalid parameter warnings. (Note that failed invalid parameter checks are harmless thanks to perl's invalid parameter handler in win32/win32.c. However, blindly ignoring them is not a good thing. Compiling with _DEBUG causes the handler to print warnings on STDERR about checks that have failed. Ideally these should be fixed, or silenced by some other means if they really are harmless--as was done for some such warnings by commit d52ca5864f.) I attempted to do something like the DebugFull part once before, but was held back by miniperl not using PerlIO, which resulted in a huge number of invalid parameter warnings: http://www.nntp.perl.org/group/perl.perl5.porters/2012/09/msg191674.html However, that issue was recently removed by commit 8c847e6678, which removed Windows makefile support for building without PerlIO, including making miniperl now use PerlIO. As noted in the makefiles comments, however, there are still a few cases of invalid parameter warnings, which is partly why I've added the new DebugFull option, rather than altering the existing Debug option.
Diffstat (limited to 'win32/Makefile')
-rw-r--r--win32/Makefile27
1 files changed, 25 insertions, 2 deletions
diff --git a/win32/Makefile b/win32/Makefile
index bc13bd280c..2086a3fc4b 100644
--- a/win32/Makefile
+++ b/win32/Makefile
@@ -138,10 +138,22 @@ CCTYPE = MSVC60
#USE_CPLUSPLUS = define
#
-# uncomment next line if you want debug version of perl (big,slow)
+# uncomment next line if you want debug version of perl (big/slow)
# If not enabled, we automatically try to use maximum optimization
# with all compilers that are known to have a working optimizer.
#
+# You can also set CFG = DebugSymbols for a slightly smaller/faster
+# debug build without the special debugging code in perl which is
+# enabled via -DDEBUGGING;
+#
+# or you can set CFG = DebugFull for an even fuller (bigger/slower)
+# debug build using the debug version of the CRT, and enabling VC++
+# debug features such as extra assertions and invalid parameter warnings
+# in perl and CRT code via -D_DEBUG. (Note that the invalid parameter
+# handler does get triggered from time to time in this configuration,
+# which causes warnings to be printed on STDERR, which in turn causes a
+# few tests to fail.)
+#
#CFG = Debug
#
@@ -432,12 +444,21 @@ LOCDEFS = -DPERLDLL -DPERL_CORE
SUBSYS = console
CXX_FLAG = -TP -EHsc
-LIBC = msvcrt.lib
+LIBC = msvcrt.lib
!IF "$(CFG)" == "Debug"
OPTIMIZE = -Od -MD -Zi -DDEBUGGING
LINK_DBG = -debug
!ELSE
+!IF "$(CFG)" == "DebugSymbols"
+OPTIMIZE = -Od -MD -Zi
+LINK_DBG = -debug
+!ELSE
+!IF "$(CFG)" == "DebugFull"
+LIBC = msvcrtd.lib
+OPTIMIZE = -Od -MDd -Zi -D_DEBUG -DDEBUGGING
+LINK_DBG = -debug
+!ELSE
# -O1 yields smaller code, which turns out to be faster than -O2 on x86 and x64
OPTIMIZE = -O1 -MD -Zi -DNDEBUG
# we enable debug symbols in release builds also
@@ -455,6 +476,8 @@ LINK_DBG = $(LINK_DBG) -ltcg
LIB_FLAGS = -ltcg
! ENDIF
!ENDIF
+!ENDIF
+!ENDIF
!IF "$(WIN64)" == "define"
DEFINES = $(DEFINES) -DWIN64 -DCONSERVATIVE