make static build to support DISABLE_MAILNEWS flag, and enable making

gecko.dll for static build bug=93100 sr=waterson


git-svn-id: svn://10.0.0.236/trunk@100742 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
cathleen%netscape.com
2001-08-10 05:18:27 +00:00
parent ec6315ccf3
commit 546ff02d58
4 changed files with 203 additions and 4 deletions

View File

@@ -26,6 +26,14 @@ include <$(DEPTH)\config\config.mak>
META_MODULES=mail
!ifdef DISABLE_MAILNEWS
META_MODULES=
!endif
!ifdef MOZ_GECKO_DLL
META_MODULES=$(META_MODULES) gecko
!endif
!ifdef BUILD_PSM2
META_MODULES=$(META_MODULES) crypto
!endif

View File

@@ -47,6 +47,23 @@ LLIBS = $(DIST)\lib\gkgfx.lib \
$(DIST)\lib\xpcom.lib \
$(LIBNSPR)
!ifdef MOZ_GECKO_DLL
LLIBS = $(LLIBS) \
$(DIST)\lib\png.lib \
$(DIST)\lib\mng.lib \
$(DIST)\lib\util.lib \
$(DIST)\lib\expat.lib \
$(DIST)\lib\nsldap32v40.lib
WIN_LIBS = comctl32.lib \
comdlg32.lib \
uuid.lib \
ole32.lib \
shell32.lib \
oleaut32.lib \
version.lib
!endif
include <$(DEPTH)/config/rules.mak>
#
@@ -98,6 +115,21 @@ $(EXTRA_LIBS_LIST_FILE): $(LINK_COMPS) $(LINK_LIBS)
sed -e "s/\(.*\)/$(DIST:\=\\\)\\\lib\\\\\1.lib/" $(LINK_COMPS) > $@
sed -e "s/\(.*\)/$(DIST:\=\\\)\\\lib\\\\\1.lib/" $(LINK_LIBS) >> $@
# XXX this is a hack. The ``gecko'' meta-module consists
# of all the static components linked into a DLL instead
# of an executable. To make this work, we'll copy the
# statically linked libs, components, and component names
# to the right file. This relies on the fact that the
# modules/staticmod directory gets built after all the other
# directories in the tree are processed.
!if defined(MOZ_GECKO_DLL) && "$(META_MODULE)" == "gecko"
export::
copy $(FINAL_LINK_LIBS) $(DIST)\$(META_MODULE)-link-libs
copy $(FINAL_LINK_COMPS) $(DIST)\$(META_MODULE)-link-comps
copy $(FINAL_LINK_COMP_NAMES) $(DIST)\$(META_MODULE)-link-comp-names
!endif
install:: $(DLL)
$(MAKE_INSTALL) $(DLL) $(DIST)/bin/components

View File

