Makefile.kmk revision 677833bc953b6cb418c701facbdcf4aa18d6c44e
#
# Makefile for XPCOM.
#
#
# Copyright (C) 2006 InnoTek Systemberatung GmbH
#
# 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 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.
#
# If you received this file as part of a commercial VirtualBox
# distribution, then only the terms of your commercial VirtualBox
# license agreement apply instead of the previous paragraph.
#
DEPTH = ../../..
include $(PATH_KBUILD)/header.kmk
# We start by creating a couple of templates for building XPCOM. In L4, this is slightly
# complicated by the fact that we still build the tools for use in Linux, since L4 isn't
# really up to scratch yet as a development environment. Whereas formerly the operating
# system definitions were "hard coded" by copying the correct file to prcpucfg.h, we now
# use a file which will include the correct definitions based on whether the variable
# __LINUX_XPCOM__ or __L4_XPCOM__ is defined. Unfortunately, we can't use __LINUX__ and
# __L4ENV__, since these are defined globally, not on a per-template basis, so __L4ENV__
# will also be defined when building the Linux-based tools.
XPCOM_SUFF_LIB.linux = .a
XPCOM_SUFF_LIB.l4 = .a
XPCOM_SUFF_LIB = $(XPCOM_SUFF_LIB.$(BUILD_TARGET))
XPCOM_SUFF_DLL.linux = .so
XPCOM_SUFF_DLL = $(XPCOM_SUFF_DLL.$(BUILD_TARGET))
#
# Template for building the XPCOM libraries
#
TEMPLATE_XPCOM = XPCOM libraries
TEMPLATE_XPCOM_TOOL = GCC3
TEMPLATE_XPCOM_CXXFLAGS = -pipe -fPIC -ansi -Wall -Wno-unused -Wno-non-virtual-dtor \
$(VBOX_GCC_Wno-invalid-offsetof) -Wno-sign-compare -Wno-unused -Wno-ctor-dtor-privacy
TEMPLATE_XPCOM_CXXFLAGS.debug = -fno-inline
TEMPLATE_XPCOM_CXXFLAGS.linux = -pthread
TEMPLATE_XPCOM_CXXFLAGS.l4 = -fno-exceptions -nostdinc
TEMPLATE_XPCOM_CFLAGS = -pipe -fPIC -ansi -pthread -Wall -Wno-unused \
-Wno-parentheses -Wno-uninitialized
TEMPLATE_XPCOM_CFLAGS.debug = -fno-inline
TEMPLATE_XPCOM_CFLAGS.linux = -pthread
TEMPLATE_XPCOM_CFLAGS.l4 = -nostdinc
TEMPLATE_XPCOM_DEFS = MOZILLA_CLIENT=1 MOZ_PRESERVE_PIC
TEMPLATE_XPCOM_DEFS.amd64 = HAVE_VA_LIST_AS_ARRAY HAVE_VA_COPY VA_COPY\(a\,b\)=__builtin_va_copy\(a\,b\)
TEMPLATE_XPCOM_DEFS.linux = XP_UNIX=1 __LINUX_XPCOM__ OSTYPE="Linux2.6" OSARCH="Linux" \
MOZ_DLL_SUFFIX="\".so\""
TEMPLATE_XPCOM_DEFS.l4 = XP_UNIX=1 __L4_XPCOM__ OSTYPE="L4ENV" OSARCH="L4" \
MOZ_DLL_SUFFIX="\".s.so\"" L4ENV
TEMPLATE_XPCOM_INCS = $(PATH_TARGET) \
xpcom/ds \
xpcom/io \
$(PATH_BIN)/sdk/include \
$(PATH_BIN)/sdk/include/xpcom \
$(PATH_BIN)/sdk/include/xpcom/nsprpub \
$(PATH_BIN)/sdk/include/xpcom/string \
$(PATH_BIN)/sdk/include/xpcom/xpcom \
$(PATH_BIN)/sdk/include/xpcom/ipcd
TEMPLATE_XPCOM_INCS.l4 = $(L4_INCDIR) $(VBOX_L4_GCC3_INCS)
TEMPLATE_XPCOM_LDFLAGS.l4 = $(L4_DIR)/lib/x86_586/crt0.o \
-T$(L4_DIR)/lib/x86_586/main_rel.ld -nostdlib \
# -Wl,--whole-archive,--no-allow-shlib-undefined
TEMPLATE_XPCOM_LIBS.l4 = $(VBOX_GCC_LIBGCC)
#
# Template for building the XPCOM executables
#
TEMPLATE_XPCOMEXE = XPCOM executable files
TEMPLATE_XPCOMEXE_TOOL = GCC3
TEMPLATE_XPCOMEXE_CXXFLAGS = -pipe -ansi -Wall -Wno-non-virtual-dtor
TEMPLATE_XPCOMEXE_CXXFLAGS.debug = -fno-inline
TEMPLATE_XPCOMEXE_CXXFLAGS.linux = -pthread
TEMPLATE_XPCOMEXE_CXXFLAGS.l4 = -fno-exceptions -nostdinc
TEMPLATE_XPCOMEXE_CFLAGS = -pipe -ansi -Wall
TEMPLATE_XPCOMEXE_CFLAGS.debug = -fno-inline
TEMPLATE_XPCOMEXE_CFLAGS.linux = -pthread
TEMPLATE_XPCOMEXE_CFLAGS.l4 = -fno-exceptions -nostdinc
TEMPLATE_XPCOMEXE_DEFS = MOZILLA_CLIENT=1 BUILD_DCONNECT="1"
TEMPLATE_XPCOMEXE_DEFS.linux = XP_UNIX=1 __LINUX_XPCOM__ OSTYPE="Linux2.6" \
OSARCH="Linux" MOZ_DLL_SUFFIX="\".so\"" _BSD_SOURCE
TEMPLATE_XPCOMEXE_DEFS.l4 = XP_UNIX=1 __L4_XPCOM__ OSTYPE="L4ENV" OSARCH="L4" \
MOZ_DLL_SUFFIX="\".s.so\"" _BSD_SOURCE L4ENV
TEMPLATE_XPCOMEXE_INCS = $(PATH_TARGET) ipc/ipcd/shared/src \
$(PATH_BIN)/sdk/include \
$(PATH_BIN)/sdk/include/xpcom \
$(PATH_BIN)/sdk/include/xpcom/nsprpub \
$(PATH_BIN)/sdk/include/xpcom/string \
$(PATH_BIN)/sdk/include/xpcom/xpcom \
$(PATH_BIN)/sdk/include/xpcom/ipcd
TEMPLATE_XPCOMEXE_INCS.l4 = $(L4_INCDIR) $(VBOX_L4_GCC3_INCS)
TEMPLATE_XPCOMEXE_LIBS = \
$(PATH_LIB)/VBox-xpcom-ipcshared$(VBOX_SUFF_LIB) \
$(PATH_BIN)/VBoxXPCOM$(XPCOM_SUFF_DLL)
TEMPLATE_XPCOMEXE_LIBS.linux = dl $(LIB_PTHREAD)
TEMPLATE_XPCOMEXE_LIBS.l4 = $(LIB_RUNTIME) $(VBOX_GCC_LIBGCC)
TEMPLATE_XPCOMEXE_LDFLAGS.l4 = $(L4_DIR)/lib/x86_586/crt0.o \
-T$(L4_DIR)/lib/x86_586/main_dyn.ld -nostdlib -lgcc \
-Wl,--export-dynamic,--dynamic-linker=libld-l4.s.so \
-Wl,--rpath-link,$(L4_LIBDIR) \
# -Wl,--whole-archive,--no-allow-shlib-undefined
#
# Template for building XPCOM Linux-based executables.
#
TEMPLATE_XPCOMLINUX = XPCOM Linux executables
TEMPLATE_XPCOMLINUX_TOOL = GCC3
TEMPLATE_XPCOMLINUX_ASTOOL = NASM
TEMPLATE_XPCOMLINUX_DEFS = __LINUX_XPCOM__ MOZILLA_CLIENT=1 \
OSTYPE="Linux2.6" OSARCH="Linux"
TEMPLATE_XPCOMLINUX_CXXFLAGS = -pipe -ansi -Wall -pthread -Wno-non-virtual-dtor
TEMPLATE_XPCOMLINUX_CXXFLAGS.debug = fno-inline
TEMPLATE_XPCOMLINUX_CFLAGS = -pipe -ansi -Wall -pthread -Wno-unused
TEMPLATE_XPCOMLINUX_CFLAGS.debug = -fno-inline
TEMPLATE_XPCOMLINUX_LIBS = dl
TEMPLATE_XPCOMLINUX_INCS = $(PATH_BIN)/sdk/include \
$(PATH_BIN)/sdk/include/xpcom \
$(PATH_BIN)/sdk/include/xpcom/nsprpub \
$(PATH_BIN)/sdk/include/xpcom/string \
$(PATH_BIN)/sdk/include/xpcom/xpcom \
$(PATH_BIN)/sdk/include/xpcom/ipcd
ifdef VBOX_USE_GPROF
endif
ifdef VBOX_USE_FNCCHECK
TEMPLATE_XPCOMLINUX_CFLAGS.profile += -finstrument-functions
TEMPLATE_XPCOMLINUX_CXXFLAGS.profile += -finstrument-functions
TEMPLATE_XPCOMLINUX_LDFLAGS.profile += -lfnccheck_hack -lfnccheck
endif
#
# First we have to build the IDL compiler as it is required for the rest
#
BLDPROGS = \
xpidl \
xpt_link
#
# We build several libraries so that the Win32 linker command line
# length limit will not be hit
#
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 \
VBox-xpcom-ipcutils \
VBox-xpcom-ipcshared \
VBox-xpcom-ipcdlock \
VBox-xpcom-ipctransmgr \
VBox-xcpom-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
# tstTestPermanentAtoms
endif # VBOX_WITH_TESTCASES
PROGRAMS.linux = VBoxXPCOMIPCD
OTHERS = \
$(PATH_BIN)/VBoxXPCOMBase.xpt
OTHER_CLEAN = \
$(PATH_TARGET)/VBox-xpcom-nspr/_pr_bld.h \
$(PATH_TARGET)/VBox-xpcom-nspr/_pl_bld.h \
$(PATH_BIN)/VBoxXPCOMBase.xpt
#
# defines for all libraries. Unfortunately, a global DEFS
# statement doesn't appear to work
#
# r=bird: Yes, it DOES work. It just depends on when config.kmk is included and += vs =.
XPCOMDEFS = \
HAVE_VISIBILITY_HIDDEN_ATTRIBUTE=1 \
HAVE_VISIBILITY_PRAGMA=1 \
_LARGEFILE64_SOURCE=1 \
HAVE_FCNTL_FILE_LOCKING=1 \
HAVE_LCHOWN=1 \
HAVE_STRERROR=1 \
_REENTRANT=1 \
FORCE_PR_LOG \
HAVE_CVAR_BUILT_ON_SEM \
_NSPR_BUILD_
XPCOMDEFS.linux = \
_POSIX_SOURCE=1 \
_BSD_SOURCE=1 \
_SVID_SOURCE=1 \
LINUX=1 \
i386=1 \
_PR_PTHREADS
# _BSD_SOURCE is here to keep the Glibc header files happy and make them include the right things
XPCOMDEFS.l4 = \
L4=1 \
_POSIX_SOURCE=1 \
_BSD_SOURCE=1 \
i386=1
# The IDL compiler. We build it statically because we cannot
# rely on additional .a files like in the original build
xpidl_TEMPLATE = XPCOMLINUX
xpidl_DEFS = EXPORT_XPT_API
xpidl_INST = bin/ $(INST_SDK)/bin/
xpidl_SOURCES = \
# This will, because this is the very first target built, cause the headers
# to be installed.
xpidl_DEPS = \
$(PATH_BIN)/sdk/include/xpcom/.keep
# We do these ONCE.
libIDL_config := $(firstword $(shell which libIDL-config-2 libIDL-config 2> /dev/null))
libIDL_config_cflags := $(shell $(libIDL_config) --cflags)
libIDL_config_libs := $(shell $(libIDL_config) --libs)
xpidl_CFLAGS = \
$(libIDL_config_cflags)
xpidl_LDFLAGS = \
$(libIDL_config_libs)
# XPT linker
xpt_link_TEMPLATE = XPCOMLINUX
xpt_link_SOURCES = \
VBox-xpcom-nspr_TEMPLATE = XPCOM
VBox-xpcom-nspr_DEFS = $(XPCOMDEFS)
VBox-xpcom-nspr_DEFS.debug = NDEBUG
VBox-xpcom-nspr_INCS = \
$(PATH_TARGET)/VBox-xpcom-nspr
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
VBox-xpcom-nspr_SOURCES = \
# L4 is ok with os_Linux_x86.
nsprpub/pr/src/io/prfile.c /* why not for Linux? */ \
nsprpub/pr/src/io/prio.c /* "" "" "" "" */ \
nsprpub/pr/src/linking/prlink.c_DEFS = _GNU_SOURCE
nsprpub/pr/src/prvrsion.c_DEPS = $(PATH_VBox-xpcom-nspr)/_pr_bld.h
nsprpub/lib/ds/plvrsion.c_DEPS = $(PATH_VBox-xpcom-nspr)/_pl_bld.h
IDLFILES = \
VBox-xpcom-typelib_TEMPLATE = XPCOM
VBox-xpcom-typelib_SOURCES = \
VBox-xpcom-string_TEMPLATE = XPCOM
VBox-xpcom-string_DEFS = _IMPL_NS_COM
VBox-xpcom-string_SOURCES = \
VBox-xpcom-base_TEMPLATE = XPCOM
VBox-xpcom-base_SOURCES = \
VBox-xpcom-ds_TEMPLATE = XPCOM
VBox-xpcom-ds_SOURCES = \
# @todo what about MOZ_USER_DIR?
VBox-xpcom-io_TEMPLATE = XPCOM
VBox-xpcom-io_DEFS = MOZ_USER_DIR="\".mozilla\""
VBox-xpcom-io_SOURCES = \
VBox-xpcom-components_TEMPLATE = XPCOM
VBox-xpcom-components_DEFS = EXPORT_XPTI_API
VBox-xpcom-components_SOURCES = \
VBox-xpcom-threads_TEMPLATE = XPCOM
VBox-xpcom-threads_SOURCES = \
VBox-xpcom-xptinfo_TEMPLATE = XPCOM
VBox-xpcom-xptinfo_DEFS = EXPORT_XPTI_API
VBox-xpcom-xptinfo_SOURCES = \
VBox-xpcom-xptcall_TEMPLATE = XPCOM
VBox-xpcom-xptcall_DEFS = EXPORT_XPTC_API
VBox-xpcom-xptcall_SOURCES = xpcom/reflect/xptcall/src/xptcall.cpp
VBox-xpcom-proxy_TEMPLATE = XPCOM
VBox-xpcom-proxy_SOURCES = xpcom/proxy/src/nsProxyEvent.cpp \
# glue library which all client apps will link with
VBoxXPCOMGlue_TEMPLATE = XPCOM
VBoxXPCOMGlue_DEFS = XPCOM_GLUE
VBoxXPCOMGlue_SOURCES = xpcom/glue/nsCOMPtr.cpp \
VBoxXPCOMGlue_INST = lib/ $(INST_SDK)/lib/
# the big DLL, assembling all lib files
VBoxXPCOM_TEMPLATE = XPCOM
VBoxXPCOM_DEFS = BUILD_DCONNECT="1"
VBoxXPCOM_SOURCES = \
VBoxXPCOM_LIBS = \
$(PATH_LIB)/VBox-xpcom-typelib$(XPCOM_SUFF_LIB) \
$(PATH_LIB)/VBox-xpcom-string$(XPCOM_SUFF_LIB) \
$(PATH_LIB)/VBox-xpcom-base$(XPCOM_SUFF_LIB) \
$(PATH_LIB)/VBox-xpcom-ds$(XPCOM_SUFF_LIB) \
$(PATH_LIB)/VBox-xpcom-io$(XPCOM_SUFF_LIB) \
$(PATH_LIB)/VBox-xpcom-components$(XPCOM_SUFF_LIB) \
$(PATH_LIB)/VBox-xpcom-threads$(XPCOM_SUFF_LIB) \
$(PATH_LIB)/VBox-xpcom-xptinfo$(XPCOM_SUFF_LIB) \
$(PATH_LIB)/VBox-xpcom-xptcall$(XPCOM_SUFF_LIB) \
$(PATH_LIB)/VBox-xpcom-proxy$(XPCOM_SUFF_LIB) \
$(PATH_LIB)/VBox-xpcom-nspr$(XPCOM_SUFF_LIB)
VBoxXPCOM_LDFLAGS = -Wl,--whole-archive $(VBoxXPCOM_LIBS) -Wl,--no-whole-archive
# EF heap
#VBoxXPCOM_LIBS += $(LIB_RUNTIME_EF)
#VBoxXPCOM_LDFLAGS = -Wl,--whole-archive $(VBoxXPCOM_LIBS) -Wl,--no-whole-archive $(LIB_RUNTIME)
ifdef VBOX_IPC_RELEASE_LOG
IPC_LOGGING = 1
else ifneq ($(BUILD_TYPE),release)
IPC_LOGGING = 1
endif
TEMPLATE_XPCOMIPC = XPCOM IPC libraries
TEMPLATE_XPCOMIPC_EXTENDS = XPCOM
TEMPLATE_XPCOMIPC_DEFS = $(TEMPLATE_XPCOM_DEFS) BUILD_DCONNECT="1"
ifdef IPC_LOGGING
TEMPLATE_XPCOMIPC_DEFS += IN_RING3 IPC_LOGGING
TEMPLATE_XPCOMIPC_LIBS = $(TEMPLATE_XPCOM_LIBS) $(LIB_RUNTIME)
endif
TEMPLATE_XPCOMIPCEXE = XPCOM IPC executables
TEMPLATE_XPCOMIPCEXE_EXTENDS = XPCOMEXE
TEMPLATE_XPCOMIPCEXE_DEFS = $(TEMPLATE_XPCOMEXE_DEFS) BUILD_DCONNECT="1"
ifdef IPC_LOGGING
TEMPLATE_XPCOMIPCEXE_DEFS += IN_RING3 IPC_LOGGING
TEMPLATE_XPCOMIPCEXE_LIBS = $(TEMPLATE_XPCOMEXE_LIBS) $(LIB_RUNTIME)
endif
VBox-xpcom-ipcutils_TEMPLATE = XPCOMIPC
VBox-xpcom-ipcutils_SOURCES = \
VBox-xpcom-ipcshared_TEMPLATE = XPCOMIPC
VBox-xpcom-ipcshared_SOURCES = \
VBox-xpcom-ipcdlock_TEMPLATE = XPCOMIPC
VBox-xpcom-ipcdlock_SOURCES = \
VBox-xpcom-ipctransmgr_TEMPLATE = XPCOMIPC
VBox-xpcom-ipctransmgr_SOURCES = \
VBox-xcpom-ipctmgrcom_TEMPLATE = XPCOMIPC
VBox-xcpom-ipctmgrcom_SOURCES = \
# DCONNECT client shared object
VBoxXPCOMIPCC_TEMPLATE = XPCOMIPC
VBoxXPCOMIPCC_DEFS = HAVE_DEPENDENT_LIBS
VBoxXPCOMIPCC_SOURCES = \
VBoxXPCOMIPCC_LIBS = \
$(PATH_LIB)/VBox-xpcom-ipcutils$(XPCOM_SUFF_LIB) \
$(PATH_LIB)/VBox-xpcom-ipcshared$(XPCOM_SUFF_LIB) \
$(PATH_LIB)/VBox-xpcom-ipcdlock$(XPCOM_SUFF_LIB) \
$(PATH_LIB)/VBox-xpcom-ipctransmgr$(XPCOM_SUFF_LIB) \
$(PATH_LIB)/VBox-xcpom-ipctmgrcom$(XPCOM_SUFF_LIB)
# EF
#VBoxXPCOMIPCC_LIBS += $(LIB_RUNTIME)
# DCONNECT daemon executable
VBoxXPCOMIPCD_TEMPLATE = XPCOMIPCEXE
VBoxXPCOMIPCD_SOURCES = \
#
# testcases
#
tstnsIFileEnumerator_TEMPLATE = XPCOMEXE
tstnsIFileEnumerator_SOURCES = xpcom/tests/nsIFileEnumerator.cpp
tstnsIFileTest_TEMPLATE = XPCOMEXE
tstnsIFileTest_SOURCES = xpcom/tests/nsIFileTest.cpp
tstTestArray_TEMPLATE = XPCOMEXE
tstTestArray_SOURCES = xpcom/tests/TestArray.cpp
tstTestAtoms_TEMPLATE = XPCOMEXE
tstTestAtoms_SOURCES = xpcom/tests/TestAtoms.cpp
tstTestAutoLock_TEMPLATE = XPCOMEXE
tstTestAutoLock_SOURCES = xpcom/tests/TestAutoLock.cpp
tstTestCallTemplates_TEMPLATE = XPCOMEXE
tstTestCallTemplates_SOURCES = xpcom/tests/TestCallTemplates.cpp
tstTestCOMPtr_TEMPLATE = XPCOMEXE
tstTestCOMPtr_SOURCES = xpcom/tests/TestCOMPtr.cpp
tstTestCOMPtrEq_TEMPLATE = XPCOMEXE
tstTestCOMPtrEq_SOURCES = xpcom/tests/TestCOMPtrEq.cpp
tstTestCRT_TEMPLATE = XPCOMEXE
tstTestCRT_SOURCES = xpcom/tests/TestCRT.cpp
tstTestFactory_TEMPLATE = XPCOMEXE
tstTestFactory_SOURCES = xpcom/tests/TestFactory.cpp
tstTestHashtables_TEMPLATE = XPCOMEXE
tstTestHashtables_SOURCES = xpcom/tests/TestHashtables.cpp
tstTestID_TEMPLATE = XPCOMEXE
tstTestID_SOURCES = xpcom/tests/TestID.cpp
tstTestObserverService_TEMPLATE= XPCOMEXE
tstTestObserverService_SOURCES = xpcom/tests/TestObserverService.cpp
tstTestPermanentAtoms_TEMPLATE = XPCOMEXE
tstTestPermanentAtoms_SOURCES = xpcom/tests/TestPermanentAtoms.cpp
tstTestPipes_TEMPLATE = XPCOMEXE
tstTestPipes_SOURCES = xpcom/tests/TestPipes.cpp
tstTestServMgr_TEMPLATE = XPCOMEXE
tstTestServMgr_SOURCES = xpcom/tests/TestServMgr.cpp
tstTestServMgr_INCS = xpcom/tests/services
tstTestThreads_TEMPLATE = XPCOMEXE
tstTestThreads_SOURCES = xpcom/tests/TestThreads.cpp
tstTestXPIDLString_TEMPLATE = XPCOMEXE
tstTestXPIDLString_SOURCES = xpcom/tests/TestXPIDLString.cpp
tstTestDeque_TEMPLATE = XPCOMEXE
tstTestDeque_SOURCES = xpcom/tests/TestDeque.cpp
tstTestAutoPtr_TEMPLATE = XPCOMEXE
tstTestAutoPtr_SOURCES = xpcom/tests/TestAutoPtr.cpp
tstTestMinStringAPI_TEMPLATE = XPCOMEXE
tstTestMinStringAPI_SOURCES = xpcom/tests/TestMinStringAPI.cpp
tstTestStrings_TEMPLATE = XPCOMEXE
tstTestStrings_SOURCES = xpcom/tests/TestStrings.cpp
OTHER_CLEAN += \
$(PATH_VBox-xpcom-string)/idl_ts \
$(addprefix $(PATH_BIN)/sdk/include/,$(notdir $(subst .idl,.h,$(IDLFILES)))) \
$(addprefix $(PATH_BIN)/sdk/include/,$(notdir $(subst .idl,.xpt,$(IDLFILES)))) \
$(addprefix $(PATH_BIN)/sdk/idl/,$(notdir $(IDLFILES)))
# generate rules
include $(PATH_KBUILD)/footer.kmk
NSPRPUB_MD_HEADERS = \
NSPRPUB_OBS_HEADERS = \
NSPRPUB_PRIV_HEADERS = \
STRING_HEADERS = xpcom/string/public/nsAString.h xpcom/string/public/nsAlgorithm.h \
XPCOM_HEADERS = xpcom/base/nsAgg.h xpcom/io/nsAppDirectoryServiceDefs.h \
# dummy target for copying XPCOM header files. This is done manually for now
# as we have to choose the right target directories
$(NSPRPUB_MD_HEADERS) $(NSPRPUB_OBS_HEADERS) $(NSPRPUB_PRIV_HEADERS) \
$(STRING_HEADERS) $(XPCOM_HEADERS) $(IPCD_HEADERS)
$(call MSG_L1,Installing XPCOM headers)
$(QUIET)$(MKDIR) -p \
$(@D)/nsprpub \
$(@D)/nsprpub/md \
$(@D)/nsprpub/obsolete \
$(@D)/nsprpub/private \
$(@D)/string \
$(@D)/xpcom \
$(@D)/ipcd
$(QUIET)$(CP) -p $(NSPRPUB_HEADERS) $(@D)/nsprpub
$(QUIET)$(CP) -p $(NSPRPUB_MD_HEADERS) $(@D)/nsprpub/md
$(QUIET)$(CP) -p $(NSPRPUB_OBS_HEADERS) $(@D)/nsprpub/obsolete
$(QUIET)$(CP) -p $(NSPRPUB_PRIV_HEADERS) $(@D)/nsprpub/private
$(QUIET)$(CP) -p $(STRING_HEADERS) $(@D)/string
$(QUIET)$(CP) -p $(XPCOM_HEADERS) $(@D)/xpcom
$(QUIET)$(CP) -p $(IPCD_HEADERS) $(@D)/ipcd
$(QUIET)$(RM) -f $@
$(QUIET)$(APPEND) "$@" "keep"
# Add the header files which we just installed to the "CLEAN" target
OTHER_CLEAN += \
$(PATH_BIN)/sdk/include/xpcom/nsprpub/prcpucfg.h \
$(PATH_BIN)/sdk/include/xpcom/nsprpub/_linuxcfg.h \
$(PATH_BIN)/sdk/include/xpcom/nsprpub/_l4v2cfg.h \
$(addprefix $(PATH_BIN)/sdk/include/xpcom/nsprpub/,$(notdir $(NSPRPUB_HEADERS))) \
$(addprefix $(PATH_BIN)/sdk/include/xpcom/nsprpub/md/,$(notdir $(NSPRPUB_MD_HEADERS))) \
$(addprefix $(PATH_BIN)/sdk/include/xpcom/nsprpub/obsolete/,$(notdir $(NSPRPUB_OBS_HEADERS))) \
$(addprefix $(PATH_BIN)/sdk/include/xpcom/nsprpub/private/,$(notdir $(NSPRPUB_PRIV_HEADERS))) \
$(addprefix $(PATH_BIN)/sdk/include/xpcom/string/,$(notdir $(STRING_HEADERS))) \
$(addprefix $(PATH_BIN)/sdk/include/xpcom/xpcom/,$(notdir $(XPCOM_HEADERS))) \
$(addprefix $(PATH_BIN)/sdk/include/xpcom/ipcd/,$(notdir $(IPCD_HEADERS))) \
$(PATH_BIN)/sdk/include/xpcom/.keep
XPTFILES = $(addprefix $(PATH_TARGET)/, \
# combined typelib library
$(PATH_BIN)/VBoxXPCOMBase.xpt: $(XPTFILES)
$(call MSG_L1,Linking $@)
$(QUIET)$(TARGET_xpt_link) $@ $^
# generate build stamps
$(PATH_VBox-xpcom-nspr)/_pr_bld.h:
$(call MSG_L1,Generating $@)
$(QUIET)echo '#define _BUILD_STRING "$(shell date "+%Y-%m-%d %T")"' > $@
$(PATH_VBox-xpcom-nspr)/_pl_bld.h:
$(call MSG_L1,Generating $@)
$(QUIET)echo '#define _BUILD_STRING "$(shell date "+%Y-%m-%d %T")"' > $@
#
# Generate IDL rules.
#
##
# Define for compiling one IDL into a header and a typelib
# @param idl The filename with everything.
XPIDL_INCS = -I xpcom/base/ -I xpcom/ds/ -I xpcom/components/ -I xpcom/io/ -I xpcom/threads/ -I xpcom/reflect/xptinfo/public/
define def_IDL
$(addprefix $(PATH_BIN)/sdk/include/,$(notdir $(subst .idl,.h,$(idl)))) \
$(PATH_TARGET)/$(notdir $(subst .idl,.xpt,$(idl))): $(idl)
$$(call MSG_L1,xpidl $$<)
$$(QUIET)$(MKDIR) -p $(PATH_BIN)/sdk/include $(PATH_BIN)/sdk/idl
$$(QUIET)$$(TARGET_xpidl) -m header $(XPIDL_INCS) -e $$@ $$<
$$(QUIET)$$(TARGET_xpidl) -m typelib $(XPIDL_INCS) -e $(addprefix $(PATH_TARGET)/,$(notdir $(subst .idl,.xpt,$(idl)))) $$<
$$(QUIET)$(CP) $$< $$(PATH_BIN)/sdk/idl
endef
$(foreach idl, $(IDLFILES), $(eval $(def_IDL)))
# dummy target.
$(PATH_VBox-xpcom-string)/idl_ts: $(addprefix $(PATH_BIN)/sdk/include/,$(notdir $(subst .idl,.h,$(IDLFILES))))
$(call MSG_L1,IDL processing completed.)
$(QUIET)$(MKDIR) -p $(dir $@)
$(QUIET)$(ECHO_EXT) > $@
# Manual dependency...
xpcom/string/src/nsAString.cpp: $(PATH_VBox-xpcom-string)/idl_ts