зеркало из https://github.com/mozilla/gecko-dev.git
bug 467862 - Build system should support building both a static and a shared library from the same Makefile. r=bsmedberg
This commit is contained in:
Родитель
ac0cef519c
Коммит
4b9a084bf4
|
@ -73,6 +73,8 @@ CHECK_VARS := \
|
|||
SHORT_LIBNAME \
|
||||
XPI_PKGNAME \
|
||||
INSTALL_EXTENSION_ID \
|
||||
SHARED_LIBRARY_NAME \
|
||||
STATIC_LIBRARY_NAME \
|
||||
$(NULL)
|
||||
|
||||
# checks for internal spaces or trailing spaces in the variable
|
||||
|
@ -359,6 +361,18 @@ DSO_PIC_CFLAGS=
|
|||
endif
|
||||
endif
|
||||
|
||||
ifndef SHARED_LIBRARY_NAME
|
||||
ifdef LIBRARY_NAME
|
||||
SHARED_LIBRARY_NAME=$(LIBRARY_NAME)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifndef STATIC_LIBRARY_NAME
|
||||
ifdef LIBRARY_NAME
|
||||
STATIC_LIBRARY_NAME=$(LIBRARY_NAME)
|
||||
endif
|
||||
endif
|
||||
|
||||
# This comes from configure
|
||||
ifdef MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE
|
||||
NO_PROFILE_GUIDED_OPTIMIZE = 1
|
||||
|
|
|
@ -219,15 +219,15 @@ endif # ENABLE_TESTS
|
|||
#
|
||||
|
||||
ifndef LIBRARY
|
||||
ifdef LIBRARY_NAME
|
||||
ifdef STATIC_LIBRARY_NAME
|
||||
ifneq (,$(filter OS2 WINNT WINCE,$(OS_ARCH)))
|
||||
ifdef SHORT_LIBNAME
|
||||
LIBRARY_NAME := $(SHORT_LIBNAME)
|
||||
endif
|
||||
endif
|
||||
LIBRARY := $(LIB_PREFIX)$(LIBRARY_NAME).$(LIB_SUFFIX)
|
||||
STATIC_LIBRARY_NAME := $(SHORT_LIBNAME)
|
||||
endif
|
||||
endif
|
||||
LIBRARY := $(LIB_PREFIX)$(STATIC_LIBRARY_NAME).$(LIB_SUFFIX)
|
||||
endif # STATIC_LIBRARY_NAME
|
||||
endif # LIBRARY
|
||||
|
||||
ifndef HOST_LIBRARY
|
||||
ifdef HOST_LIBRARY_NAME
|
||||
|
@ -244,9 +244,9 @@ MKSHLIB = $(MKCSHLIB)
|
|||
endif
|
||||
|
||||
ifdef MAKE_FRAMEWORK
|
||||
SHARED_LIBRARY := $(LIBRARY_NAME)
|
||||
SHARED_LIBRARY := $(SHARED_LIBRARY_NAME)
|
||||
else
|
||||
SHARED_LIBRARY := $(DLL_PREFIX)$(LIBRARY_NAME)$(DLL_SUFFIX)
|
||||
SHARED_LIBRARY := $(DLL_PREFIX)$(SHARED_LIBRARY_NAME)$(DLL_SUFFIX)
|
||||
endif
|
||||
|
||||
ifeq ($(OS_ARCH),OS2)
|
||||
|
@ -254,7 +254,7 @@ DEF_FILE := $(SHARED_LIBRARY:.dll=.def)
|
|||
endif
|
||||
|
||||
ifneq (,$(filter OS2 WINNT WINCE,$(OS_ARCH)))
|
||||
IMPORT_LIBRARY := $(LIB_PREFIX)$(LIBRARY_NAME).$(IMPORT_LIB_SUFFIX)
|
||||
IMPORT_LIBRARY := $(LIB_PREFIX)$(SHARED_LIBRARY_NAME).$(IMPORT_LIB_SUFFIX)
|
||||
endif
|
||||
|
||||
ifdef MOZ_ENABLE_LIBXUL
|
||||
|
@ -319,8 +319,8 @@ CODFILE=$(basename $(@F)).cod
|
|||
endif
|
||||
|
||||
ifdef MOZ_MAPINFO
|
||||
ifdef LIBRARY_NAME
|
||||
MAPFILE=$(LIBRARY_NAME).map
|
||||
ifdef SHARED_LIBRARY_NAME
|
||||
MAPFILE=$(SHARED_LIBRARY_NAME).map
|
||||
else
|
||||
MAPFILE=$(basename $(@F)).map
|
||||
endif # LIBRARY_NAME
|
||||
|
@ -333,15 +333,8 @@ endif
|
|||
|
||||
ifdef MAPFILE
|
||||
OS_LDFLAGS += -MAP:$(MAPFILE)
|
||||
#CFLAGS += -Fm$(MAPFILE)
|
||||
#CXXFLAGS += -Fm$(MAPFILE)
|
||||
endif
|
||||
|
||||
#ifdef CODFILE
|
||||
#CFLAGS += -Fa$(CODFILE) -FAsc
|
||||
#CFLAGS += -Fa$(CODFILE) -FAsc
|
||||
#endif
|
||||
|
||||
endif # !GNU_CC
|
||||
|
||||
ifdef ENABLE_CXX_EXCEPTIONS
|
||||
|
@ -841,13 +834,13 @@ ifdef LIBRARY_NAME
|
|||
ifdef EXPORT_LIBRARY
|
||||
ifdef IS_COMPONENT
|
||||
ifdef BUILD_STATIC_LIBS
|
||||
@$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl $(FINAL_LINK_COMPS) $(LIBRARY_NAME)
|
||||
@$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl $(FINAL_LINK_COMPS) $(STATIC_LIBRARY_NAME)
|
||||
ifdef MODULE_NAME
|
||||
@$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl $(FINAL_LINK_COMP_NAMES) $(MODULE_NAME)
|
||||
endif
|
||||
endif
|
||||
else
|
||||
$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl $(FINAL_LINK_LIBS) $(LIBRARY_NAME)
|
||||
endif # BUILD_STATIC_LIBS
|
||||
else # !IS_COMPONENT
|
||||
$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl $(FINAL_LINK_LIBS) $(STATIC_LIBRARY_NAME)
|
||||
endif # IS_COMPONENT
|
||||
endif # EXPORT_LIBRARY
|
||||
endif # LIBRARY_NAME
|
||||
|
@ -1183,7 +1176,7 @@ endif
|
|||
ifeq ($(OS_ARCH),OS2)
|
||||
$(DEF_FILE): $(OBJS) $(SHARED_LIBRARY_LIBS)
|
||||
rm -f $@
|
||||
echo LIBRARY $(LIBRARY_NAME) INITINSTANCE TERMINSTANCE > $@
|
||||
echo LIBRARY $(SHARED_LIBRARY_NAME) INITINSTANCE TERMINSTANCE > $@
|
||||
echo PROTMODE >> $@
|
||||
echo CODE LOADONCALL MOVEABLE DISCARDABLE >> $@
|
||||
echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $@
|
||||
|
|
|
@ -73,6 +73,8 @@ CHECK_VARS := \
|
|||
SHORT_LIBNAME \
|
||||
XPI_PKGNAME \
|
||||
INSTALL_EXTENSION_ID \
|
||||
SHARED_LIBRARY_NAME \
|
||||
STATIC_LIBRARY_NAME \
|
||||
$(NULL)
|
||||
|
||||
# checks for internal spaces or trailing spaces in the variable
|
||||
|
@ -359,6 +361,18 @@ DSO_PIC_CFLAGS=
|
|||
endif
|
||||
endif
|
||||
|
||||
ifndef SHARED_LIBRARY_NAME
|
||||
ifdef LIBRARY_NAME
|
||||
SHARED_LIBRARY_NAME=$(LIBRARY_NAME)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifndef STATIC_LIBRARY_NAME
|
||||
ifdef LIBRARY_NAME
|
||||
STATIC_LIBRARY_NAME=$(LIBRARY_NAME)
|
||||
endif
|
||||
endif
|
||||
|
||||
# This comes from configure
|
||||
ifdef MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE
|
||||
NO_PROFILE_GUIDED_OPTIMIZE = 1
|
||||
|
|
|
@ -219,15 +219,15 @@ endif # ENABLE_TESTS
|
|||
#
|
||||
|
||||
ifndef LIBRARY
|
||||
ifdef LIBRARY_NAME
|
||||
ifdef STATIC_LIBRARY_NAME
|
||||
ifneq (,$(filter OS2 WINNT WINCE,$(OS_ARCH)))
|
||||
ifdef SHORT_LIBNAME
|
||||
LIBRARY_NAME := $(SHORT_LIBNAME)
|
||||
endif
|
||||
endif
|
||||
LIBRARY := $(LIB_PREFIX)$(LIBRARY_NAME).$(LIB_SUFFIX)
|
||||
STATIC_LIBRARY_NAME := $(SHORT_LIBNAME)
|
||||
endif
|
||||
endif
|
||||
LIBRARY := $(LIB_PREFIX)$(STATIC_LIBRARY_NAME).$(LIB_SUFFIX)
|
||||
endif # STATIC_LIBRARY_NAME
|
||||
endif # LIBRARY
|
||||
|
||||
ifndef HOST_LIBRARY
|
||||
ifdef HOST_LIBRARY_NAME
|
||||
|
@ -244,9 +244,9 @@ MKSHLIB = $(MKCSHLIB)
|
|||
endif
|
||||
|
||||
ifdef MAKE_FRAMEWORK
|
||||
SHARED_LIBRARY := $(LIBRARY_NAME)
|
||||
SHARED_LIBRARY := $(SHARED_LIBRARY_NAME)
|
||||
else
|
||||
SHARED_LIBRARY := $(DLL_PREFIX)$(LIBRARY_NAME)$(DLL_SUFFIX)
|
||||
SHARED_LIBRARY := $(DLL_PREFIX)$(SHARED_LIBRARY_NAME)$(DLL_SUFFIX)
|
||||
endif
|
||||
|
||||
ifeq ($(OS_ARCH),OS2)
|
||||
|
@ -254,7 +254,7 @@ DEF_FILE := $(SHARED_LIBRARY:.dll=.def)
|
|||
endif
|
||||
|
||||
ifneq (,$(filter OS2 WINNT WINCE,$(OS_ARCH)))
|
||||
IMPORT_LIBRARY := $(LIB_PREFIX)$(LIBRARY_NAME).$(IMPORT_LIB_SUFFIX)
|
||||
IMPORT_LIBRARY := $(LIB_PREFIX)$(SHARED_LIBRARY_NAME).$(IMPORT_LIB_SUFFIX)
|
||||
endif
|
||||
|
||||
ifdef MOZ_ENABLE_LIBXUL
|
||||
|
@ -319,8 +319,8 @@ CODFILE=$(basename $(@F)).cod
|
|||
endif
|
||||
|
||||
ifdef MOZ_MAPINFO
|
||||
ifdef LIBRARY_NAME
|
||||
MAPFILE=$(LIBRARY_NAME).map
|
||||
ifdef SHARED_LIBRARY_NAME
|
||||
MAPFILE=$(SHARED_LIBRARY_NAME).map
|
||||
else
|
||||
MAPFILE=$(basename $(@F)).map
|
||||
endif # LIBRARY_NAME
|
||||
|
@ -333,15 +333,8 @@ endif
|
|||
|
||||
ifdef MAPFILE
|
||||
OS_LDFLAGS += -MAP:$(MAPFILE)
|
||||
#CFLAGS += -Fm$(MAPFILE)
|
||||
#CXXFLAGS += -Fm$(MAPFILE)
|
||||
endif
|
||||
|
||||
#ifdef CODFILE
|
||||
#CFLAGS += -Fa$(CODFILE) -FAsc
|
||||
#CFLAGS += -Fa$(CODFILE) -FAsc
|
||||
#endif
|
||||
|
||||
endif # !GNU_CC
|
||||
|
||||
ifdef ENABLE_CXX_EXCEPTIONS
|
||||
|
@ -841,13 +834,13 @@ ifdef LIBRARY_NAME
|
|||
ifdef EXPORT_LIBRARY
|
||||
ifdef IS_COMPONENT
|
||||
ifdef BUILD_STATIC_LIBS
|
||||
@$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl $(FINAL_LINK_COMPS) $(LIBRARY_NAME)
|
||||
@$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl $(FINAL_LINK_COMPS) $(STATIC_LIBRARY_NAME)
|
||||
ifdef MODULE_NAME
|
||||
@$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl $(FINAL_LINK_COMP_NAMES) $(MODULE_NAME)
|
||||
endif
|
||||
endif
|
||||
else
|
||||
$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl $(FINAL_LINK_LIBS) $(LIBRARY_NAME)
|
||||
endif # BUILD_STATIC_LIBS
|
||||
else # !IS_COMPONENT
|
||||
$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl $(FINAL_LINK_LIBS) $(STATIC_LIBRARY_NAME)
|
||||
endif # IS_COMPONENT
|
||||
endif # EXPORT_LIBRARY
|
||||
endif # LIBRARY_NAME
|
||||
|
@ -1183,7 +1176,7 @@ endif
|
|||
ifeq ($(OS_ARCH),OS2)
|
||||
$(DEF_FILE): $(OBJS) $(SHARED_LIBRARY_LIBS)
|
||||
rm -f $@
|
||||
echo LIBRARY $(LIBRARY_NAME) INITINSTANCE TERMINSTANCE > $@
|
||||
echo LIBRARY $(SHARED_LIBRARY_NAME) INITINSTANCE TERMINSTANCE > $@
|
||||
echo PROTMODE >> $@
|
||||
echo CODE LOADONCALL MOVEABLE DISCARDABLE >> $@
|
||||
echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $@
|
||||
|
|
Загрузка…
Ссылка в новой задаче