Adding build SDK support. r=dougt, sr=alecf, submitted by seawood, a=asa

This commit is contained in:
dougt%netscape.com 2002-02-25 23:20:01 +00:00
parent f6115a6997
commit 874111f277
8 changed files with 121 additions and 46 deletions

View File

@ -610,12 +610,17 @@ LIBS_DIR = -L$(DIST)/bin -L$(DIST)/lib
endif
# Default location of include files
IDL_DIR = $(DIST)/idl
ifdef MODULE
PUBLIC = $(DIST)/include/$(MODULE)
else
PUBLIC = $(DIST)/include
endif
SDK_PUBLIC = $(DIST)/sdk/$(MODULE)/include
SDK_IDL_DIR = $(DIST)/sdk/$(MODULE)/idl
SDK_BIN_DIR = $(DIST)/sdk/$(MODULE)/bin
DEPENDENCIES = .md
MOZ_COMPONENT_LIBS=$(MOZ_COMPONENT_XPCOM_LIBS) $(MOZ_COMPONENT_NSPR_LIBS)

View File

@ -1293,8 +1293,8 @@ endif
################################################################################
# Copy each element of EXPORTS to $(PUBLIC)
ifneq ($(EXPORTS)$(XPIDLSRCS),)
$(PUBLIC)::
ifneq ($(EXPORTS)$(XPIDLSRCS)$(SDK_HEADERS)$(SDK_XPIDLSRCS),)
$(SDK_PUBLIC) $(PUBLIC)::
@if test ! -d $@; then echo Creating $@; rm -rf $@; $(NSINSTALL) -D $@; else true; fi
endif
@ -1306,6 +1306,18 @@ ifndef NO_DIST_INSTALL
endif
endif
ifneq ($(SDK_HEADERS),)
export:: $(PUBLIC) $(SDK_PUBLIC)
export:: $(SDK_HEADERS)
ifndef NO_DIST_INSTALL
$(INSTALL) $(IFLAGS1) $^ $(PUBLIC)
$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl $(PUBLIC)/.headerlist $(notdir $(filter-out $(PUBLIC),$^))
$(INSTALL) $(IFLAGS1) $^ $(SDK_PUBLIC)
$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl $(PUBLIC)/.headerlist $(notdir $(filter-out $(SDK_PUBLIC),$^))
endif
endif
################################################################################
# Copy each element of PREF_JS_EXPORTS to $(DIST)/bin/defaults/pref
@ -1331,10 +1343,10 @@ ifndef NO_DIST_INSTALL
endif
endif
################################################################################
# Export the elements of $(XPIDLSRCS), generating .h and .xpt files and
# moving them to the appropriate places.
# Export the elements of $(XPIDLSRCS) & $(SDK_XPIDLSRCS),
# generating .h and .xpt files and moving them to the appropriate places.
ifneq ($(XPIDLSRCS),)
ifneq ($(XPIDLSRCS)$(SDK_XPIDLSRCS),)
ifndef XPIDL_MODULE
XPIDL_MODULE = $(MODULE)
@ -1349,15 +1361,9 @@ export:: FORCE
@echo; sleep 2; false
endif
# export .idl files to $(DIST)/idl
$(DIST)/idl::
$(SDK_IDL_DIR) $(IDL_DIR)::
@if test ! -d $@; then echo Creating $@; rm -rf $@; $(NSINSTALL) -D $@; else true; fi
export:: $(XPIDLSRCS) $(DIST)/idl
ifndef NO_DIST_INSTALL
$(INSTALL) $(IFLAGS1) $^
endif
# generate .h files from into $(XPIDL_GEN_DIR), then export to $(PUBLIC);
# warn against overriding existing .h file.
$(XPIDL_GEN_DIR)/.done:
@ -1369,22 +1375,16 @@ $(XPIDL_GEN_DIR)/.done:
$(XPIDL_GEN_DIR)/%.h: %.idl $(XPIDL_COMPILE) $(XPIDL_GEN_DIR)/.done
$(REPORT_BUILD)
$(ELOG) $(XPIDL_COMPILE) -m header -w -I $(DIST)/idl -I$(srcdir) -o $(XPIDL_GEN_DIR)/$* $<
@if test -n "$(findstring $*.h, $(EXPORTS))"; \
$(ELOG) $(XPIDL_COMPILE) -m header -w -I $(IDL_DIR) -I$(srcdir) -o $(XPIDL_GEN_DIR)/$* $<
@if test -n "$(findstring $*.h, $(EXPORTS) $(SDK_HEADERS))"; \
then echo "*** WARNING: file $*.h generated from $*.idl overrides $(srcdir)/$*.h"; else true; fi
export:: $(patsubst %.idl,$(XPIDL_GEN_DIR)/%.h, $(XPIDLSRCS)) $(PUBLIC)
ifndef NO_DIST_INSTALL
$(INSTALL) $(IFLAGS1) $^
$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl $(PUBLIC)/.headerlist $(notdir $(filter-out $(PUBLIC),$^))
endif
ifndef NO_GEN_XPT
# generate intermediate .xpt files into $(XPIDL_GEN_DIR), then link
# into $(XPIDL_MODULE).xpt and export it to $(DIST)/bin/components.
$(XPIDL_GEN_DIR)/%.xpt: %.idl $(XPIDL_COMPILE)
$(REPORT_BUILD)
$(ELOG) $(XPIDL_COMPILE) -m typelib -w -I $(DIST)/idl -I$(srcdir) -o $(XPIDL_GEN_DIR)/$* $<
$(ELOG) $(XPIDL_COMPILE) -m typelib -w -I $(IDL_DIR) -I$(srcdir) -o $(XPIDL_GEN_DIR)/$* $<
$(XPIDL_GEN_DIR)/$(XPIDL_MODULE).xpt: $(patsubst %.idl,$(XPIDL_GEN_DIR)/%.xpt,$(XPIDLSRCS))
$(XPIDL_LINK) $(XPIDL_GEN_DIR)/$(XPIDL_MODULE).xpt $^
@ -1393,12 +1393,61 @@ libs:: $(XPIDL_GEN_DIR)/$(XPIDL_MODULE).xpt
ifndef NO_DIST_INSTALL
$(INSTALL) $(IFLAGS1) $(XPIDL_GEN_DIR)/$(XPIDL_MODULE).xpt $(DIST)/bin/$(COMPONENTS_PATH)
endif
endif
endif # NO_GEN_XPT
GARBAGE_DIRS += $(XPIDL_GEN_DIR)
endif # XPIDLSRCS || SDK_XPIDLSRCS
ifneq ($(XPIDLSRCS),)
# export .idl files to $(IDL_DIR)
export:: $(XPIDLSRCS) $(IDL_DIR)
ifndef NO_DIST_INSTALL
$(INSTALL) $(IFLAGS1) $^
endif
export:: $(patsubst %.idl,$(XPIDL_GEN_DIR)/%.h, $(XPIDLSRCS)) $(PUBLIC)
ifndef NO_DIST_INSTALL
$(INSTALL) $(IFLAGS1) $^
$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl $(PUBLIC)/.headerlist $(notdir $(filter-out $(PUBLIC),$^))
endif
endif # XPIDLSRCS
ifneq ($(SDK_XPIDLSRCS),)
# export .idl files to $(IDL_DIR) & $(SDK_IDL_DIR)
export:: $(IDL_DIR) $(SDK_IDL_DIR)
export:: $(SDK_XPIDLSRCS)
ifndef NO_DIST_INSTALL
$(INSTALL) $(IFLAGS1) $^ $(IDL_DIR)
$(INSTALL) $(IFLAGS1) $^ $(SDK_IDL_DIR)
endif
export:: $(patsubst %.idl,$(XPIDL_GEN_DIR)/%.h, $(SDK_XPIDLSRCS))
ifndef NO_DIST_INSTALL
$(INSTALL) $(IFLAGS1) $^ $(PUBLIC)
$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl $(PUBLIC)/.headerlist $(notdir $(filter-out $(PUBLIC),$^))
$(INSTALL) $(IFLAGS1) $^ $(SDK_PUBLIC)
$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl $(PUBLIC)/.headerlist $(notdir $(filter-out $(SDK_PUBLIC),$^))
endif
endif # SDK_XPIDLSRCS
################################################################################
# SDK
ifneq (,$(SDK_BINARY))
$(SDK_BIN_DIR)::
@if test ! -d $@; then echo Creating $@; rm -rf $@; $(NSINSTALL) -D $@; else true; fi
libs:: $(SDK_BINARY) $(SDK_BIN_DIR)
ifndef NO_DIST_INSTALL
$(INSTALL) $(IFLAGS2) $^
endif
endif # SDK_BINARY
################################################################################
# CHROME PACKAGING

