+2008-07-23 Jason Rumney <jasonr@gnu.org>
+
+ * configure.bat: New option --profile.
+ * gmake.defs: Set cflags and ldflags for profiling when specified.
+
2008-07-23 Dan Nicolaescu <dann@ics.uci.edu>
* config.nt (C_SWITCH_SITE, LD_SWITCH_SITE): Do not undefine.
set prefix=\r
set nodebug=N\r
set noopt=N\r
+set profile=N\r
set nocygwin=N\r
set COMPILER=\r
set usercflags=\r
if "%1" == "--with-msvc" goto withmsvc\r
if "%1" == "--no-debug" goto nodebug\r
if "%1" == "--no-opt" goto noopt\r
+if "%1" == "--profile" goto profile\r
if "%1" == "--no-cygwin" goto nocygwin\r
if "%1" == "--cflags" goto usercflags\r
if "%1" == "--ldflags" goto userldflags\r
echo. --with-msvc use MSVC to compile Emacs\r
echo. --no-debug exclude debug info from executables\r
echo. --no-opt disable optimization\r
+echo. --profile enable profiling\r
echo. --no-cygwin use -mno-cygwin option with GCC\r
echo. --cflags FLAG pass FLAG to compiler\r
echo. --ldflags FLAG pass FLAG to compiler when linking\r
shift\r
goto again\r
rem ----------------------------------------------------------------------\r
+:profile\r
+set profile=Y\r
+shift\r
+goto again\r
+rem ----------------------------------------------------------------------\r
:nocygwin\r
set nocygwin=Y\r
shift\r
if not "(%dbginfo%)" == "()" echo DEBUG_INFO=%dbginfo%>>config.settings\r
if (%nodebug%) == (Y) echo NODEBUG=1 >>config.settings\r
if (%noopt%) == (Y) echo NOOPT=1 >>config.settings\r
+if (%profile%) == (Y) echo PROFILE=1 >>config.settings\r
if (%nocygwin%) == (Y) echo NOCYGWIN=1 >>config.settings\r
if not "(%prefix%)" == "()" echo INSTALL_DIR=%prefix%>>config.settings\r
rem We go thru docflags because usercflags could be "-DFOO=bar" -something\r
set prefix=\r
set nodebug=\r
set noopt=\r
+set profile=\r
set nocygwin=\r
set COMPILER=\r
set MAKECMD=\r
else
DEBUG_CFLAGS =
endif
-CFLAGS = -I. $(ARCH_CFLAGS) $(DEBUG_CFLAGS) $(USER_CFLAGS) $(LOCAL_FLAGS)
+CFLAGS = -I. $(ARCH_CFLAGS) $(DEBUG_CFLAGS) $(PROFILE_CFLAGS) $(USER_CFLAGS) $(LOCAL_FLAGS)
EMACS_EXTRA_C_FLAGS = -DUSE_CRT_DLL=1
+ifdef PROFILE
+PROFILE_CFLAGS = -pg
+PROFILE_LDFLAGS = -pg
+else
+PROFILE_CFLAGS =
+PROFILE_LDFLAGS =
+endif
+
+
# see comments in allocate_heap in w32heap.c before changing any of the
# -stack, -heap, or -image-base settings.
TEMACS_EXTRA_LINK = -Wl,-stack,0x00800000 -Wl,-heap,0x00100000 -Wl,-image-base,0x01000000 $(SUBSYSTEM_CONSOLE) -Wl,-entry,__start -Wl,-Map,$(BLD)/temacs.map
ERROR Unknown architecture type "$(ARCH)".
endif
-LINK_FLAGS = $(ARCH_LDFLAGS) $(DEBUG_LINK) $(NOCYGWIN) $(USER_LDFLAGS)
+LINK_FLAGS = $(ARCH_LDFLAGS) $(DEBUG_LINK) $(PROFILE_LDFLAGS) $(NOCYGWIN) $(USER_LDFLAGS)
export XMFLAGS