Bug 311735 - When --disable-libxul, build a little xul.dll with the embedding exports, r=darin (This xul.dll is not built in static builds because it wouldn't have access to the static module list anyway)

This commit is contained in:
bsmedberg%covad.net 2005-11-23 14:16:33 +00:00
parent 1d05d0bc6c
commit 6a4881b44b
13 changed files with 459 additions and 358 deletions

View file

@ -65,14 +65,20 @@ endif
REQUIRES = \
xpcom \
xulapp \
$(NULL)
CPPSRCS = nsBrowserApp.cpp
LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre
ifdef BUILD_STATIC_LIBS
STATIC_COMPONENTS_LINKER_PATH = -L$(DIST)/lib/components
LIBS += $(DIST)/lib/$(LIB_PREFIX)xulapp_s.$(LIB_SUFFIX)
else
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
LIBS += -lXUL
else
EXTRA_DSO_LIBS += xul
endif
endif
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
@ -80,13 +86,12 @@ TK_LIBS := -framework Cocoa $(TK_LIBS)
endif
ifdef MOZ_ENABLE_CAIRO_GFX
EXTRA_DSO_LIBS = thebes
EXTRA_DSO_LIBS += thebes
endif
LIBS = \
LIBS += \
$(STATIC_COMPONENTS_LINKER_PATH) \
$(EXTRA_DSO_LIBS) \
$(DIST)/lib/$(LIB_PREFIX)xulapp_s.$(LIB_SUFFIX) \
$(MOZ_JS_LIBS) \
$(XPCOM_LIBS) \
$(NSPR_LIBS) \

View file

@ -71,16 +71,22 @@ LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre
ifdef BUILD_STATIC_LIBS
STATIC_COMPONENTS_LINKER_PATH = -L$(DIST)/lib/components
LIBS += $(DIST)/lib/$(LIB_PREFIX)xulapp_s.$(LIB_SUFFIX)
else
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
LIBS += -lXUL
else
EXTRA_DSO_LIBS += xul
endif
endif
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
TK_LIBS := -framework Cocoa $(TK_LIBS)
endif
LIBS = \
LIBS += \
$(STATIC_COMPONENTS_LINKER_PATH) \
$(EXTRA_DSO_LIBS) \
$(DIST)/lib/$(LIB_PREFIX)xulapp_s.$(LIB_SUFFIX) \
$(MOZ_JS_LIBS) \
$(XPCOM_LIBS) \
$(NSPR_LIBS) \

View file

@ -40,10 +40,15 @@ DIRS = os2Embed
endif
ifeq ($(OS_ARCH),WINNT)
# disable winembed+mfcembed in static builds
# disable winembed in non-libxul
ifndef BUILD_STATIC_LIBS
ifdef MOZ_XUL_APP
DIRS = winEmbed
endif
endif
# disable mfcembed in static builds
ifndef BUILD_STATIC_LIBS
ifndef GNU_CC
ifndef NO_MFC
DIRS += mfcembed/components mfcembed

View file

@ -43,12 +43,10 @@
#include <commdlg.h>
// Mozilla Frozen APIs
#ifdef MOZ_ENABLE_LIBXUL
#include "nsXULAppAPI.h"
#else
// This is not technically frozen, it is statically linked
#include "nsEmbedAPI.h"
#endif
XRE_InitEmbeddingType XRE_InitEmbedding;
XRE_TermEmbeddingType XRE_TermEmbedding;
#include "nsAppDirectoryServiceDefs.h"
#include "nsDirectoryServiceDefs.h"
@ -134,13 +132,6 @@ static const TCHAR *gDefaultURLs[] =
_T("http://www.javasoft.com/")
};
typedef nsresult (*XRE_InitEmbeddingFunc)(nsILocalFile*,
nsILocalFile*,
nsIDirectoryServiceProvider*,
nsStaticModuleInfo const *,
PRUint32);
typedef void (*XRE_TermEmbeddingFunc)();
int main(int argc, char *argv[])
{
nsresult rv;
@ -211,17 +202,19 @@ int main(int argc, char *argv[])
char temp[_MAX_PATH];
GetModuleFileName(xulModule, temp, sizeof(temp));
XRE_InitEmbeddingFunc initFunc =
(XRE_InitEmbeddingFunc) GetProcAddress(xulModule, "XRE_InitEmbedding");
if (!initFunc) {
XRE_InitEmbedding =
(XRE_InitEmbeddingType) GetProcAddress(xulModule, "XRE_InitEmbedding");
if (!XRE_InitEmbedding) {
fprintf(stderr, "Error: %i\n", GetLastError());
return 5;
}
XRE_TermEmbeddingFunc termFunc =
(XRE_TermEmbeddingFunc) GetProcAddress(xulModule, "XRE_TermEmbedding");
if (!initFunc || !termFunc)
XRE_TermEmbedding =
(XRE_TermEmbeddingType) GetProcAddress(xulModule, "XRE_TermEmbedding");
if (!XRE_TermEmbedding) {
fprintf(stderr, "Error: %i\n", GetLastError());
return 5;
}
// Scope all the XPCOM stuff
{
@ -245,7 +238,7 @@ int main(int argc, char *argv[])
if (NS_FAILED(rv))
return 8;
rv = initFunc(xuldir, appdir, nsnull, nsnull, 0);
rv = XRE_InitEmbedding(xuldir, appdir, nsnull, nsnull, 0);
if (NS_FAILED(rv))
return 9;
@ -267,7 +260,7 @@ int main(int argc, char *argv[])
rv = AppCallbacks::RunEventLoop(runCondition);
}
}
termFunc();
XRE_TermEmbedding();
return rv;
}