View File

@ -86,19 +86,22 @@ EXPORTS += pure.h
endif
endif
SDK_XPIDLSRCS = \
nsIInterfaceRequestor.idl \
nsIProgrammingLanguage.idl \
nsISupports.idl \
nsIWeakReference.idl \
nsIMemory.idl \
nsrootidl.idl \
XPIDLSRCS = \
nsrootidl.idl \
nsISupports.idl \
nsIMemory.idl \
nsIErrorService.idl \
nsIInterfaceRequestor.idl \
nsIWeakReference.idl \
nsIConsoleService.idl \
nsIConsoleMessage.idl \
nsIConsoleListener.idl \
nsIException.idl \
nsIExceptionService.idl \
nsIProgrammingLanguage.idl \
$(NULL)
ifdef GC_LEAK_DETECTOR

View File

@ -34,10 +34,6 @@ REQUIRES = libreg \
string \
$(NULL)
EXPORTS = \
nsXPCOM.h \
$(NULL)
# pull in MoreFiles for MacOSX
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
REQUIRES += macmorefiles
@ -85,6 +81,12 @@ LOCAL_INCLUDES = \
-I$(srcdir)/../proxy/src \
$(NULL)
SDK_HEADERS = \
nsXPCOM.h \
$(NULL)
SDK_BINARY = $(IMPORT_LIBRARY) $(SHARED_LIBRARY)
ifdef MOZ_DEMANGLE_SYMBOLS
EXTRA_DSO_LDOPTS += -liberty
endif

