Add support for MOZ_PROFILE, MOZ_COVERAGE, & MOZ_MAPINFO for win32 gmake builds.

Set these variables in your MOZCONFIG file before running configure or on the make cmd line when building in individual dirs.
This commit is contained in:
seawood%netscape.com 2002-02-03 03:28:07 +00:00
parent 609d7f797d
commit 79fbcc79c7
3 changed files with 62 additions and 1 deletions

View File

@ -370,3 +370,9 @@ MOZ_PSM=@MOZ_PSM@
# for Qt build
MOC=@MOC@
# Win32 options
MOZ_PROFILE = @MOZ_PROFILE@
MOZ_COVERAGE = @MOZ_COVERAGE@
MOZ_MAPINFO = @MOZ_MAPINFO@
MOZ_BROWSE_INFO = @MOZ_BROWSE_INFO@

View File

@ -270,6 +270,55 @@ OS_CFLAGS += $(_DEBUG_CFLAGS)
OS_CXXFLAGS += $(_DEBUG_CFLAGS)
OS_LDFLAGS += $(_DEBUG_LDFLAGS)
# MOZ_PROFILE & MOZ_COVERAGE equivs for win32
ifeq ($(OS_ARCH),WINNT)
ifdef MOZ_DEBUG
ifneq (,$(MOZ_BROWSE_INFO)$(MOZ_BSCFILE))
OS_CFLAGS += /FR
OS_CXXFLAGS += /FR
endif
else
# if MOZ_DEBUG is not set and MOZ_PROFILE is set, then we generate
# an optimized build with debugging symbols. Useful for debugging
# compiler optimization bugs, as well as running with Quantify.
ifdef MOZ_PROFILE
_WIN32_PROFILE_FLAGS=-Zi -O1 -UDEBUG -DNDEBUG
OS_CFLAGS += $(_WIN32_PROFILE_FLAGS)
OS_CXXFLAGS += $(_WIN32_PROFILE_FLAGS)
OS_LDFLAGS += /DEBUG /DEBUGTYPE:CV /PDB:NONE /OPT:REF /OPT:nowin98
endif
# if MOZ_COVERAGE is set, we handle pdb files slightly differently
ifdef MOZ_COVERAGE
_WIN32_COVERAGE_FLAGS=-Zi -O1 -UDEBUG -DNDEBUG
OS_CFLAGS += $(_WIN32_COVERAGE_FLAGS)
OS_CXXFLAGS += $(_WIN32_COVERAGE_FLAGS)
OS_LDFLAGS += /DEBUG /DEBUGTYPE:CV /PDB:$(PDBFILE) /OPT:REF /OPT:nowin98
endif
# MOZ_COVERAGE
#
# Handle trace-malloc in optimized builds.
# No opt to give sane callstacks.
#
ifdef NS_TRACE_MALLOC
_WIN32_TM_FLAGS=-Zi -Od -UDEBUG -DNDEBUG
OS_CFLAGS += $(_WIN32_TM_FLAGS)
OS_CXXFLAGS += $(_WIN32_TM_FLAGS)
OS_LDFLAGS += /DEBUG /DEBUGTYPE:CV /PDB:NONE /OPT:REF /OPT:nowin98
endif
# MOZ_TRACE_MALLOC
# if MOZ_DEBUG is not set and MOZ_MAPINFO
ifdef MOZ_MAPINFO
OS_LDFLAGS += /MAP:$(MAPFILE) /MAPINFO:LINES
endif
#MOZ_MAPINFO
endif # MOZ_DEBUG
endif # WINNT
#
# -ffunction-sections is needed to reorder functions using a GNU ld
# script.

View File

@ -3540,7 +3540,7 @@ MOZ_ARG_ENABLE_BOOL(perf-metrics,
dnl ========================================================
dnl = Enable trace malloc
dnl ========================================================
NS_TRACE_MALLOC=
NS_TRACE_MALLOC=${MOZ_TRACE_MALLOC}
MOZ_ARG_ENABLE_BOOL(trace-malloc,
[ --enable-trace-malloc Enable malloc tracing],
NS_TRACE_MALLOC=1 )
@ -4290,6 +4290,12 @@ AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
AC_SUBST(MOZ_REORDER)
AC_SUBST(MOZ_TIMELINE)
dnl win32 options
AC_SUBST(MOZ_PROFILE)
AC_SUBST(MOZ_COVERAGE)
AC_SUBST(MOZ_MAPINFO)
AC_SUBST(MOZ_BROWSE_INFO)
dnl Disable profile at startup, hack for tinderbox.
if test "$MOZ_BYPASS_PROFILE_AT_STARTUP"; then
AC_DEFINE(MOZ_BYPASS_PROFILE_AT_STARTUP)