Makefile.kmk revision 30cc271e3faa0726922677df6403e8b6e23e9338
# $Id$
## @file
# Sub-Makefile for XPCOM.
#
#
# Copyright (C) 2006-2007 Oracle Corporation
#
# This file is part of VirtualBox Open Source Edition (OSE), as
# available from http://www.virtualbox.org. This file is free software;
# you can redistribute it and/or modify it under the terms of the GNU
# General Public License (GPL) as published by the Free Software
# Foundation, in version 2 as it comes in the "COPYING" file of the
# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
#
SUB_DEPTH = ../../..
include $(KBUILD_PATH)/subheader.kmk
# Make sure our Config.kmk is included.
ifndef VBOX_PATH_XPCOM_SRC
include $(PATH_SUB_CURRENT)/Config.kmk
endif
#
# Globals
#
# File for filtering out C symbols from the XPCOM library. Used to avoid
# symbol namespace pollution, causing trouble with system libraries.
XPCOM_C_NAMESPACE_MAP = $(VBOX_PATH_XPCOM_SRC)/xpcom-namespace-cleanup.map
ifdef VBOX_WITH_XPCOM_NAMESPACE_CLEANUP
VBOX_NM = nm$(HOSTSUFF_EXE)
# At the moment, only Solaris uses the generated map file. GNU ld is smart
# enough to handle symbol wildcards itself.
if1of ($(KBUILD_TARGET), solaris)
XPCOM_C_NAMESPACE_MAP = $(PATH_TARGET)/xpcom-namespace-cleanup.map
OTHER_CLEAN += $(XPCOM_C_NAMESPACE_MAP)
endif
endif
# @todo check whether VBoxXPCOMIPCC.so or VBoxXPCOMIPCD contain undefined
# symbols starting with NS_, PL_, PR_ or XPT. Would move the test time failure
# when missing a symbol renaming to a build time failure. Likewise, there
# should be a check whether VBoxXPCOM.so contains global C symbols (at least
# where the whitelisting of symbols via the map file is not used).
#
# Header installs.
#
INSTALLS += \
NSPRPUB-HEADERS \
NSPRPUB-MD-HEADERS \
NSPRPUB-OBS-HEADERS \
NSPRPUB-PRIV-HEADERS \
STRING-HEADERS \
XPCOM-HEADERS \
IPCD-HEADERS
#
# The IDL compiler, typelib linker and xpt files.
#
BLDPROGS += \
xpidl \
xpt_link
BLDDIRS += \
$(PATH_TARGET)/VBox-xpcom-xpt-files/
#
# We build several libraries so that any linker command line
# length restrictions limit will be avoided. (Solaris, Mac?)
#
ifndef VBOX_ONLY_SDK
LIBRARIES += \
VBox-xpcom-nspr \
VBox-xpcom-typelib \
VBox-xpcom-string \
VBox-xpcom-base \
VBox-xpcom-ds \
VBox-xpcom-io \
VBox-xpcom-components \
VBox-xpcom-threads \
VBox-xpcom-xptinfo \
VBox-xpcom-xptcall \
VBox-xpcom-proxy \
VBoxXPCOMGlue_s \
VBoxXPCOMGlue \
VBox-xpcom-ipcutils \
VBox-xpcom-ipcshared \
VBox-xpcom-ipcdlock \
VBox-xpcom-ipctransmgr \
VBox-xpcom-ipctmgrcom
DLLS += \
VBoxXPCOM \
VBoxXPCOMIPCC
ifdef VBOX_WITH_TESTCASES
PROGRAMS += \
tstnsIFileEnumerator \
tstnsIFileTest \
tstTestArray \
tstTestAtoms \
tstTestAutoLock \
tstTestCallTemplates \
tstTestCOMPtr \
tstTestCOMPtrEq \
tstTestCRT \
tstTestFactory \
tstTestHashtables \
tstTestID \
tstTestObserverService \
tstTestPipes \
tstTestServMgr \
tstTestThreads \
tstTestXPIDLString \
tstTestDeque \
tstTestAutoPtr \
tstTestMinStringAPI \
tstTestStrings \
tstPrimitiveTest \
tstSimpleTypeLib \
tstXptDump \
tstXptLink
# tstTestPermanentAtoms
endif # VBOX_WITH_TESTCASES
PROGRAMS += VBoxXPCOMIPCD
endif # !VBOX_ONLY_SDK
#
# SDK headers - lot's of files to install...
#
# Tip: If you are going to remove files here, you might
# wish to do a `kmk uninstall' first to avoid have
# obsoleted files in the $(INST_SDK) directory.
#
NSPRPUB-HEADERS_INST = $(INST_SDK)bindings/xpcom/include/nsprpub/
NSPRPUB-HEADERS_IFFLAGS = -m 644
NSPRPUB-HEADERS_SOURCES = \
NSPRPUB-MD-HEADERS_INST = $(INST_SDK)bindings/xpcom/include/nsprpub/md/
NSPRPUB-MD-HEADERS_IFFLAGS = -m 644
NSPRPUB-MD-HEADERS_SOURCES = \
\
NSPRPUB-OBS-HEADERS_INST = $(INST_SDK)bindings/xpcom/include/nsprpub/obsolete/
NSPRPUB-OBS-HEADERS_IFFLAGS = -m 644
NSPRPUB-OBS-HEADERS_SOURCES = \
NSPRPUB-PRIV-HEADERS_INST = $(INST_SDK)bindings/xpcom/include/nsprpub/private/
NSPRPUB-PRIV-HEADERS_IFFLAGS = -m 644
NSPRPUB-PRIV-HEADERS_SOURCES = \
STRING-HEADERS_INST = $(INST_SDK)bindings/xpcom/include/string/
STRING-HEADERS_IFFLAGS = -m 644
STRING-HEADERS_SOURCES = \
XPCOM-HEADERS_INST = $(INST_SDK)bindings/xpcom/include/xpcom/
XPCOM-HEADERS_IFFLAGS = -m 644
XPCOM-HEADERS_SOURCES = \
\
\
\
\
IPCD-HEADERS_INST = $(INST_SDK)bindings/xpcom/include/ipcd/
IPCD-HEADERS_IFFLAGS = -m 644
IPCD-HEADERS_SOURCES = \
#
# The IDL compiler.
#
# We build it statically because we cannot rely on additional .a files
# like in the original build
#
xpidl_TEMPLATE = XPCOMBLDPROG
xpidl_DEFS = EXPORT_XPT_API
## @todo This assumes HOST == TARGET.
xpidl_INST = $(INST_BIN)
## Obsolete hack: MacPorts is 32-bit on 10.5 and 64-bit on 10.6. Set your KBUILD_HOST_ARCH env.vars. accordingly.
#if "$(KBUILD_HOST).$(KBUILD_HOST_ARCH)" == "darwin.amd64" && defined(VBOX_MACOS_10_5_WORKAROUND)
# xpidl_BLD_TRG_ARCH = x86
# ## @todo kBuild ticket 84 workarounds:
#endif
ifdef VBOX_WITH_JAVA_SUPPORT_IN_XPIDL
xpidl_DEFS += VBOX_XPIDL_EMULATE_GENJIFACES VBOX_XPIDL_EMULATE_GENJIFACES_DIFF
endif
xpidl_SOURCES = \
ifeq ($(KBUILD_TARGET),os2)
# glib and libIDL needed by XPCOM on OS/2.
ifeq ($(VBOX_PATH_GLIB),)
VBOX_PATH_GLIB := $(lastword $(sort $(wildcard $(PATH_DEVTOOLS_TRG)/glibidl/*/glibidl/gcc335)))
endif
VBOX_PATH_LIBIDL ?= $(VBOX_PATH_GLIB)
ifeq ($(wildcard $(VBOX_PATH_GLIB)),)
$(warning VBOX_PATH_GLIB is "$(VBOX_PATH_GLIB)" which is not a valid directory!)
endif
ifeq ($(wildcard $(VBOX_PATH_LIBIDL)),)
$(warning VBOX_PATH_LIBIDL is "$(VBOX_PATH_LIBIDL)" which is not a valid directory!)
endif
xpidl_INCS = \
$(VBOX_PATH_LIBIDL)/include \
$(VBOX_PATH_GLIB)/include
xpidl_LIBS = \
$(VBOX_PATH_LIBIDL)/lib/libidl.lib \
$(VBOX_PATH_LIBIDL)/lib/glib.lib
# install necessary DLLs to the same place where xpidl goes
INSTALLS += xpidl-DLLS
xpidl_ORDERDEPS = $(xpidl-DLLS_1_TARGET)
xpidl-DLLS_INST = $(xpidl_INST)
# static libraries of these may be provided instead,
# so copy DLLs only when they are present
xpidl-DLLS_SOURCES += $(wildcard $(VBOX_PATH_GLIB)/lib/glib.dll)
xpidl-DLLS_SOURCES += $(wildcard $(VBOX_PATH_LIBIDL)/lib/libIDL.dll)
else
# We do these ONCE.
libIDL_config_cflags := $(shell $(VBOX_LIBIDL_CONFIG) --cflags)
libIDL_config_libs := $(shell $(VBOX_LIBIDL_CONFIG) --libs)
xpidl_CFLAGS = \
$(libIDL_config_cflags)
ifeq ($(BUILD_PLATFORM),linux)
xpidl_LDFLAGS = \
$(filter-out -l%,$(libIDL_config_libs))
else
xpidl_LDFLAGS = \
$(libIDL_config_libs)
endif
$(VBOX_LD_as_needed)
xpidl_LIBS.linux += \
$(subst -l,,$(filter -l%,$(libIDL_config_libs)))
endif
#
# The XPT linker.
#
xpt_link_TEMPLATE = XPCOMBLDPROG
xpt_link_SOURCES = \
#
# The NSPR Library.
#
VBox-xpcom-nspr_TEMPLATE = XPCOM
VBox-xpcom-nspr_INSTTYPE = none
VBox-xpcom-nspr_DEFS = \
_NSPR_BUILD_ \
HAVE_LCHOWN=1 \
HAVE_STRERROR=1 \
FORCE_PR_LOG
VBox-xpcom-nspr_DEFS += \
VBOX_USE_IPRT_IN_NSPR
VBOX_USE_MORE_IPRT_IN_NSPR
HAVE_BSD_FLOCK=1 \
_PR_PTHREADS
FREEBSD=1 \
HAVE_CVAR_BUILT_ON_SEM \
_PR_PTHREADS
## @todo filling in the missing stuff, please don't just copy it from linux.
# FIXME: LINUX should be defined by _linux.cfg
LINUX=1 \
_POSIX_SOURCE=1 \
_BSD_SOURCE=1 \
_SVID_SOURCE=1 \
_REENTRANT=1 \
_LARGEFILE64_SOURCE=1 \
HAVE_FCNTL_FILE_LOCKING=1 \
HAVE_CVAR_BUILT_ON_SEM \
_PR_PTHREADS
# _BSD_SOURCE is here to keep the Glibc header files happy and make them include the right things
# FIXME: L4 should be defined by _linux.cfg
L4=1 \
_REENTRANT=1 \
_LARGEFILE64_SOURCE=1 \
_POSIX_SOURCE=1 \
_BSD_SOURCE=1 \
HAVE_FCNTL_FILE_LOCKING=1 \
HAVE_CVAR_BUILT_ON_SEM
_PR_PTHREADS
_PR_PTHREADS
HAVE_FCNTL_FILE_LOCKING=1 \
_PR_PTHREADS
VBox-xpcom-nspr_INCS = \
$(VBox-xpcom-nspr_0_OUTDIR)
VBox-xpcom-nspr_SOURCES = \
ifeq ($(filter-out darwin freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),) # unixish
VBox-xpcom-nspr_SOURCES += \
endif
nsprpub/pr/src/io/prfile.c /* why not for Linux? */ \
nsprpub/pr/src/io/prio.c /* "" "" "" "" */ \
# gcc/emx sources
# IBM VAC sources (not used)
# generate build stamps
nsprpub/pr/src/prvrsion.c_DEPS = $(VBox-xpcom-nspr_0_OUTDIR)/_pr_bld.h
nsprpub/lib/ds/plvrsion.c_DEPS = $(VBox-xpcom-nspr_0_OUTDIR)/_pl_bld.h
VBox-xpcom-nspr_CLEAN += \
$(VBox-xpcom-nspr_0_OUTDIR)/_pr_bld.h \
$(VBox-xpcom-nspr_0_OUTDIR)/_pl_bld.h
$$(VBox-xpcom-nspr_0_OUTDIR)/_pr_bld.h: | $$(VBox-xpcom-nspr_0_OUTDIR)/
$(call MSG_GENERATE,,$@)
$(QUIET)$(APPEND) -t $@ '#define _BUILD_STRING "$(date +%Y-%m-%d %T)"'
$$(VBox-xpcom-nspr_0_OUTDIR)/_pl_bld.h: | $$(VBox-xpcom-nspr_0_OUTDIR)/
$(call MSG_GENERATE,,$@)
$(QUIET)$(APPEND) -t $@ '#define _BUILD_STRING "$(date +%Y-%m-%d %T)"'
VBox-xpcom-typelib_TEMPLATE = XPCOM
VBox-xpcom-typelib_INSTTYPE = none
VBox-xpcom-typelib_SOURCES = \
VBox-xpcom-string_TEMPLATE = XPCOM
VBox-xpcom-string_INSTTYPE = none
VBox-xpcom-string_SOURCES = \
VBox-xpcom-base_TEMPLATE = XPCOM
VBox-xpcom-base_INSTTYPE = none
VBox-xpcom-base_DEFS = _IMPL_NS_COM
VBox-xpcom-base_SOURCES = \
VBox-xpcom-ds_TEMPLATE = XPCOM
VBox-xpcom-ds_INSTTYPE = none
VBox-xpcom-ds_DEFS = _IMPL_NS_COM
VBox-xpcom-ds_SOURCES = \
# @todo what about MOZ_USER_DIR?
VBox-xpcom-io_TEMPLATE = XPCOM
VBox-xpcom-io_INSTTYPE = none
VBox-xpcom-io_DEFS = _IMPL_NS_COM MOZ_USER_DIR=\".mozilla\"
VBox-xpcom-io_SOURCES = \
if1of ($(KBUILD_TARGET) $(KBUILD_TARGET).$(KBUILD_TARGET_ARCH), freebsd linux netbsd openbsd solaris darwin.amd64)
VBox-xpcom-io_SOURCES += \
endif
VBox-xpcom-components_TEMPLATE = XPCOM
VBox-xpcom-components_INSTTYPE = none
VBox-xpcom-components_DEFS = _IMPL_NS_COM EXPORT_XPTI_API
VBox-xpcom-components_SOURCES = \
VBox-xpcom-threads_TEMPLATE = XPCOM
VBox-xpcom-threads_INSTTYPE = none
VBox-xpcom-threads_DEFS = _IMPL_NS_COM
VBox-xpcom-threads_SOURCES = \
VBox-xpcom-xptinfo_TEMPLATE = XPCOM
VBox-xpcom-xptinfo_INSTTYPE = none
VBox-xpcom-xptinfo_DEFS = _IMPL_NS_COM _IMPL_NS_BASE EXPORT_XPTI_API EXPORT_XPT_API
VBox-xpcom-xptinfo_SOURCES = \
VBox-xpcom-xptcall_TEMPLATE = XPCOM
VBox-xpcom-xptcall_INSTTYPE = none
VBox-xpcom-xptcall_DEFS = _IMPL_NS_COM _IMPL_NS_BASE EXPORT_XPTC_API
VBox-xpcom-xptcall_DEFS.darwin = KEEP_STACK_16_BYTE_ALIGNED
VBox-xpcom-xptcall_DEFS.os2 = MOZ_NEED_LEADING_UNDERSCORE
VBox-xpcom-xptcall_SOURCES = xpcom/reflect/xptcall/src/xptcall.cpp
VBox-xpcom-xptcall_SOURCES.darwin.x86 = xpcom/reflect/xptcall/src/md/unix/xptcinvoke_unixish_x86.cpp \
VBox-xpcom-xptcall_SOURCES.darwin.amd64= xpcom/reflect/xptcall/src/md/unix/xptcinvoke_amd64_darwin.cpp \
VBox-xpcom-xptcall_SOURCES.freebsd.x86 = xpcom/reflect/xptcall/src/md/unix/xptcinvoke_gcc_x86_unix.cpp \
VBox-xpcom-xptcall_SOURCES.freebsd.amd64=xpcom/reflect/xptcall/src/md/unix/xptcinvoke_x86_64_linux.cpp \
VBox-xpcom-xptcall_SOURCES.linux.x86 = xpcom/reflect/xptcall/src/md/unix/xptcinvoke_gcc_x86_unix.cpp \
VBox-xpcom-xptcall_SOURCES.linux.amd64 = xpcom/reflect/xptcall/src/md/unix/xptcinvoke_x86_64_linux.cpp \
VBox-xpcom-xptcall_SOURCES.solaris.x86 = xpcom/reflect/xptcall/src/md/unix/xptcinvoke_x86_solaris.cpp \
ifdef VBOX_SOLARIS_AS_IS_CRAP
else
endif
# -O0 works fine, while -O1 doesn't. The gcc man page can't be listing all the -f*
# stuff that -O1 enables, because when using the options without -O1, it's -fomit-frame-pointer
# that triggers is, while -O1 -fno-omit-frame-pointer does not work. Anyway, it's probably a gcc/mozila
# bug and it's not worth investigating as I'm not the maintainger of the solaris gcc port. [bird, 2007-09-17]
VBox-xpcom-proxy_TEMPLATE = XPCOM
VBox-xpcom-proxy_INSTTYPE = none
VBox-xpcom-proxy_DEFS = _IMPL_NS_COM EXPORT_XPTC_API EXPORT_XPTI_API
VBox-xpcom-proxy_SOURCES = xpcom/proxy/src/nsProxyEvent.cpp \
#
# The VBoxXPCOM Glue static libraries.
#
# See http://developer.mozilla.org/en/docs/XPCOM_Glue for details about the
# original XPCOM glue library purpose and usage.
#
# We don't really use the glue library in the described way because we don't
# provide frozen APIs (yet), so all VBox XPCOM client applications are
# dependent on the given version of both the VBox XPCOM runtime (binary
# dependency) and VirtualBox component library (COM interface dependency). For
# this reason, VBox client applications link to the VBox XPCOM shared library
# directly (instead of linking to the standalone XPCOM glue library that would
# dynamically search for and load the installed XPCOM runtime). For the same
# reason, we link all parts of XPCOM into a single shared XPCOM library below
# (as opposed to the original XPCOM where e.g. NSPR lives in a separate DLL).
#
VBoxXPCOMGlue_COMMON_SOURCES = \
# dependent glue library which goes in to the VBoxXPCOM shared library
VBoxXPCOMGlue_s_TEMPLATE = XPCOM
VBoxXPCOMGlue_s_INSTTYPE = none
VBoxXPCOMGlue_s_DEFS = _IMPL_NS_COM
VBoxXPCOMGlue_s_SOURCES = $(VBoxXPCOMGlue_COMMON_SOURCES)
# standalone glue library which all third-party client apps (if any) will link with
# (currently not used anywhere (see above) but still built to make sure
# the code inside #ifdef XPCOM_GLUE compiles)
VBoxXPCOMGlue_TEMPLATE = XPCOM
VBoxXPCOMGlue_DEFS = XPCOM_GLUE
VBoxXPCOMGlue_SOURCES = $(VBoxXPCOMGlue_COMMON_SOURCES) \
VBoxXPCOMGlue_SOURCES += \
$(VBox-xpcom-string_1_TARGET)
#VBoxXPCOMGlue_INST = lib/ $(INST_SDK)lib/
#
# The VBoxXPCOM Shared Object, assembling all lib files.
#
VBoxXPCOM_TEMPLATE = XPCOM
VBoxXPCOM_NAME = $(basename $(notdir $(LIB_XPCOM)))
VBoxXPCOM_DEFS = BUILD_DCONNECT="1" _IMPL_NS_COM
ifdef VBOX_WITH_XPCOM_NAMESPACE_CLEANUP
VBoxXPCOM_LDFLAGS.linux = -Wl,--version-script=$(XPCOM_C_NAMESPACE_MAP)
VBoxXPCOM_LNK_DEPS.linux += $(XPCOM_C_NAMESPACE_MAP)
VBoxXPCOM_LDFLAGS.solaris = -Wl,-M,$(XPCOM_C_NAMESPACE_MAP)
VBoxXPCOM_LNK_DEPS.solaris+= $(XPCOM_C_NAMESPACE_MAP)
endif
VBoxXPCOM_SOURCES = \
VBoxXPCOM_LIBS = \
$(VBox-xpcom-typelib_1_TARGET) \
$(VBox-xpcom-string_1_TARGET) \
$(VBox-xpcom-base_1_TARGET) \
$(VBox-xpcom-ds_1_TARGET) \
$(VBox-xpcom-io_1_TARGET) \
$(VBox-xpcom-components_1_TARGET) \
$(VBox-xpcom-threads_1_TARGET) \
$(VBox-xpcom-xptinfo_1_TARGET) \
$(VBox-xpcom-xptcall_1_TARGET) \
$(VBox-xpcom-proxy_1_TARGET) \
$(VBox-xpcom-nspr_1_TARGET) \
$(VBoxXPCOMGlue_s_1_TARGET)
pthread dl
ifeq ($(filter-out freebsd l4 linux netbsd openbsd,$(KBUILD_TARGET)),) # gnu ld.
VBoxXPCOM_LDFLAGS = -Wl,--whole-archive \
$(VBox-xpcom-typelib_1_TARGET) \
$(VBox-xpcom-string_1_TARGET) \
$(VBox-xpcom-base_1_TARGET) \
$(VBox-xpcom-ds_1_TARGET) \
$(VBox-xpcom-io_1_TARGET) \
$(VBox-xpcom-components_1_TARGET) \
$(VBox-xpcom-threads_1_TARGET) \
$(VBox-xpcom-xptinfo_1_TARGET) \
$(VBox-xpcom-xptcall_1_TARGET) \
$(VBox-xpcom-proxy_1_TARGET) \
$(VBox-xpcom-nspr_1_TARGET) \
$(VBoxXPCOMGlue_s_1_TARGET) \
-Wl,--no-whole-archive
endif
VBoxXPCOM_LDFLAGS.solaris += -Wl,-z,allextract \
$(VBox-xpcom-typelib_1_TARGET) \
$(VBox-xpcom-string_1_TARGET) \
$(VBox-xpcom-base_1_TARGET) \
$(VBox-xpcom-ds_1_TARGET) \
$(VBox-xpcom-io_1_TARGET) \
$(VBox-xpcom-components_1_TARGET) \
$(VBox-xpcom-threads_1_TARGET) \
$(VBox-xpcom-xptinfo_1_TARGET) \
$(VBox-xpcom-xptcall_1_TARGET) \
$(VBox-xpcom-proxy_1_TARGET) \
$(VBox-xpcom-nspr_1_TARGET) \
$(VBoxXPCOMGlue_s_1_TARGET) \
-Wl,-z,defaultextract
#VBoxXPCOM_LIBS.l4 = $(L4_LIBDIR)/libxpcomstubs.a $(L4_LIBDIR)/../libuc_c++.a \
# $(VBOX_PATH_L4_GCC3_INSTALL)/libsupc++.a $(VBOX_PATH_L4_GCC3_INSTALL)/libgcc_eh.a
# EF heap
#VBoxXPCOM_LIBS += $(LIB_RUNTIME_EF)
#VBoxXPCOM_LDFLAGS = -Wl,--whole-archive $(VBoxXPCOM_LIBS) -Wl,--no-whole-archive $(LIB_RUNTIME)
VBoxXPCOM_LDFLAGS.darwin = -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxXPCOM.dylib
ifdef VBOX_IPC_RELEASE_LOG
IPC_LOGGING = 1
else ifneq ($(KBUILD_TYPE),release)
IPC_LOGGING = 1
endif
TEMPLATE_XPCOMIPC = XPCOM IPC libraries
TEMPLATE_XPCOMIPC_EXTENDS = XPCOM
TEMPLATE_XPCOMIPC_DEFS = \
$(TEMPLATE_XPCOM_DEFS) BUILD_DCONNECT="1" \
IPC_DAEMON_APP_NAME=\"VBoxXPCOMIPCD$(SUFF_EXE)\"
ifdef IPC_LOGGING
TEMPLATE_XPCOMIPC_DEFS += IPC_LOGGING
endif
TEMPLATE_XPCOMIPC_LIBS = $(VBoxXPCOM_1_TARGET) $(TEMPLATE_XPCOM_LIBS)
TEMPLATE_XPCOMIPCEXE = XPCOM IPC executables
TEMPLATE_XPCOMIPCEXE_EXTENDS = XPCOMEXE
TEMPLATE_XPCOMIPCEXE_DEFS = $(TEMPLATE_XPCOMEXE_DEFS) BUILD_DCONNECT="1"
ifdef IPC_LOGGING
TEMPLATE_XPCOMIPCEXE_DEFS += IPC_LOGGING
endif
VBox-xpcom-ipcutils_TEMPLATE = XPCOMIPC
VBox-xpcom-ipcutils_INSTTYPE = none
VBox-xpcom-ipcutils_SOURCES = \
VBox-xpcom-ipcshared_TEMPLATE = XPCOMIPC
VBox-xpcom-ipcshared_INSTTYPE = none
VBox-xpcom-ipcshared_SOURCES = \
VBox-xpcom-ipcdlock_TEMPLATE = XPCOMIPC
VBox-xpcom-ipcdlock_INSTTYPE = none
VBox-xpcom-ipcdlock_SOURCES = \
VBox-xpcom-ipctransmgr_TEMPLATE = XPCOMIPC
VBox-xpcom-ipctransmgr_INSTTYPE = none
VBox-xpcom-ipctransmgr_SOURCES = \
VBox-xpcom-ipctmgrcom_TEMPLATE = XPCOMIPC
VBox-xpcom-ipctmgrcom_INSTTYPE = none
VBox-xpcom-ipctmgrcom_SOURCES = \
#
# DCONNECT client shared object
#
VBoxXPCOMIPCC_TEMPLATE = XPCOMIPC
VBoxXPCOMIPCC_NAME.os2 = VBoxIPCC
VBoxXPCOMIPCC_INST = $(INST_BIN)components/
#VBoxXPCOMIPCC_DEFS = HAVE_DEPENDENT_LIBS - dependentLibs.h is linux specific, so this cannot be required.
VBoxXPCOMIPCC_SOURCES = \
ifeq ($(KBUILD_TARGET),win)
VBoxXPCOMIPCC_SOURCES += \
else
VBoxXPCOMIPCC_SOURCES += \
endif
VBoxXPCOMIPCC_LDFLAGS.darwin = -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/components/VBoxXPCOMIPCC.dylib
VBoxXPCOMIPCC_LIBS = \
$(VBox-xpcom-ipcutils_1_TARGET) \
$(VBox-xpcom-ipcshared_1_TARGET) \
$(VBox-xpcom-ipcdlock_1_TARGET) \
$(VBox-xpcom-ipctransmgr_1_TARGET) \
$(VBox-xpcom-ipctmgrcom_1_TARGET)
# EF
#VBoxXPCOMIPCC_LIBS += $(LIB_RUNTIME)
#
# DCONNECT daemon executable
#
VBoxXPCOMIPCD_TEMPLATE = XPCOMIPCEXE
VBoxXPCOMIPCD_SOURCES = \
ifeq ($(KBUILD_TARGET),win)
VBoxXPCOMIPCD_SOURCES += \
else
VBoxXPCOMIPCD_SOURCES += \
endif
#
# Include sub-makefiles for the Python<->XPCOM and Java<->XPCOM bridges.
#
# Find the Python headers for the Python<->XPCOM bridge if enabled.
ifdef VBOX_WITH_PYTHON
include $(PATH_SUB_CURRENT)/python/Makefile.kmk
endif
ifdef VBOX_WITH_JXPCOM
include $(PATH_SUB_CURRENT)/java/Makefile.kmk
endif
#
# testcases
#
tstnsIFileEnumerator_TEMPLATE = XPCOMTSTEXE
tstnsIFileEnumerator_SOURCES = xpcom/tests/nsIFileEnumerator.cpp
tstnsIFileTest_TEMPLATE = XPCOMTSTEXE
tstnsIFileTest_SOURCES = xpcom/tests/nsIFileTest.cpp
tstTestArray_TEMPLATE = XPCOMTSTEXE
tstTestArray_SOURCES = xpcom/tests/TestArray.cpp
tstTestAtoms_TEMPLATE = XPCOMTSTEXE
tstTestAtoms_SOURCES = xpcom/tests/TestAtoms.cpp
tstTestAutoLock_TEMPLATE = XPCOMTSTEXE
tstTestAutoLock_SOURCES = xpcom/tests/TestAutoLock.cpp
tstTestCallTemplates_TEMPLATE = XPCOMTSTEXE
tstTestCallTemplates_SOURCES = xpcom/tests/TestCallTemplates.cpp
tstTestCOMPtr_TEMPLATE = XPCOMTSTEXE
tstTestCOMPtr_SOURCES = xpcom/tests/TestCOMPtr.cpp
tstTestCOMPtrEq_TEMPLATE = XPCOMTSTEXE
tstTestCOMPtrEq_SOURCES = xpcom/tests/TestCOMPtrEq.cpp
tstTestCRT_TEMPLATE = XPCOMTSTEXE
tstTestCRT_SOURCES = xpcom/tests/TestCRT.cpp
tstTestFactory_TEMPLATE = XPCOMTSTEXE
tstTestFactory_SOURCES = xpcom/tests/TestFactory.cpp
tstTestHashtables_TEMPLATE = XPCOMTSTEXE
tstTestHashtables_SOURCES = xpcom/tests/TestHashtables.cpp
tstTestID_TEMPLATE = XPCOMTSTEXE
tstTestID_SOURCES = xpcom/tests/TestID.cpp
tstTestObserverService_TEMPLATE= XPCOMTSTEXE
tstTestObserverService_SOURCES = xpcom/tests/TestObserverService.cpp
tstTestPermanentAtoms_TEMPLATE = XPCOMTSTEXE
tstTestPermanentAtoms_SOURCES = xpcom/tests/TestPermanentAtoms.cpp
tstTestPipes_TEMPLATE = XPCOMTSTEXE
tstTestPipes_SOURCES = xpcom/tests/TestPipes.cpp
tstTestServMgr_TEMPLATE = XPCOMTSTEXE
tstTestServMgr_SOURCES = xpcom/tests/TestServMgr.cpp
tstTestServMgr_INCS = xpcom/tests/services
tstTestThreads_TEMPLATE = XPCOMTSTEXE
tstTestThreads_SOURCES = xpcom/tests/TestThreads.cpp
tstTestXPIDLString_TEMPLATE = XPCOMTSTEXE
tstTestXPIDLString_SOURCES = xpcom/tests/TestXPIDLString.cpp
tstTestDeque_TEMPLATE = XPCOMTSTEXE
tstTestDeque_SOURCES = xpcom/tests/TestDeque.cpp
tstTestAutoPtr_TEMPLATE = XPCOMTSTEXE
tstTestAutoPtr_SOURCES = xpcom/tests/TestAutoPtr.cpp
tstTestMinStringAPI_TEMPLATE = XPCOMTSTEXE
tstTestMinStringAPI_SOURCES = xpcom/tests/TestMinStringAPI.cpp
tstTestStrings_TEMPLATE = XPCOMTSTEXE
tstTestStrings_SOURCES = xpcom/tests/TestStrings.cpp
tstPrimitiveTest_TEMPLATE = XPCOMTSTEXE
tstPrimitiveTest_SOURCES = xpcom/typelib/xpt/tests/PrimitiveTest.c
tstSimpleTypeLib_TEMPLATE = XPCOMTSTEXE
tstSimpleTypeLib_SOURCES = xpcom/typelib/xpt/tests/SimpleTypeLib.c
tstXptDump_TEMPLATE = XPCOMTSTEXE
tstXptDump_SOURCES = xpcom/typelib/xpt/tools/xpt_dump.c
tstXptLink_TEMPLATE = XPCOMTSTEXE
tstXptLink_SOURCES = xpcom/typelib/xpt/tools/xpt_link.c
OTHER_CLEAN += \
$(PATH_TARGET)/VBox-xpcom-idl-timestamp \
$(addprefix $(VBOX_PATH_SDK)/bindings/xpcom/include,$(notdir $(subst .idl,.h,$(XPCOM_IDLFILES)))) \
$(addprefix $(VBOX_PATH_SDK)/bindings/xpcom/include,$(notdir $(subst .idl,.xpt,$(XPCOM_IDLFILES)))) \
$(addprefix $(VBOX_PATH_SDK)/bindings/xpcom/idl/,$(notdir $(XPCOM_IDLFILES))) \
$(addprefix $(PATH_TARGET)/VBox-xpcom-xpt-files/,$(notdir $(subst .idl,.xpt,$(XPCOM_IDLFILES))))
#
# Create and install VBoxXPCOMBase.xpt
#
INSTALLS += VBoxXPCOMBase-xpt-inst
VBOX_XPTFILES = $(addprefix $(PATH_TARGET)/VBox-xpcom-xpt-files/, \
VBoxXPCOMBase-xpt-inst_INST = $(INST_BIN)components/
VBoxXPCOMBase-xpt-inst_MODE = 0644
VBoxXPCOMBase-xpt-inst_SOURCES = \
$(PATH_TARGET)/VBox-xpcom-xpt-files/VBoxXPCOMBase.xpt
VBoxXPCOMBase-xpt-inst_CLEAN = \
$(VBOX_XPTFILES) \
$(PATH_TARGET)/VBox-xpcom-xpt-files/VBoxXPCOMBase.xpt
# combined typelib library
$(PATH_TARGET)/VBox-xpcom-xpt-files/VBoxXPCOMBase.xpt: $$(VBOX_XPTFILES) | $$(xpt_link_1_TARGET) $(PATH_TARGET)/VBox-xpcom-xpt-files/
$(call MSG_LINK,XPCOM_TYPELIB,$@)
$(QUIET)$(MKDIR) -p -- $(PATH_STAGE_BIN)/components
$(QUIET)$(xpt_link_1_TARGET) $@ $^
# generate rules
include $(KBUILD_PATH)/subfooter.kmk
#
# Generate IDL rules.
#
##
# Define for compiling one IDL into a header and a typelib
# @param idl The filename with everything.
define def_IDL
$(VBOX_PATH_SDK)/bindings/xpcom/include/$(notdir $(subst .idl,.h,$(idl))) \
+ $(PATH_TARGET)/VBox-xpcom-xpt-files/$(notdir $(subst .idl,.xpt,$(idl))): \
$(VBOX_PATH_XPCOM_SRC)/$(idl) \
| $$$$(xpidl_1_TARGET) \
$(PATH_TARGET)/VBox-xpcom-xpt-files/
$$(call MSG_TOOL,xpidl,XPCOM,$$<,$$@)
$$(QUIET)$(MKDIR) -p $(VBOX_PATH_SDK)/bindings/xpcom/include $(VBOX_PATH_SDK)/bindings/xpcom/idl
$$(QUIET)$$(xpidl_1_TARGET) -m header $(XPIDL_INCS) -e $$@ $$<
$$(QUIET)$$(xpidl_1_TARGET) -m typelib $(XPIDL_INCS) -e $(addprefix $(PATH_TARGET)/VBox-xpcom-xpt-files/,$(notdir $(subst .idl,.xpt,$(idl)))) $$<
$$(QUIET)$(CP) $$< $$(VBOX_PATH_SDK)/bindings/xpcom/idl
endef
$(foreach idl, $(XPCOM_IDLFILES), $(eval $(def_IDL)))
# dummy target.
$(PATH_TARGET)/VBox-xpcom-idl-timestamp: $$(addprefix $$(VBOX_PATH_SDK)/bindings/xpcom/include/,$$(notdir $$(subst .idl,.h,$$(XPCOM_IDLFILES))))
$(call MSG_L1,IDL processing completed.)
$(QUIET)$(MKDIR) -p $(dir $@)
$(QUIET)$(APPEND) -t $@
#
# HACK ALERT! Make sure main doesn't start using xpidl before we're done
# with the idl files here. The trick here is that we're using TARGET_xpidl,
# i.e. the copy residing in obj/, while VBOX_XPIDL is pointing to
# xpidl_1_STAGE_TARGET which is the one in bin/.
#
$(VBOX_XPIDL): | $(PATH_TARGET)/VBox-xpcom-idl-timestamp
#
# Generate linker map file filtering out unwanted global symbols.
#
$(PATH_TARGET)/xpcom-namespace-cleanup.map foo.map: $$(VBoxXPCOM_LIBS) $$(VBoxXPCOM_OBJS_)
$(call MSG_L1, Creating linker map $@ for scrubbing the symbol namespace)
$(QUIET)$(APPEND) -t $@ '{ local: *; global: '
$(QUIET)$(VBOX_NM) -p -g $^ \
| $(SED) -n \
-e '/^$$/b' \
-e '/:$$/b' \
-e '/ U /b' \
-e 's/^[^ ]* [A-Z] \(.*\)$$/\1/' \
-e 's/\<_Z[^ ]*$$/&;/p' \
-e 's/\<VBoxNs[^ ]*$$/&;/p' \
-e 's/\<_edata$$/&;/p' \
-e 's/\<_end$$/&;/p' \
-e 's/\<_etext$$/&;/p'\
-e 's/\<_fini$$/&;/p' \
-e 's/\<_init$$/&;/p' \
--append $@
$(QUIET)$(APPEND) $@ '};'