View File

@ -67,15 +67,18 @@ EXPORTS = \
XPIDLSRCS = \
nsICategoryHandler.idl \
nsICategoryManager.idl \
nsIClassInfo.idl \
nsIComponentLoader.idl \
nsIComponentManager.idl \
nsIComponentManagerObsolete.idl \
nsIComponentRegistrar.idl \
nsIFactory.idl \
nsIModule.idl \
nsIRegistry.idl \
nsIServiceManager.idl \
$(NULL)
SDK_XPIDLSRCS = \
nsIClassInfo.idl \
nsIFactory.idl \
nsIModule.idl \
nsIServiceManager.idl \
nsIComponentManager.idl \
$(NULL)
EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS))

View File

@ -113,20 +113,23 @@ XPIDLSRCS = \
nsIAtomService.idl \
nsICollection.idl \
nsIEnumerator.idl \
nsIObserver.idl \
nsIObserverService.idl \
nsIPersistentProperties2.idl \
nsIProperties.idl \
nsIPropertyBag.idl \
nsIVariant.idl \
nsISerializable.idl \
nsISimpleEnumerator.idl \
nsISupportsArray.idl \
nsISupportsIterators.idl \
nsISupportsPrimitives.idl \
nsITimelineService.idl \
$(NULL)
SDK_XPIDLSRCS = \
nsIObserverService.idl \
nsIObserver.idl \
nsISimpleEnumerator.idl \
$(NULL)
EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS))
# we don't want the shared lib, but we want to force the creation of a static lib.

View File

@ -43,11 +43,18 @@ LOCAL_INCLUDES = \
-I$(srcdir)/../build \
$(NULL)
SDK_HEADERS = \
nsCOMPtr.h \
nsDebug.h \
nsMemory.h \
nsWeakReference.h\
$(NULL)
SDK_BINARY = \
$(LIB_PREFIX)xpcomglue.$(LIB_SUFFIX) \
$(NULL)
EXPORTS = \
nsCOMPtr.h \
nsDebug.h \
nsMemory.h \
nsWeakReference.h \
$(NULL)
XPIDLSRCS = \

View File

@ -111,7 +111,6 @@ XPIDLSRCS = \
nsIBinaryInputStream.idl \
nsIBinaryOutputStream.idl \
nsIByteArrayInputStream.idl \
nsIDirectoryService.idl \
nsIFastLoadFileControl.idl \
nsIFastLoadService.idl \
nsIFile.idl \
@ -132,6 +131,10 @@ XPIDLSRCS = \
nsIStringStream.idl \
$(NULL)
SDK_XPIDLSRCS = \
nsIDirectoryService.idl \
$(NULL)
EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS))
# we don't want the shared lib, but we want to force the creation of a static lib.