@@ -0,0 +1,159 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Christopher Seawood <cls@seawood.org>
* Doug Turner <dougt@netscape.com>
*/
#include "nsError.h"
#include "nsIModule.h"
#include "nsIFile.h"
#include "nsIGenericFactory.h"
#include "prmem.h"
#define NS_METAMODULE_NAME "nsMetaModuleGecko"
#define NS_METAMODULE_DESC "Meta Component Gecko"
#define NS_METAMODULE_CID \
{ 0xf958fb6b, 0x41eb, 0x4615, { 0x97, 0xfb, 0x81, 0xf2, 0x29, 0x37, 0xf8, 0x3c } }
#define NS_METAMODULE_CONTRACTID "@mozilla.org/metamodule_gecko;1"
/*
* NO USER EDITABLE PORTIONS AFTER THIS POINT
*
*/
#define REGISTER_MODULE_USING(mod) { \
nsCOMPtr<nsIModule> module; \
mod##(aCompMgr, aPath, getter_AddRefs(module)); \
module->RegisterSelf(aCompMgr, aPath, aRegistryLocation, aComponentType); \
}
struct nsModuleComponentInfoContainer {
nsModuleComponentInfo *list;
PRUint32 count;
};
%DECLARE_COMPONENT_LIST%
static nsresult
NS_RegisterMetaModules(nsIComponentManager *aCompMgr,
nsIFile *aPath,
const char *aRegistryLocation,
const char *aComponentType)
{
nsresult rv = NS_OK;
%COMPONENT_NS_GET_MODULE%
{};
return rv;
}
void META_DESTRUCTOR_FUNC(nsIModule *self, nsModuleComponentInfo *components)
{
PR_Free(components);
}
class nsMetaModuleImpl : public nsISupports
{
public:
nsMetaModuleImpl();
virtual ~nsMetaModuleImpl();
NS_DECL_ISUPPORTS
};
nsMetaModuleImpl::nsMetaModuleImpl()
{
NS_INIT_REFCNT();
}
nsMetaModuleImpl::~nsMetaModuleImpl()
{
}
NS_IMPL_ISUPPORTS1(nsMetaModuleImpl, nsISupports);
NS_GENERIC_FACTORY_CONSTRUCTOR(nsMetaModuleImpl)
static NS_METHOD nsMetaModuleRegistrationProc(nsIComponentManager *aCompMgr,
nsIFile *aPath,
const char *registryLocation,
const char *componentType,
const nsModuleComponentInfo *info)
{
NS_RegisterMetaModules(aCompMgr, aPath, registryLocation, componentType);
return NS_OK;
}
static NS_METHOD nsMetaModuleUnregistrationProc(nsIComponentManager *aCompMgr,
nsIFile *aPath,
const char *registryLocation,
const nsModuleComponentInfo *info)
{
return NS_OK;
}
static nsModuleComponentInfo components[] =
{
{ NS_METAMODULE_DESC,
NS_METAMODULE_CID,
NS_METAMODULE_CONTRACTID,
nsMetaModuleImplConstructor,
nsMetaModuleRegistrationProc,
nsMetaModuleUnregistrationProc
},
};
static nsModuleComponentInfoContainer componentsList[] = {
{ components, sizeof(components)/sizeof(components[0]) },
%COMPONENT_LIST%
{ nsnull, 0 }
};
extern "C" NS_EXPORT nsresult NSGetModule(nsIComponentManager *servMgr,
nsIFile* location,
nsIModule** result)
{
nsModuleComponentInfo *outList = nsnull;
nsModuleComponentInfoContainer *inList = componentsList;
PRUint32 count = 0, i = 0, k=0, msize = sizeof(nsModuleComponentInfo);
while (inList[i].list != nsnull) {
count += inList[i].count;
i++;
}
outList = (nsModuleComponentInfo *) PR_Calloc(count, sizeof(nsModuleComponentInfo));
i = 0; k =0;
while (inList[i].list != nsnull) {
memcpy(&outList[k], inList[i].list, msize * inList[i].count);
k+= inList[i].count;
i++;
}
return NS_NewGenericModule(NS_METAMODULE_NAME, count, outList, nsnull, nsnull, result);
}

View File

@@ -24,7 +24,7 @@ include <$(DEPTH)/config/config.mak>
DEFINES=-DWIN32_LEAN_AND_MEAN
!ifdef MOZ_STATIC_COMPONENT_LIBS
!if defined(MOZ_STATIC_COMPONENT_LIBS) && !defined(MOZ_GECKO_DLL)
DEFINES=$(DEFINES) -D_BUILD_STATIC_BIN
EXTRA_LIBS_LIST_FILE=$(OBJDIR)\libs.txt
SEDCMDS=nsStaticComonents.cpp.sed
@@ -38,7 +38,7 @@ CPPSRCS= \
nsNativeAppSupportBase.cpp \
nsNativeAppSupportWin.cpp \
showOSAlert.cpp \
!ifdef MOZ_STATIC_COMPONENT_LIBS
!if defined(MOZ_STATIC_COMPONENT_LIBS) && !defined(MOZ_GECKO_DLL)
nsStaticComponents.cpp \
!endif
$(NULL)
@@ -50,7 +50,7 @@ CPP_OBJS= \
.\$(OBJDIR)\nsNativeAppSupportBase.obj \
.\$(OBJDIR)\nsNativeAppSupportWin.obj \
.\$(OBJDIR)\showOSAlert.obj \
!ifdef MOZ_STATIC_COMPONENT_LIBS
!if defined(MOZ_STATIC_COMPONENT_LIBS) && !defined(MOZ_GECKO_DLL)
.\$(OBJDIR)\nsStaticComponents.obj \
!endif
$(NULL)
@@ -140,7 +140,7 @@ WIN_LIBS= \
include <$(DEPTH)\config\rules.mak>
!ifdef MOZ_STATIC_COMPONENT_LIBS
!if defined(MOZ_STATIC_COMPONENT_LIBS) && !defined(MOZ_GECKO_DLL)
$(SEDCMDS): $(FINAL_LINK_COMP_NAMES)
rm -f $@