Build the pieces of the chromium code we actually need. Many thanks to bent for doing this the first time: I redid the Makefile to be all in one directory and use vpath directives so that dependencies work correctly.
authorBenjamin Smedberg <benjamin@smedbergs.us>
Mon, 29 Jun 2009 14:31:58 -0400
changeset 35732 fc6ed914e44e888e9fef446de12ad915d156555d
parent 35731 231c4c3a3a78a172ddf1516db304b489e616fa1d
child 35733 919f10919769dffe2176f42bc50bcb89df49b03d
push id10694
push userbsmedberg@mozilla.com
push dateMon, 14 Dec 2009 15:23:10 +0000
treeherdermozilla-central@683dfdc4adf0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone1.9.2a1pre
Build the pieces of the chromium code we actually need. Many thanks to bent for doing this the first time: I redid the Makefile to be all in one directory and use vpath directives so that dependencies work correctly.
config/autoconf.mk.in
configure.in
ipc/Makefile.in
ipc/chromium/Makefile.in
ipc/chromium/chromium-config.mk
toolkit/toolkit-tiers.mk
--- a/config/autoconf.mk.in
+++ b/config/autoconf.mk.in
@@ -100,16 +100,17 @@ MOZ_DEBUG_ENABLE_DEFS		= @MOZ_DEBUG_ENAB
 MOZ_DEBUG_DISABLE_DEFS	= @MOZ_DEBUG_DISABLE_DEFS@
 MOZ_DEBUG_FLAGS	= @MOZ_DEBUG_FLAGS@
 MOZ_DEBUG_LDFLAGS=@MOZ_DEBUG_LDFLAGS@
 MOZ_DBGRINFO_MODULES	= @MOZ_DBGRINFO_MODULES@
 MOZ_EXTENSIONS  = @MOZ_EXTENSIONS@
 MOZ_IMG_DECODERS= @MOZ_IMG_DECODERS@
 MOZ_IMG_ENCODERS= @MOZ_IMG_ENCODERS@
 MOZ_JSDEBUGGER  = @MOZ_JSDEBUGGER@
+MOZ_IPC = @MOZ_IPC@
 MOZ_PERF_METRICS = @MOZ_PERF_METRICS@
 MOZ_LEAKY	= @MOZ_LEAKY@
 MOZ_MEMORY      = @MOZ_MEMORY@
 MOZ_JPROF       = @MOZ_JPROF@
 MOZ_SHARK       = @MOZ_SHARK@
 MOZ_CALLGRIND   = @MOZ_CALLGRIND@
 MOZ_VTUNE       = @MOZ_VTUNE@
 DEHYDRA_PATH    = @DEHYDRA_PATH@
