Bug 753046 - Add IPC support for BSDs, build glue. r=khuey,cjones
authorMartin Husemann <martin@NetBSD.ORG>
Tue, 28 Aug 2012 23:16:51 +0200
changeset 105754 99bb81d74a3d15ec8ab7286915d0a09903149750
parent 105753 00a80ec972d5fce9132a79b78df4722ab99dd3d7
child 105755 e8600673551097c55453af1bf79b512a1d0a936d
push id55
push usershu@rfrn.org
push dateThu, 30 Aug 2012 01:33:09 +0000
reviewerskhuey, cjones
bugs753046
milestone18.0a1
Bug 753046 - Add IPC support for BSDs, build glue. r=khuey,cjones
config/system-headers
ipc/chromium/Makefile.in
ipc/chromium/chromium-config.mk
js/src/config/system-headers
toolkit/library/Makefile.in
--- a/config/system-headers
+++ b/config/system-headers
@@ -1062,8 +1062,12 @@ nestegg/nestegg.h
 cubeb/cubeb.h
 #endif
 gst/gst.h
 gst/app/gstappsink.h
 gst/app/gstappsrc.h
 gst/video/video.h
 sys/msg.h
 sys/ipc.h
+sys/thr.h
+sys/user.h
+kvm.h
+spawn.h
--- a/ipc/chromium/Makefile.in
+++ b/ipc/chromium/Makefile.in
@@ -235,16 +235,43 @@ MOCSRCS = \
 CPPSRCS += \
   $(MOCSRCS) \
   message_pump_qt.cc \
   $(NULL)
 endif
 
 endif # } OS_LINUX
 
+ifdef OS_BSD # {
+
+CPPSRCS += \
+  atomicops_internals_x86_gcc.cc \
+  process_util_bsd.cc \
+  time_posix.cc \
+  $(NULL)
+
+ifdef MOZ_ENABLE_GTK2
+CPPSRCS += \
+  message_pump_glib.cc \
+  $(NULL)
+endif
+
+ifdef MOZ_ENABLE_QT
+MOCSRCS = \
+  moc_message_pump_qt.cc \
+  $(NULL)
+
+CPPSRCS += \
+  $(MOCSRCS) \
+  message_pump_qt.cc \
+  $(NULL)
+endif
+
+endif # } OS_BSD
+
 # libevent
 
 ifndef MOZ_NATIVE_LIBEVENT # {
 
 ifdef OS_POSIX # {
 
 LOCAL_INCLUDES += -I$(srcdir)/src/third_party/libevent
 DEFINES += -DHAVE_CONFIG_H
--- a/ipc/chromium/chromium-config.mk
+++ b/ipc/chromium/chromium-config.mk
@@ -19,27 +19,16 @@ DEFINES += \
   $(NULL)
 
 LOCAL_INCLUDES += \
   -I$(topsrcdir)/ipc/chromium/src \
   -I$(topsrcdir)/ipc/glue \
   -I$(DEPTH)/ipc/ipdl/_ipdlheaders \
   $(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 \
@@ -56,23 +45,79 @@ DEFINES += \
   -DWIN32_LEAN_AND_MEAN \
   $(NULL)
 
 ifdef _MSC_VER
 DEFINES += -DCOMPILER_MSVC
 endif
 
 else # } {
+OS_POSIX = 1
+DEFINES += -DOS_POSIX=1
+
+ifeq ($(OS_ARCH),Darwin) # {
+
+OS_MACOSX = 1
+DEFINES += \
+  -DOS_MACOSX=1 \
+  $(NULL)
+
+else # } {
+ifeq ($(OS_ARCH),DragonFly) # {
+
+OS_DRAGONFLY = 1
+OS_BSD = 1
+OS_LIBS += $(call EXPAND_LIBNAME,kvm)
+DEFINES += \
+  -DOS_DRAGONFLY=1 \
+  -DOS_BSD=1 \
+  $(NULL)
+
+else # } {
+ifeq ($(OS_ARCH),FreeBSD) # {
+
+OS_FREEBSD = 1
+OS_BSD = 1
+OS_LIBS += $(call EXPAND_LIBNAME,kvm)
+DEFINES += \
+  -DOS_FREEBSD=1 \
+  -DOS_BSD=1 \
+  $(NULL)
+
+else # } {
+ifeq ($(OS_ARCH),NetBSD) # {
+
+OS_NETBSD = 1
+OS_BSD = 1
+OS_LIBS += $(call EXPAND_LIBNAME,kvm)
+DEFINES += \
+  -DOS_NETBSD=1 \
+  -DOS_BSD=1 \
+  $(NULL)
+
+else # } {
+ifeq ($(OS_ARCH),OpenBSD) # {
+
+OS_OPENBSD = 1
+OS_BSD = 1
+OS_LIBS += $(call EXPAND_LIBNAME,kvm)
+DEFINES += \
+  -DOS_OPENBSD=1 \
+  -DOS_BSD=1 \
+  $(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))
 
 endif # }
 endif # }
+endif # }
+endif # }
+endif # }
+endif # }
 
--- a/js/src/config/system-headers
+++ b/js/src/config/system-headers
@@ -1062,8 +1062,12 @@ nestegg/nestegg.h
 cubeb/cubeb.h
 #endif
 gst/gst.h
 gst/app/gstappsink.h
 gst/app/gstappsrc.h
 gst/video/video.h
 sys/msg.h
 sys/ipc.h
+sys/thr.h
+sys/user.h
+kvm.h
+spawn.h
--- a/toolkit/library/Makefile.in
+++ b/toolkit/library/Makefile.in
@@ -528,16 +528,22 @@ endif
 ifeq ($(OS_ARCH),SunOS)
 ifdef GNU_CC
 EXTRA_DSO_LDOPTS += -lelf
 else
 EXTRA_DSO_LDOPTS += -lelf -ldemangle
 endif
 endif
 
+ifneq (,$(filter DragonFly FreeBSD NetBSD OpenBSD,$(OS_ARCH)))
+OS_LIBS += $(call EXPAND_LIBNAME,kvm)
+# keep `environ' unresolved, see bug 14426 for binutils
+EXTRA_DSO_LDOPTS += -Wl,--warn-unresolved-symbols
+endif
+
 ifeq ($(OS_ARCH),WINNT)
 OS_LIBS += $(call EXPAND_LIBNAME,shell32 ole32 version winspool comdlg32 imm32 msimg32 shlwapi psapi ws2_32 dbghelp rasapi32 rasdlg iphlpapi uxtheme setupapi secur32 sensorsapi portabledeviceguids windowscodecs wininet)
 ifdef ACCESSIBILITY
 OS_LIBS += $(call EXPAND_LIBNAME,oleacc)
 endif
 ifdef _MSC_VER
 OS_LIBS += $(call EXPAND_LIBNAME,delayimp)
 EXTRA_DSO_LDOPTS += \