Implement mozcomps static build variant.

Remove unnecessary EXPORT_LIBRARY settings.
Bug #201602 r=bryner


git-svn-id: svn://10.0.0.236/trunk@141327 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
seawood%netscape.com 2003-04-17 19:19:42 +00:00
parent 81cde04677
commit fd152f541a
27 changed files with 131 additions and 46 deletions

View File

@ -59,16 +59,8 @@ STATIC_EXTRA_LIBS += \
$(MNG_LIBS) \
$(JPEG_LIBS) \
$(ZLIB_LIBS) \
$(MOZ_GDK_PIXBUF_LIBS) \
$(MOZ_XPRINT_LDFLAGS) \
$(NULL)
ifeq ($(MOZ_WIDGET_TOOLKIT),xlib)
STATIC_EXTRA_LIBS += \
$(MOZ_XIE_LIBS) \
$(NULL)
endif
ifdef MOZ_PSM
STATIC_EXTRA_LIBS += \
$(NSS_LIBS) \
@ -85,10 +77,6 @@ ifdef MOZ_SVG
STATIC_EXTRA_LIBS += $(MOZ_LIBART_LIBS)
endif
ifneq (,$(MOZ_ENABLE_GTK)$(MOZ_ENABLE_GTK2)$(MOZ_ENABLE_XLIB))
STATIC_EXTRA_LIBS += $(XLDFLAGS) $(XT_LIBS)
endif
ifdef MOZ_ENABLE_XINERAMA
STATIC_EXTRA_LIBS += $(MOZ_XINERAMA_LIBS)
endif
@ -97,6 +85,20 @@ ifdef MOZ_CALENDAR
STATIC_EXTRA_LIBS += $(call EXPAND_MOZLIBNAME,mozicalss mozical)
endif
ifneq (,$(MOZ_ENABLE_GTK)$(MOZ_ENABLE_GTK2)$(MOZ_ENABLE_XLIB))
STATIC_EXTRA_LIBS += $(XLDFLAGS) $(XT_LIBS)
endif
ifeq ($(MOZ_WIDGET_TOOLKIT),xlib)
STATIC_EXTRA_LIBS += \
$(MOZ_XIE_LIBS) \
$(NULL)
endif
ifdef MOZ_ENABLE_XPRINT
STATIC_EXTRA_LIBS += $(MOZ_XPRINT_LDFLAGS)
endif
# Component Makefile always brings in this.
# STATIC_EXTRA_LIBS += $(TK_LIBS)

View File

@ -28,7 +28,6 @@ include $(DEPTH)/config/autoconf.mk
MODULE = jsurl
LIBRARY_NAME = jsurl_s
EXPORT_LIBRARY = 1
FORCE_STATIC_LIB = 1
MODULE_NAME = javascript__protocol
GRE_MODULE = 1

View File

@ -28,7 +28,6 @@ include $(DEPTH)/config/autoconf.mk
MODULE = txtsvc
LIBRARY_NAME = txtsvc_s
EXPORT_LIBRARY = 1
FORCE_STATIC_LIB = 1
MODULE_NAME = nsTextServicesModule
REQUIRES = xpcom \

View File

@ -64,6 +64,13 @@ CPPSRCS += \
GtkPromptService.cpp
endif
# Force applications to be built non-statically
# when building the mozcomps meta component
ifneq (,$(filter mozcomps,$(MOZ_META_COMPONENTS)))
BUILD_STATIC_LIBS=
BUILD_SHARED_LIBS=1
endif
ifdef BUILD_STATIC_LIBS
# Static build stuff
DEFINES += -D_BUILD_STATIC_BIN=1

View File

@ -71,6 +71,13 @@ endif
include $(topsrcdir)/config/config.mk
# Force applications to be built non-statically
# when building the mozcomps meta component
ifneq (,$(filter mozcomps,$(MOZ_META_COMPONENTS)))
BUILD_STATIC_LIBS=
BUILD_SHARED_LIBS=1
endif
ifdef BUILD_STATIC_LIBS
ifndef MOZ_FAT_EMBED

View File