--- a/configure.in
+++ b/configure.in
@@ -5311,16 +5311,27 @@ dnl = JS Debugger XPCOM component (js/js
 dnl ========================================================
 MOZ_ARG_DISABLE_BOOL(jsd,
 [  --disable-jsd           Disable JavaScript debug library],
     MOZ_JSDEBUGGER=,
     MOZ_JSDEBUGGER=1)
 
 
 dnl ========================================================
+dnl = Disable IPC support for tabs and plugins
+dnl ========================================================
+MOZ_IPC=1
+MOZ_ARG_DISABLE_BOOL(ipc,
+[  --disable-ipc           Disable IPC supports for tabs and plugins],
+    MOZ_IPC=,
+    MOZ_IPC=1)
+
+AC_SUBST(MOZ_IPC)
+
+dnl ========================================================
 dnl = Disable plugin support
 dnl ========================================================
 MOZ_ARG_DISABLE_BOOL(plugins,
 [  --disable-plugins       Disable plugins support],
     MOZ_PLUGINS=,
     MOZ_PLUGINS=1)
 
 dnl ========================================================
new file mode 100644
--- /dev/null
+++ b/ipc/Makefile.in
@@ -0,0 +1,46 @@
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is the Mozilla platform.
+#
+# The Initial Developer of the Original Code is
+# the Mozilla Foundation <http://www.mozilla.org/>.
+# Portions created by the Initial Developer are Copyright (C) 2009
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+
+DEPTH = ..
+topsrcdir = @top_srcdir@
+srcdir = @srcdir@
+VPATH = @srcdir@
+
+include $(DEPTH)/config/autoconf.mk
+
+DIRS += chromium
+
+include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/ipc/chromium/Makefile.in
@@ -0,0 +1,295 @@
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is the Mozilla platform.
+#
+# The Initial Developer of the Original Code is
+# the Mozilla Foundation <http://www.mozilla.org/>.
+# Portions created by the Initial Developer are Copyright (C) 2009
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+
+DEPTH = ../..
+topsrcdir = @top_srcdir@
+srcdir = @srcdir@
+VPATH = @srcdir@
+
+include $(DEPTH)/config/autoconf.mk
+
+LIBRARY_NAME = chromium_s
+FORCE_STATIC_LIB = 1
+
+ENABLE_CXX_EXCEPTIONS = 1
+ACDEFINES =
+
+vpath %.c \
+  $(srcdir)/src/third_party/libevent \
+  $(NULL)
+
+vpath %.cc \
+  $(srcdir)/src/base \
+  $(srcdir)/src/base/third_party/dmg_fp \
+  $(srcdir)/src/base/third_party/nspr \
+  $(srcdir)/src/base/third_party/nss \
+  $(srcdir)/src/chrome/common \
+  $(NULL)
+
+vpath %.mm \
+  $(srcdir)/src/base \
+  $(srcdir)/src/chrome/common \
+  $(NULL)
+
+CPPSRCS += \
+  dtoa.cc \
+  g_fmt.cc \
+  prtime.cc \
+  at_exit.cc \
+  base_paths.cc \
+  base_switches.cc \
+  command_line.cc \
+  debug_util.cc \
+  file_path.cc \
+  file_util.cc \
+  histogram.cc \
+  lazy_instance.cc \
+  lock.cc \
+  logging.cc \
+  memory_debug.cc \
+  message_loop.cc \
+  message_pump_default.cc \
+  non_thread_safe.cc \
+  path_service.cc \
+  pickle.cc \
+  rand_util.cc \
+  ref_counted.cc \
+  revocable_store.cc \
+  scoped_temp_dir.cc \
+  sha2.cc \
+  simple_thread.cc \
+  stats_table.cc \
+  string_escape.cc \
+  string_piece.cc \
+  string_util.cc \
+  system_monitor.cc \
+  thread.cc \
+  thread_collision_warner.cc \
+  time.cc \
+  timer.cc \
+  trace_event.cc \
+  tracked.cc \
+  tracked_objects.cc \
+  child_process.cc \
+  child_process_host.cc \
+  child_process_info.cc \
+  child_thread.cc \
+  chrome_counters.cc \
+  chrome_paths.cc \
+  chrome_switches.cc \
+  debug_flags.cc \
+  env_vars.cc \
+  ipc_channel_proxy.cc \
+  ipc_logging.cc \
+  ipc_message.cc \
+  ipc_message_utils.cc \
+  ipc_sync_channel.cc \
+  ipc_sync_message.cc \
+  message_router.cc \
+  notification_service.cc \
+  task_queue.cc \
+  $(NULL)
+
+ifdef OS_WIN # {
+
+DEFINES += \
+  -D_WIN32_WINNT=0x0600 \
+  -DWINVER=0x0600 \
+  $(NULL)
+
+CPPSRCS += \
+  base_paths_win.cc \
+  cpu.cc \
+  condition_variable_win.cc \
+  debug_on_start.cc \
+  debug_util_win.cc \
+  event_recorder.cc \
+  file_util_win.cc \
+  file_version_info.cc \
+  lock_impl_win.cc \
+  idle_timer.cc \
+  message_pump_win.cc \
+  object_watcher.cc \
+  platform_file_win.cc \
+  platform_thread_win.cc \
+  process_util_win.cc \
+  process_win.cc \
+  rand_util_win.cc \
+  registry.cc \
+  shared_memory_win.cc \
+  sys_info_win.cc \
+  sys_string_conversions_win.cc \
+  system_monitor_win.cc \
+  thread_local_storage_win.cc \
+  thread_local_win.cc \
+  time_win.cc \
+  waitable_event_watcher_win.cc \
+  waitable_event_win.cc \
+  win_util.cc \
+  chrome_paths_win.cc \
+  ipc_channel_win.cc \
+  process_watcher_win.cc \
+  transport_dib_win.cc \
+  $(NULL)
+
+endif # } OS_WIN
+
+ifdef OS_POSIX # {
+
+CPPSRCS += \
+  sha512.cc \
+  condition_variable_posix.cc \
+  debug_util_posix.cc \
+  event_recorder_stubs.cc \
+  file_descriptor_shuffle.cc \
+  file_util_posix.cc \
+  lock_impl_posix.cc \
+  message_pump_libevent.cc \
+  platform_file_posix.cc \
+  platform_thread_posix.cc \
+  process_posix.cc \
+  process_util_posix.cc \
+  rand_util_posix.cc \
+  shared_memory_posix.cc \
+  string16.cc \
+  system_monitor_posix.cc \
+  sys_info_posix.cc \
+  thread_local_posix.cc \
+  thread_local_storage_posix.cc \
+  waitable_event_posix.cc \
+  waitable_event_watcher_posix.cc \
+  file_descriptor_set_posix.cc \
+  ipc_channel_posix.cc \
+  process_watcher_posix.cc \
+  $(NULL)
+
+endif # } OS_POSIX
+
+ifdef OS_MACOSX # {
+
+CMMSRCS += \
+  base_paths_mac.mm \
+  file_util_mac.mm \
+  file_version_info_mac.mm \
+  mac_util.mm \
+  message_pump_mac.mm \
+  platform_thread_mac.mm \
+  process_util_mac.mm \
+  scoped_nsautorelease_pool.mm \
+  sys_string_conversions_mac.mm \
+  worker_pool_mac.mm \
+  chrome_paths_mac.mm \
+  mach_ipc_mac.mm \
+  platform_util_mac.mm \
+  $(NULL)
+
+CPPSRCS += \
+  data_pack.cc \
+  debug_util_mac.cc \
+  hmac_mac.cc \
+  idle_timer.cc \
+  sys_info_mac.cc \
+  time_mac.cc \
+  mach_message_source_mac.cc \
+  transport_dib_mac.cc \
+  $(NULL)
+
+endif # } OS_MACOSX
+
+ifdef OS_LINUX # {
+
+CPPSRCS += \
+  atomicops_internals_x86_gcc.cc \
+  base_paths_linux.cc \
+  data_pack.cc \
+  file_util_linux.cc \
+  file_version_info_linux.cc \
+  idle_timer_none.cc \
+  message_pump_glib.cc \
+  process_util_linux.cc \
+  time_posix.cc \
+  chrome_paths_linux.cc \
+  owned_widget_gtk.cc \
+  platform_util_linux.cc \
+  transport_dib_linux.cc \
+  x11_util.cc \
+  $(NULL)
+
+endif # } OS_LINUX
+
+# libevent
+
+ifdef OS_POSIX # {
+
+LOCAL_INCLUDES += $(srcdir)/src/third_party/libevent
+DEFINES += -DHAVE_CONFIG_H
+
+CSRCS += \
+  buffer.c \
+  evbuffer.c \
+  evdns.c \
+  event.c \
+  event_tagging.c \
+  evrpc.c \
+  evutil.c \
+  http.c \
+  log.c \
+  poll.c \
+  select.c \
+  signal.c \
+  strlcpy.c \
+  $(NULL)
+
+ifdef OS_MACOSX # {
+LOCAL_INCLUDES += $(srcdir)/src/third_party/libevent/mac
+CSRCS += kqueue.c
+endif # }
+
+ifdef OS_LINUX # {
+LOCAL_INCLUDES += $(srcdir)/src/third_party/libevent/linux
+CSRCS += \
+  epoll.c \
+  epoll_sub.c \
+  $(NULL)
+endif # }
+
+endif # }
+
+include $(topsrcdir)/config/config.mk
+include $(topsrcdir)/ipc/chromium/chromium-config.mk
+include $(topsrcdir)/config/rules.mk
+
+CXXFLAGS += $(MOZ_RTTI_FLAGS_ON)
new file mode 100644
--- /dev/null
+++ b/ipc/chromium/chromium-config.mk
@@ -0,0 +1,110 @@
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is the Mozilla platform.
+#
+# The Initial Developer of the Original Code is
+# the Mozilla Foundation <http://www.mozilla.org/>.
+# Portions created by the Initial Developer are Copyright (C) 2009
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+
+ifndef INCLUDED_CONFIG_MK
+$(error Must include config.mk before this file.)
+endif
+
+ifdef CHROMIUM_CONFIG_INCLUDED
+$(error Must not include chromium-config.mk twice.)
+endif
+
+CHROMIUM_CONFIG_INCLUDED = 1
+
+EXTRA_DEPS += $(topsrcdir)/ipc/chromium/chromium-defs.mk
+
+DEFINES += \
+  -DEXCLUDE_SKIA_DEPENDENCIES \
+  -DCHROMIUM_MOZILLA_BUILD \
+  $(NULL)
+
+LOCAL_INCLUDES += \
+  -I$(topsrcdir)/ipc/chromium/src \
+  $(NULL)
+
+ifeq ($(OS_ARCH),Darwin) # {
+
+OS_MACOSX = 1
+OS_POSIX = 1
+
+DEFINES += \
+  -DOS_MACOSX=1 \
+  -DOS_POSIX=1 \
+  $(NULL)
+
+else # } {
+ifeq ($(OS_ARCH),WINNT) # {
+OS_LIBS += $(call EXPAND_LIBNAME,psapi shell32 dbghelp)
+
+OS_WIN = 1
+
+DEFINES += \
+  -DUNICODE \
+  -D_UNICODE \
+  -DNOMINMAX \
+  -D_CRT_RAND_S \
+  -DCERT_CHAIN_PARA_HAS_EXTRA_FIELDS \
+  -D_SECURE_ATL \
+  -D_HAS_TR1=0 \
+  -DCHROMIUM_BUILD \
+  -DU_STATIC_IMPLEMENTATION \
+  -DCOMPILER_MSVC \
+  -DOS_WIN=1 \
+  -DWIN32 \
+  -D_WIN32 \
+  -D_WINDOWS \
+  -DWIN32_LEAN_AND_MEAN \
+  $(NULL)
+
+else # } {
+
+OS_LINUX = 1
+OS_POSIX = 1
+
+DEFINES += \
+  -DOS_LINUX=1 \
+  -DOS_POSIX=1 \
+  $(NULL)
+
+# NB: to stop gcc warnings about exporting template instantiation
+OS_CXXFLAGS := $(filter-out -pedantic,$(OS_CXXFLAGS))
+
+# TODO support !GTK
+OS_CXXFLAGS += $(MOZ_GTK2_CFLAGS)
+OS_CFLAGS += $(MOZ_GTK2_CFLAGS)
+
+endif # }
+endif # }
--- a/toolkit/toolkit-tiers.mk
+++ b/toolkit/toolkit-tiers.mk
@@ -76,16 +76,20 @@ tier_external_dirs	+= gfx/qcms
 # tier "gecko" - core components
 #
 
 tier_gecko_dirs += \
 		js/src/xpconnect \
 		intl/chardet \
 		$(NULL)
 
+ifdef MOZ_IPC
+tier_gecko_dirs += ipc
+endif
+
 ifdef MOZ_ENABLE_GTK2
 ifdef MOZ_X11
 tier_gecko_dirs     += widget/src/gtkxtbin
 endif
 endif
 
 tier_gecko_dirs	+= \
 		modules/libutil \