Bug 520339 - Remove leftovers from MOZ_COMPONENTLIB, r=bsmedberg

This commit is contained in:
Phil Ringnalda 2009-10-10 18:07:43 -07:00
parent 38a767ad9f
commit 1f92d17fc3
5 changed files with 3 additions and 335 deletions

View File

@ -707,18 +707,6 @@ endif
endif
endif
# Flags needed to link against the component library
ifdef MOZ_COMPONENTLIB
MOZ_COMPONENTLIB_EXTRA_DSO_LIBS = mozcomps
# Tell the linker where NSS is, if we're building crypto
ifeq ($(OS_ARCH),Darwin)
ifeq (,$(findstring crypto,$(MOZ_META_COMPONENTS)))
MOZ_COMPONENTLIB_EXTRA_LIBS = $(foreach library, $(patsubst -l%, $(LIB_PREFIX)%$(DLL_SUFFIX), $(filter -l%, $(NSS_LIBS))), -dylib_file @executable_path/$(library):$(DIST)/bin/$(library))
endif
endif
endif
# If we're building a component on MSVC, we don't want to generate an
# import lib, because that import lib will collide with the name of a
# static version of the same library.

View File

@ -1,168 +0,0 @@
#
# ***** 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.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# 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 *****
DEPTH = ../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
LOCAL_INCLUDES = -I$(srcdir)
include $(topsrcdir)/config/config.mk
_FINAL_COMPONENT_NAMES := $(shell cat $(FINAL_LINK_COMP_NAMES))
_FINAL_COMPONENT_LIBS := $(shell cat $(FINAL_LINK_COMPS))
_FINAL_LINK_LIBS := $(shell cat $(FINAL_LINK_LIBS))
_META_COMPONENT_NAMES := _FINAL_COMPONENT_NAMES
_META_COMPONENT_LIBS := _FINAL_COMPONENT_LIBS
_META_DEP_LIBS := _FINAL_LINK_LIBS
LIBRARY_NAME = mozcomps
CPPSRCS = nsMetaModule_mozcomps.cpp
include $(topsrcdir)/config/static-config.mk
EXTRA_DSO_LIBS = $(STATIC_EXTRA_DSO_LIBS)
# See explanation below.
ifeq ($(OS_ARCH),Darwin)
EXTRA_DEPS = force_data_segment.o exported_symbols
endif
FORCE_SHARED_LIB = 1
include $(topsrcdir)/config/rules.mk
include $(topsrcdir)/config/static-rules.mk
# Force XPCOM_TRANSLATE_NSGM_ENTRY_POINT to be defined so the macros
# in nsIGenericFactory.h will come out in the wash.
DEFINES += -DMETA_MODULE=\"$(LIBRARY_NAME)\" -DXPCOM_TRANSLATE_NSGM_ENTRY_POINT
# We don't want to link mozcomps against NSS if not necessary
ifneq (,$(findstring crypto,$(MOZ_META_COMPONENTS)))
STATIC_EXTRA_LIBS := $(filter-out $(NSS_LIBS),$(STATIC_EXTRA_LIBS))
endif
EXTRA_DSO_LDOPTS += \
$(LIBS_DIR) \
$(EXTRA_DSO_LIBS) \
$(STATIC_EXTRA_LIBS) \
$(MOZ_JS_LIBS) \
$(MOZ_UNICHARUTIL_LIBS) \
$(MOZ_COMPONENT_LIBS) \
$(TK_LIBS) \
$(NULL)
ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
OS_LIBS += -framework QuickTime
endif
ifeq ($(OS_ARCH),Darwin)
# A limitation exists in the Mach-O format which causes "scattered" relocation
# entries in shared libraries to be limited to a 24-bit address space (16 MB).
# The high 8 bits of the address are dropped. This can cause problems in
# a mozcomps build, particularly non-optimized builds. To avoid the problem,
# we move the data segment before the code segment in the libraray. The data
# segment is relatively small, and all of the relocations in question
# (which are pointers to construction vtables) reside in the
# (__DATA,__const) section.
#
# See also the 5th item in the TODO section of:
# http://www.opensource.apple.com/darwinsource/10.2.6/cctools/ld/notes
# (free APSL registration required)
# Generate a .o file with only a data segment, which we'll link as the first
# object file in the library. That will cause the data segment to be first.
force_data_segment.o:
ld -sectcreate __DATA __const /dev/null -noseglinkedit -arch ppc -o $@
exported_symbols:
echo _nsMetaModule_nsGetModule > $@
# We have to invoke ld directly so that force_data_segment.o can be linked
# before dylib1.o
MKSHLIB = $(LD) $(DSO_LDOPTS) -o $@
# force it to be first
SHLIB_LDSTARTFILE = force_data_segment.o -ldylib1.o
# translate gcc link options to corresponding ld options
EXTRA_DSO_LDOPTS := $(subst -dynamiclib,-dylib,$(EXTRA_DSO_LDOPTS))
EXTRA_DSO_LDOPTS := $(subst install_name,dylib_install_name,$(EXTRA_DSO_LDOPTS))
EXTRA_DSO_LDOPTS := $(subst compatibility_version,dylib_compatibility_version,$(EXTRA_DSO_LDOPTS))
EXTRA_DSO_LDOPTS := $(subst current_version,dylib_current_version,$(EXTRA_DSO_LDOPTS))
# It would be nice to limit the exported symbols here, but doing so exposes a
# bug in the linker that causes some C++ static initializers not to run after
# prebinding is updated at runtime (reported as Radar bug 3268595).
#EXTRA_DSO_LDOPTS += -exported_symbols_list exported_symbols
OS_LIBS := -lstdc++ $(OS_LIBS)
SHLIB_LDENDFILE = -lgcc
endif # darwin
ifeq ($(OS_ARCH),WINNT)
OS_LIBS += ole32.lib shell32.lib
endif
ifeq ($(OS_ARCH),BeOS)
OS_LIBS += -ltracker
endif
GARBAGE += $(CPPSRCS)
ifdef _NO_AUTO_VARS
_TARGET = $(srcdir)/$(@F)
GARBAGE += $(addprefix $(srcdir)/,$(CPPSRCS))
else
_TARGET = $@
endif
nsMetaModule_%.cpp: nsMetaModule.cpp.in $(GLOBAL_DEPS) $(topsrcdir)/config/config.mk
rm -f $@
cat $< | \
sed -e "s|%DECLARE_SUBMODULE_INFOS%|$(foreach m, $($(_META_COMPONENT_NAMES)), extern nsModuleInfo NSMODULEINFO($(m));)|" | \
sed -e "s|%SUBMODULE_INFOS%|$(foreach m, $($(_META_COMPONENT_NAMES)), \\& NSMODULEINFO($(m)),)|" \
> $(_TARGET)