View file

@ -83,7 +83,7 @@ InitEmbedding_Impl(JNIEnv* env, jobject aLibXULDirectory,
}
// init libXUL
rv = XRE_InitEmbedding(libXULDir, appDir, provider);
rv = XRE_InitEmbedding(libXULDir, appDir, provider, nsnull, 0);
NS_ENSURE_SUCCESS(rv, rv);
return rv;

View file

@ -63,23 +63,28 @@ endif
REQUIRES = \
xpcom \
xulapp \
$(NULL)
LOCAL_INCLUDES = -I$(topsrcdir)/toolkit/xre
CPPSRCS = nsMailApp.cpp
ifdef BUILD_STATIC_LIBS
STATIC_COMPONENTS_LINKER_PATH = -L$(DIST)/lib/components
LIBS += $(DIST)/lib/$(LIB_PREFIX)xulapp_s.$(LIB_SUFFIX)
else
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
LIBS += -lXUL
else
EXTRA_DSO_LIBS += xul
endif
endif
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
TK_LIBS := -framework Cocoa $(TK_LIBS)
endif
LIBS = \
LIBS += \
$(STATIC_COMPONENTS_LINKER_PATH) \
$(DIST)/lib/$(LIB_PREFIX)xulapp_s.$(LIB_SUFFIX) \
$(MOZ_JS_LIBS) \
$(EXTRA_DSO_LIBS) \
$(XPCOM_LIBS) \

View file

