Config.kmk revision 818fc571b99bf867efcfd44b8e79c58ea9e1df56
f0b8f6dd844f8752946b865bdd44175863b15812Peter Major# XPCOM kBuild Configuration file.
f0b8f6dd844f8752946b865bdd44175863b15812Peter Major# Copyright (C) 2006-2013 Oracle Corporation
f0b8f6dd844f8752946b865bdd44175863b15812Peter Major# This file is part of VirtualBox Open Source Edition (OSE), as
f0b8f6dd844f8752946b865bdd44175863b15812Peter Major# available from http://www.virtualbox.org. This file is free software;
f0b8f6dd844f8752946b865bdd44175863b15812Peter Major# you can redistribute it and/or modify it under the terms of the GNU
f0b8f6dd844f8752946b865bdd44175863b15812Peter Major# General Public License (GPL) as published by the Free Software
f0b8f6dd844f8752946b865bdd44175863b15812Peter Major# Foundation, in version 2 as it comes in the "COPYING" file of the
f0b8f6dd844f8752946b865bdd44175863b15812Peter Major# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
f0b8f6dd844f8752946b865bdd44175863b15812Peter Major# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
9401b2513f39074de0be9ae452108d0508a6d59fAndrew Forrest# Include the top-level configure file.
9401b2513f39074de0be9ae452108d0508a6d59fAndrew Forrestifndef VBOX_ROOT_CONFIG_KMK_INCLUDED
9401b2513f39074de0be9ae452108d0508a6d59fAndrew Forrest include $(PATH_ROOT)/Config.kmk
9401b2513f39074de0be9ae452108d0508a6d59fAndrew ForrestVBOX_PATH_XPCOM_SRC := $(PATH_ROOT)/src/libs/xpcom18a4
6202ba4d983650b484ebe9607707003fef5e09c6Andrew Forrest# Template for building the XPCOM libraries (shared).
6202ba4d983650b484ebe9607707003fef5e09c6Andrew ForrestTEMPLATE_XPCOM = XPCOM libraries (shared)
9401b2513f39074de0be9ae452108d0508a6d59fAndrew ForrestTEMPLATE_XPCOM_EXTENDS = VBOXR3NP
9401b2513f39074de0be9ae452108d0508a6d59fAndrew Forrest## @todo correct inheritance here to make it use all the VBOXR3NP settings instead of overriding all of them.
9401b2513f39074de0be9ae452108d0508a6d59fAndrew ForrestTEMPLATE_XPCOM_ASTOOL = $(TEMPLATE_VBOXR3NP_TOOL)
9401b2513f39074de0be9ae452108d0508a6d59fAndrew ForrestTEMPLATE_XPCOM_ASFLAGS = $(NO_SUCH_VARIABLE)
c0a77206e33b2d1f4e6d77fb25c4deaf933f92f5Jaco JoosteTEMPLATE_XPCOM_ASDEFS = $(NO_SUCH_VARIABLE)
c0a77206e33b2d1f4e6d77fb25c4deaf933f92f5Jaco JoosteTEMPLATE_XPCOM_CXXFLAGS = -g -pipe -ansi -Wall -Wno-unused -Wno-non-virtual-dtor \
c0a77206e33b2d1f4e6d77fb25c4deaf933f92f5Jaco Jooste $(VBOX_GCC_Wno-invalid-offsetof) -Wno-sign-compare -Wno-unused -Wno-ctor-dtor-privacy \
9401b2513f39074de0be9ae452108d0508a6d59fAndrew Forrest $(VBOX_GCC_fvisibility-inlines-hidden) $(VBOX_GCC_fvisibility-hidden) \
9401b2513f39074de0be9ae452108d0508a6d59fAndrew Forrest $(VBOX_GCC_fdiagnostics-show-option) $(VBOX_GCC_Wno-delete-non-virtual-dtor)
9401b2513f39074de0be9ae452108d0508a6d59fAndrew ForrestTEMPLATE_XPCOM_CXXFLAGS.darwin = -fpascal-strings -fshort-wchar -fno-common -fno-rtti $(VBOX_DARWIN_DEF_SDK_CXXFLAGS)
9401b2513f39074de0be9ae452108d0508a6d59fAndrew ForrestTEMPLATE_XPCOM_CXXFLAGS.solaris = -fno-omit-frame-pointer # for now anyway.
9401b2513f39074de0be9ae452108d0508a6d59fAndrew ForrestTEMPLATE_XPCOM_CFLAGS = -g -pipe -Wall -Wno-unused -Wno-parentheses -Wno-uninitialized $(VBOX_GCC_fvisibility-hidden) \
9401b2513f39074de0be9ae452108d0508a6d59fAndrew Forrest $(VBOX_GCC_fdiagnostics-show-option)
9401b2513f39074de0be9ae452108d0508a6d59fAndrew ForrestTEMPLATE_XPCOM_CFLAGS.solaris = -fno-omit-frame-pointer # for now anyway.
9401b2513f39074de0be9ae452108d0508a6d59fAndrew ForrestTEMPLATE_XPCOM_DEFS = \
9401b2513f39074de0be9ae452108d0508a6d59fAndrew Forrest MOZILLA_CLIENT=1 \
9401b2513f39074de0be9ae452108d0508a6d59fAndrew Forrest _IMPL_NS_COM \
9401b2513f39074de0be9ae452108d0508a6d59fAndrew Forrest XPCOM_DLL_BASE=\"$(basename $(notdir $(LIB_XPCOM)))\" \
9401b2513f39074de0be9ae452108d0508a6d59fAndrew Forrest MOZ_DLL_SUFFIX=\"$(suffix $(LIB_XPCOM))\" \
9401b2513f39074de0be9ae452108d0508a6d59fAndrew Forrest VBOX_USE_IPRT_IN_XPCOM
9401b2513f39074de0be9ae452108d0508a6d59fAndrew Forrestifdef VBOX_WITH_XPCOM_NAMESPACE_CLEANUP
0440e371231a4e5877f4f26b7c7195c5ceda0545Andrew Forrest TEMPLATE_XPCOM_DEFS += VBOX_WITH_XPCOM_NAMESPACE_CLEANUP
0440e371231a4e5877f4f26b7c7195c5ceda0545Andrew ForrestTEMPLATE_XPCOM_DEFS.amd64 = HAVE_VA_LIST_AS_ARRAY HAVE_VA_COPY VA_COPY\(a\,b\)=__builtin_va_copy\(a\,b\)
0440e371231a4e5877f4f26b7c7195c5ceda0545Andrew ForrestTEMPLATE_XPCOM_DEFS.darwin = OSTYPE=\"Darwin8.8.1\" OSARCH=\"Darwin\" XP_UNIX=1 XP_MACOSX=1 TARGET_CARBON=1 HAVE_VISIBILITY_ATTRIBUTE=1 DARWIN=1 $(TEMPLATE_VBOXR3NP_DEFS.darwin)
9401b2513f39074de0be9ae452108d0508a6d59fAndrew ForrestTEMPLATE_XPCOM_DEFS.darwin.amd64 = VBOX_MACOSX_FOLLOWS_UNIX_IO
9401b2513f39074de0be9ae452108d0508a6d59fAndrew ForrestTEMPLATE_XPCOM_DEFS.freebsd = OSTYPE=\"FreeBSD5+\" OSARCH=\"FreeBSD\" XP_UNIX=1 FREEBSD=1 HAVE_VISIBILITY_ATTRIBUTE=1
9401b2513f39074de0be9ae452108d0508a6d59fAndrew ForrestTEMPLATE_XPCOM_DEFS.linux = OSTYPE=\"Linux2.6\" OSARCH=\"Linux\" XP_UNIX=1 _GNU_SOURCE HAVE_VISIBILITY_ATTRIBUTE=1 ## @todo LINUX=1
9401b2513f39074de0be9ae452108d0508a6d59fAndrew Forrest# Don't define BSD_SELECT because bsdselect() from kLIBC <= 0.6.3 has problems on SMP
9401b2513f39074de0be9ae452108d0508a6d59fAndrew ForrestTEMPLATE_XPCOM_DEFS.os2 = OSTYPE=\"OS/2_4.5\" OSARCH=\"OS/2\" XP_OS2 XP_PC OS2=4
9401b2513f39074de0be9ae452108d0508a6d59fAndrew ForrestTEMPLATE_XPCOM_DEFS.solaris = OSTYPE=\"Solaris10\" OSARCH=\"Solaris\" XP_UNIX=1 XP_SOLARIS=1 HAVE_LIBDL=1 HAVE_SENDFILEV=1 SOLARIS=1 _REENTRANT
9401b2513f39074de0be9ae452108d0508a6d59fAndrew Forrest## @todo The LDFLAGS inheriting is being hidden here and below where -fPIC is added.
9401b2513f39074de0be9ae452108d0508a6d59fAndrew Forrestifdef VBOX_WITH_RUNPATH
9401b2513f39074de0be9ae452108d0508a6d59fAndrew ForrestTEMPLATE_XPCOM_LDFLAGS += '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RUNPATH)'
9401b2513f39074de0be9ae452108d0508a6d59fAndrew Forrestelse ifdef VBOX_WITH_RELATIVE_RUNPATH
9401b2513f39074de0be9ae452108d0508a6d59fAndrew ForrestTEMPLATE_XPCOM_LDFLAGS += '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)'
9401b2513f39074de0be9ae452108d0508a6d59fAndrew ForrestTEMPLATE_XPCOM_LDFLAGS.darwin = $(TEMPLATE_VBOXR3NP_LDFLAGS.darwin) \
9401b2513f39074de0be9ae452108d0508a6d59fAndrew Forrest -fshort-wchar -fno-rtti -fno-exceptions -fpascal-strings \
c871a8ff857961f6d1bd43c62072979969d53b59Tom Rumsey -current_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
9401b2513f39074de0be9ae452108d0508a6d59fAndrew Forrest -compatibility_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
9401b2513f39074de0be9ae452108d0508a6d59fAndrew Forrest -framework CoreServices \
9401b2513f39074de0be9ae452108d0508a6d59fAndrew Forrest -framework CoreFoundation \
9401b2513f39074de0be9ae452108d0508a6d59fAndrew Forrest -framework Foundation \
9401b2513f39074de0be9ae452108d0508a6d59fAndrew Forrest -framework AppKit \
9401b2513f39074de0be9ae452108d0508a6d59fAndrew Forrest -framework Carbon
9401b2513f39074de0be9ae452108d0508a6d59fAndrew Forrest## @todo why is -fno-exceptions here.
519e6a1e8ca3ed474248f89104d260b15fcb6e07Phill Cunningtonifn1of ($(KBUILD_TARGET), os2 win)
519e6a1e8ca3ed474248f89104d260b15fcb6e07Phill Cunnington TEMPLATE_XPCOM_CXXFLAGS += -fPIC
519e6a1e8ca3ed474248f89104d260b15fcb6e07Phill Cunnington TEMPLATE_XPCOM_CFLAGS += -fPIC
519e6a1e8ca3ed474248f89104d260b15fcb6e07Phill Cunnington TEMPLATE_XPCOM_LDFLAGS += -fPIC
519e6a1e8ca3ed474248f89104d260b15fcb6e07Phill Cunnington TEMPLATE_XPCOM_DEFS += MOZ_PRESERVE_PIC
c0a77206e33b2d1f4e6d77fb25c4deaf933f92f5Jaco JoosteTEMPLATE_XPCOM_INCS = $(VBOX_PATH_XPCOM_SRC)/xpcom/build \
c0a77206e33b2d1f4e6d77fb25c4deaf933f92f5Jaco Jooste $(VBOX_PATH_XPCOM_SRC)/xpcom/ds \
c0a77206e33b2d1f4e6d77fb25c4deaf933f92f5Jaco Jooste $(VBOX_PATH_XPCOM_SRC)/xpcom/io \
c0a77206e33b2d1f4e6d77fb25c4deaf933f92f5Jaco Jooste $(VBOX_PATH_XPCOM_SRC)/xpcom/base \
c0a77206e33b2d1f4e6d77fb25c4deaf933f92f5Jaco Jooste $(VBOX_PATH_XPCOM_SRC)/xpcom/components \
9401b2513f39074de0be9ae452108d0508a6d59fAndrew Forrest $(VBOX_PATH_XPCOM_SRC)/xpcom/threads \
9401b2513f39074de0be9ae452108d0508a6d59fAndrew Forrest $(VBOX_PATH_XPCOM_SRC)/xpcom/proxy/src \
f0b8f6dd844f8752946b865bdd44175863b15812Peter Major $(VBOX_PATH_XPCOM_SRC)/xpcom/reflect/xptcall/src \
$(VBOX_PATH_XPCOM_SRC)/ipc/ipcd/client/src \
$(VBOX_PATH_XPCOM_SRC)/ipc/ipcd/shared/src \
$(VBOX_PATH_XPCOM_SRC)/ipc/ipcd/extensions/lock/src \
$(VBOX_PATH_XPCOM_SRC)/ipc/ipcd/extensions/transmngr/src \
$(VBOX_PATH_XPCOM_SRC)/ipc/ipcd/extensions/dconnect/src \
$(VBOX_PATH_XPCOM_SRC)/ipc/ipcd/extensions/transmngr/common \
$(VBOX_PATH_SDK)/bindings/xpcom/include \
$(VBOX_PATH_SDK)/bindings/xpcom/include/nsprpub \
$(VBOX_PATH_SDK)/bindings/xpcom/include/string \
$(VBOX_PATH_SDK)/bindings/xpcom/include/xpcom \
$(VBOX_PATH_SDK)/bindings/xpcom/include/ipcd \
TEMPLATE_XPCOM_LIBS.solaris = sendfile
TEMPLATE_XPCOM_ORDERDEPS = $(foreach hdrinst, $(filter %-HEADERS, $(INSTALLS)), $($(hdrinst)_1_TARGET)) \
TEMPLATE_XPCOM_DEFS.os2 += OS2EMX_PLAIN_CHAR
TEMPLATE_XPCOM_DEFS.os2 += XP_OS2_EMX OS2=4
TEMPLATE_XPCOM_DEFS.os2 += _EMX_SOURCE
TEMPLATE_XPCOM_ASFLAGS.os2 += -Zomf
# When using IPRT in NSRP or/and using IPRT for logging, link with IPRT.
TEMPLATE_XPCOMEXE_INCS = ipc/ipcd/shared/src \
$(VBOX_PATH_SDK)/bindings/xpcom/include \
$(VBOX_PATH_SDK)/bindings/xpcom/include/nsprpub \
$(VBOX_PATH_SDK)/bindings/xpcom/include/string \
$(VBOX_PATH_SDK)/bindings/xpcom/include/xpcom \
$(VBOX_PATH_SDK)/bindings/xpcom/include/ipcd \
TEMPLATE_XPCOMEXE_LIBS.freebsd = $(LIB_PTHREAD)
TEMPLATE_XPCOMEXE_LIBS.linux = dl $(LIB_PTHREAD)
TEMPLATE_XPCOMEXE_LDFLAGS.darwin = -bind_at_load $(filter-out -current_version -compatibility_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD),$(TEMPLATE_XPCOM_LDFLAGS.darwin))
TEMPLATE_XPCOMTSTEXE_LDFLAGS = '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RUNPATH)' $(TEMPLATE_XPCOMEXE_LDFLAGS)
TEMPLATE_XPCOMTSTEXE_LDFLAGS = '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)/..' $(TEMPLATE_XPCOMEXE_LDFLAGS)
# It extends the BLDPROG template in config.kmk but overrides CFLAGS
## @todo Verify that this doesn't blow up because of template inheriance ordering. (we're assuming XPCOMEXE is expanded when this is being used.)
TEMPLATE_XPCOMBLDPROG_DEFS.$(KBUILD_HOST) = $(TEMPLATE_VBoxBldProg_DEFS.$(KBUILD_HOST)) $(TEMPLATE_XPCOMEXE_DEFS.$(KBUILD_HOST))
TEMPLATE_XPCOMBLDPROG_DEFS.amd64 = $(TEMPLATE_VBoxBldProg_DEFS.amd64) $(TEMPLATE_XPCOMEXE_DEFS.amd64)
$(VBOX_PATH_SDK)/bindings/xpcom/include \
$(VBOX_PATH_SDK)/bindings/xpcom/include/nsprpub \
$(VBOX_PATH_SDK)/bindings/xpcom/include/string \
$(VBOX_PATH_SDK)/bindings/xpcom/include/xpcom \
$(VBOX_PATH_SDK)/bindings/xpcom/include/ipcd
TEMPLATE_XPCOMBLDPROG_CFLAGS = $(filter-out -pedantic -Wshadow, $(TEMPLATE_VBOX_BLDPROG_CFLAGS)) $(VBOX_GCC_Wno-int-to-pointer-cast) $(VBOX_GCC_Wno-pointer-to-int-cast) -Wno-format
TEMPLATE_XPCOMBLDPROG_CXXFLAGS.darwin = $(TEMPLATE_VBoxBldProg_CXXFLAGS.darwin) -fpascal-strings -fshort-wchar -fno-common -fno-rtti
TEMPLATE_XPCOMBLDPROG_CXXFLAGS.solaris = $(TEMPLATE_VBoxBldProg_CXXFLAGS.solaris) -fno-omit-frame-pointer # for now anyway.
TEMPLATE_XPCOMBLDPROG_LDFLAGS.darwin = $(TEMPLATE_VBoxBldProg_LDFLAGS.darwin) -fpascal-strings -fshort-wchar -fno-rtti -fno-exceptions
TEMPLATE_XPCOMBLDPROG_ORDERDEPS = $(foreach hdrinst, $(filter %-HEADERS, $(INSTALLS)), $($(hdrinst)_1_TARGET))
TEMPLATE_XPCOMOSX104_CXXFLAGS.darwin = $(filter-out $(VBOX_DARWIN_DEF_SDK_CXXFLAGS),$(TEMPLATE_XPCOM_CXXFLAGS.darwin)) $(VBOX_DARWIN_DEF_SDK_10_4_CXXFLAGS)
TEMPLATE_XPCOMOSX104_CFLAGS.darwin = $(filter-out $(VBOX_DARWIN_DEF_SDK_CFLAGS),$(TEMPLATE_XPCOM_CFLAGS.darwin)) $(VBOX_DARWIN_DEF_SDK_10_4_CFLAGS)
TEMPLATE_XPCOMOSX104_LDFLAGS.darwin = $(filter-out $(VBOX_DARWIN_DEF_SDK_LDFLAGS),$(TEMPLATE_XPCOM_LDFLAGS.darwin)) $(VBOX_DARWIN_DEF_SDK_10_4_LDFLAGS)
TEMPLATE_XPCOMOSX104_DEFS.darwin = $(filter-out $(VBOX_DARWIN_DEF_SDK_DEFS),$(TEMPLATE_XPCOM_DEFS.darwin)) $(VBOX_DARWIN_DEF_SDK_10_4_DEFS)
TEMPLATE_XPCOMOSX105_CXXFLAGS.darwin = $(filter-out $(VBOX_DARWIN_DEF_SDK_CXXFLAGS),$(TEMPLATE_XPCOM_CXXFLAGS.darwin)) $(VBOX_DARWIN_DEF_SDK_10_5_CXXFLAGS)
TEMPLATE_XPCOMOSX105_CFLAGS.darwin = $(filter-out $(VBOX_DARWIN_DEF_SDK_CFLAGS),$(TEMPLATE_XPCOM_CFLAGS.darwin)) $(VBOX_DARWIN_DEF_SDK_10_5_CFLAGS)
TEMPLATE_XPCOMOSX105_LDFLAGS.darwin = $(filter-out $(VBOX_DARWIN_DEF_SDK_LDFLAGS),$(TEMPLATE_XPCOM_LDFLAGS.darwin)) $(VBOX_DARWIN_DEF_SDK_10_5_LDFLAGS)
TEMPLATE_XPCOMOSX105_DEFS.darwin = $(filter-out $(VBOX_DARWIN_DEF_SDK_DEFS),$(TEMPLATE_XPCOM_DEFS.darwin)) $(VBOX_DARWIN_DEF_SDK_10_5_DEFS)
TEMPLATE_XPCOMOSX106_CXXFLAGS.darwin = $(filter-out $(VBOX_DARWIN_DEF_SDK_CXXFLAGS),$(TEMPLATE_XPCOM_CXXFLAGS.darwin)) $(VBOX_DARWIN_DEF_SDK_10_6_CXXFLAGS)
TEMPLATE_XPCOMOSX106_CFLAGS.darwin = $(filter-out $(VBOX_DARWIN_DEF_SDK_CFLAGS),$(TEMPLATE_XPCOM_CFLAGS.darwin)) $(VBOX_DARWIN_DEF_SDK_10_6_CFLAGS)
TEMPLATE_XPCOMOSX106_LDFLAGS.darwin = $(filter-out $(VBOX_DARWIN_DEF_SDK_LDFLAGS),$(TEMPLATE_XPCOM_LDFLAGS.darwin)) $(VBOX_DARWIN_DEF_SDK_10_6_LDFLAGS)
TEMPLATE_XPCOMOSX106_DEFS.darwin = $(filter-out $(VBOX_DARWIN_DEF_SDK_DEFS),$(TEMPLATE_XPCOM_DEFS.darwin)) $(VBOX_DARWIN_DEF_SDK_10_6_DEFS)
TEMPLATE_XPCOMOSX107_CXXFLAGS.darwin = $(filter-out $(VBOX_DARWIN_DEF_SDK_CXXFLAGS),$(TEMPLATE_XPCOM_CXXFLAGS.darwin)) $(VBOX_DARWIN_DEF_SDK_10_7_CXXFLAGS)
TEMPLATE_XPCOMOSX107_CFLAGS.darwin = $(filter-out $(VBOX_DARWIN_DEF_SDK_CFLAGS),$(TEMPLATE_XPCOM_CFLAGS.darwin)) $(VBOX_DARWIN_DEF_SDK_10_7_CFLAGS)
TEMPLATE_XPCOMOSX107_LDFLAGS.darwin = $(filter-out $(VBOX_DARWIN_DEF_SDK_LDFLAGS),$(TEMPLATE_XPCOM_LDFLAGS.darwin)) $(VBOX_DARWIN_DEF_SDK_10_7_LDFLAGS)
TEMPLATE_XPCOMOSX107_DEFS.darwin = $(filter-out $(VBOX_DARWIN_DEF_SDK_DEFS),$(TEMPLATE_XPCOM_DEFS.darwin)) $(VBOX_DARWIN_DEF_SDK_10_7_DEFS)
-I $(VBOX_PATH_XPCOM_SRC)/xpcom/base/ \
-I $(VBOX_PATH_XPCOM_SRC)/xpcom/ds/ \
-I $(VBOX_PATH_XPCOM_SRC)/xpcom/components/ \
-I $(VBOX_PATH_XPCOM_SRC)/xpcom/io/ \
-I $(VBOX_PATH_XPCOM_SRC)/xpcom/threads/ \
-I $(VBOX_PATH_XPCOM_SRC)/xpcom/reflect/xptinfo/public/