gecko/intl/icu/source/config/mh-cygwin-msvc

230 lines
7.9 KiB
Plaintext
Raw Normal View History

## Cygwin with Microsoft Visual C++ compiler specific setup
Bug 924839 - Update our embedded ICU to 52.1, plus a very few local patches. r=lots of people, see subsequent lines in this commit message for the original subcomponents (merged together for landing), and the original bug for the original patch divisions Bug 924839 - Remove a patch already part of ICU 52.1. See http://bugs.icu-project.org/trac/ticket/10283 but also note the relevant code was removed completely upstream. r=glandium * * * Bug 924839 - Remove another patch already part of ICU 52.1. See http://bugs.icu-project.org/trac/ticket/10290 for that. r=gaston * * * Bug 924839 - Remove another patch already in ICU 52.1. See http://bugs.icu-project.org/trac/ticket/10045 for more. r=Norbert * * * Bug 924839 - Remove another patch already applied upstream. See http://bugs.icu-project.org/trac/changeset/32937 for more. r=gaston * * * Bug 924839 - Update the ICU update script to update to 52.1, *without* applying any of our local patches. r=glandium * * * Bug 924839 - Make the ICU update script only do updating within intl/icu/source and nowhere else. r=glandium * * * Bug 924839 - Implement the changes that would be made by |cd intl/; ./update-icu.sh http://source.icu-project.org/repos/icu/icu/tags/release-52-1/;|, run with the prior changesets' changes made (thus not applying any of our local patches). These changes don't actually work without subsequent adjustments, but this provides a codebase upon which those adjustments can be made, for the purpose of generating local patches to be kept in intl/icu-patches/. rs=the-usual-suspects * * * Bug 924839 - Update the bug 899722 local patch to make runConfigureICU not override CC/CXX on BSD systems. r=gaston * * * Bug 924839 - Update the bug 724533 patch that makes ICU builds with MozillaBuild on Windows. r=glandium * * * Bug 924839 - Import an upstream patch fixing the genrb tool to properly handle the -R (--omitCollationRules) option. See http://bugs.icu-project.org/trac/ticket/10043 for the original bug report and a link to the ultimate upstream landing. r=Norbert * * * Bug 924839 - Import the upstream fix for http://bugs.icu-project.org/trac/ticket/10486 so that ICU with -DU_USING_ICU_NAMESPACE=0 will compile on Windows. r=Norbert * * * Bug 924839 - Adjust the update script to update ICU, then to apply all local patches (rather than skipping the second step). Thus if the update script is properly run, now, the final result should be no changes at all to the tree. NOT REVIEWED YET * * * Bug 924839 - Update jstests that depend on CLDR locale data to match CLDR 24. r=Norbert
2013-11-12 16:23:48 -08:00
## Copyright (c) 2001-2013, International Business Machines Corporation and
## others. All Rights Reserved.
# We install sbin tools into the same bin directory because
# pkgdata needs some of the tools in sbin, and we can't always depend on
# icu-config working on Windows.
sbindir=$(bindir)
## Commands to generate dependency files
GEN_DEPS.c= :
GEN_DEPS.cc= :
#GEN_DEPS.c= $(COMPILE.c) /E
#GEN_DEPS.cc= $(COMPILE.cc) /E
## Flags to create/use a static library
ifneq ($(ENABLE_SHARED),YES)
## Make sure that the static libraries can be built and used
CPPFLAGS += -DU_STATIC_IMPLEMENTATION#M#
else
## Make sure that the static libraries can be built
STATICCPPFLAGS = -DU_STATIC_IMPLEMENTATION
endif
## Flags for position independent code
SHAREDLIBCFLAGS =
SHAREDLIBCXXFLAGS =
SHAREDLIBCPPFLAGS =
## Additional flags when building libraries and with threads
LIBCPPFLAGS =
ifeq ($(ENABLE_RELEASE),1)
# Make sure that assertions are disabled
CPPFLAGS+=-DU_RELEASE=1#M#
endif
ifeq ($(ENABLE_DEBUG),1)
# Pass debugging flag through
CPPFLAGS+=-D_DEBUG=1#M#
ICULIBSUFFIX:=$(ICULIBSUFFIX)d#M#
endif
# /GF pools strings and places them into read-only memory
# /EHsc enables exception handling
# /Zc:wchar_t makes wchar_t a native type. Required for C++ ABI compatibility.
# -D_CRT_SECURE_NO_DEPRECATE is needed to quiet warnings about using standard C functions.
CFLAGS+=/GF /nologo
CXXFLAGS+=/GF /nologo /EHsc /Zc:wchar_t
CPPFLAGS+=-D_CRT_SECURE_NO_DEPRECATE
DEFS+=-DWIN32 -DCYGWINMSVC
LDFLAGS+=/nologo
# Commands to compile
COMPILE.c= $(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) /c
COMPILE.cc= $(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) /c
# Commands to link
LINK.c= LINK.EXE /subsystem:console $(LDFLAGS)
LINK.cc= LINK.EXE /subsystem:console $(LDFLAGS)
## Commands to make a shared library
SHLIB.c= LINK.EXE /DLL $(LDFLAGS)
SHLIB.cc= LINK.EXE /DLL $(LDFLAGS)
## Compiler switch to embed a runtime search path
LD_RPATH=
LD_RPATH_PRE=
## Compiler switch to embed a library name
LD_SONAME = /IMPLIB:$(SO_TARGET:.dll=.lib)
## Shared object suffix
SO = dll
## Non-shared intermediate object suffix
STATIC_O = ao
# OUTOPT is for creating a specific output name
OUTOPT = /out:
# Static library prefix and file extension
LIBSICU = $(STATIC_PREFIX)$(ICUPREFIX)
A = lib
# Cygwin's ar can't handle Win64 right now. So we use Microsoft's tool instead.
AR = LIB.EXE#M#
ARFLAGS := /nologo $(ARFLAGS:r=)#M#
RANLIB = ls -s#M#
AR_OUTOPT = /OUT:#M#
## An import library is needed for z/OS, MSVC and Cygwin
IMPORT_LIB_EXT = .lib
LIBPREFIX=
DEFAULT_LIBS = advapi32.lib
# Change the stubnames so that poorly working FAT disks and installation programs can work.
# This is also for backwards compatibility.
DATA_STUBNAME = dt
I18N_STUBNAME = in
LIBICU = $(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)
## Link commands to link to ICU libs
ifeq ($(wildcard $(LIBDIR)/$(LIBICU)$(DATA_STUBNAME)$(ICULIBSUFFIX).lib),)
LIBICUDT= $(top_builddir)/stubdata/$(LIBICU)$(DATA_STUBNAME)$(ICULIBSUFFIX).lib
else
LIBICUDT= $(LIBDIR)/$(LIBICU)$(DATA_STUBNAME)$(ICULIBSUFFIX).lib
endif
LIBICUUC= $(LIBDIR)/$(LIBICU)$(COMMON_STUBNAME)$(ICULIBSUFFIX).lib $(LIBICUDT)
LIBICUI18N= $(LIBDIR)/$(LIBICU)$(I18N_STUBNAME)$(ICULIBSUFFIX).lib
LIBICULE= $(LIBDIR)/$(LIBICU)$(LAYOUT_STUBNAME)$(ICULIBSUFFIX).lib
LIBICULX= $(LIBDIR)/$(LIBICU)$(LAYOUTEX_STUBNAME)$(ICULIBSUFFIX).lib
LIBICUIO= $(LIBDIR)/$(LIBICU)$(IO_STUBNAME)$(ICULIBSUFFIX).lib
LIBCTESTFW= $(top_builddir)/tools/ctestfw/$(LIBICU)$(CTESTFW_STUBNAME)$(ICULIBSUFFIX).lib
LIBICUTOOLUTIL= $(LIBDIR)/$(LIBICU)$(TOOLUTIL_STUBNAME)$(ICULIBSUFFIX).lib
## These are the library specific LDFLAGS
LDFLAGSICUDT+= /base:"0x4ad00000" /NOENTRY# The NOENTRY option is required for creating a resource-only DLL.
LDFLAGSICUUC= /base:"0x4a800000"# in-uc = 1MB
LDFLAGSICUI18N= /base:"0x4a900000"# io-in = 2MB
LDFLAGSICUIO= /base:"0x4ab00000"# le-io = 1MB
LDFLAGSICULE= /base:"0x4ac00000"# lx-le = 512KB
LDFLAGSICULX= /base:"0x4ac80000"
LDFLAGSCTESTFW=# Unused for now.
LDFLAGSICUTOOLUTIL= /base:"0x4ac00000"# Same as layout. Layout and tools probably won't mix.
# The #M# is used to delete lines for icu-config
# Current full path directory.
Bug 924839 - Update our embedded ICU to 52.1, plus a very few local patches. r=lots of people, see subsequent lines in this commit message for the original subcomponents (merged together for landing), and the original bug for the original patch divisions Bug 924839 - Remove a patch already part of ICU 52.1. See http://bugs.icu-project.org/trac/ticket/10283 but also note the relevant code was removed completely upstream. r=glandium * * * Bug 924839 - Remove another patch already part of ICU 52.1. See http://bugs.icu-project.org/trac/ticket/10290 for that. r=gaston * * * Bug 924839 - Remove another patch already in ICU 52.1. See http://bugs.icu-project.org/trac/ticket/10045 for more. r=Norbert * * * Bug 924839 - Remove another patch already applied upstream. See http://bugs.icu-project.org/trac/changeset/32937 for more. r=gaston * * * Bug 924839 - Update the ICU update script to update to 52.1, *without* applying any of our local patches. r=glandium * * * Bug 924839 - Make the ICU update script only do updating within intl/icu/source and nowhere else. r=glandium * * * Bug 924839 - Implement the changes that would be made by |cd intl/; ./update-icu.sh http://source.icu-project.org/repos/icu/icu/tags/release-52-1/;|, run with the prior changesets' changes made (thus not applying any of our local patches). These changes don't actually work without subsequent adjustments, but this provides a codebase upon which those adjustments can be made, for the purpose of generating local patches to be kept in intl/icu-patches/. rs=the-usual-suspects * * * Bug 924839 - Update the bug 899722 local patch to make runConfigureICU not override CC/CXX on BSD systems. r=gaston * * * Bug 924839 - Update the bug 724533 patch that makes ICU builds with MozillaBuild on Windows. r=glandium * * * Bug 924839 - Import an upstream patch fixing the genrb tool to properly handle the -R (--omitCollationRules) option. See http://bugs.icu-project.org/trac/ticket/10043 for the original bug report and a link to the ultimate upstream landing. r=Norbert * * * Bug 924839 - Import the upstream fix for http://bugs.icu-project.org/trac/ticket/10486 so that ICU with -DU_USING_ICU_NAMESPACE=0 will compile on Windows. r=Norbert * * * Bug 924839 - Adjust the update script to update ICU, then to apply all local patches (rather than skipping the second step). Thus if the update script is properly run, now, the final result should be no changes at all to the tree. NOT REVIEWED YET * * * Bug 924839 - Update jstests that depend on CLDR locale data to match CLDR 24. r=Norbert
2013-11-12 16:23:48 -08:00
CURR_FULL_DIR?=$(subst \,/,$(shell cygpath -da .))#M# -m isn't used because it doesn't work on Win98
# Current full path directory for use in source code in a -D compiler option.
CURR_SRCCODE_FULL_DIR=$(subst \,\\,$(shell cygpath -da .))#M#
ifeq ($(srcdir),.)
SOURCE_FILE=$<
else
SOURCE_FILE=$(shell cygpath -dma $<)#M#
endif
## Compilation rules
%.$(STATIC_O): $(srcdir)/%.c
$(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) /Fo$@ $(SOURCE_FILE)
%.o: $(srcdir)/%.c
$(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) /Fo$@ $(SOURCE_FILE)
%.$(STATIC_O): $(srcdir)/%.cpp
$(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) /Fo$@ $(SOURCE_FILE)
%.o: $(srcdir)/%.cpp
$(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) /Fo$@ $(SOURCE_FILE)
## Dependency rules
## This is a start to how depdendencies could work
# The commented out rules may not properly delete the file when ^C is pressed
# or the compiler fails.
# make currently doesn't like rules with C:\\PROGRA~1\\.. in the depedency.
# So system headers are ignored by ignoring \\
%.d : $(srcdir)/%.c
@echo "generating dependency information for $<"
@$(GEN_DEPS.c) $< > $@
# @echo -n "generating dependency information for "
# @echo -n "$@ $(basename $<).o : " > $@
# @$(SHELL) -ec '$(GEN_DEPS.c) $< \
# | grep "#line 1 " | grep -v \\\\ | cut -d " " -f 3 \
# | /usr/bin/sort -u | sed s/\"$$/\\\\/ | sed s/^\"/\ / >> $@ \
# || (rm -f $@ && echo $@ && false)'
%.d : $(srcdir)/%.cpp
@echo "generating dependency information for $<"
@$(GEN_DEPS.cc) $< > $@
# @echo -n "generating dependency information for "
# @echo -n "$@ $(basename $<).o : " > $@
# @$(SHELL) -ec '$(GEN_DEPS.cc) $< \
# | grep "#line 1 " | grep -v \\\\ | cut -d " " -f 3 \
# | /usr/bin/sort -u | sed s/\"$$/\\\\/ | sed s/^\"/\ / >> $@ \
# || (rm -f $@ && echo $@ && false)'
## Compile a Windows resource file
%.res : $(srcdir)/%.rc
rc.exe /fo$@ $(CPPFLAGS) $(SOURCE_FILE)
## Versioned target for a shared library.
FINAL_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO)
MIDDLE_SO_TARGET=$(FINAL_SO_TARGET)
## Starting in MSVC 2005, manifest files are required. This reduces the obnoxiousness of this feature.
POST_SO_BUILD_STEP = @([ -e $<.manifest ] && \
( echo Embedding manifest into $< && mt.exe -nologo -manifest $<.manifest -outputresource:"$<;2" && rm -rf $<.manifest )) \
|| true
POST_BUILD_STEP = @([ -e $@.manifest ] && \
( echo Embedding manifest into $@ && mt.exe -nologo -manifest $@.manifest -outputresource:"$@;1" && rm -rf $@.manifest )) \
|| true
## Special pkgdata information that is needed
PKGDATA_VERSIONING = -r $(SO_TARGET_VERSION_MAJOR)
ICUPKGDATA_INSTALL_DIR = $(shell mkdir -p $(DESTDIR)$(ICUPKGDATA_DIR) ; cygpath -dma $(DESTDIR)$(ICUPKGDATA_DIR))#M#
ICUPKGDATA_INSTALL_LIBDIR = $(shell mkdir -p $(DESTDIR)$(libdir) ; cygpath -dma $(DESTDIR)$(libdir))#M#
## Versioned import library names. The library names are versioned,
## but the import libraries do not need versioning.
IMPORT_LIB = $(basename $(SO_TARGET))$(IMPORT_LIB_EXT)#M#
MIDDLE_IMPORT_LIB = $(IMPORT_LIB)#M#
FINAL_IMPORT_LIB = $(MIDDLE_IMPORT_LIB)#M#
# The following is for Makefile.inc's use.
ICULIBSUFFIX_VERSION = $(LIB_VERSION_MAJOR)
## Versioned libraries rules
#%$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO)
# $(RM) $@ && cp ${<F} $@
# The following rule is sometimes a no op.
# We only want to do a post-build step when a manifest file doesn't exist.
%.$(SO): %$(SO_TARGET_VERSION_MAJOR).$(SO)
@echo -n
$(POST_SO_BUILD_STEP)
## Install libraries as executable
INSTALL-L=$(INSTALL_PROGRAM)
# Environment variable to set a runtime search path
LDLIBRARYPATH_ENVVAR = PATH
# These are needed to allow the pkgdata nmake files to work
PKGDATA_INVOKE_OPTS = MAKEFLAGS=
# Include the version information in the shared library
ENABLE_SO_VERSION_DATA=1
## End Cygwin-specific setup