@ -44,7 +44,6 @@ include $(DEPTH)/config/autoconf.mk
MODULE = libxul
LIBRARY_NAME = xul
EXPORT_LIBRARY = 1
FORCE_USE_PIC = 1
FORCE_SHARED_LIB = 1
MOZILLA_INTERNAL_API = 1
@ -65,237 +64,40 @@ REQUIRES = \
xulapp \
$(NULL)
CPPSRCS = \
nsStaticXULComponents.cpp \
$(NULL)
ifeq ($(OS_ARCH)_$(GNU_CC),WINNT_)
REQUIRES += libreg widget gfx
CPPSRCS += \
dlldeps.cpp \
dlldeps-obs.cpp \
nsGFXDeps.cpp \
nsDllMain.cpp \
dlldeps-xul.cpp \
$(NULL)
ifndef MOZ_NATIVE_ZLIB
CPPSRCS += dlldeps-zlib.cpp
DEFINES += -DZLIB_INTERNAL
endif
LOCAL_INCLUDES += -I$(topsrcdir)/widget/src/windows
endif
ifeq ($(OS_ARCH),WINNT)
DEFINES += -DZLIB_DLL=1
CPPSRCS += dlldeps-xul.cpp
endif
# dependent libraries
STATIC_LIBS = \
xpcom_core \
xpcom_compat \
unicharutil_s \
ucvutil_s \
gkgfx \
gfxshared_s \
xulapp_s \
$(NULL)
# component libraries
COMPONENT_LIBS += \
xpcom_compat_c \
xpconnect \
necko \
uconv \
i18n \
jar$(VERSION_NUMBER) \
pref \
caps \
rdf \
htmlpars \
imglib2 \
gkplugin \
gklayout \
xmlextras \
docshell \
embedcomponents \
webbrwsr \
editor \
nsappshell \
txmgr \
composer \
chrome \
mork \
mozfind \
appcomps \
commandlines \
tkautocomplete \
toolkitcomps \
xpinstall \
jsd \
pippki \
pipboot \
pipnss \
$(NULL)
ifeq ($(OS_ARCH),WINNT)
COMPONENT_LIBS += intlcmpt
endif
ifdef MOZ_MATHML
COMPONENT_LIBS += ucvmath
endif
ifneq (,$(filter xlib,$(MOZ_WIDGET_TOOLKIT))$(MOZ_ENABLE_XLIB)$(MOZ_ENABLE_XPRINT))
STATIC_LIBS += xlibrgb
endif
ifdef MOZ_ENABLE_XPRINT
DEFINES += -DMOZ_ENABLE_XPRINT
STATIC_LIBS += xprintutil
COMPONENTS_LIBS += gfxxprint
endif
ifdef MOZ_ENABLE_XLIB
STATIC_LIBS += xlibxtbin
endif
ifdef MOZ_ENABLE_GTK
STATIC_LIBS += gtksuperwin
COMPONENT_LIBS += widget_gtk
endif
ifdef MOZ_ENABLE_GTK2
COMPONENT_LIBS += widget_gtk2
endif
ifneq (,$(MOZ_ENABLE_GTK)$(MOZ_ENABLE_GTK2))
STATIC_LIBS += gtkxtbin
endif
ifdef MOZ_IPCD
DEFINES += -DMOZ_IPCD
COMPONENT_LIBS += ipcdc
endif
ifdef MOZ_ENABLE_POSTSCRIPT
DEFINES += -DMOZ_ENABLE_POSTSCRIPT
STATIC_LIBS += gfxpsshar
COMPONENT_LIBS += gfxps
endif
ifneq (,$(filter icon,$(MOZ_IMG_DECODERS)))
ifndef MOZ_ENABLE_GNOMEUI
DEFINES += -DICON_DECODER
COMPONENT_LIBS += imgicon
endif
endif
ifeq (windows,$(MOZ_WIDGET_TOOLKIT))
COMPONENT_LIBS += gkgfxwin gkwidget
endif
ifeq (beos,$(MOZ_WIDGET_TOOLKIT))
COMPONENT_LIBS += gfx_beos widget_beos
endif
ifeq (os2,$(MOZ_WIDGET_TOOLKIT))
COMPONENT_LIBS += gfx_os2 wdgtos2
endif
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
COMPONENT_LIBS += gfx_mac widget_mac
endif
ifeq (qt,$(MOZ_WIDGET_TOOLKIT))
COMPONENT_LIBS += widget_qt
endif
ifdef MOZ_ENABLE_CAIRO_GFX
DEFINES += -DMOZ_ENABLE_CAIRO_GFX
COMPONENT_LIBS += gkgfxcairo
else
ifneq (,$(MOZ_ENABLE_GTK)$(MOZ_ENABLE_GTK2))
COMPONENT_LIBS += gfx_gtk
endif
ifdef MOZ_ENABLE_QT
COMPONENT_LIBS += gfx_qt
endif
ifdef MOZ_ENABLE_XLIB
COMPONENT_LIBS += gfx_xlib
endif
ifdef MOZ_ENABLE_PHOTON
COMPONENT_LIBS += gfx_photon
endif
endif
ifdef MOZ_ENABLE_XLIB
COMPONENT_LIBS += widget_xlib
endif
ifdef MOZ_ENABLE_PHOTON
COMPONENT_LIBS += widget_photon
endif
ifdef MOZ_OJI
STATIC_LIBS += jsj
COMPONENT_LIBS += oji
endif
ifdef ACCESSIBILITY
COMPONENT_LIBS += accessibility
endif
ifdef MOZ_ENABLE_XREMOTE
COMPONENT_LIBS += remoteservice
endif
SHARED_LIBRARY_LIBS = \
$(foreach lib,$(STATIC_LIBS),$(DIST)/lib/$(LIB_PREFIX)$(lib).$(LIB_SUFFIX)) \
$(foreach component,$(COMPONENT_LIBS),$(DIST)/lib/components/$(LIB_PREFIX)$(component).$(LIB_SUFFIX)) \
$(NULL)
EXTRA_DSO_LDOPTS += \
$(MOZ_FIX_LINK_PATHS) \
$(LIBS_DIR) \
$(JPEG_LIBS) \
$(PNG_LIBS) \
$(MOZ_JS_LIBS) \
$(NSS_LIBS) \
ifdef MOZ_ENABLE_LIBXUL
include $(srcdir)/libxul-config.mk
EXTRA_DEPS += \
$(srcdir)/libxul-config.mk \
$(srcdir)/libxul-rules.mk \
$(NULL)
ifdef MOZ_NATIVE_ZLIB
EXTRA_DSO_LDOPTS += $(ZLIB_LIBS)
else
EXTRA_DSO_LDOPTS += $(MOZ_ZLIB_LIBS)
endif
ifdef GC_LEAK_DETECTOR
EXTRA_DSO_LIBS += boehm
endif
ifdef NS_TRACE_MALLOC
EXTRA_DSO_LIBS += tracemalloc
endif
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
EXTRA_DSO_LIBS += macmorefiles_s
EXTRA_DEPS += $(DIST)/lib/$(LIB_PREFIX)macmorefiles_s.$(LIB_SUFFIX)
endif
LOCAL_INCLUDES += -I$(topsrcdir)/config
include $(topsrcdir)/config/rules.mk
EXTRA_DSO_LDOPTS += $(EXTRA_DSO_LIBS)
OS_LIBS += $(LIBICONV)
ifdef MOZ_ENABLE_LIBXUL
include $(srcdir)/libxul-rules.mk
else
EXTRA_DSO_LDOPTS += $(MOZ_COMPONENT_LIBS)
endif
DEFINES += \
-D_IMPL_NS_COM \
-D_IMPL_NS_STRINGAPI \
-DEXPORT_XPT_API \
-DEXPORT_XPTC_API \
-D_IMPL_NS_COM_OBSOLETE \
-D_IMPL_NS_GFX \
-D_IMPL_NS_WIDGET \
-DIMPL_XULAPI \
$(NULL)
DEFINES += -DIMPL_XREAPI
EXTRA_DSO_LDOPTS += $(NSPR_LIBS)
@ -332,23 +134,3 @@ ifdef GNU_CXX
DSO_LDOPTS += -Wl,--export-all-symbols
endif
endif # WINNT
ifdef MOZ_SVG_RENDERER_GDIPLUS
OS_LIBS += Gdiplus.lib
endif
ifdef MOZ_SVG_RENDERER_LIBART
EXTRA_DSO_LDOPTS += $(MOZ_LIBART_LIBS)
endif
ifneq (,$(MOZ_ENABLE_CANVAS)$(MOZ_SVG_RENDERER_CAIRO))
EXTRA_DSO_LDOPTS += $(MOZ_CAIRO_LIBS)
endif
export:: dlldeps.cpp dlldeps-obs.cpp
dlldeps.cpp: $(topsrcdir)/xpcom/build/dlldeps.cpp
$(INSTALL) $^ .
dlldeps-obs.cpp: $(topsrcdir)/xpcom/obsolete/dlldeps-obs.cpp
$(INSTALL) $^ .

