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 | #! 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 | MOD_DEPTH = .. |
michael@0 | 8 | topsrcdir = @top_srcdir@ |
michael@0 | 9 | srcdir = @srcdir@ |
michael@0 | 10 | VPATH = @srcdir@ |
michael@0 | 11 | |
michael@0 | 12 | include $(MOD_DEPTH)/config/autoconf.mk |
michael@0 | 13 | |
michael@0 | 14 | # Indicate that this directory builds build tools. |
michael@0 | 15 | INTERNAL_TOOLS = 1 |
michael@0 | 16 | |
michael@0 | 17 | # For sanity's sake, we compile nsinstall without the wrapped system |
michael@0 | 18 | # headers, so that we can use it to set up the wrapped system headers. |
michael@0 | 19 | VISIBILITY_FLAGS = |
michael@0 | 20 | |
michael@0 | 21 | # autoconf.mk must be deleted last (from the top-level directory) |
michael@0 | 22 | # because it is included by every makefile. |
michael@0 | 23 | DIST_GARBAGE = nsprincl.mk nsprincl.sh nspr-config nspr.pc |
michael@0 | 24 | |
michael@0 | 25 | RELEASE_BINS = nspr-config |
michael@0 | 26 | |
michael@0 | 27 | include $(topsrcdir)/config/config.mk |
michael@0 | 28 | |
michael@0 | 29 | CSRCS = now.c |
michael@0 | 30 | |
michael@0 | 31 | # This version hasn't been ported for us; the one in mozilla/config has |
michael@0 | 32 | ifneq ($(OS_ARCH),OS2) |
michael@0 | 33 | CSRCS += nsinstall.c |
michael@0 | 34 | |
michael@0 | 35 | PLSRCS = nfspwd.pl |
michael@0 | 36 | endif |
michael@0 | 37 | |
michael@0 | 38 | ifeq (,$(CROSS_COMPILE)$(filter-out WINNT OS2,$(OS_ARCH))) |
michael@0 | 39 | PROG_SUFFIX = .exe |
michael@0 | 40 | else |
michael@0 | 41 | PROG_SUFFIX = |
michael@0 | 42 | endif |
michael@0 | 43 | |
michael@0 | 44 | # Temporary workaround to disable the generation of |
michael@0 | 45 | # library build time because now.c uses the 'long long' |
michael@0 | 46 | # data type that's not available on some platforms. |
michael@0 | 47 | ifeq (,$(filter-out QNX SCOOS UNIXWARE,$(OS_ARCH))) |
michael@0 | 48 | DEFINES += -DOMIT_LIB_BUILD_TIME |
michael@0 | 49 | endif |
michael@0 | 50 | |
michael@0 | 51 | ifeq ($(OS_ARCH), IRIX) |
michael@0 | 52 | ifeq ($(basename $(OS_RELEASE)),6) |
michael@0 | 53 | ifndef NS_USE_GCC |
michael@0 | 54 | ifeq ($(USE_N32),1) |
michael@0 | 55 | XLDOPTS += -n32 -Wl,-woff,85 |
michael@0 | 56 | else |
michael@0 | 57 | ifeq ($(USE_64),1) |
michael@0 | 58 | XLDOPTS += -64 |
michael@0 | 59 | else |
michael@0 | 60 | XLDOPTS += -32 |
michael@0 | 61 | endif |
michael@0 | 62 | endif |
michael@0 | 63 | endif |
michael@0 | 64 | endif |
michael@0 | 65 | endif |
michael@0 | 66 | |
michael@0 | 67 | ifeq ($(OS_ARCH), HP-UX) |
michael@0 | 68 | ifeq ($(USE_64),1) |
michael@0 | 69 | XLDOPTS += +DD64 |
michael@0 | 70 | endif |
michael@0 | 71 | endif |
michael@0 | 72 | |
michael@0 | 73 | ifeq ($(OS_ARCH), OS2) |
michael@0 | 74 | XCFLAGS = $(OS_CFLAGS) |
michael@0 | 75 | endif |
michael@0 | 76 | |
michael@0 | 77 | include $(topsrcdir)/config/rules.mk |
michael@0 | 78 | |
michael@0 | 79 | PROGS = $(OBJDIR)/now$(PROG_SUFFIX) |
michael@0 | 80 | |
michael@0 | 81 | ifeq (,$(CROSS_COMPILE)$(filter-out OS2 WINNT,$(OS_ARCH))) |
michael@0 | 82 | TARGETS = $(PROGS) |
michael@0 | 83 | else |
michael@0 | 84 | ifeq (,$(filter-out SYMBIAN WINCE,$(OS_ARCH))) |
michael@0 | 85 | TARGETS = $(PROGS) |
michael@0 | 86 | else |
michael@0 | 87 | PROGS += $(OBJDIR)/nsinstall$(PROG_SUFFIX) |
michael@0 | 88 | TARGETS = $(PROGS) $(PLSRCS:.pl=) |
michael@0 | 89 | endif |
michael@0 | 90 | endif |
michael@0 | 91 | |
michael@0 | 92 | OUTOPTION = -o # end of the line |
michael@0 | 93 | ifeq (,$(filter-out WINNT WIN95 WINCE,$(OS_TARGET))) |
michael@0 | 94 | ifndef NS_USE_GCC |
michael@0 | 95 | OUTOPTION = -Fe |
michael@0 | 96 | endif |
michael@0 | 97 | endif |
michael@0 | 98 | |
michael@0 | 99 | # Redefine MAKE_OBJDIR for just this directory |
michael@0 | 100 | define MAKE_OBJDIR |
michael@0 | 101 | if test ! -d $(@D); then rm -rf $(@D); mkdir $(@D); else true; fi |
michael@0 | 102 | endef |
michael@0 | 103 | |
michael@0 | 104 | export:: $(TARGETS) |
michael@0 | 105 | rm -f $(dist_bindir)/nspr-config |
michael@0 | 106 | |
michael@0 | 107 | ifdef WRAP_SYSTEM_INCLUDES |
michael@0 | 108 | export:: |
michael@0 | 109 | if test ! -d system_wrappers; then mkdir system_wrappers; fi |
michael@0 | 110 | $(PERL) $(srcdir)/make-system-wrappers.pl system_wrappers < $(srcdir)/system-headers |
michael@0 | 111 | $(INSTALL) system_wrappers $(dist_includedir) |
michael@0 | 112 | endif |
michael@0 | 113 | |
michael@0 | 114 | $(OBJDIR)/%$(PROG_SUFFIX): $(OBJDIR)/%.$(OBJ_SUFFIX) |
michael@0 | 115 | @$(MAKE_OBJDIR) |
michael@0 | 116 | $(CC) $(XCFLAGS) $< $(LDFLAGS) $(XLDOPTS) $(OUTOPTION)$@ |
michael@0 | 117 | |
michael@0 | 118 | install:: nspr.m4 |
michael@0 | 119 | $(NSINSTALL) -D $(DESTDIR)$(datadir)/aclocal |
michael@0 | 120 | $(NSINSTALL) -t -m 0644 $< $(DESTDIR)$(datadir)/aclocal |
michael@0 | 121 | |
michael@0 | 122 | install:: nspr.pc |
michael@0 | 123 | $(NSINSTALL) -D $(DESTDIR)$(libdir)/pkgconfig |
michael@0 | 124 | $(NSINSTALL) -t -m 0644 $< $(DESTDIR)$(libdir)/pkgconfig |