@ -65,6 +65,13 @@ CPPSRCS = \
PromptService.cpp \
nsUnknownContentTypeHandler.cpp
# Force applications to be built non-statically
# when building the mozcomps meta component
ifneq (,$(filter mozcomps,$(MOZ_META_COMPONENTS)))
BUILD_STATIC_LIBS=
BUILD_SHARED_LIBS=1
endif
ifdef BUILD_STATIC_LIBS
# Static build stuff
DEFINES += -D_BUILD_STATIC_BIN=1

View File

@ -100,6 +100,7 @@ endif
LIBS = \
$(EXTRA_DSO_LIBS) \
$(MOZ_UNICHARUTIL_LIBS) \
$(XPCOM_LIBS) \
$(NSPR_LIBS) \
$(MOZ_JS_LIBS) \
@ -129,6 +130,12 @@ LDFLAGS += /HEAP:0x40000
include $(topsrcdir)/config/config.mk
# Force applications to be built non-statically
# when building the mozcomps meta component
ifneq (,$(filter mozcomps,$(MOZ_META_COMPONENTS)))
BUILD_STATIC_LIBS=
BUILD_SHARED_LIBS=1
endif
ifdef BUILD_STATIC_LIBS

View File

@ -84,6 +84,12 @@ LDFLAGS += /HEAP:0x40000
include $(topsrcdir)/config/config.mk
# Force applications to be built non-statically
# when building the mozcomps meta component
ifneq (,$(filter mozcomps,$(MOZ_META_COMPONENTS)))
BUILD_STATIC_LIBS=
BUILD_SHARED_LIBS=1
endif
ifdef BUILD_STATIC_LIBS

View File

@ -65,6 +65,7 @@ EXTRA_DSO_LIBS = embed_base_s gkgfx
LIBS = \
$(EXTRA_DSO_LIBS) \
$(MOZ_UNICHARUTIL_LIBS) \
$(XPCOM_LIBS) \
$(NSPR_LIBS) \
$(MOZ_JS_LIBS) \
@ -89,6 +90,12 @@ LDFLAGS += /HEAP:0x40000
include $(topsrcdir)/config/config.mk
# Force applications to be built non-statically
# when building the mozcomps meta component
ifneq (,$(filter mozcomps,$(MOZ_META_COMPONENTS)))
BUILD_STATIC_LIBS=
BUILD_SHARED_LIBS=1
endif
ifdef BUILD_STATIC_LIBS

View File

@ -28,7 +28,6 @@ include $(DEPTH)/config/autoconf.mk
MODULE = chardet
LIBRARY_NAME = chardet_s
EXPORT_LIBRARY = 1
FORCE_STATIC_LIB = 1
REQUIRES = xpcom \

View File

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

View File

@ -28,7 +28,6 @@ include $(DEPTH)/config/autoconf.mk
MODULE = locale
LIBRARY_NAME = platlocale_s
EXPORT_LIBRARY = 1
FORCE_STATIC_LIB= 1
REQUIRES = xpcom \

View File

@ -28,7 +28,6 @@ include $(DEPTH)/config/autoconf.mk
MODULE = locale
LIBRARY_NAME = platlocale_s
EXPORT_LIBRARY = 1
FORCE_STATIC_LIB = 1
REQUIRES = xpcom \

View File

@ -28,7 +28,6 @@ include $(DEPTH)/config/autoconf.mk
MODULE = lwbrk
LIBRARY_NAME = lwbrk_s
EXPORT_LIBRARY = 1
FORCE_STATIC_LIB = 1
REQUIRES = xpcom \

View File

@ -28,7 +28,6 @@ include $(DEPTH)/config/autoconf.mk
MODULE = intl
LIBRARY_NAME = strres_s
EXPORT_LIBRARY = 1
FORCE_STATIC_LIB = 1
REQUIRES = xpcom \

View File

@ -112,6 +112,7 @@ endif
endif
EXTRA_DSO_LDOPTS = \
$(DIST)/lib/$(LIB_PREFIX)ucvutil_s.$(LIB_SUFFIX) \
$(MOZ_UNICHARUTIL_LIBS) \
$(MOZ_NECKO_UTIL_LIBS) \
$(MOZ_COMPONENT_LIBS) \
@ -142,10 +143,6 @@ LOCAL_INCLUDES = -I$(srcdir)/../util \
-I$(srcdir)/../native \
$(NULL)
SHARED_LIBRARY_LIBS = \
$(DIST)/lib/$(LIB_PREFIX)ucvutil_s.$(LIB_SUFFIX) \
$(NULL)
ifndef MOZ_USE_NATIVE_UCONV
SHARED_LIBRARY_LIBS += \
$(DIST)/lib/$(LIB_PREFIX)ucvlatin_s.$(LIB_SUFFIX) \

