Bug 973403 - Move the LOCAL_INCLUDES in memory to moz.build; r=glandium
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 18 Feb 2014 01:05:51 -0500
changeset 169592 1a4c5d3a814c2244895985514014260336436ef3
parent 169591 e72376b70bed14e5bfaff34e7758631ea2384262
child 169593 658a158fa8688938f0ad3dcbc7de0c6b43de22d6
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersglandium
bugs973403
milestone30.0a1
Bug 973403 - Move the LOCAL_INCLUDES in memory to moz.build; r=glandium
memory/build/Makefile.in
memory/build/moz.build
memory/jemalloc/Makefile.in
memory/jemalloc/moz.build
memory/mozalloc/Makefile.in
memory/mozalloc/moz.build
memory/replace/jemalloc/Makefile.in
memory/replace/jemalloc/moz.build
--- a/memory/build/Makefile.in
+++ b/memory/build/Makefile.in
@@ -4,26 +4,14 @@
 
 STLFLAGS =
 ifdef MOZ_GLUE_PROGRAM_LDFLAGS
 SDK_LIBRARY = $(REAL_LIBRARY)
 DIST_INSTALL = 1
 endif
 
 ifdef MOZ_JEMALLOC3
-LOCAL_INCLUDES += -I../jemalloc/src/include
-ifdef _MSC_VER
-LOCAL_INCLUDES += -I$(topsrcdir)/memory/jemalloc/src/include/msvc_compat
-endif
-
 ifndef MOZ_NATIVE_JEMALLOC
 SHARED_LIBRARY_LIBS += $(call EXPAND_LIBNAME_PATH,jemalloc,$(DEPTH)/memory/jemalloc)
 endif
 else
 SHARED_LIBRARY_LIBS += $(call EXPAND_LIBNAME_PATH,jemalloc,$(DEPTH)/memory/mozjemalloc)
 endif
-
-ifdef MOZ_REPLACE_MALLOC
-# The zone allocator for OSX needs some jemalloc internal functions
-ifeq (Darwin,$(OS_TARGET))
-LOCAL_INCLUDES += -I$(topsrcdir)/memory/jemalloc/src/include
-endif
-endif
--- a/memory/build/moz.build
+++ b/memory/build/moz.build
@@ -22,20 +22,27 @@ SOURCES += [
     'jemalloc_config.c',
     'mozmemory_wrap.c',
 ]
 
 if CONFIG['MOZ_JEMALLOC3']:
     SOURCES += [
         'mozjemalloc_compat.c',
     ]
+    GENERATED_INCLUDES += ['../jemalloc/src/include']
+    if CONFIG['_MSC_VER']:
+        LOCAL_INCLUDES += ['/memory/jemalloc/src/include/msvc_compat']
 
 if CONFIG['MOZ_REPLACE_MALLOC']:
     SOURCES += [
         'replace_malloc.c',
     ]
 
 LIBRARY_NAME = 'memory'
 
 # Keep jemalloc separated when mozglue is statically linked
 if CONFIG['MOZ_MEMORY'] and (CONFIG['OS_TARGET'] in ('WINNT', 'Darwin', 'Android') or
                              CONFIG['MOZ_NATIVE_JEMALLOC']):
     FINAL_LIBRARY = 'mozglue'
+
+if CONFIG['MOZ_REPLACE_MALLOC'] and CONFIG['OS_TARGET'] == 'Darwin':
+    # The zone allocator for OSX needs some jemalloc internal functions
+    LOCAL_INCLUDES += ['/memory/jemalloc/src/include']
--- a/memory/jemalloc/Makefile.in
+++ b/memory/jemalloc/Makefile.in
@@ -4,20 +4,11 @@
 
 ifdef MOZ_GLUE_PROGRAM_LDFLAGS
 SDK_LIBRARY = $(REAL_LIBRARY)
 DIST_INSTALL = 1
 endif
 
 include $(topsrcdir)/config/rules.mk
 
-LOCAL_INCLUDES += \
-  -I$(srcdir)/src/include \
-  -Isrc/include \
-  $(NULL)
-
-ifdef _MSC_VER
-LOCAL_INCLUDES += -I$(srcdir)/src/include/msvc_compat
-endif
-
 ifdef GNU_CC
 CFLAGS += -std=gnu99
 endif
--- a/memory/jemalloc/moz.build
+++ b/memory/jemalloc/moz.build
@@ -37,14 +37,18 @@ if CONFIG['OS_TARGET'] == 'Darwin' and n
     ]
 
 LIBRARY_NAME = 'jemalloc'
 
 FORCE_STATIC_LIB = True
 
 if CONFIG['_MSC_VER']:
     DEFINES['DLLEXPORT'] = True
+    LOCAL_INCLUDES += ['src/include/msvc_compat']
 
 if CONFIG['OS_TARGET'] == 'Linux':
     # For mremap
     DEFINES['_GNU_SOURCE'] = True
 
 DEFINES['abort'] = 'moz_abort'
+
+GENERATED_INCLUDES += ['src/include']
+LOCAL_INCLUDES += ['src/include']
--- a/memory/mozalloc/Makefile.in
+++ b/memory/mozalloc/Makefile.in
@@ -10,10 +10,8 @@ endif
 
 DIST_INSTALL 	= 1
 
 ifneq (,$(filter WINNT,$(OS_ARCH)))
 SDK_LIBRARY = $(IMPORT_LIBRARY)
 else
 SDK_LIBRARY = $(SHARED_LIBRARY)
 endif
-
-LOCAL_INCLUDES += -I$(DEPTH)/xpcom
--- a/memory/mozalloc/moz.build
+++ b/memory/mozalloc/moz.build
@@ -62,8 +62,10 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk
     FORCE_STATIC_LIB = True
 else:
     FORCE_SHARED_LIB = True
 
 # The strndup declaration in string.h is in an ifdef __USE_GNU section
 DEFINES['_GNU_SOURCE'] = True
 
 TEST_TOOL_DIRS += ['tests']
+
+GENERATED_INCLUDES += ['/xpcom']
--- a/memory/replace/jemalloc/Makefile.in
+++ b/memory/replace/jemalloc/Makefile.in
@@ -1,12 +1,8 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 SHARED_LIBRARY_LIBS = $(call EXPAND_LIBNAME_PATH,jemalloc,$(DEPTH)/memory/jemalloc)
-LOCAL_INCLUDES += -I../../jemalloc/src/include
-ifdef _MSC_VER
-LOCAL_INCLUDES += -I$(topsrcdir)/memory/jemalloc/src/include/msvc_compat
-endif
 
 MOZ_GLUE_LDFLAGS = # Don't link against mozglue
 WRAP_LDFLAGS = # Never wrap malloc function calls with -Wl,--wrap
--- a/memory/replace/jemalloc/moz.build
+++ b/memory/replace/jemalloc/moz.build
@@ -19,8 +19,12 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'andr
     ]
 
 LIBRARY_NAME = 'replace_jemalloc'
 
 FORCE_SHARED_LIB = True
 
 DEFINES['MOZ_JEMALLOC3'] = True
 DEFINES['MOZ_REPLACE_JEMALLOC'] = True
+
+GENERATED_INCLUDES += ['../../jemalloc/src/include']
+if CONFIG['_MSC_VER']:
+    LOCAL_INCLUDES += ['/memory/jemalloc/src/include/msvc_compat']