Bug 734335 - Only build SPS on supported platforms. r=bgirard,r=khuey
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 13 Mar 2012 09:48:00 +0100
changeset 88905 5168ba8c86f0ac4f6b4f15f981bc7ae770236bda
parent 88904 ad62dcabf6969355343034d3003546436ed0023e
child 88906 28920721ac6d41674158819e029bcbb8e4395f04
push id7068
push usermh@glandium.org
push dateTue, 13 Mar 2012 08:50:40 +0000
treeherdermozilla-inbound@35fb1400f0f7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbgirard, khuey
bugs734335
milestone13.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 734335 - Only build SPS on supported platforms. r=bgirard,r=khuey
configure.in
toolkit/library/Makefile.in
toolkit/library/nsStaticXULComponents.cpp
tools/profiler/Makefile.in
tools/profiler/sampler.h
--- a/configure.in
+++ b/configure.in
@@ -1976,20 +1976,43 @@ MOZ_ARG_ENABLE_BOOL(jprof,
 if test -n "$MOZ_JPROF"; then
     MOZ_PROFILING=1
     AC_DEFINE(MOZ_JPROF)
 fi
 
 dnl ========================================================
 dnl SPS Profiler
 dnl ========================================================
-MOZ_ARG_ENABLE_BOOL(sps,
-[  --enable-sps          Enable sps profiling tool.],
-    MOZ_ENABLE_PROFILER_SPS=1,
-    MOZ_ENABLE_PROFILER_SPS= )
+MOZ_ENABLE_PROFILER_SPS=1
+
+case "${OS_TARGET}" in
+Android)
+    case "${CPU_ARCH}" in
+    x86 | arm) ;;
+    *)
+        MOZ_ENABLE_PROFILER_SPS=
+    esac
+    ;;
+Linux)
+    case "${CPU_ARCH}" in
+    x86 | x86_64) ;;
+    *)
+        MOZ_ENABLE_PROFILER_SPS=
+    esac
+    ;;
+WINNT|Darwin) ;;
+*)
+    MOZ_ENABLE_PROFILER_SPS=
+    ;;
+esac
+
+MOZ_ARG_DISABLE_BOOL(sps,
+[  --disable-sps         Disable sps profiling tool.],
+    MOZ_ENABLE_PROFILER_SPS=,
+    MOZ_ENABLE_PROFILER_SPS=1)
 if test -n "$MOZ_ENABLE_PROFILER_SPS"; then
     AC_DEFINE(MOZ_ENABLE_PROFILER_SPS)
 fi
 
 dnl ========================================================
 dnl shark
 dnl ========================================================
 MOZ_ARG_ENABLE_BOOL(shark,
--- a/toolkit/library/Makefile.in
+++ b/toolkit/library/Makefile.in
@@ -275,17 +275,19 @@ STATIC_LIBS += skia_npapi
 endif
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),gonk)
 COMPONENT_LIBS += widget_gonk
 endif
 
 STATIC_LIBS += thebes gl ycbcr
 
+ifdef MOZ_ENABLE_PROFILER_SPS
 COMPONENT_LIBS += profiler
+endif
 
 ifeq (windows,$(MOZ_WIDGET_TOOLKIT))
 COMPONENT_LIBS += widget_windows
 endif
 ifeq (os2,$(MOZ_WIDGET_TOOLKIT))
 COMPONENT_LIBS += wdgtos2
 endif
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
--- a/toolkit/library/nsStaticXULComponents.cpp
+++ b/toolkit/library/nsStaticXULComponents.cpp
@@ -193,33 +193,39 @@
 #if defined(MOZ_APP_COMPONENT_INCLUDE)
 #include MOZ_APP_COMPONENT_INCLUDE
 #define MOZ_APP_COMPONENT_MODULES APP_COMPONENT_MODULES
 #else
 #define MOZ_APP_COMPONENT_MODULES
 #endif
 #endif
 