View file

@ -0,0 +1,215 @@
#
# ***** 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 Mozilla libxul
#
# The Initial Developer of the Original Code is
# Benjamin Smedberg <benjamin@smedbergs.us>
#
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of 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 *****
CPPSRCS += \
nsStaticXULComponents.cpp \
$(NULL)
ifeq ($(OS_ARCH)_$(GNU_CC),WINNT_)
REQUIRES += libreg widget gfx
CPPSRCS += \
dlldeps.cpp \
dlldeps-obs.cpp \
nsGFXDeps.cpp \
nsDllMain.cpp \
$(NULL)
ifndef MOZ_NATIVE_ZLIB
CPPSRCS += dlldeps-zlib.cpp
DEFINES += -DZLIB_INTERNAL
endif
LOCAL_INCLUDES += -I$(topsrcdir)/widget/src/windows
endif
ifeq ($(OS_ARCH),WINNT)
DEFINES += -DZLIB_DLL=1
endif
# dependent libraries
STATIC_LIBS += \
xpcom_core \
xpcom_compat \
unicharutil_s \
ucvutil_s \
gkgfx \
gfxshared_s \
$(NULL)
# component libraries
COMPONENT_LIBS += \
xpcom_compat_c \
xpconnect \
necko \
uconv \
i18n \
jar$(VERSION_NUMBER) \
pref \
caps \
rdf \
htmlpars \
imglib2 \
gkplugin \
gklayout \
xmlextras \
docshell \
embedcomponents \
webbrwsr \
editor \
nsappshell \
txmgr \
composer \
chrome \
mork \
mozfind \
appcomps \
commandlines \
tkautocomplete \
toolkitcomps \
xpinstall \
jsd \
pippki \
pipboot \
pipnss \
$(NULL)
ifeq ($(OS_ARCH),WINNT)
COMPONENT_LIBS += intlcmpt
endif
ifdef MOZ_MATHML
COMPONENT_LIBS += ucvmath
endif
ifneq (,$(filter xlib,$(MOZ_WIDGET_TOOLKIT))$(MOZ_ENABLE_XLIB)$(MOZ_ENABLE_XPRINT))
STATIC_LIBS += xlibrgb
endif
ifdef MOZ_ENABLE_XPRINT
DEFINES += -DMOZ_ENABLE_XPRINT
STATIC_LIBS += xprintutil
COMPONENTS_LIBS += gfxxprint
endif
ifdef MOZ_ENABLE_XLIB
STATIC_LIBS += xlibxtbin
endif
ifdef MOZ_ENABLE_GTK
STATIC_LIBS += gtksuperwin
COMPONENT_LIBS += widget_gtk
endif
ifdef MOZ_ENABLE_GTK2
COMPONENT_LIBS += widget_gtk2
endif
ifneq (,$(MOZ_ENABLE_GTK)$(MOZ_ENABLE_GTK2))
STATIC_LIBS += gtkxtbin
endif
ifdef MOZ_IPCD
DEFINES += -DMOZ_IPCD
COMPONENT_LIBS += ipcdc
endif
ifdef MOZ_ENABLE_POSTSCRIPT
DEFINES += -DMOZ_ENABLE_POSTSCRIPT
STATIC_LIBS += gfxpsshar
COMPONENT_LIBS += gfxps
endif
ifneq (,$(filter icon,$(MOZ_IMG_DECODERS)))
ifndef MOZ_ENABLE_GNOMEUI
DEFINES += -DICON_DECODER
COMPONENT_LIBS += imgicon
endif
endif
ifeq (windows,$(MOZ_WIDGET_TOOLKIT))
COMPONENT_LIBS += gkgfxwin gkwidget
endif
ifeq (beos,$(MOZ_WIDGET_TOOLKIT))
COMPONENT_LIBS += gfx_beos widget_beos
endif
ifeq (os2,$(MOZ_WIDGET_TOOLKIT))
COMPONENT_LIBS += gfx_os2 wdgtos2
endif
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
COMPONENT_LIBS += gfx_mac widget_mac
endif
ifeq (qt,$(MOZ_WIDGET_TOOLKIT))
COMPONENT_LIBS += widget_qt
endif
ifdef MOZ_ENABLE_CAIRO_GFX
DEFINES += -DMOZ_ENABLE_CAIRO_GFX
COMPONENT_LIBS += gkgfxcairo
else
ifneq (,$(MOZ_ENABLE_GTK)$(MOZ_ENABLE_GTK2))
COMPONENT_LIBS += gfx_gtk
endif
ifdef MOZ_ENABLE_QT
COMPONENT_LIBS += gfx_qt
endif
ifdef MOZ_ENABLE_XLIB
COMPONENT_LIBS += gfx_xlib
endif
ifdef MOZ_ENABLE_PHOTON
COMPONENT_LIBS += gfx_photon
endif
endif
ifdef MOZ_ENABLE_XLIB
COMPONENT_LIBS += widget_xlib
endif
ifdef MOZ_ENABLE_PHOTON
COMPONENT_LIBS += widget_photon
endif
ifdef MOZ_OJI
STATIC_LIBS += jsj
COMPONENT_LIBS += oji
endif
ifdef ACCESSIBILITY
COMPONENT_LIBS += accessibility
endif
ifdef MOZ_ENABLE_XREMOTE
COMPONENT_LIBS += remoteservice
endif

