intl/icu-patches/bug-724533

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 # HG changeset patch
michael@0 2 # Parent a7f3631893c30ca7f1ccf5a36674786566e48103
michael@0 3 # User Jeff Walden <jwalden@mit.edu>
michael@0 4 Bug 724533 - Make ICU build with Mozilla build for Windows. r=gps
michael@0 5
michael@0 6 diff --git a/intl/icu/source/acinclude.m4 b/intl/icu/source/acinclude.m4
michael@0 7 --- a/intl/icu/source/acinclude.m4
michael@0 8 +++ b/intl/icu/source/acinclude.m4
michael@0 9 @@ -42,7 +42,10 @@ powerpc*-*-linux*)
michael@0 10 #error This is not MinGW64
michael@0 11 #endif], [], icu_cv_host_frag=mh-mingw64, icu_cv_host_frag=mh-mingw), icu_cv_host_frag=mh-cygwin)
michael@0 12 else
michael@0 13 - icu_cv_host_frag=mh-cygwin-msvc
michael@0 14 + case "${host}" in
michael@0 15 + *-*-cygwin) icu_cv_host_frag=mh-cygwin-msvc ;;
michael@0 16 + *-*-mingw32|*-*-mingw64) icu_cv_host_frag=mh-msys-msvc ;;
michael@0 17 + esac
michael@0 18 fi ;;
michael@0 19 *-*-*bsd*|*-*-dragonfly*) icu_cv_host_frag=mh-bsd-gcc ;;
michael@0 20 *-*-aix*)
michael@0 21 @@ -474,7 +477,9 @@ AC_DEFUN([AC_CHECK_STRICT_COMPILE],
michael@0 22 if test "`$CC /help 2>&1 | head -c9`" = "Microsoft"
michael@0 23 then
michael@0 24 CFLAGS="$CFLAGS /W4"
michael@0 25 - fi
michael@0 26 + fi ;;
michael@0 27 + *-*-mingw32|*-*-mingw64)
michael@0 28 + CFLAGS="$CFLAGS -W4" ;;
michael@0 29 esac
michael@0 30 fi
michael@0 31 if test "$GXX" = yes
michael@0 32 @@ -486,7 +491,9 @@ AC_DEFUN([AC_CHECK_STRICT_COMPILE],
michael@0 33 if test "`$CXX /help 2>&1 | head -c9`" = "Microsoft"
michael@0 34 then
michael@0 35 CXXFLAGS="$CXXFLAGS /W4"
michael@0 36 - fi
michael@0 37 + fi ;;
michael@0 38 + *-*-mingw32|*-*-mingw64)
michael@0 39 + CFLAGS="$CFLAGS -W4" ;;
michael@0 40 esac
michael@0 41 fi
michael@0 42 fi
michael@0 43 diff --git a/intl/icu/source/config/mh-cygwin-msvc b/intl/icu/source/config/mh-msys-msvc
michael@0 44 copy from intl/icu/source/config/mh-cygwin-msvc
michael@0 45 copy to intl/icu/source/config/mh-msys-msvc
michael@0 46 --- a/intl/icu/source/config/mh-cygwin-msvc
michael@0 47 +++ b/intl/icu/source/config/mh-msys-msvc
michael@0 48 @@ -1,4 +1,4 @@
michael@0 49 -## Cygwin with Microsoft Visual C++ compiler specific setup
michael@0 50 +## MSYS with Microsoft Visual C++ compiler specific setup
michael@0 51 ## Copyright (c) 2001-2013, International Business Machines Corporation and
michael@0 52 ## others. All Rights Reserved.
michael@0 53
michael@0 54 @@ -10,8 +10,8 @@ sbindir=$(bindir)
michael@0 55 ## Commands to generate dependency files
michael@0 56 GEN_DEPS.c= :
michael@0 57 GEN_DEPS.cc= :
michael@0 58 -#GEN_DEPS.c= $(COMPILE.c) /E
michael@0 59 -#GEN_DEPS.cc= $(COMPILE.cc) /E
michael@0 60 +#GEN_DEPS.c= $(COMPILE.c) -E
michael@0 61 +#GEN_DEPS.cc= $(COMPILE.cc) -E
michael@0 62
michael@0 63 ## Flags to create/use a static library
michael@0 64 ifneq ($(ENABLE_SHARED),YES)
michael@0 65 @@ -41,41 +41,41 @@ CPPFLAGS+=-D_DEBUG=1#M#
michael@0 66 ICULIBSUFFIX:=$(ICULIBSUFFIX)d#M#
michael@0 67 endif
michael@0 68
michael@0 69 -# /GF pools strings and places them into read-only memory
michael@0 70 -# /EHsc enables exception handling
michael@0 71 -# /Zc:wchar_t makes wchar_t a native type. Required for C++ ABI compatibility.
michael@0 72 +# -GF pools strings and places them into read-only memory
michael@0 73 +# -EHsc enables exception handling
michael@0 74 +# -Zc:wchar_t makes wchar_t a native type. Required for C++ ABI compatibility.
michael@0 75 # -D_CRT_SECURE_NO_DEPRECATE is needed to quiet warnings about using standard C functions.
michael@0 76 -CFLAGS+=/GF /nologo
michael@0 77 -CXXFLAGS+=/GF /nologo /EHsc /Zc:wchar_t
michael@0 78 +CFLAGS+=-GF -nologo
michael@0 79 +CXXFLAGS+=-GF -nologo -EHsc -Zc:wchar_t
michael@0 80 CPPFLAGS+=-D_CRT_SECURE_NO_DEPRECATE
michael@0 81 DEFS+=-DWIN32 -DCYGWINMSVC
michael@0 82 -LDFLAGS+=/nologo
michael@0 83 +LDFLAGS+=-nologo
michael@0 84
michael@0 85 # Commands to compile
michael@0 86 -COMPILE.c= $(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) /c
michael@0 87 -COMPILE.cc= $(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) /c
michael@0 88 +COMPILE.c= $(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) -c
michael@0 89 +COMPILE.cc= $(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -c
michael@0 90
michael@0 91 # Commands to link
michael@0 92 -LINK.c= LINK.EXE /subsystem:console $(LDFLAGS)
michael@0 93 -LINK.cc= LINK.EXE /subsystem:console $(LDFLAGS)
michael@0 94 +LINK.c= LINK.EXE -subsystem:console $(LDFLAGS)
michael@0 95 +LINK.cc= LINK.EXE -subsystem:console $(LDFLAGS)
michael@0 96
michael@0 97 ## Commands to make a shared library
michael@0 98 -SHLIB.c= LINK.EXE /DLL $(LDFLAGS)
michael@0 99 -SHLIB.cc= LINK.EXE /DLL $(LDFLAGS)
michael@0 100 +SHLIB.c= LINK.EXE -DLL $(LDFLAGS)
michael@0 101 +SHLIB.cc= LINK.EXE -DLL $(LDFLAGS)
michael@0 102
michael@0 103 ## Compiler switch to embed a runtime search path
michael@0 104 LD_RPATH=
michael@0 105 LD_RPATH_PRE=
michael@0 106
michael@0 107 ## Compiler switch to embed a library name
michael@0 108 -LD_SONAME = /IMPLIB:$(SO_TARGET:.dll=.lib)
michael@0 109 +LD_SONAME = -IMPLIB:$(SO_TARGET:.dll=.lib)
michael@0 110
michael@0 111 ## Shared object suffix
michael@0 112 SO = dll
michael@0 113 ## Non-shared intermediate object suffix
michael@0 114 STATIC_O = ao
michael@0 115 # OUTOPT is for creating a specific output name
michael@0 116 -OUTOPT = /out:
michael@0 117 +OUTOPT = -out:
michael@0 118
michael@0 119 # Static library prefix and file extension
michael@0 120 LIBSICU = $(STATIC_PREFIX)$(ICUPREFIX)
michael@0 121 @@ -83,11 +83,11 @@ A = lib
michael@0 122
michael@0 123 # Cygwin's ar can't handle Win64 right now. So we use Microsoft's tool instead.
michael@0 124 AR = LIB.EXE#M#
michael@0 125 -ARFLAGS := /nologo $(ARFLAGS:r=)#M#
michael@0 126 +ARFLAGS := -nologo $(ARFLAGS:r=)#M#
michael@0 127 RANLIB = ls -s#M#
michael@0 128 -AR_OUTOPT = /OUT:#M#
michael@0 129 +AR_OUTOPT = -OUT:#M#
michael@0 130
michael@0 131 -## An import library is needed for z/OS, MSVC and Cygwin
michael@0 132 +## An import library is needed for z-OS, MSVC and Cygwin
michael@0 133 IMPORT_LIB_EXT = .lib
michael@0 134
michael@0 135 LIBPREFIX=
michael@0 136 @@ -114,37 +114,25 @@ LIBCTESTFW= $(top_builddir)/tools/ctestf
michael@0 137 LIBICUTOOLUTIL= $(LIBDIR)/$(LIBICU)$(TOOLUTIL_STUBNAME)$(ICULIBSUFFIX).lib
michael@0 138
michael@0 139 ## These are the library specific LDFLAGS
michael@0 140 -LDFLAGSICUDT+= /base:"0x4ad00000" /NOENTRY# The NOENTRY option is required for creating a resource-only DLL.
michael@0 141 -LDFLAGSICUUC= /base:"0x4a800000"# in-uc = 1MB
michael@0 142 -LDFLAGSICUI18N= /base:"0x4a900000"# io-in = 2MB
michael@0 143 -LDFLAGSICUIO= /base:"0x4ab00000"# le-io = 1MB
michael@0 144 -LDFLAGSICULE= /base:"0x4ac00000"# lx-le = 512KB
michael@0 145 -LDFLAGSICULX= /base:"0x4ac80000"
michael@0 146 +LDFLAGSICUDT+= -base:"0x4ad00000" -NOENTRY# The NOENTRY option is required for creating a resource-only DLL.
michael@0 147 +LDFLAGSICUUC= -base:"0x4a800000"# in-uc = 1MB
michael@0 148 +LDFLAGSICUI18N= -base:"0x4a900000"# io-in = 2MB
michael@0 149 +LDFLAGSICUIO= -base:"0x4ab00000"# le-io = 1MB
michael@0 150 +LDFLAGSICULE= -base:"0x4ac00000"# lx-le = 512KB
michael@0 151 +LDFLAGSICULX= -base:"0x4ac80000"
michael@0 152 LDFLAGSCTESTFW=# Unused for now.
michael@0 153 -LDFLAGSICUTOOLUTIL= /base:"0x4ac00000"# Same as layout. Layout and tools probably won't mix.
michael@0 154 -
michael@0 155 -# The #M# is used to delete lines for icu-config
michael@0 156 -# Current full path directory.
michael@0 157 -CURR_FULL_DIR?=$(subst \,/,$(shell cygpath -da .))#M# -m isn't used because it doesn't work on Win98
michael@0 158 -# Current full path directory for use in source code in a -D compiler option.
michael@0 159 -CURR_SRCCODE_FULL_DIR=$(subst \,\\,$(shell cygpath -da .))#M#
michael@0 160 -
michael@0 161 -ifeq ($(srcdir),.)
michael@0 162 -SOURCE_FILE=$<
michael@0 163 -else
michael@0 164 -SOURCE_FILE=$(shell cygpath -dma $<)#M#
michael@0 165 -endif
michael@0 166 +LDFLAGSICUTOOLUTIL= -base:"0x4ac00000"# Same as layout. Layout and tools probably won't mix.
michael@0 167
michael@0 168 ## Compilation rules
michael@0 169 %.$(STATIC_O): $(srcdir)/%.c
michael@0 170 - $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) /Fo$@ $(SOURCE_FILE)
michael@0 171 + $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -Fo$@ $<
michael@0 172 %.o: $(srcdir)/%.c
michael@0 173 - $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) /Fo$@ $(SOURCE_FILE)
michael@0 174 + $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -Fo$@ $<
michael@0 175
michael@0 176 %.$(STATIC_O): $(srcdir)/%.cpp
michael@0 177 - $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) /Fo$@ $(SOURCE_FILE)
michael@0 178 + $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -Fo$@ $<
michael@0 179 %.o: $(srcdir)/%.cpp
michael@0 180 - $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) /Fo$@ $(SOURCE_FILE)
michael@0 181 + $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -Fo$@ $<
michael@0 182
michael@0 183
michael@0 184 ## Dependency rules
michael@0 185 @@ -175,7 +163,7 @@ endif
michael@0 186
michael@0 187 ## Compile a Windows resource file
michael@0 188 %.res : $(srcdir)/%.rc
michael@0 189 - rc.exe /fo$@ $(CPPFLAGS) $(SOURCE_FILE)
michael@0 190 + rc.exe -fo$@ $(CPPFLAGS) $<
michael@0 191
michael@0 192 ## Versioned target for a shared library.
michael@0 193 FINAL_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO)
michael@0 194 @@ -191,8 +179,8 @@ MIDDLE_SO_TARGET=$(FINAL_SO_TARGET)
michael@0 195
michael@0 196 ## Special pkgdata information that is needed
michael@0 197 PKGDATA_VERSIONING = -r $(SO_TARGET_VERSION_MAJOR)
michael@0 198 -ICUPKGDATA_INSTALL_DIR = $(shell mkdir -p $(DESTDIR)$(ICUPKGDATA_DIR) ; cygpath -dma $(DESTDIR)$(ICUPKGDATA_DIR))#M#
michael@0 199 -ICUPKGDATA_INSTALL_LIBDIR = $(shell mkdir -p $(DESTDIR)$(libdir) ; cygpath -dma $(DESTDIR)$(libdir))#M#
michael@0 200 +ICUPKGDATA_INSTALL_DIR = $(shell mkdir -p $(DESTDIR)$(ICUPKGDATA_DIR) ; echo $(DESTDIR)$(ICUPKGDATA_DIR))#M#
michael@0 201 +ICUPKGDATA_INSTALL_LIBDIR = $(shell mkdir -p $(DESTDIR)$(libdir) ; echo $(DESTDIR)$(libdir))#M#
michael@0 202
michael@0 203 ## Versioned import library names. The library names are versioned,
michael@0 204 ## but the import libraries do not need versioning.
michael@0 205 @@ -225,5 +213,5 @@ PKGDATA_INVOKE_OPTS = MAKEFLAGS=
michael@0 206 # Include the version information in the shared library
michael@0 207 ENABLE_SO_VERSION_DATA=1
michael@0 208
michael@0 209 -## End Cygwin-specific setup
michael@0 210 +## End MSYS-specific setup
michael@0 211
michael@0 212 diff --git a/intl/icu/source/configure b/intl/icu/source/configure
michael@0 213 --- a/intl/icu/source/configure
michael@0 214 +++ b/intl/icu/source/configure
michael@0 215 @@ -4100,7 +4100,9 @@ fi
michael@0 216 if test "`$CC /help 2>&1 | head -c9`" = "Microsoft"
michael@0 217 then
michael@0 218 CFLAGS="$CFLAGS /W4"
michael@0 219 - fi
michael@0 220 + fi ;;
michael@0 221 + *-*-mingw32|*-*-mingw64)
michael@0 222 + CFLAGS="$CFLAGS -W4" ;;
michael@0 223 esac
michael@0 224 fi
michael@0 225 if test "$GXX" = yes
michael@0 226 @@ -4112,7 +4114,9 @@ fi
michael@0 227 if test "`$CXX /help 2>&1 | head -c9`" = "Microsoft"
michael@0 228 then
michael@0 229 CXXFLAGS="$CXXFLAGS /W4"
michael@0 230 - fi
michael@0 231 + fi ;;
michael@0 232 + *-*-mingw32|*-*-mingw64)
michael@0 233 + CFLAGS="$CFLAGS -W4" ;;
michael@0 234 esac
michael@0 235 fi
michael@0 236 fi
michael@0 237 @@ -4915,7 +4919,10 @@ else
michael@0 238 fi
michael@0 239 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
michael@0 240 else
michael@0 241 - icu_cv_host_frag=mh-cygwin-msvc
michael@0 242 + case "${host}" in
michael@0 243 + *-*-cygwin) icu_cv_host_frag=mh-cygwin-msvc ;;
michael@0 244 + *-*-mingw32|*-*-mingw64) icu_cv_host_frag=mh-msys-msvc ;;
michael@0 245 + esac
michael@0 246 fi ;;
michael@0 247 *-*-*bsd*|*-*-dragonfly*) icu_cv_host_frag=mh-bsd-gcc ;;
michael@0 248 *-*-aix*)
michael@0 249 @@ -5157,7 +5164,7 @@ fi
michael@0 250 MSVC_RELEASE_FLAG=""
michael@0 251 if test $enabled = yes
michael@0 252 then
michael@0 253 - if test $icu_cv_host_frag = mh-cygwin-msvc
michael@0 254 + if test $icu_cv_host_frag = mh-cygwin-msvc -o $icu_cv_host_frag = mh-msys-msvc
michael@0 255 then
michael@0 256 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
michael@0 257 /* end confdefs.h. */
michael@0 258 diff --git a/intl/icu/source/configure.ac b/intl/icu/source/configure.ac
michael@0 259 --- a/intl/icu/source/configure.ac
michael@0 260 +++ b/intl/icu/source/configure.ac
michael@0 261 @@ -330,7 +330,7 @@ AC_SUBST(UCLN_NO_AUTO_CLEANUP)
michael@0 262 MSVC_RELEASE_FLAG=""
michael@0 263 if test $enabled = yes
michael@0 264 then
michael@0 265 - if test $icu_cv_host_frag = mh-cygwin-msvc
michael@0 266 + if test $icu_cv_host_frag = mh-cygwin-msvc -o $icu_cv_host_frag = mh-msys-msvc
michael@0 267 then
michael@0 268 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
michael@0 269 #if defined _MSC_VER && _MSC_VER >= 1400
michael@0 270 diff --git a/intl/icu/source/data/Makefile.in b/intl/icu/source/data/Makefile.in
michael@0 271 --- a/intl/icu/source/data/Makefile.in
michael@0 272 +++ b/intl/icu/source/data/Makefile.in
michael@0 273 @@ -350,7 +350,8 @@ ifeq ($(ENABLE_SO_VERSION_DATA),1)
michael@0 274 ifeq ($(PKGDATA_MODE),dll)
michael@0 275 SO_VERSION_DATA = $(OUTTMPDIR)/icudata.res
michael@0 276 $(SO_VERSION_DATA) : $(MISCSRCDIR)/icudata.rc
michael@0 277 - rc.exe /i$(srcdir)/../common /i$(top_builddir)/common /fo$@ $(CPPFLAGS) $(SOURCE_FILE)
michael@0 278 + # fixme: need to tell whether to use - or /, $(SOURCEFILE) or $<
michael@0 279 + rc.exe -i$(srcdir)/../common -i$(top_builddir)/common -fo$@ $(CPPFLAGS) $<
michael@0 280 endif
michael@0 281 endif
michael@0 282
michael@0 283 diff --git a/intl/icu/source/runConfigureICU b/intl/icu/source/runConfigureICU
michael@0 284 --- a/intl/icu/source/runConfigureICU
michael@0 285 +++ b/intl/icu/source/runConfigureICU
michael@0 286 @@ -315,6 +315,17 @@ case $platform in
michael@0 287 CXXFLAGS="--std=c++03"
michael@0 288 export CXXFLAGS
michael@0 289 ;;
michael@0 290 + MSYS/MSVC)
michael@0 291 + THE_OS="MSYS"
michael@0 292 + THE_COMP="Microsoft Visual C++"
michael@0 293 + CC=cl; export CC
michael@0 294 + CXX=cl; export CXX
michael@0 295 + RELEASE_CFLAGS='-Gy -MD'
michael@0 296 + RELEASE_CXXFLAGS='-Gy -MD'
michael@0 297 + DEBUG_CFLAGS='-Zi -MDd'
michael@0 298 + DEBUG_CXXFLAGS='-Zi -MDd'
michael@0 299 + DEBUG_LDFLAGS='-DEBUG'
michael@0 300 + ;;
michael@0 301 *BSD)
michael@0 302 THE_OS="BSD"
michael@0 303 THE_COMP="the GNU C++"

mercurial