View File

@ -69,10 +69,9 @@ CPPSRCS += \
EXPORTS = nsUCvMathCID.h
SHARED_LIBRARY_LIBS = \
EXTRA_DSO_LDOPTS += \
$(DIST)/lib/$(LIB_PREFIX)ucvutil_s.$(LIB_SUFFIX) \
$(MOZ_COMPONENT_LIBS) \
$(NULL)
EXTRA_DSO_LDOPTS += $(MOZ_COMPONENT_LIBS)
include $(topsrcdir)/config/rules.mk

View File

@ -28,7 +28,6 @@ include $(DEPTH)/config/autoconf.mk
MODULE = unicharutil
LIBRARY_NAME = ucharucomp_s
EXPORT_LIBRARY = 1
FORCE_STATIC_LIB = 1
REQUIRES = xpcom \

View File

@ -24,7 +24,6 @@ include $(DEPTH)/config/autoconf.mk
MODULE = jsloader
LIBRARY_NAME = jsloader_s
EXPORT_LIBRARY = 1
FORCE_STATIC_LIB = 1
REQUIRES = xpcom \
string \
@ -41,8 +40,4 @@ include $(topsrcdir)/config/rules.mk
DEFINES += -DJSFILE -DJS_THREADSAFE
EXTRA_DSO_LDOPTS += \
$(MOZ_COMPONENT_LIBS) \
$(MOZ_JS_LIBS) \
$(NULL)

View File

@ -29,7 +29,6 @@ include $(DEPTH)/config/autoconf.mk
MODULE = imgxbm
LIBRARY_NAME = imgxbm_s
EXPORT_LIBRARY = 1
FORCE_STATIC_LIB = 1
MODULE_NAME = nsXBMModule

View File

@ -28,7 +28,6 @@ include $(DEPTH)/config/autoconf.mk
MODULE = imglib2
LIBRARY_NAME = imglib2_s
EXPORT_LIBRARY = 1
FORCE_STATIC_LIB = 1
MODULE_NAME = nsImageLib2Module
GRE_MODULE = 1

View File