View file

@ -0,0 +1,99 @@
#
# ***** 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 Mozilla libxul
#
# The Initial Developer of the Original Code is
# Benjamin Smedberg <benjamin@smedbergs.us>
#
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of 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 *****
EXTRA_DSO_LDOPTS += \
$(MOZ_FIX_LINK_PATHS) \
$(LIBS_DIR) \
$(JPEG_LIBS) \
$(PNG_LIBS) \
$(MOZ_JS_LIBS) \
$(NSS_LIBS) \
$(NULL)
ifdef MOZ_NATIVE_ZLIB
EXTRA_DSO_LDOPTS += $(ZLIB_LIBS)
else
EXTRA_DSO_LDOPTS += $(MOZ_ZLIB_LIBS)
endif
ifdef GC_LEAK_DETECTOR
EXTRA_DSO_LIBS += boehm
endif
ifdef NS_TRACE_MALLOC
EXTRA_DSO_LIBS += tracemalloc
endif
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
EXTRA_DSO_LIBS += macmorefiles_s
EXTRA_DEPS += $(DIST)/lib/$(LIB_PREFIX)macmorefiles_s.$(LIB_SUFFIX)
endif
LOCAL_INCLUDES += -I$(topsrcdir)/config
OS_LIBS += $(LIBICONV)
DEFINES += \
-D_IMPL_NS_COM \
-D_IMPL_NS_STRINGAPI \
-DEXPORT_XPT_API \
-DEXPORT_XPTC_API \
-D_IMPL_NS_COM_OBSOLETE \
-D_IMPL_NS_GFX \
-D_IMPL_NS_WIDGET \
$(NULL)
ifdef MOZ_SVG_RENDERER_GDIPLUS
OS_LIBS += Gdiplus.lib
endif
ifdef MOZ_SVG_RENDERER_LIBART
EXTRA_DSO_LDOPTS += $(MOZ_LIBART_LIBS)
endif
ifneq (,$(MOZ_ENABLE_CANVAS)$(MOZ_SVG_RENDERER_CAIRO))
EXTRA_DSO_LDOPTS += $(MOZ_CAIRO_LIBS)
endif
export:: dlldeps.cpp dlldeps-obs.cpp
dlldeps.cpp: $(topsrcdir)/xpcom/build/dlldeps.cpp
$(INSTALL) $^ .
dlldeps-obs.cpp: $(topsrcdir)/xpcom/obsolete/dlldeps-obs.cpp
$(INSTALL) $^ .

