From 53ac0b7a238395b2efe01c2ff47712ec162bbce7 Mon Sep 17 00:00:00 2001 From: "benjamin%smedbergs.us" Date: Thu, 15 Jun 2006 13:35:59 +0000 Subject: [PATCH] Bug 341406 - Build bookmarks as a separate component, r+sr=Neil --- Makefile.in | 5 ++++- xpfe/components/Makefile.in | 1 - xpfe/components/bookmarks/src/Makefile.in | 15 +++++++++------ .../bookmarks/src/nsBookmarksService.cpp | 15 +++++++++++++++ xpfe/components/build/Makefile.in | 2 -- xpfe/components/build/nsModule.cpp | 9 --------- xpinstall/packager/packages-os2 | 1 + xpinstall/packager/packages-unix | 1 + xpinstall/packager/packages-win | 1 + 9 files changed, 31 insertions(+), 19 deletions(-) diff --git a/Makefile.in b/Makefile.in index bf4644772fa9..1373426333da 100644 --- a/Makefile.in +++ b/Makefile.in @@ -389,7 +389,10 @@ tier_99_dirs += calendar/sunbird endif ifdef MOZ_SUITE -tier_99_dirs += xpfe/components/search +tier_99_dirs += \ + xpfe/components/search \ + xpfe/components/bookmarks \ + $(NULL) # When Suite becomes a full MOZ_XUL_APP we can remove this ifdef ifdef MOZ_XUL_APP diff --git a/xpfe/components/Makefile.in b/xpfe/components/Makefile.in index d72f2045cd02..c960b9666acd 100644 --- a/xpfe/components/Makefile.in +++ b/xpfe/components/Makefile.in @@ -84,7 +84,6 @@ DIRS += \ related \ console \ autocomplete \ - bookmarks \ download-manager \ history \ sidebar \ diff --git a/xpfe/components/bookmarks/src/Makefile.in b/xpfe/components/bookmarks/src/Makefile.in index f9f8086a5d79..37d66dca8351 100644 --- a/xpfe/components/bookmarks/src/Makefile.in +++ b/xpfe/components/bookmarks/src/Makefile.in @@ -42,9 +42,12 @@ VPATH = @srcdir@ include $(DEPTH)/config/autoconf.mk -MODULE = appcomps -LIBRARY_NAME = bookmarks_s +MODULE = appcomps +LIBRARY_NAME = bookmark +MODULE_NAME = BookmarkModule MOZILLA_INTERNAL_API = 1 +IS_COMPONENT = 1 +EXPORT_LIBRARY = 1 REQUIRES = xpcom \ string \ @@ -68,9 +71,9 @@ REQUIRES = xpcom \ CPPSRCS = nsBookmarksService.cpp -# we don't want the shared lib, but we want to force the creation of a -# static lib. -FORCE_STATIC_LIB = 1 - include $(topsrcdir)/config/rules.mk +EXTRA_DSO_LDOPTS += \ + $(MOZ_UNICHARUTIL_LIBS) \ + $(MOZ_COMPONENT_LIBS) \ + $(NULL) diff --git a/xpfe/components/bookmarks/src/nsBookmarksService.cpp b/xpfe/components/bookmarks/src/nsBookmarksService.cpp index f70357436bc7..2c5e882551be 100644 --- a/xpfe/components/bookmarks/src/nsBookmarksService.cpp +++ b/xpfe/components/bookmarks/src/nsBookmarksService.cpp @@ -73,6 +73,7 @@ #include "nsIURL.h" #include "nsIFileURL.h" #include "nsIFile.h" +#include "nsIGenericFactory.h" #include "nsIInputStream.h" #include "nsILineInputStream.h" #include "nsIOutputStream.h" @@ -6051,3 +6052,17 @@ nsBookmarksService::OnEndUpdateBatch(nsIRDFDataSource* aDataSource) return NS_OK; } + +NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsBookmarksService, Init) + +static const nsModuleComponentInfo components[] = { + { "Bookmarks", NS_BOOKMARKS_SERVICE_CID, NS_BOOKMARKS_SERVICE_CONTRACTID, + nsBookmarksServiceConstructor }, + { "Bookmarks", NS_BOOKMARKS_SERVICE_CID, + "@mozilla.org/embeddor.implemented/bookmark-charset-resolver;1", + nsBookmarksServiceConstructor }, + { "Bookmarks", NS_BOOKMARKS_SERVICE_CID, NS_BOOKMARKS_DATASOURCE_CONTRACTID, + nsBookmarksServiceConstructor } +}; + +NS_IMPL_NSGETMODULE(BookmarkModule, components) diff --git a/xpfe/components/build/Makefile.in b/xpfe/components/build/Makefile.in index b6871dbec196..06cd94673068 100644 --- a/xpfe/components/build/Makefile.in +++ b/xpfe/components/build/Makefile.in @@ -110,13 +110,11 @@ ifdef MOZ_SUITE REQUIRES += history downloadmanager SHARED_LIBRARY_LIBS += \ - ../bookmarks/src/$(LIB_PREFIX)bookmarks_s.$(LIB_SUFFIX) \ ../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) LOCAL_INCLUDES += \ - -I$(srcdir)/../bookmarks/src \ -I$(srcdir)/../download-manager/src \ -I$(srcdir)/../history/src \ -I$(srcdir)/../related/src \ diff --git a/xpfe/components/build/nsModule.cpp b/xpfe/components/build/nsModule.cpp index 803049b3c295..827f5f4261ac 100644 --- a/xpfe/components/build/nsModule.cpp +++ b/xpfe/components/build/nsModule.cpp @@ -43,7 +43,6 @@ #include "nsRDFCID.h" #ifdef MOZ_SUITE -#include "nsBookmarksService.h" #include "nsRelatedLinksHandlerImpl.h" #include "nsGlobalHistory.h" #include "nsDocShellCID.h" @@ -93,7 +92,6 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsBrowserInstance) #ifdef MOZ_SUITE NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(RelatedLinksHandlerImpl, Init) -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) @@ -164,13 +162,6 @@ static const nsModuleComponentInfo components[] = { nsHTTPIndexConstructor }, #ifdef MOZ_SUITE - { "Bookmarks", NS_BOOKMARKS_SERVICE_CID, NS_BOOKMARKS_SERVICE_CONTRACTID, - nsBookmarksServiceConstructor }, - { "Bookmarks", NS_BOOKMARKS_SERVICE_CID, - "@mozilla.org/embeddor.implemented/bookmark-charset-resolver;1", - nsBookmarksServiceConstructor }, - { "Bookmarks", NS_BOOKMARKS_SERVICE_CID, NS_BOOKMARKS_DATASOURCE_CONTRACTID, - nsBookmarksServiceConstructor }, { "Download Manager", NS_DOWNLOADMANAGER_CID, NS_DOWNLOADMANAGER_CONTRACTID, nsDownloadManagerConstructor }, { "Download", NS_DOWNLOAD_CID, NS_TRANSFER_CONTRACTID, diff --git a/xpinstall/packager/packages-os2 b/xpinstall/packager/packages-os2 index 53388958e281..d9fa6e01c4bd 100644 --- a/xpinstall/packager/packages-os2 +++ b/xpinstall/packager/packages-os2 @@ -80,6 +80,7 @@ bin/components/accessibility.xpt bin/components/appshell.xpt bin/components/appshell.dll bin/components/appcomps.dll +bin/components/bookmark.dll bin/components/windowds.dll bin/components/intlapp.dll bin/components/xpautoc.dll diff --git a/xpinstall/packager/packages-unix b/xpinstall/packager/packages-unix index 03560ffb86c9..efc2b2541c6d 100644 --- a/xpinstall/packager/packages-unix +++ b/xpinstall/packager/packages-unix @@ -80,6 +80,7 @@ bin/components/alerts.xpt bin/components/libaccessibility.so bin/components/accessibility.xpt bin/components/libappcomps.so +bin/components/libbookmark.so bin/components/libwindowds.so bin/components/libintlapp.so bin/components/libxpautocomplete.so diff --git a/xpinstall/packager/packages-win b/xpinstall/packager/packages-win index 74008f95a529..ce8382ab04b6 100644 --- a/xpinstall/packager/packages-win +++ b/xpinstall/packager/packages-win @@ -63,6 +63,7 @@ bin\xpicleanup.exe bin\components\AcctIdl.dll bin\components\AcctIdl.xpt bin\components\appcomps.dll +bin\components\bookmark.dll bin\components\windowds.dll bin\components\intlapp.dll bin\components\xpautoc.dll