View File

@ -1,134 +0,0 @@
/* ***** 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.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Christopher Seawood <cls@seawood.org>
* Doug Turner <dougt@netscape.com>
* Chris Waterson <waterson@netscape.com>
*
* 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 ***** */
#line 27 "nsMetaModule.cpp.in"
#include "nsError.h"
#include "nsIModule.h"
#include "nsIFile.h"
#include "nsIGenericFactory.h"
#include "prmem.h"
%DECLARE_SUBMODULE_INFOS%
#line 35 "nsMetaModule.cpp.in"
static nsModuleInfo* gSubModules[] = {
%SUBMODULE_INFOS%
#line 39 "nsMetaModule.cpp.in"
};
#define NUM_SUB_MODULES (sizeof(gSubModules) / sizeof(gSubModules[0]))
static nsModuleComponentInfo* gComponentInfo;
static PRBool gInitialized = PR_FALSE;
PR_STATIC_CALLBACK(nsresult)
Initialize(nsIModule *self)
{
if (! gInitialized) {
// Run the ctor for each sub-module
gInitialized = PR_TRUE;
nsModuleInfo** module = gSubModules;
nsModuleInfo** limit = module + NUM_SUB_MODULES;
for ( ; module < limit; ++module) {
if ((*module)->mCtor)
((*module)->mCtor)(self);
}
}
return NS_OK;
}
PR_STATIC_CALLBACK(void)
Shutdown(nsIModule *self)
{
if (gInitialized) {
// Run the dtor for each sub-module
gInitialized = PR_FALSE;
nsModuleInfo** module = gSubModules;
nsModuleInfo** limit = module + NUM_SUB_MODULES;
for ( ; module < limit; ++module) {
if ((*module)->mDtor)
((*module)->mDtor)(self);
}
}
}
extern "C" NS_EXPORT nsresult
nsMetaModule_nsGetModule(nsIComponentManager *servMgr,
nsIFile *location,
nsIModule **result)
{
// Count the number of components contained in all of the
// sub-modules
nsModuleInfo** info = gSubModules;
nsModuleInfo** limit = info + NUM_SUB_MODULES;
PRUint32 count = 0;
for ( ; info < limit; ++info)
count += (*info)->mCount;
// Allocate an nsModuleComponentInfo array large enough to contain
// all of them. This will be permanently leaked.
gComponentInfo = new nsModuleComponentInfo[count];
if (! gComponentInfo)
return NS_ERROR_OUT_OF_MEMORY;
// Copy the module component info into the contiguous array
nsModuleComponentInfo *comps = gComponentInfo;
for (info = gSubModules; info < limit; ++info) {
PRUint32 n = (*info)->mCount;
::memcpy(comps, (*info)->mComponents, sizeof(nsModuleComponentInfo) * n);
comps += n;
}
// Dummy up an nsModuleInfo struct to register us as a generic
// module that contains all our sub-module's components.
nsModuleInfo metainfo;
memset(&metainfo, 0, sizeof(metainfo));
metainfo.mVersion = NS_MODULEINFO_VERSION;
metainfo.mModuleName = META_MODULE " meta module";
metainfo.mComponents = gComponentInfo;
metainfo.mCount = count;
metainfo.mCtor = Initialize;
metainfo.mDtor = Shutdown;
return NS_NewGenericModule2(&metainfo, result);
}

