nsprpub/config/config.mk

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

michael@0 1 #! gmake
michael@0 2 #
michael@0 3 # This Source Code Form is subject to the terms of the Mozilla Public
michael@0 4 # License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
michael@0 6
michael@0 7 # Configuration information for building in the NSPR source module
michael@0 8
michael@0 9 # Define an include-at-most-once-flag
michael@0 10 NSPR_CONFIG_MK = 1
michael@0 11
michael@0 12 #
michael@0 13 # The variable definitions in this file are inputs to NSPR's
michael@0 14 # build system. This file, if present, is included at the
michael@0 15 # beginning of config.mk.
michael@0 16 #
michael@0 17 # For example:
michael@0 18 #
michael@0 19 # MOZ_OPTIMIZE=1
michael@0 20 # USE_PTHREADS=1
michael@0 21 # NS_USE_GCC=
michael@0 22 #
michael@0 23 ifndef topsrcdir
michael@0 24 topsrcdir=$(MOD_DEPTH)
michael@0 25 endif
michael@0 26
michael@0 27 ifndef srcdir
michael@0 28 srcdir=.
michael@0 29 endif
michael@0 30
michael@0 31 NFSPWD = $(MOD_DEPTH)/config/nfspwd
michael@0 32
michael@0 33 CFLAGS = $(VISIBILITY_FLAGS) $(CC_ONLY_FLAGS) $(OPTIMIZER)\
michael@0 34 $(OS_CFLAGS) $(XP_DEFINE) $(DEFINES) $(INCLUDES) $(XCFLAGS)
michael@0 35 CCCFLAGS = $(VISIBILITY_FLAGS) $(CCC_ONLY_FLAGS) $(OPTIMIZER)\
michael@0 36 $(OS_CFLAGS) $(XP_DEFINE) $(DEFINES) $(INCLUDES) $(XCFLAGS)
michael@0 37 # For purify
michael@0 38 NOMD_CFLAGS = $(CC_ONLY_FLAGS) $(OPTIMIZER) $(NOMD_OS_CFLAGS)\
michael@0 39 $(XP_DEFINE) $(DEFINES) $(INCLUDES) $(XCFLAGS)
michael@0 40 NOMD_CCFLAGS = $(CCC_ONLY_FLAGS) $(OPTIMIZER) $(NOMD_OS_CFLAGS)\
michael@0 41 $(XP_DEFINE) $(DEFINES) $(INCLUDES) $(XCFLAGS)
michael@0 42
michael@0 43 LDFLAGS = $(OS_LDFLAGS)
michael@0 44
michael@0 45 # Enable profile-guided optimization
michael@0 46 ifndef NO_PROFILE_GUIDED_OPTIMIZE
michael@0 47 ifdef MOZ_PROFILE_GENERATE
michael@0 48 CFLAGS += $(PROFILE_GEN_CFLAGS)
michael@0 49 LDFLAGS += $(PROFILE_GEN_LDFLAGS)
michael@0 50 DLLFLAGS += $(PROFILE_GEN_LDFLAGS)
michael@0 51 ifeq (WINNT,$(OS_ARCH))
michael@0 52 AR_FLAGS += -LTCG
michael@0 53 endif
michael@0 54 endif # MOZ_PROFILE_GENERATE
michael@0 55
michael@0 56 ifdef MOZ_PROFILE_USE
michael@0 57 CFLAGS += $(PROFILE_USE_CFLAGS)
michael@0 58 LDFLAGS += $(PROFILE_USE_LDFLAGS)
michael@0 59 DLLFLAGS += $(PROFILE_USE_LDFLAGS)
michael@0 60 ifeq (WINNT,$(OS_ARCH))
michael@0 61 AR_FLAGS += -LTCG
michael@0 62 endif
michael@0 63 endif # MOZ_PROFILE_USE
michael@0 64 endif # NO_PROFILE_GUIDED_OPTIMIZE
michael@0 65
michael@0 66 define MAKE_OBJDIR
michael@0 67 if test ! -d $(@D); then rm -rf $(@D); $(NSINSTALL) -D $(@D); fi
michael@0 68 endef
michael@0 69
michael@0 70 LINK_DLL = $(LD) $(OS_DLLFLAGS) $(DLLFLAGS)
michael@0 71
michael@0 72 ifeq ($(OS_ARCH),Darwin)
michael@0 73 PWD := $(shell pwd)
michael@0 74 endif
michael@0 75
michael@0 76 ifeq (,$(CROSS_COMPILE)$(filter-out WINNT OS2, $(OS_ARCH)))
michael@0 77 INSTALL = $(NSINSTALL)
michael@0 78 else
michael@0 79 ifeq ($(NSDISTMODE),copy)
michael@0 80 # copy files, but preserve source mtime
michael@0 81 INSTALL = $(NSINSTALL) -t
michael@0 82 else
michael@0 83 ifeq ($(NSDISTMODE),absolute_symlink)
michael@0 84 # install using absolute symbolic links
michael@0 85 ifeq ($(OS_ARCH),Darwin)
michael@0 86 INSTALL = $(NSINSTALL) -L $(PWD)
michael@0 87 else
michael@0 88 INSTALL = $(NSINSTALL) -L `$(NFSPWD)`
michael@0 89 endif
michael@0 90 else
michael@0 91 # install using relative symbolic links
michael@0 92 INSTALL = $(NSINSTALL) -R
michael@0 93 endif
michael@0 94 endif
michael@0 95 endif # (WINNT || OS2) && !CROSS_COMPILE
michael@0 96
michael@0 97 DEPENDENCIES = $(OBJDIR)/.md
michael@0 98
michael@0 99 ifdef BUILD_DEBUG_GC
michael@0 100 DEFINES += -DDEBUG_GC
michael@0 101 endif
michael@0 102
michael@0 103 GARBAGE += $(DEPENDENCIES) core $(wildcard core.[0-9]*)
michael@0 104
michael@0 105 DIST_GARBAGE += Makefile
michael@0 106
michael@0 107 ####################################################################
michael@0 108 #
michael@0 109 # The NSPR-specific configuration
michael@0 110 #
michael@0 111 ####################################################################
michael@0 112
michael@0 113 DEFINES += -DFORCE_PR_LOG
michael@0 114
michael@0 115 ifeq ($(_PR_NO_CLOCK_TIMER),1)
michael@0 116 DEFINES += -D_PR_NO_CLOCK_TIMER
michael@0 117 endif
michael@0 118
michael@0 119 ifeq ($(USE_PTHREADS), 1)
michael@0 120 DEFINES += -D_PR_PTHREADS -UHAVE_CVAR_BUILT_ON_SEM
michael@0 121 endif
michael@0 122
michael@0 123 ifeq ($(PTHREADS_USER), 1)
michael@0 124 DEFINES += -DPTHREADS_USER -UHAVE_CVAR_BUILT_ON_SEM
michael@0 125 endif
michael@0 126
michael@0 127 ifeq ($(USE_IPV6),1)
michael@0 128 DEFINES += -D_PR_INET6
michael@0 129 endif
michael@0 130
michael@0 131 ifeq ($(MOZ_UNICODE),1)
michael@0 132 DEFINES += -DMOZ_UNICODE
michael@0 133 endif
michael@0 134
michael@0 135 ####################################################################
michael@0 136 #
michael@0 137 # Configuration for the release process
michael@0 138 #
michael@0 139 ####################################################################
michael@0 140
michael@0 141 MDIST = /m/dist
michael@0 142 ifeq ($(OS_ARCH),WINNT)
michael@0 143 MDIST = //helium/dist
michael@0 144 MDIST_DOS = $(subst /,\\,$(MDIST))
michael@0 145 endif
michael@0 146
michael@0 147 # RELEASE_DIR is ns/dist/<module name>
michael@0 148
michael@0 149 RELEASE_DIR = $(MOD_DEPTH)/dist/release/$(MOD_NAME)
michael@0 150
michael@0 151 RELEASE_INCLUDE_DIR = $(RELEASE_DIR)/$(BUILD_NUMBER)/$(OBJDIR_NAME)/include
michael@0 152 RELEASE_BIN_DIR = $(RELEASE_DIR)/$(BUILD_NUMBER)/$(OBJDIR_NAME)/bin
michael@0 153 RELEASE_LIB_DIR = $(RELEASE_DIR)/$(BUILD_NUMBER)/$(OBJDIR_NAME)/lib
michael@0 154
michael@0 155 # autoconf.mk sets OBJ_SUFFIX to an error to avoid use before including
michael@0 156 # this file
michael@0 157 OBJ_SUFFIX := $(_OBJ_SUFFIX)
michael@0 158
michael@0 159 # PGO builds with GCC build objects with instrumentation in a first pass,
michael@0 160 # then objects optimized, without instrumentation, in a second pass. If
michael@0 161 # we overwrite the ojects from the first pass with those from the second,
michael@0 162 # we end up not getting instrumentation data for better optimization on
michael@0 163 # incremental builds. As a consequence, we use a different object suffix
michael@0 164 # for the first pass.
michael@0 165 ifdef MOZ_PROFILE_GENERATE
michael@0 166 ifdef NS_USE_GCC
michael@0 167 OBJ_SUFFIX := i_o
michael@0 168 endif
michael@0 169 endif

mercurial