From 4121dfd424534b32e76b3aceefb84ec46b3576db Mon Sep 17 00:00:00 2001 From: "bugzilla%standard8.demon.co.uk" Date: Fri, 14 Apr 2006 07:04:53 +0000 Subject: [PATCH] Bug 330053 Make SeaMonkey capable of generating a reasonable build with MOZ_XUL_APP set. Part 5 - First stab at sorting out inclusion of modules in xpfe and toolkit. r=benjamin,sr=Neil git-svn-id: svn://10.0.0.236/trunk@194399 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/toolkit/components/build/Makefile.in | 6 ++++++ .../components/build/nsToolkitCompsModule.cpp | 9 +++++++++ mozilla/xpfe/components/Makefile.in | 7 ++++++- mozilla/xpfe/components/build/Makefile.in | 13 +++++++++++++ mozilla/xpfe/components/build/nsModule.cpp | 17 ++++++++++++++--- mozilla/xpfe/components/console/Makefile.in | 4 ++++ .../components/download-manager/src/Makefile.in | 5 +++++ .../download-manager/src/nsDownloadManager.cpp | 3 +++ 8 files changed, 60 insertions(+), 4 deletions(-) diff --git a/mozilla/toolkit/components/build/Makefile.in b/mozilla/toolkit/components/build/Makefile.in index 5fe6fa925b3..78db03e10b1 100644 --- a/mozilla/toolkit/components/build/Makefile.in +++ b/mozilla/toolkit/components/build/Makefile.in @@ -102,16 +102,22 @@ SHARED_LIBRARY_LIBS = \ ../startup/src/$(LIB_PREFIX)appstartup_s.$(LIB_SUFFIX) \ $(NULL) +ifndef MOZ_SUITE +# XXX Suite isn't ready to build this just yet ifdef MOZ_XPINSTALL SHARED_LIBRARY_LIBS += ../downloads/src/$(LIB_PREFIX)download_s.$(LIB_SUFFIX) endif +endif ifdef ALERTS_SERVICE SHARED_LIBRARY_LIBS += ../alerts/src/$(LIB_PREFIX)alerts_s.$(LIB_SUFFIX) endif +ifndef MOZ_SUITE +# XXX Suite isn't ready to build this just yet SHARED_LIBRARY_LIBS += ../typeaheadfind/src/$(LIB_PREFIX)fastfind_s.$(LIB_SUFFIX) EXTRA_DSO_LIBS = gkgfx +endif EXTRA_DSO_LDOPTS += \ $(LIBS_DIR) \ diff --git a/mozilla/toolkit/components/build/nsToolkitCompsModule.cpp b/mozilla/toolkit/components/build/nsToolkitCompsModule.cpp index 708bd886e1f..559dfe65576 100644 --- a/mozilla/toolkit/components/build/nsToolkitCompsModule.cpp +++ b/mozilla/toolkit/components/build/nsToolkitCompsModule.cpp @@ -44,12 +44,15 @@ #include "nsAlertsService.h" #endif +#ifndef MOZ_SUITE +// XXX Suite isn't ready to include this just yet #ifdef MOZ_XPINSTALL #include "nsDownloadManager.h" #include "nsDownloadProxy.h" #endif #include "nsTypeAheadFind.h" +#endif // MOZ_SUITE ///////////////////////////////////////////////////////////////////////////// @@ -60,12 +63,15 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsUserInfo) NS_GENERIC_FACTORY_CONSTRUCTOR(nsAlertsService) #endif +#ifndef MOZ_SUITE +// XXX Suite isn't ready to include this just yet #ifdef MOZ_XPINSTALL NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsDownloadManager, Init) NS_GENERIC_FACTORY_CONSTRUCTOR(nsDownloadProxy) #endif NS_GENERIC_FACTORY_CONSTRUCTOR(nsTypeAheadFind) +#endif // MOZ_SUITE ///////////////////////////////////////////////////////////////////////////// @@ -86,6 +92,8 @@ static const nsModuleComponentInfo components[] = NS_ALERTSERVICE_CONTRACTID, nsAlertsServiceConstructor }, #endif +#ifndef MOZ_SUITE +// XXX Suite isn't ready to include this just yet #ifdef MOZ_XPINSTALL { "Download Manager", NS_DOWNLOADMANAGER_CID, @@ -101,6 +109,7 @@ static const nsModuleComponentInfo components[] = NS_TYPEAHEADFIND_CONTRACTID, nsTypeAheadFindConstructor }, +#endif // MOZ_SUITE }; NS_IMPL_NSGETMODULE(nsToolkitCompsModule, components) diff --git a/mozilla/xpfe/components/Makefile.in b/mozilla/xpfe/components/Makefile.in index ccf61d4c200..bdd8fa1490b 100644 --- a/mozilla/xpfe/components/Makefile.in +++ b/mozilla/xpfe/components/Makefile.in @@ -86,18 +86,23 @@ ifndef MOZ_XULRUNNER DIRS += \ related \ console \ - updates \ autocomplete \ bookmarks \ download-manager \ history \ sidebar \ + $(NULL) +# XXX When Suite is a fully fledged xul app, this ifdef can be reduced. +ifneq (11,$(MOZ_SUITE)$(MOZ_XUL_APP)) +DIRS += \ + updates \ startup \ alerts \ extensions \ $(NULL) endif endif +endif ifeq ($(OS_ARCH),WINNT) ifndef MOZ_PHOENIX diff --git a/mozilla/xpfe/components/build/Makefile.in b/mozilla/xpfe/components/build/Makefile.in index 96e86f4cba6..8490fb80e78 100644 --- a/mozilla/xpfe/components/build/Makefile.in +++ b/mozilla/xpfe/components/build/Makefile.in @@ -52,10 +52,18 @@ LIBXUL_LIBRARY = 1 PACKAGE_FILE = appcomps.pkg PACKAGE_VARS += MOZ_PHOENIX +# don't build ALERTS_SERVICE for firefox, xulrunner or toolkit-based suite +ifndef MOZ_PHOENIX +ifndef MOZ_XULRUNNER +# XXX When Suite is a fully fledged xul app, this ifdef can be reduced. +ifneq (11,$(MOZ_SUITE)$(MOZ_XUL_APP)) ifneq (,$(filter $(MOZ_GFX_TOOLKIT),windows gtk gtk2)) ALERTS_SERVICE=1 DEFINES += -DALERTS_SERVICE endif +endif +endif +endif REQUIRES = xpcom \ string \ @@ -114,9 +122,14 @@ SHARED_LIBRARY_LIBS += \ ../download-manager/src/$(LIB_PREFIX)downloadmanager_s.$(LIB_SUFFIX) \ ../history/src/$(LIB_PREFIX)history_s.$(LIB_SUFFIX) \ ../related/src/$(LIB_PREFIX)related_s.$(LIB_SUFFIX) \ + $(NULL) +# XXX When Suite is a fully fledged xul app, this ifdef can be reduced. +ifneq (11,$(MOZ_SUITE)$(MOZ_XUL_APP)) +SHARED_LIBRARY_LIBS += \ ../startup/src/$(LIB_PREFIX)appstartup_s.$(LIB_SUFFIX) \ $(NULL) endif +endif ifdef ALERTS_SERVICE SHARED_LIBRARY_LIBS += \ diff --git a/mozilla/xpfe/components/build/nsModule.cpp b/mozilla/xpfe/components/build/nsModule.cpp index c69c5d0f196..c0d34cc88b5 100644 --- a/mozilla/xpfe/components/build/nsModule.cpp +++ b/mozilla/xpfe/components/build/nsModule.cpp @@ -52,16 +52,20 @@ #include "nsDocShellCID.h" #include "nsDownloadManager.h" #include "nsDownloadProxy.h" +// XXX When Suite is a fully fledged xul app, this ifdef can be reduced. +#if !defined(MOZ_SUITE) || !defined(MOZ_XUL_APP) #include "nsAppStartup.h" #include "nsCommandLineService.h" #include "nsUserInfo.h" +#endif #endif // !defined(MOZ_PHOENIX) && !defined(MOZ_XULRUNNER) && !defined(MOZ_MACBROWSER) -#if !defined(MOZ_PHOENIX) && !defined(MOZ_XULRUNNER) #if defined(ALERTS_SERVICE) #include "nsAlertsService.h" #endif + +#if !defined(MOZ_PHOENIX) && !defined(MOZ_XULRUNNER) #if defined(XP_WIN) #include "nsWindowsHooks.h" #include "nsUrlWidget.h" @@ -97,15 +101,19 @@ NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsBookmarksService, Init) NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGlobalHistory, Init) NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsDownloadManager, Init) NS_GENERIC_FACTORY_CONSTRUCTOR(nsDownloadProxy) +// XXX When Suite is a fully fledged xul app, this ifdef can be reduced. +#if !defined(MOZ_SUITE) || !defined(MOZ_XUL_APP) NS_GENERIC_FACTORY_CONSTRUCTOR(nsCmdLineService) NS_GENERIC_FACTORY_CONSTRUCTOR(nsAppStartup) NS_GENERIC_FACTORY_CONSTRUCTOR(nsUserInfo) +#endif #endif // !defined(MOZ_PHOENIX) && !defined(MOZ_XULRUNNER) && !defined(MOZ_MACBROWSER) -#if !defined(MOZ_PHOENIX) && !defined(MOZ_XULRUNNER) #if defined(ALERTS_SERVICE) NS_GENERIC_FACTORY_CONSTRUCTOR(nsAlertsService) #endif + +#if !defined(MOZ_PHOENIX) && !defined(MOZ_XULRUNNER) #if defined(XP_WIN) NS_GENERIC_FACTORY_CONSTRUCTOR(nsWindowsHooks) NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsUrlWidget, Init) @@ -194,6 +202,8 @@ static const nsModuleComponentInfo components[] = { nsGlobalHistoryConstructor }, { "Global History", NS_GLOBALHISTORY_CID, NS_GLOBALHISTORY_AUTOCOMPLETE_CONTRACTID, nsGlobalHistoryConstructor }, +// XXX When Suite is a fully fledged xul app, this ifdef can be reduced. +#if !defined(MOZ_SUITE) || !defined(MOZ_XUL_APP) { "App Startup Service", NS_SEAMONKEY_APPSTARTUP_CID, NS_APPSTARTUP_CONTRACTID, @@ -209,6 +219,7 @@ static const nsModuleComponentInfo components[] = { NS_USERINFO_CONTRACTID, nsUserInfoConstructor }, +#endif { "Related Links Handler", NS_RELATEDLINKSHANDLER_CID, NS_RELATEDLINKSHANDLER_CONTRACTID, RelatedLinksHandlerImplConstructor}, #endif // !defined(MOZ_PHOENIX) && !defined(MOZ_XULRUNNER) && !defined(MOZ_MACBROWSER) @@ -236,11 +247,11 @@ static const nsModuleComponentInfo components[] = { }, #endif -#if !defined(MOZ_PHOENIX) && !defined(MOZ_XULRUNNER) #if defined(ALERTS_SERVICE) { "nsAlertsService", NS_ALERTSSERVICE_CID, NS_ALERTSERVICE_CONTRACTID, nsAlertsServiceConstructor }, #endif +#if !defined(MOZ_PHOENIX) && !defined(MOZ_XULRUNNER) #if defined(XP_WIN) { NS_IURLWIDGET_CLASSNAME, NS_IURLWIDGET_CID, NS_IURLWIDGET_CONTRACTID, nsUrlWidgetConstructor }, diff --git a/mozilla/xpfe/components/console/Makefile.in b/mozilla/xpfe/components/console/Makefile.in index fa4827418ae..a0c4bb1fca8 100644 --- a/mozilla/xpfe/components/console/Makefile.in +++ b/mozilla/xpfe/components/console/Makefile.in @@ -43,7 +43,11 @@ VPATH = @srcdir@ include $(DEPTH)/config/autoconf.mk +ifneq (11,$(MOZ_SUITE)$(MOZ_XUL_APP)) EXTRA_COMPONENTS = jsconsole-clhandler.js +else +EXTRA_COMPONENTS = $(topsrcdir)/toolkit/components/console/jsconsole-clhandler.js +endif include $(topsrcdir)/config/rules.mk diff --git a/mozilla/xpfe/components/download-manager/src/Makefile.in b/mozilla/xpfe/components/download-manager/src/Makefile.in index 066a2f3b046..cfd35deed12 100644 --- a/mozilla/xpfe/components/download-manager/src/Makefile.in +++ b/mozilla/xpfe/components/download-manager/src/Makefile.in @@ -66,6 +66,11 @@ REQUIRES = xpcom \ appcomps \ embed_base \ $(NULL) + +ifdef MOZ_XUL_APP +REQUIRES += alerts toolkitcomps +endif + CPPSRCS = \ nsDownloadManager.cpp \ $(NULL) diff --git a/mozilla/xpfe/components/download-manager/src/nsDownloadManager.cpp b/mozilla/xpfe/components/download-manager/src/nsDownloadManager.cpp index 4e898e0c5b4..fea8a10d987 100644 --- a/mozilla/xpfe/components/download-manager/src/nsDownloadManager.cpp +++ b/mozilla/xpfe/components/download-manager/src/nsDownloadManager.cpp @@ -65,6 +65,9 @@ #include "nsIAlertsService.h" #include "nsEmbedCID.h" #include "nsInt64.h" +#ifdef MOZ_XUL_APP +#include "nsToolkitCompsCID.h" +#endif /* Outstanding issues/todo: * 1. Implement pause/resume.