View File

@ -707,18 +707,6 @@ endif
endif
endif
# Flags needed to link against the component library
ifdef MOZ_COMPONENTLIB
MOZ_COMPONENTLIB_EXTRA_DSO_LIBS = mozcomps
# Tell the linker where NSS is, if we're building crypto
ifeq ($(OS_ARCH),Darwin)
ifeq (,$(findstring crypto,$(MOZ_META_COMPONENTS)))
MOZ_COMPONENTLIB_EXTRA_LIBS = $(foreach library, $(patsubst -l%, $(LIB_PREFIX)%$(DLL_SUFFIX), $(filter -l%, $(NSS_LIBS))), -dylib_file @executable_path/$(library):$(DIST)/bin/$(library))
endif
endif
endif
# If we're building a component on MSVC, we don't want to generate an
# import lib, because that import lib will collide with the name of a
# static version of the same library.

View File

@ -1245,17 +1245,11 @@ if [ "$MOZ_JAVAXPCOM" ]; then
"
fi
if [ "$MOZ_COMPONENTLIB" ]; then
if [ "$MOZ_STATIC_COMPONENTS" -o "$MOZ_META_COMPONENTS" ]; then
add_makefiles "
embedding/componentlib/Makefile
modules/staticmod/Makefile
"
else
if [ "$MOZ_STATIC_COMPONENTS" -o "$MOZ_META_COMPONENTS" ]; then
add_makefiles "
modules/staticmod/Makefile
"
fi
fi # MOZ_COMPONENTLIB
fi
if [ "$MOZ_MEDIA" ]; then
add_makefiles "