Tue, 06 Jan 2015 21:39:09 +0100
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 | # This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
michael@0 | 4 | |
michael@0 | 5 | USE_RCS_MK := 1 |
michael@0 | 6 | include $(topsrcdir)/config/makefiles/rcs.mk |
michael@0 | 7 | |
michael@0 | 8 | PREF_JS_EXPORTS = $(srcdir)/b2g.js |
michael@0 | 9 | |
michael@0 | 10 | ifndef LIBXUL_SDK |
michael@0 | 11 | |
michael@0 | 12 | ifeq (gonk,$(MOZ_WIDGET_TOOLKIT)) |
michael@0 | 13 | LIBS += \ |
michael@0 | 14 | -lui \ |
michael@0 | 15 | -lEGL \ |
michael@0 | 16 | -lhardware_legacy \ |
michael@0 | 17 | -lhardware \ |
michael@0 | 18 | -lcutils \ |
michael@0 | 19 | $(DEPTH)/media/libpng/$(LIB_PREFIX)mozpng.$(LIB_SUFFIX) \ |
michael@0 | 20 | $(DEPTH)/widget/gonk/libdisplay/$(LIB_PREFIX)display.$(LIB_SUFFIX) \ |
michael@0 | 21 | $(MOZ_ZLIB_LIBS) \ |
michael@0 | 22 | $(NULL) |
michael@0 | 23 | ifeq ($(ANDROID_VERSION),$(findstring $(ANDROID_VERSION),17 18 19)) |
michael@0 | 24 | LIBS += \ |
michael@0 | 25 | -lgui \ |
michael@0 | 26 | -lsuspend \ |
michael@0 | 27 | $(NULL) |
michael@0 | 28 | endif |
michael@0 | 29 | endif |
michael@0 | 30 | |
michael@0 | 31 | LIBS += $(JEMALLOC_LIBS) |
michael@0 | 32 | |
michael@0 | 33 | LIBS += \ |
michael@0 | 34 | $(XPCOM_STANDALONE_GLUE_LDOPTS) \ |
michael@0 | 35 | $(NULL) |
michael@0 | 36 | |
michael@0 | 37 | ifeq (gonk,$(MOZ_WIDGET_TOOLKIT)) |
michael@0 | 38 | LIBS += \ |
michael@0 | 39 | -lbinder \ |
michael@0 | 40 | -lutils \ |
michael@0 | 41 | $(NULL) |
michael@0 | 42 | endif |
michael@0 | 43 | |
michael@0 | 44 | ifeq ($(OS_ARCH),WINNT) |
michael@0 | 45 | OS_LIBS += $(call EXPAND_LIBNAME,version) |
michael@0 | 46 | endif |
michael@0 | 47 | endif #LIBXUL_SDK |
michael@0 | 48 | |
michael@0 | 49 | UA_UPDATE_FILE = ua-update.json |
michael@0 | 50 | |
michael@0 | 51 | $(UA_UPDATE_FILE): % : %.in |
michael@0 | 52 | # strip out comment lines, which are not valid in JSON |
michael@0 | 53 | sed -e '/^ *\/\//d' -e '/^ *$$/d' $^ > $@ |
michael@0 | 54 | |
michael@0 | 55 | UA_UPDATE_FILES = $(UA_UPDATE_FILE) |
michael@0 | 56 | UA_UPDATE_DEST = $(FINAL_TARGET) |
michael@0 | 57 | INSTALL_TARGETS += UA_UPDATE |
michael@0 | 58 | |
michael@0 | 59 | # Make sure the standalone glue doesn't try to get libxpcom.so from b2g/app. |
michael@0 | 60 | NSDISTMODE = copy |
michael@0 | 61 | |
michael@0 | 62 | include $(topsrcdir)/config/rules.mk |
michael@0 | 63 | |
michael@0 | 64 | APP_ICON = b2g |
michael@0 | 65 | |
michael@0 | 66 | source_repo ?= $(call getSourceRepo,$(srcdir)/..) |
michael@0 | 67 | ifneq (,$(filter http%,$(source_repo))) |
michael@0 | 68 | DEFINES += -DMOZ_SOURCE_REPO='$(source_repo)' |
michael@0 | 69 | endif |
michael@0 | 70 | |
michael@0 | 71 | ifeq ($(OS_ARCH),WINNT) |
michael@0 | 72 | REDIT_PATH = $(LIBXUL_DIST)/bin |
michael@0 | 73 | endif |
michael@0 | 74 | |
michael@0 | 75 | APP_BINARY = $(MOZ_APP_NAME)$(BIN_SUFFIX) |
michael@0 | 76 | |
michael@0 | 77 | ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT)) |
michael@0 | 78 | |
michael@0 | 79 | APP_NAME = $(MOZ_APP_DISPLAYNAME) |
michael@0 | 80 | APP_VERSION = $(MOZ_APP_VERSION) |
michael@0 | 81 | |
michael@0 | 82 | ifdef MOZ_DEBUG |
michael@0 | 83 | APP_NAME := $(APP_NAME)Debug |
michael@0 | 84 | endif |
michael@0 | 85 | |
michael@0 | 86 | AB_CD = $(MOZ_UI_LOCALE) |
michael@0 | 87 | |
michael@0 | 88 | AB := $(firstword $(subst -, ,$(AB_CD))) |
michael@0 | 89 | |
michael@0 | 90 | clean clobber repackage:: |
michael@0 | 91 | rm -rf $(DIST)/$(APP_NAME).app |
michael@0 | 92 | |
michael@0 | 93 | ifdef LIBXUL_SDK |
michael@0 | 94 | APPFILES = Resources |
michael@0 | 95 | else |
michael@0 | 96 | APPFILES = MacOS |
michael@0 | 97 | endif |
michael@0 | 98 | |
michael@0 | 99 | libs-preqs = \ |
michael@0 | 100 | $(call mkdir_deps,$(DIST)/$(APP_NAME).app/Contents/MacOS) \ |
michael@0 | 101 | $(call mkdir_deps,$(DIST)/$(APP_NAME).app/Contents/Resources/$(AB).lproj) \ |
michael@0 | 102 | $(NULL) |
michael@0 | 103 | |
michael@0 | 104 | .PHONY: repackage |
michael@0 | 105 | tools repackage:: $(libs-preqs) |
michael@0 | 106 | rsync -a --exclude '*.in' $(srcdir)/macbuild/Contents $(DIST)/$(APP_NAME).app --exclude English.lproj |
michael@0 | 107 | rsync -a --exclude '*.in' $(srcdir)/macbuild/Contents/Resources/English.lproj/ $(DIST)/$(APP_NAME).app/Contents/Resources/$(AB).lproj |
michael@0 | 108 | sed -e 's/%MOZ_APP_VERSION%/$(MOZ_APP_VERSION)/' -e 's/%MOZ_APP_NAME%/$(MOZ_APP_NAME)/' -e 's/%APP_VERSION%/$(APP_VERSION)/' -e 's/%APP_NAME%/$(APP_NAME)/' -e 's/%APP_BINARY%/$(APP_BINARY)/' $(srcdir)/macbuild/Contents/Info.plist.in > $(DIST)/$(APP_NAME).app/Contents/Info.plist |
michael@0 | 109 | sed -e 's/%APP_VERSION%/$(APP_VERSION)/' -e 's/%APP_NAME%/$(APP_NAME)/' $(srcdir)/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in | iconv -f UTF-8 -t UTF-16 > $(DIST)/$(APP_NAME).app/Contents/Resources/$(AB).lproj/InfoPlist.strings |
michael@0 | 110 | rsync -a $(DIST)/bin/ $(DIST)/$(APP_NAME).app/Contents/$(APPFILES) |
michael@0 | 111 | $(RM) $(DIST)/$(APP_NAME).app/Contents/$(APPFILES)/mangle $(DIST)/$(APP_NAME).app/Contents/$(APPFILES)/shlibsign |
michael@0 | 112 | ifdef LIBXUL_SDK |
michael@0 | 113 | cp $(LIBXUL_DIST)/bin/xulrunner$(BIN_SUFFIX) $(DIST)/$(APP_NAME).app/Contents/MacOS/$(APP_BINARY) |
michael@0 | 114 | rsync -a --exclude nsinstall --copy-unsafe-links $(LIBXUL_DIST)/XUL.framework $(DIST)/$(APP_NAME).app/Contents/Frameworks |
michael@0 | 115 | else |
michael@0 | 116 | $(RM) $(DIST)/$(APP_NAME).app/Contents/MacOS/$(PROGRAM) |
michael@0 | 117 | rsync -aL $(PROGRAM) $(DIST)/$(APP_NAME).app/Contents/MacOS |
michael@0 | 118 | endif |
michael@0 | 119 | cp -RL $(srcdir)/b2g.icns $(DIST)/$(APP_NAME).app/Contents/Resources/$(MOZ_APP_NAME).icns |
michael@0 | 120 | printf APPLMOZB > $(DIST)/$(APP_NAME).app/Contents/PkgInfo |
michael@0 | 121 | |
michael@0 | 122 | else # MOZ_WIDGET_TOOLKIT != cocoa |
michael@0 | 123 | |
michael@0 | 124 | libs:: |
michael@0 | 125 | ifdef LIBXUL_SDK |
michael@0 | 126 | cp $(LIBXUL_DIST)/bin/xulrunner-stub$(BIN_SUFFIX) $(DIST)/bin/$(APP_BINARY) |
michael@0 | 127 | endif |
michael@0 | 128 | ifndef SKIP_COPY_XULRUNNER |
michael@0 | 129 | ifdef LIBXUL_SDK |
michael@0 | 130 | $(NSINSTALL) -D $(DIST)/bin/xulrunner |
michael@0 | 131 | (cd $(LIBXUL_SDK)/bin && tar $(TAR_CREATE_FLAGS) - .) | (cd $(DIST)/bin/xulrunner && tar -xf -) |
michael@0 | 132 | endif |
michael@0 | 133 | endif # SKIP_COPY_XULRUNNER |
michael@0 | 134 | |
michael@0 | 135 | $(NSINSTALL) -D $(DIST)/bin/chrome/icons/default |
michael@0 | 136 | |
michael@0 | 137 | # Copy the app icon for b2g-desktop |
michael@0 | 138 | ifeq ($(OS_ARCH),WINNT) |
michael@0 | 139 | cp $(srcdir)/$(APP_ICON).ico $(DIST)/bin/chrome/icons/default/$(APP_ICON).ico |
michael@0 | 140 | $(REDIT_PATH)/redit$(HOST_BIN_SUFFIX) $(DIST)/bin/$(APP_BINARY) $(srcdir)/$(APP_ICON).ico |
michael@0 | 141 | cp $(srcdir)/$(APP_ICON).ico $(DIST)/bin/chrome/icons/default/default.ico |
michael@0 | 142 | else ifneq (gonk,$(MOZ_WIDGET_TOOLKIT)) |
michael@0 | 143 | cp $(srcdir)/default.png $(DIST)/bin/chrome/icons/default/default.png |
michael@0 | 144 | endif |
michael@0 | 145 | |
michael@0 | 146 | endif |