libxul step 4 - most of tier 50 (not PSM, and I may have forgotten a few things in toolkit/mozapps also) r=darin

This commit is contained in:
bsmedberg%covad.net 2005-03-18 21:24:05 +00:00
Родитель fc973076cd
Коммит d3d9589cf0
39 изменённых файлов: 186 добавлений и 79 удалений

Просмотреть файл

@ -213,13 +213,6 @@ ifdef ACCESSIBILITY
tier_9_dirs += accessible
endif
ifdef MOZ_ENABLE_LIBXUL
tier_9_dirs += \
toolkit/library \
xpcom/stub \
$(NULL)
endif
#
# tier 50 - xpfe & toolkit
#
@ -236,10 +229,6 @@ endif
tier_50_dirs += profile
ifdef MOZ_PSM
tier_50_dirs += security/manager
endif
# This must preceed xpfe
ifdef MOZ_JPROF
tier_50_dirs += tools/jprof
@ -252,15 +241,10 @@ endif
tier_50_dirs += \
db \
xpfe \
themes \
$(NULL)
ifdef MOZ_LEAKY
tier_50_dirs += tools/leaky
endif
ifdef MOZ_MAPINFO
tier_50_dirs += tools/codesighs
ifndef MOZ_XUL_APP
tier_50_dirs += themes
endif
ifdef MOZ_XUL_APP
@ -273,7 +257,6 @@ ifdef MOZ_PHOENIX
tier_50_dirs += browser/components/bookmarks/public browser/components/shell/public
endif
# toolkit/xre/ depends on xpinstall, so it must be in tier 50
ifdef MOZ_XPINSTALL
tier_50_dirs += xpinstall
endif
@ -282,6 +265,17 @@ ifdef NS_TRACE_MALLOC
tier_50_dirs += tools/trace-malloc
endif
ifdef MOZ_ENABLE_LIBXUL
tier_50_dirs += \
toolkit/library \
xpcom/stub \
$(NULL)
endif
ifdef MOZ_PSM
tier_50_dirs += security/manager
endif
ifdef MOZ_STORAGE
tier_50_dirs += db/sqlite3/src storage
endif
@ -296,6 +290,14 @@ tier_50_dirs += toolkit/components/gnome
endif
endif
ifdef MOZ_LEAKY
tier_50_dirs += tools/leaky
endif
ifdef MOZ_MAPINFO
tier_50_dirs += tools/codesighs
endif
#
# tier 9x - application features
#

Просмотреть файл