+#if defined(MOZ_ENABLE_PROFILER_SPS)
+#define PROFILER_MODULE MODULE(nsProfilerModule)
+#else
+#define PROFILER_MODULE
+#endif
+
 #define XUL_MODULES                          \
     MODULE(nsUConvModule)                    \
     MODULE(nsI18nModule)                     \
     MODULE(nsChardetModule)                  \
     UNIVERSALCHARDET_MODULE                  \
     MODULE(necko)                            \
     PERMISSIONS_MODULES                      \
     AUTH_MODULE                              \
     MODULE(nsJarModule)                      \
     ZIPWRITER_MODULE                         \
     MODULE(StartupCacheModule)               \
     MODULE(nsPrefModule)                     \
     MODULE(nsRDFModule)                      \
     MODULE(nsWindowDataSourceModule)         \
     MODULE(nsParserModule)                   \
     MODULE(nsGfxModule)                      \
-    MODULE(nsProfilerModule)                 \
+    PROFILER_MODULE                          \
     WIDGET_MODULES                           \
     MODULE(nsImageLib2Module)                \
     ICON_MODULE                              \
     MODULE(nsPluginModule)                   \
     MODULE(nsLayoutModule)                   \
     MODULE(docshell_provider)                \
     MODULE(embedcomponents)                  \
     MODULE(Browser_Embedding_Module)         \
--- a/tools/profiler/Makefile.in
+++ b/tools/profiler/Makefile.in
@@ -39,18 +39,20 @@
 
 DEPTH       = ../..
 topsrcdir	  = @top_srcdir@
 srcdir      = @srcdir@
 VPATH       = $(srcdir)
 
 include $(DEPTH)/config/autoconf.mk
 
-EXPORTS = \
-  sampler.h \
+EXPORTS = sampler.h
+
+ifdef MOZ_ENABLE_PROFILER_SPS
+EXPORTS += \
   sps_sampler.h \
   thread_helper.h \
   shared-libraries.h \
   $(NULL)
 
 LOCAL_INCLUDES += \
   -I$(topsrcdir)/ipc/chromium/src \
   $(NULL)
@@ -60,52 +62,43 @@ MODULE_NAME     = nsProfilerModule
 LIBRARY_NAME    = profiler
 EXPORT_LIBRARY  = 1
 LIBXUL_LIBRARY  = 1
 IS_COMPONENT    = 1
 
 CPPSRCS		= \
   nsProfilerFactory.cpp \
   nsProfiler.cpp \
+  TableTicker.cpp \
   $(NULL)
 
 XPIDLSRCS = \
   nsIProfiler.idl \
   $(NULL)
 
 EXTRA_JS_MODULES = \
   Profiler.jsm \
   $(NULL)
 
 ifneq (,$(filter Android Linux,$(OS_TARGET)))
-
-DEFINES += -DMOZ_ENABLE_PROFILER_SPS
-
 CPPSRCS += \
   shared-libraries-linux.cc \
   platform-linux.cc \
-  TableTicker.cpp \
   $(NULL)
 endif
+
 ifeq ($(OS_TARGET),Darwin)
-
-DEFINES += -DMOZ_ENABLE_PROFILER_SPS
-
 CPPSRCS += \
   shared-libraries-macos.cc \
   platform-macos.cc \
-  TableTicker.cpp \
   $(NULL)
 endif
 
 ifeq ($(OS_TARGET),WINNT)
-
-DEFINES += -DMOZ_ENABLE_PROFILER_SPS
-
 CPPSRCS += \
   shared-libraries-win32.cc \
   platform-win32.cc \
-  TableTicker.cpp \
   $(NULL)
 endif
 
+endif
+
 include $(topsrcdir)/config/rules.mk
-
--- a/tools/profiler/sampler.h
+++ b/tools/profiler/sampler.h
@@ -78,17 +78,17 @@
  *
  * NOTE: File format is planned to be extended to include a dictionary to reduce size.
  */
 
 #ifndef SAMPLER_H
 #define SAMPLER_H
 
 // Redefine the macros for platforms where SPS is supported.
-#if defined(ANDROID) || defined(__linux__) || defined(XP_MACOSX) || defined(XP_WIN)
+#ifdef MOZ_ENABLE_PROFILER_SPS
 
 #include "sps_sampler.h"
 
 #else
 
 // Initialize the sampler. Any other calls will be silently discarded
 // before the sampler has been initialized (i.e. early start-up code)
 #define SAMPLER_INIT()