@ -31,6 +31,7 @@ MODULE = staticmod
LIBRARY_NAME = staticmod
SHORT_LIBNAME = statcmod
endif
IS_COMPONENT = 1
include $(topsrcdir)/config/config.mk
@ -44,11 +45,27 @@ endif
LOCAL_INCLUDES = -I$(srcdir)
#
# _COMPONENT_BASE is the base name of the meta component library
# that we are building in the current pass of this makefile
#
# mozcomps is a special name used to specify that we want to link all
# of the non-meta components into this special meta component
#
ifdef _COMPONENT_BASE
ifeq ($(_COMPONENT_BASE),mozcomps)
_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
else
_META_COMPONENT_NAMES := MOZ_META_COMPONENTS_$(_COMPONENT_BASE)
_META_COMPONENT_LIBS := MOZ_META_COMPONENTS_$(_COMPONENT_BASE)_comps
_META_DEP_LIBS := MOZ_META_COMPONENTS_$(_COMPONENT_BASE)_libs
endif
endif # mozcomps
endif # _COMPONENT_BASE
ifdef MOZ_STATIC_COMPONENTS
SHARED_LIBRARY_LIBS = \
@ -56,10 +73,16 @@ SHARED_LIBRARY_LIBS = \
endif
ifdef _COMPONENT_BASE
ifneq ($(_COMPONENT_BASE),mozcomps)
SHARED_LIBRARY_LIBS = $(foreach m,$($(_META_COMPONENT_LIBS)), $(DIST)/lib/components/$(LIB_PREFIX)$(m).$(LIB_SUFFIX))
SHARED_LIBRARY_LIBS += $(foreach m,$($(_META_DEP_LIBS)), $(DIST)/lib/$(LIB_PREFIX)$(m).$(LIB_SUFFIX))
EXTRA_DSO_LDOPTS += $(foreach m,$($(_META_DEP_LIBS)), $(DIST)/lib/$(LIB_PREFIX)$(m).$(LIB_SUFFIX))
endif
endif
#
# Create each meta component by calling this makefile recursively
# and forcing it to built a shared library meta component library
#
ifndef NO_RECURSE
libs clean distclean clobber realclean clobber_all::
set -e; \
@ -68,9 +91,17 @@ libs clean distclean clobber realclean clobber_all::
done
endif
ifeq ($(LIBRARY_NAME),meta_mozcomps)
include $(topsrcdir)/config/static-config.mk
EXTRA_DSO_LIBS = $(STATIC_EXTRA_DSO_LIBS)
endif
include $(topsrcdir)/config/rules.mk
ifeq ($(LIBRARY_NAME),meta_mozcomps)
include $(topsrcdir)/config/static-rules.mk
endif
ifdef MOZ_STATIC_COMPONENTS
EXTRA_DSO_LDOPTS += \
$(ZLIB_LIBS) \
@ -85,24 +116,45 @@ ifdef MOZ_META_COMPONENTS
# 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
ifeq ($(LIBRARY_NAME),meta_mail)
EXTRA_DSO_LDOPTS += \
$(DIST)/lib/$(LIB_PREFIX)gkgfx.$(LIB_SUFFIX) \
$(DIST)/lib/$(LIB_PREFIX)rdfutil_s.$(LIB_SUFFIX) \
$(LIBS_DIR) \
$(call EXPAND_MOZLIBNAME,xpcom_compat gkgfx rdfutil_s) \
$(MOZ_UNICHARUTIL_LIBS) \
$(MOZ_COMPONENT_LIBS) \
$(NULL)
endif
endif # meta_mail
ifeq ($(LIBRARY_NAME),meta_crypto)
EXTRA_DSO_LDOPTS += \
$(MOZ_JS_LIBS) \
$(NSS_LIBS) \
$(NULL)
endif
EXTRA_DSO_LDOPTS += \
$(MOZ_UNICHARUTIL_LIBS) \
$(MOZ_COMPONENT_LIBS) \
$(NULL)
endif # meta_crypto
ifeq ($(LIBRARY_NAME),meta_mozcomps)
# 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) \
$(STATIC_EXTRA_DSO_LIBS) \
$(STATIC_EXTRA_LIBS) \
$(MOZ_JS_LIBS) \
$(MOZ_UNICHARUTIL_LIBS) \
$(MOZ_COMPONENT_LIBS) \
$(TK_LIBS) \
$(NULL)
endif # meta_mozcomps
endif # MOZ_META_COMPONENTS
ifeq ($(OS_ARCH),WINNT)
OS_LIBS += ole32.lib shell32.lib
endif

View File

@ -28,7 +28,6 @@ include $(DEPTH)/config/autoconf.mk
MODULE = view
LIBRARY_NAME = gkview_s
EXPORT_LIBRARY = 1
FORCE_STATIC_LIB = 1
MODULE_NAME = nsViewModule
GRE_MODULE = 1

View File

@ -177,6 +177,12 @@ include $(topsrcdir)/config/config.mk
libs::
+$(LOOP_OVER_DIRS)
# Force applications to be built non-statically
# when building the mozcomps meta component
ifneq (,$(filter mozcomps,$(MOZ_META_COMPONENTS)))
BUILD_STATIC_LIBS=
BUILD_SHARED_LIBS=1
endif
ifdef BUILD_STATIC_LIBS

View File

@ -99,6 +99,13 @@ else
PROGRAM = mozilla-bin$(BIN_SUFFIX)
endif
# Force applications to be built non-statically
# when building the mozcomps meta component
ifneq (,$(filter mozcomps,$(MOZ_META_COMPONENTS)))
BUILD_STATIC_LIBS=
BUILD_SHARED_LIBS=1
endif
CPPSRCS = \
nsAppRunner.cpp \
nsWindowCreator.cpp \

View File

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

View File

@ -28,7 +28,6 @@ include $(DEPTH)/config/autoconf.mk
MODULE = shistory
LIBRARY_NAME = shistory_s
EXPORT_LIBRARY = 1
FORCE_STATIC_LIB = 1
REQUIRES = xpcom \