View file

@ -45,7 +45,6 @@ include $(DEPTH)/config/autoconf.mk
MODULE = xulapp
LIBRARY_NAME = xulapp_s
EXPORT_LIBRARY = 1
LIBXUL_LIBRARY = 1
REQUIRES = \
@ -92,7 +91,10 @@ XPIDLSRCS = \
nsIXULRuntime.idl \
$(NULL)
EXPORTS = nsXULAppAPI.h
EXPORTS = \
xrecore.h \
nsXULAppAPI.h \
$(NULL)
SHAREDCPPSRCS = \
showOSAlert.cpp \
@ -106,7 +108,9 @@ CPPSRCS = \
nsNativeAppSupportBase.cpp \
$(NULL)
ifdef MOZ_ENABLE_LIBXUL
DEFINES += -DIMPL_XREAPI
ifndef BUILD_STATIC_LIBS
CPPSRCS += nsEmbedFunctions.cpp
endif

View file

@ -42,23 +42,9 @@
#include "prtypes.h"
#include "nsID.h"
#include "nscore.h"
#include "xrecore.h"
#include "nsXPCOM.h"
// XXXbsmedberg - eventually we're going to freeze the XULAPI
// symbols, and we don't want every consumer to define MOZ_ENABLE_LIBXUL.
// Reverse the logic so that those who aren't using libxul have to do the
// work.
#ifdef MOZ_ENABLE_LIBXUL
#ifdef IMPL_XULAPI
#define XULAPI NS_EXPORT
#else
#define XULAPI NS_IMPORT
#endif
#else
#define XULAPI
#endif
/**
* Application-specific data needed to start the apprunner.
*
@ -193,16 +179,15 @@ struct nsXREAppData
* SetCurrentDirectory, and relative paths on the command line
* won't be correct.
*/
extern "C" XULAPI int
XRE_main(int argc, char* argv[],
const nsXREAppData* aAppData);
XRE_API(int,
XRE_main, (int argc, char* argv[], const nsXREAppData* sAppData))
/**
* Given a path relative to the current working directory (or an absolute
* path), return an appropriate nsILocalFile object.
*/
extern "C" XULAPI nsresult
XRE_GetFileFromPath(const char *aPath, nsILocalFile* *aResult);
XRE_API(nsresult,
XRE_GetFileFromPath, (const char *aPath, nsILocalFile* *aResult))
/**
* Get the path of the running application binary and store it in aResult.
@ -210,15 +195,15 @@ XRE_GetFileFromPath(const char *aPath, nsILocalFile* *aResult);
* used on *nix, and only when other methods of determining
* the binary path have failed.
*/
extern "C" XULAPI nsresult
XRE_GetBinaryPath(const char *argv0, nsILocalFile* *aResult);
XRE_API(nsresult,
XRE_GetBinaryPath, (const char *argv0, nsILocalFile* *aResult))
/**
* Get the static components built in to libxul.
*/
extern "C" XULAPI void
XRE_GetStaticComponents(nsStaticModuleInfo const **aStaticComponents,
PRUint32 *aComponentCount);
XRE_API(void,
XRE_GetStaticComponents, (nsStaticModuleInfo const **aStaticComponents,
PRUint32 *aComponentCount))
/**
* Initialize libXUL for embedding purposes.
@ -245,14 +230,14 @@ XRE_GetStaticComponents(nsStaticModuleInfo const **aStaticComponents,
* resources allocated by XRE_InitEmbedding.
*/
extern "C" XULAPI nsresult
XRE_InitEmbedding(nsILocalFile *aLibXULDirectory,
nsILocalFile *aAppDirectory,
nsIDirectoryServiceProvider *aAppDirProvider = nsnull,
nsStaticModuleInfo const *aStaticComponents = nsnull,
PRUint32 aStaticComponentCount = 0);
XRE_API(nsresult,
XRE_InitEmbedding, (nsILocalFile *aLibXULDirectory,
nsILocalFile *aAppDirectory,
nsIDirectoryServiceProvider *aAppDirProvider,
nsStaticModuleInfo const *aStaticComponents,
PRUint32 aStaticComponentCount))
extern "C" XULAPI void
XRE_TermEmbedding();
XRE_API(void,
XRE_TermEmbedding, ())
#endif // _nsXULAppAPI_h__