@ -57,7 +57,7 @@ static const nsXREAppData kAppData = {
int main(int argc, char* argv[])
{
return xre_main(argc, argv, &kAppData);
return XRE_main(argc, argv, &kAppData);
}
#if defined( XP_WIN ) && defined( WIN32 ) && !defined(__GNUC__)

Просмотреть файл

@ -58,7 +58,7 @@ static const nsXREAppData kAppData = {
int main(int argc, char* argv[])
{
return xre_main(argc, argv, &kAppData);
return XRE_main(argc, argv, &kAppData);
}
#if defined( XP_WIN ) && defined( WIN32 ) && !defined(__GNUC__)

Просмотреть файл

@ -42,7 +42,9 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
DIRS = public src tools
DIRS = public src
TOOL_DIRS = tools
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -48,6 +48,7 @@ EXPORT_LIBRARY = 1
IS_COMPONENT = 1
MODULE_NAME = nsChromeModule
GRE_MODULE = 1
LIBXUL_LIBRARY = 1
PACKAGE_FILE = chrome.pkg

Просмотреть файл

@ -483,6 +483,7 @@ DEFINES += \
-D_IMPL_NS_COM_OBSOLETE \
-D_IMPL_NS_GFX \
-D_IMPL_NS_WIDGET \
-DIMPL_XULAPI \
$(NULL)
ifndef MOZ_NATIVE_ZLIB

Просмотреть файл

@ -47,6 +47,7 @@ LIBRARY_NAME = mork
EXPORT_LIBRARY = 1
IS_COMPONENT = 1
MODULE_NAME = nsMorkModule
LIBXUL_LIBRARY = 1
PACKAGE_FILE = mork.pkg

Просмотреть файл

@ -58,7 +58,7 @@ static const nsXREAppData kAppData = {
int main(int argc, char* argv[])
{
return xre_main(argc, argv, &kAppData);
return XRE_main(argc, argv, &kAppData);
}
#if defined( XP_WIN ) && defined( WIN32 ) && !defined(__GNUC__)

Просмотреть файл

@ -45,6 +45,9 @@ include $(DEPTH)/config/autoconf.mk
MODULE = alerts
LIBRARY_NAME = alerts_s
FORCE_STATIC_LIB = 1
LIBXUL_LIBRARY = 1
REQUIRES = xpcom \
string \
windowwatcher \
@ -55,10 +58,6 @@ CPPSRCS = \
nsAlertsService.cpp \
$(NULL)
# 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_COMPONENT_LIBS)

Просмотреть файл

@ -46,6 +46,7 @@ include $(DEPTH)/config/autoconf.mk
MODULE = autocomplete
LIBRARY_NAME = autocomplete_s
FORCE_STATIC_LIB = 1
LIBXUL_LIBRARY = 1
REQUIRES = xpcom \
string \

Просмотреть файл

@ -48,6 +48,7 @@ SHORT_LIBNAME = tkitcmps
EXPORT_LIBRARY = 1
IS_COMPONENT = 1
MODULE_NAME = nsToolkitCompsModule
LIBXUL_LIBRARY = 1
REQUIRES = \
xpcom \

Просмотреть файл

@ -51,6 +51,7 @@ SHORT_LIBNAME = cmdlines
EXPORT_LIBRARY = 1
IS_COMPONENT = 1
MODULE_NAME = CommandLineModule
LIBXUL_LIBRARY = 1
REQUIRES = \
xpcom \

Просмотреть файл

@ -46,6 +46,8 @@ include $(DEPTH)/config/autoconf.mk
MODULE = downloads
LIBRARY_NAME = download_s
FORCE_STATIC_LIB = 1
LIBXUL_LIBRARY = 1
REQUIRES = xpcom \
string \
@ -72,10 +74,6 @@ CPPSRCS = \
nsDownloadManager.cpp \
$(NULL)
# 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_COMPONENT_LIBS)

Просмотреть файл

@ -46,6 +46,7 @@ include $(DEPTH)/config/autoconf.mk
MODULE = history
LIBRARY_NAME = history_s
FORCE_STATIC_LIB = 1
LIBXUL_LIBRARY = 1
REQUIRES = xpcom \
string \

Просмотреть файл

@ -45,6 +45,7 @@ include $(DEPTH)/config/autoconf.mk
MODULE = passwordmgr
LIBRARY_NAME = passwordmgr_s
FORCE_STATIC_LIB = 1
LIBXUL_LIBRARY = 1
REQUIRES = \
necko \

Просмотреть файл

@ -46,6 +46,7 @@ include $(DEPTH)/config/autoconf.mk
MODULE = satchel
LIBRARY_NAME = satchel_s
FORCE_STATIC_LIB = 1
LIBXUL_LIBRARY = 1
REQUIRES = \
xpcom \

Просмотреть файл

@ -44,6 +44,7 @@ include $(DEPTH)/config/autoconf.mk
MODULE = toolkitcomps
LIBRARY_NAME = appstartup_s
FORCE_STATIC_LIB = 1
LIBXUL_LIBRARY = 1
REQUIRES = \
xpcom \

Просмотреть файл

@ -45,6 +45,7 @@ MODULE = fastfind
LIBRARY_NAME = fastfind_s
GRE_MODULE = 1
FORCE_STATIC_LIB = 1
LIBXUL_LIBRARY = 1
PACKAGE_FILE = typeaheadfind.pkg

Просмотреть файл

@ -53,6 +53,7 @@ REQUIRES = \
string \
xpcom_obsolete \
$(ZLIB_REQUIRES) \
xulapp \
$(NULL)
CPPSRCS = \
@ -67,6 +68,7 @@ CPPSRCS += \
dlldeps-obs.cpp \
nsGFXDeps.cpp \
nsDllMain.cpp \
dlldeps-xul.cpp \
$(NULL)
ifndef MOZ_NATIVE_ZLIB
@ -89,6 +91,7 @@ STATIC_LIBS = \
ucvutil_s \
gkgfx \
gfxshared_s \
xulapp_s \
$(NULL)
# component libraries
@ -113,6 +116,13 @@ COMPONENT_LIBS += \
nsappshell \
txmgr \
composer \
chrome \
mork \
mozfind \
appcomps \
commandlines \
toolkitcomps \
xpinstall \
$(NULL)
ifeq ($(OS_ARCH),WINNT)
@ -262,6 +272,7 @@ DEFINES += \
-D_IMPL_NS_COM_OBSOLETE \
-D_IMPL_NS_GFX \
-D_IMPL_NS_WIDGET \
-DIMPL_XULAPI \
$(NULL)
EXTRA_DSO_LDOPTS += $(NSPR_LIBS)

44
toolkit/library/dlldeps-xul.cpp Executable file
Просмотреть файл

@ -0,0 +1,44 @@
/* ***** 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 embedding code.
*
* 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 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 ***** */
#include "nsXULAppAPI.h"
void xxxNeverCalledXUL()
{
XRE_main(0, nsnull, nsnull);
XRE_GetFileFromPath(nsnull, nsnull);
}

Просмотреть файл

@ -178,6 +178,13 @@
MODULE(appshell) \
MODULE(nsTransactionManagerModule) \
MODULE(nsComposerModule) \
MODULE(nsChromeModule) \
MODULE(nsMorkModule) \
MODULE(nsFindComponent) \
MODULE(application) \
MODULE(CommandLineModule) \
MODULE(nsToolkitCompsModule) \
MODULE(nsSoftwareUpdate) \
/* end of list */
#define MODULE(_name) \

Просмотреть файл

@ -45,6 +45,7 @@ include $(DEPTH)/config/autoconf.mk
MODULE = xulapp
LIBRARY_NAME = profile_s
FORCE_STATIC_LIB = 1
LIBXUL_LIBRARY = 1
REQUIRES = \
xpcom \

Просмотреть файл

@ -769,7 +769,7 @@ NS_NewToolkitProfileService(nsIToolkitProfileService* *aResult)
}
nsresult
NS_GetFileFromPath(const char *aPath, nsILocalFile* *aResult)
XRE_GetFileFromPath(const char *aPath, nsILocalFile* *aResult)
{
#if defined(XP_MACOSX)
PRInt32 pathLen = strlen(aPath);

Просмотреть файл

@ -45,6 +45,7 @@ include $(DEPTH)/config/autoconf.mk
MODULE = xulapp
LIBRARY_NAME = xulapp_s
EXPORT_LIBRARY = 1
LIBXUL_LIBRARY = 1
REQUIRES = \
appcomps \

Просмотреть файл

@ -1313,7 +1313,7 @@ SelectProfile(nsIProfileLock* *aResult, nsINativeAppSupport* aNative,
}
if (ar) {
nsCOMPtr<nsILocalFile> lf;
rv = NS_GetFileFromPath(arg, getter_AddRefs(lf));
rv = XRE_GetFileFromPath(arg, getter_AddRefs(lf));
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIProfileUnlocker> unlocker;
@ -1555,7 +1555,8 @@ public:
typedef void (*_g_set_application_name_fn)(const gchar *application_name);
#endif
int xre_main(int argc, char* argv[], const nsXREAppData* aAppData)
int
XRE_main(int argc, char* argv[], const nsXREAppData* aAppData)
{
nsresult rv;
NS_TIMELINE_MARK("enter main");
@ -1643,7 +1644,7 @@ int xre_main(int argc, char* argv[], const nsXREAppData* aAppData)
const char *appDataFile;
if (CheckArg("app", &appDataFile) == ARG_FOUND) {
nsCOMPtr<nsILocalFile> lf;
NS_GetFileFromPath(appDataFile, getter_AddRefs(lf));
XRE_GetFileFromPath(appDataFile, getter_AddRefs(lf));
lf->GetParent(getter_AddRefs(xulAppDir));
}

Просмотреть файл

@ -87,9 +87,6 @@ nsresult NS_CreateNativeAppSupport(nsINativeAppSupport* *aResult);
NS_HIDDEN_(nsresult)
NS_NewToolkitProfileService(nsIToolkitProfileService* *aResult);
NS_HIDDEN_(nsresult)
NS_GetFileFromPath(const char *aPath, nsILocalFile* *aResult);
NS_HIDDEN_(nsresult)
NS_LockProfilePath(nsILocalFile* aPath, nsIProfileUnlocker* *aUnlocker,
nsIProfileLock* *aResult);

Просмотреть файл

@ -42,17 +42,28 @@
#include "prtypes.h"
#include "nsID.h"
#include "nscore.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
class nsILocalFile;
/**
* This API is "not even kinda frozen yet"
*/
/**
* Indicates whether or not to heed "general.startup.*" prefs.
* XXXbsmedberg this is going away
*/
#define NS_XRE_USE_STARTUP_PREFS (1 << 0)
/**
* Indicates whether or not the profile migrator service may be
* invoked at startup when creating a profile.
@ -130,6 +141,14 @@ struct nsXREAppData
* SetCurrentDirectory, and relative paths on the command line
* won't be correct.
*/
int xre_main(int argc, char* argv[], const nsXREAppData* aAppData);
extern "C" XULAPI int
XRE_main(int argc, char* argv[], const nsXREAppData* aAppData);
/**
* 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);
#endif // _nsXULAppAPI_h__

Просмотреть файл

@ -89,6 +89,7 @@ CPPSRCS = \
# we don't want the shared lib, but we want to force the creation of a static lib.
FORCE_STATIC_LIB = 1
LIBXUL_LIBRARY = 1
LOCAL_INCLUDES = \
-I$(srcdir) \

Просмотреть файл

@ -45,6 +45,7 @@ include $(DEPTH)/config/autoconf.mk
MODULE = browser
LIBRARY_NAME = mozbrwsr_s
FORCE_STATIC_LIB = 1
LIBXUL_LIBRARY = 1
MODULE_NAME = nsBrowserModule
REQUIRES = xpcom \
string \

Просмотреть файл

@ -47,6 +47,7 @@ LIBRARY_NAME = appcomps
EXPORT_LIBRARY = 1
IS_COMPONENT = 1
MODULE_NAME = application
LIBXUL_LIBRARY = 1
PACKAGE_FILE = appcomps.pkg
PACKAGE_VARS += MOZ_PHOENIX

Просмотреть файл

@ -43,8 +43,10 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = appcomps
LIBRARY_NAME = directory_s
XPIDL_MODULE = directory
LIBRARY_NAME = directory_s
LIBXUL_LIBRARY = 1
XPIDLSRCS = nsIHTTPIndex.idl
REQUIRES = xpcom \
string \

Просмотреть файл

@ -48,6 +48,7 @@ LIBRARY_NAME = mozfind
EXPORT_LIBRARY = 1
IS_COMPONENT = 1
MODULE_NAME = nsFindComponent
LIBXUL_LIBRARY = 1
PACKAGE_FILE = mozfind.pkg

Просмотреть файл

@ -44,6 +44,9 @@ include $(DEPTH)/config/autoconf.mk
MODULE = appcomps
LIBRARY_NAME = appcompintl_s
FORCE_STATIC_LIB = 1
LIBXUL_LIBRARY = 1
REQUIRES = xpcom \
string \
uconv \
@ -68,6 +71,4 @@ CPPSRCS= \
nsFontPackageHandler.cpp \
$(NULL)
FORCE_STATIC_LIB=1
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -44,6 +44,12 @@ include $(DEPTH)/config/autoconf.mk
MODULE = appcomps
LIBRARY_NAME = search_s
FORCE_STATIC_LIB = 1
# XXXbsmedberg: this really shouldn't be part of toolkit, but part of
# tier_99 app-specific code. Fix me!
LIBXUL_LIBRARY = 1
REQUIRES = xpcom \
string \
rdf \
@ -63,9 +69,5 @@ CPPSRCS = \
nsLocalSearchService.cpp \
$(NULL)
# 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

Просмотреть файл

@ -45,6 +45,8 @@ include $(DEPTH)/config/autoconf.mk
MODULE = appcomps
XPIDL_MODULE = windowds
LIBRARY_NAME = windowds_s
LIBXUL_LIBRARY = 1
FORCE_STATIC_LIB = 1
REQUIRES = xpcom \
string \
@ -58,9 +60,5 @@ CPPSRCS = nsWindowDataSource.cpp
XPIDLSRCS = nsIWindowDataSource.idl
# 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

Просмотреть файл

@ -47,7 +47,11 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = xpinstall
DIRS = public src stub cleanup
DIRS = public src cleanup
ifndef MOZ_ENABLE_LIBXUL
DIRS += stub
endif
ifndef MOZ_XUL_APP
DIRS += res

Просмотреть файл

@ -53,11 +53,12 @@ ifndef MOZ_ENABLE_LIBXUL
# this component is shared by installer
FORCE_SHARED_LIB = 1
MOZ_STATIC_COMPONENT_LIBS=
endif
SHORT_LIBNAME = xpinstal
endif
IS_COMPONENT = 1
MODULE_NAME = nsSoftwareUpdate
GRE_MODULE = 1
LIBXUL_LIBRARY = 1
PACKAGE_FILE = base.pkg
@ -144,9 +145,7 @@ CPPSRCS += \
nsAppleSingleDecoder.cpp \
$(NULL)
LIBS += \
$(DEPTH)/dist/lib/libmacmorefiles_s.a \
$(NULL)
EXTRA_DSO_LDOPTS += $(DEPTH)/dist/lib/libmacmorefiles_s.a
endif
LOCAL_INCLUDES = -I$(srcdir)/../public
@ -158,13 +157,8 @@ EXTRA_DSO_LDOPTS = \
$(MOZ_COMPONENT_LIBS) \
$(MOZ_UNICHARUTIL_LIBS) \
$(ZLIB_LIBS) \
$(NULL)
ifndef MOZ_ENABLE_LIBXUL
EXTRA_DSO_LDOPTS += \
$(MOZ_XPCOM_OBSOLETE_LIBS) \
$(NULL)
endif
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
EXTRA_DSO_LDOPTS += $(TK_LIBS)

Просмотреть файл

@ -65,6 +65,10 @@ REQUIRES = \
CPPSRCS = nsXULRunnerApp.cpp
ifdef MOZ_ENABLE_LIBXUL
CPPSRCS += nsINIParser.cpp
endif
LOCAL_INCLUDES += \
-I$(topsrcdir)/toolkit/xre \
-I$(topsrcdir)/toolkit/profile/src \
@ -81,13 +85,16 @@ endif
LIBS = \
$(STATIC_COMPONENTS_LINKER_PATH) \
$(EXTRA_DSO_LIBS) \
$(DIST)/lib/$(LIB_PREFIX)xulapp_s.$(LIB_SUFFIX) \
$(MOZ_JS_LIBS) \
$(XPCOM_LIBS) \
$(NSPR_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)
@ -203,8 +210,6 @@ LDFLAGS += /HEAP:0x40000
endif
endif
$(PROGRAM): $(DIST)/lib/$(LIB_PREFIX)xulapp_s.$(LIB_SUFFIX)
ifeq ($(OS_ARCH),OS2)
ifdef BUILD_STATIC_LIBS
$(EXE_DEF_FILE):
@ -317,6 +322,11 @@ endif
README_FILE = $(topsrcdir)/README.txt
ifdef MOZ_ENABLE_LIBXUL
export::
$(INSTALL) $(topsrcdir)/toolkit/profile/src/nsINIParser.cpp .
endif
libs::
$(INSTALL) $(README_FILE) $(DIST)/bin
$(INSTALL) $(topsrcdir)/LICENSE $(DIST)/bin

Просмотреть файл

@ -109,7 +109,7 @@ static const nsXREAppData* LoadAppData(const char* appDataFile)
vendor, name, version, buildID, {0,0,0,{0,0,0,0,0,0,0,0}}, copyright, 0 };
nsCOMPtr<nsILocalFile> lf;
NS_GetFileFromPath(appDataFile, getter_AddRefs(lf));
XRE_GetFileFromPath(appDataFile, getter_AddRefs(lf));
if (!lf)
return nsnull;
@ -180,7 +180,6 @@ static const nsXREAppData* LoadAppData(const char* appDataFile)
const char* key;
PRUint32 flag;
} boolean_fields[] = {
{ "UseStartupPrefs", NS_XRE_USE_STARTUP_PREFS },
{ "EnableProfileMigrator", NS_XRE_ENABLE_PROFILE_MIGRATOR },
{ "EnableExtensionManager", NS_XRE_ENABLE_EXTENSION_MANAGER }
};
@ -283,7 +282,7 @@ int main(int argc, char* argv[])
argc++;
}
int rv = xre_main(argc, argv, appData);
int rv = XRE_main(argc, argv, appData);
if (argv2)
free(argv2);