From 7d0170c8c71ff83a380770d4c164e2b949c08628 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Sun, 18 Jul 2010 11:41:48 +0200 Subject: [PATCH] * configure.bat: New option --enable-checking. * gmake.defs, nmake.defs (CHECKING_CFLAGS): New define. (CFLAGS): Include it. --- nt/ChangeLog | 6 ++++++ nt/configure.bat | 10 ++++++++++ nt/gmake.defs | 9 ++++++++- nt/nmake.defs | 9 ++++++++- 4 files changed, 32 insertions(+), 2 deletions(-) diff --git a/nt/ChangeLog b/nt/ChangeLog index 6e6ed00696d..0d10a8123d0 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog @@ -1,3 +1,9 @@ +2010-07-18 Juanma Barranquero + + * configure.bat: New option --enable-checking. + * gmake.defs, nmake.defs (CHECKING_CFLAGS): New define. + (CFLAGS): Include it. + 2010-07-12 Dan Nicolaescu * config.nt (volatile): Remove definition. diff --git a/nt/configure.bat b/nt/configure.bat index 7317416442b..705d4e92717 100755 --- a/nt/configure.bat +++ b/nt/configure.bat @@ -80,6 +80,7 @@ rem Default settings. set prefix= set nodebug=N set noopt=N +set enablechecking=N set profile=N set nocygwin=N set COMPILER= @@ -100,6 +101,7 @@ if "%1" == "--with-gcc" goto withgcc if "%1" == "--with-msvc" goto withmsvc if "%1" == "--no-debug" goto nodebug if "%1" == "--no-opt" goto noopt +if "%1" == "--enable-checking" goto enablechecking if "%1" == "--profile" goto profile if "%1" == "--no-cygwin" goto nocygwin if "%1" == "--cflags" goto usercflags @@ -119,6 +121,7 @@ echo. --with-gcc use GCC to compile Emacs echo. --with-msvc use MSVC to compile Emacs echo. --no-debug exclude debug info from executables echo. --no-opt disable optimization +echo. --enable-checking enable checks and assertions echo. --profile enable profiling echo. --no-cygwin use -mno-cygwin option with GCC echo. --cflags FLAG pass FLAG to compiler @@ -157,6 +160,11 @@ set noopt=Y shift goto again rem ---------------------------------------------------------------------- +:enablechecking +set enablechecking=Y +shift +goto again +rem ---------------------------------------------------------------------- :profile set profile=Y shift @@ -529,6 +537,7 @@ 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 (%enablechecking%) == (Y) echo ENABLECHECKS=1 >>config.settings if (%profile%) == (Y) echo PROFILE=1 >>config.settings if (%nocygwin%) == (Y) echo NOCYGWIN=1 >>config.settings if not "(%prefix%)" == "()" echo INSTALL_DIR=%prefix%>>config.settings @@ -660,6 +669,7 @@ set $foo$= set prefix= set nodebug= set noopt= +set enablechecking= set profile= set nocygwin= set COMPILER= diff --git a/nt/gmake.defs b/nt/gmake.defs index 7b2aba4151e..f552113e3d4 100644 --- a/nt/gmake.defs +++ b/nt/gmake.defs @@ -198,7 +198,14 @@ DEBUG_CFLAGS = -DEMACSDEBUG else DEBUG_CFLAGS = endif -CFLAGS = -I. $(ARCH_CFLAGS) $(DEBUG_CFLAGS) $(PROFILE_CFLAGS) $(USER_CFLAGS) $(LOCAL_FLAGS) + +ifdef ENABLECHECKS +CHECKING_CFLAGS = -DENABLE_CHECKING -DXASSERTS +else +CHECKING_CFLAGS = +endif + +CFLAGS = -I. $(ARCH_CFLAGS) $(DEBUG_CFLAGS) $(CHECKING_CFLAGS) $(PROFILE_CFLAGS) $(USER_CFLAGS) $(LOCAL_FLAGS) EMACS_EXTRA_C_FLAGS = -DUSE_CRT_DLL=1 ifdef PROFILE diff --git a/nt/nmake.defs b/nt/nmake.defs index c065ee60de1..412b0148bb5 100644 --- a/nt/nmake.defs +++ b/nt/nmake.defs @@ -136,8 +136,15 @@ DEBUG_CFLAGS = -DEMACSDEBUG !else DEBUG_CFLAGS = !endif + +!ifdef ENABLECHECKS +CHECKING_CFLAGS = -DENABLE_CHECKING -DXASSERTS +!else +CHECKING_CFLAGS = +!endif + CFLAGS = -I. $(ARCH_CFLAGS) \ - $(DEBUG_CFLAGS) $(USER_CFLAGS) $(LOCAL_FLAGS) + $(DEBUG_CFLAGS) $(CHECKING_CFLAGS) $(USER_CFLAGS) $(LOCAL_FLAGS) EMACS_EXTRA_C_FLAGS = SYS_LDFLAGS = -nologo -release -incremental:no -version:3.10 -swaprun:cd -swaprun:net setargv.obj