56
toolkit/xre/xrecore.h Normal file
View file

@ -0,0 +1,56 @@
/* ***** 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 Mozilla XULRunner.
*
* The Initial Developer of the Original Code is
* Benjamin Smedberg <benjamin@smedbergs.us>.
*
* Portions created by the Initial Developer are Copyright (C) 2005
* the Mozilla Foundation <http://www.mozilla.org/>. 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 xrecore_h__
#define xrecore_h__
#include "nscore.h"
/**
* Import/export macros for libXUL APIs.
*/
#ifdef XPCOM_GLUE
#define XRE_API(type, name, params) \
typedef (NS_FROZENCALL * name##Type) params; \
extern name##Type name NS_HIDDEN;
#elif defined(IMPL_XREAPI)
#define XRE_API(type, name, params) EXPORT_XPCOM_API(type) name params;
#else
#define XRE_API(type, name, params) IMPORT_XPCOM_API(type) name params;
#endif
#endif // xrecore_h__

View file

@ -88,16 +88,14 @@ LOCAL_INCLUDES += \
-I$(topsrcdir)/toolkit/profile/src \
$(NULL)
ifdef BUILD_STATIC_LIBS
STATIC_COMPONENTS_LINKER_PATH = -L$(DIST)/lib/components
endif
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
TK_LIBS := -framework Cocoa $(TK_LIBS)
LIBS += -lXUL
else
EXTRA_DSO_LIBS += xul
endif
LIBS = \
$(STATIC_COMPONENTS_LINKER_PATH) \
LIBS += \
$(EXTRA_DSO_LIBS) \
$(MOZ_JS_LIBS) \
$(XPCOM_LIBS) \
@ -105,10 +103,6 @@ LIBS = \
$(TK_LIBS) \
$(NULL)
ifndef MOZ_ENABLE_LIBXUL
LIBS += $(DIST)/lib/$(LIB_PREFIX)xulapp_s.$(LIB_SUFFIX)
endif
# Add explicit X11 dependency when building against X11 toolkits
ifneq (,$(filter gtk gtk2 xlib,$(MOZ_WIDGET_TOOLKIT)))
LIBS += $(XLDFLAGS) $(XLIBS)
@ -130,25 +124,11 @@ DEFINES += -DMOZ_WINCONSOLE=$(MOZ_WINCONSOLE)
NSDISTMODE = copy
include $(topsrcdir)/config/config.mk
ifndef BUILD_STATIC_LIBS
ifdef NS_TRACE_MALLOC
EXTRA_DSO_LIBS += tracemalloc
endif
else
include $(topsrcdir)/config/static-config.mk
EXTRA_DEPS += \
$(STATIC_EXTRA_DEPS) \
$(NULL)
DEFINES += $(STATIC_DEFINES)
CPPSRCS += $(STATIC_CPPSRCS)
EXTRA_DSO_LIBS += $(STATIC_EXTRA_DSO_LIBS)
REQUIRES += $(STATIC_REQUIRES)
EXTRA_LIBS += $(STATIC_EXTRA_LIBS)
endif
ifeq ($(OS_ARCH),WINNT)
OS_LIBS += $(call EXPAND_LIBNAME,comctl32 comdlg32 uuid shell32 ole32 oleaut32 version winspool gdi32)
RCINCLUDE = splash.rc
@ -157,9 +137,6 @@ RCFLAGS += -DMOZ_XULRUNNER -I$(srcdir)
else
RCFLAGS += -DMOZ_XULRUNNER --include-dir $(srcdir)
endif
ifdef BUILD_STATIC_LIBS
RCFLAGS += -DMOZ_STATIC_BUILD
endif
ifdef DEBUG
RCFLAGS += -DDEBUG
endif
@ -172,10 +149,6 @@ endif
ifeq ($(OS_ARCH),OS2)
RESFILE=splashos2.res
RCFLAGS += -DMOZ_XULRUNNER
ifdef BUILD_STATIC_LIBS
EXE_DEF_FILE = xulrunner.def
RCFLAGS += -DMOZ_STATIC_BUILD -i $(DIST)/include/widget
endif
ifdef DEBUG
RCFLAGS += -DDEBUG
endif
@ -186,19 +159,6 @@ include $(topsrcdir)/config/rules.mk
DEFINES += -DXULRUNNER_ICO=\"$(DIST)/branding/xulrunner.ico\" -DDOCUMENT_ICO=\"$(DIST)/branding/document.ico\"
ifdef BUILD_STATIC_LIBS
include $(topsrcdir)/config/static-rules.mk
endif
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
ifdef BUILD_STATIC_LIBS
LIBS += -framework QuickTime -framework IOKit
ifdef USE_PREBINDING
BIN_FLAGS += -Wl,-headerpad -Wl,5a0c
endif
endif
endif
ifeq ($(MOZ_WIDGET_TOOLKIT),photon)
LIBS += -lphexlib
endif
@ -219,20 +179,6 @@ LDFLAGS += /HEAP:0x40000
endif
endif
ifeq ($(OS_ARCH),OS2)
ifdef BUILD_STATIC_LIBS
$(EXE_DEF_FILE):
rm -f $@
@echo NAME mozilla >$(EXE_DEF_FILE)
@echo IMPORTS >>$(EXE_DEF_FILE)
@echo WinQueryProperty = PMMERGE.5450 >>$(EXE_DEF_FILE)
@echo WinRemoveProperty = PMMERGE.5451 >>$(EXE_DEF_FILE)
@echo WinSetProperty = PMMERGE.5452 >>$(EXE_DEF_FILE)
LDFLAGS += -Zlinker /NOE
endif
endif
ifneq (,$(filter-out OS2 WINNT Darwin,$(OS_ARCH)))
xulrunner:: mozilla.in Makefile.in Makefile $(DEPTH)/config/autoconf.mk