michael@0: # HG changeset patch michael@0: # Parent a7f3631893c30ca7f1ccf5a36674786566e48103 michael@0: # User Jeff Walden michael@0: Bug 724533 - Make ICU build with Mozilla build for Windows. r=gps michael@0: michael@0: diff --git a/intl/icu/source/acinclude.m4 b/intl/icu/source/acinclude.m4 michael@0: --- a/intl/icu/source/acinclude.m4 michael@0: +++ b/intl/icu/source/acinclude.m4 michael@0: @@ -42,7 +42,10 @@ powerpc*-*-linux*) michael@0: #error This is not MinGW64 michael@0: #endif], [], icu_cv_host_frag=mh-mingw64, icu_cv_host_frag=mh-mingw), icu_cv_host_frag=mh-cygwin) michael@0: else michael@0: - icu_cv_host_frag=mh-cygwin-msvc michael@0: + case "${host}" in michael@0: + *-*-cygwin) icu_cv_host_frag=mh-cygwin-msvc ;; michael@0: + *-*-mingw32|*-*-mingw64) icu_cv_host_frag=mh-msys-msvc ;; michael@0: + esac michael@0: fi ;; michael@0: *-*-*bsd*|*-*-dragonfly*) icu_cv_host_frag=mh-bsd-gcc ;; michael@0: *-*-aix*) michael@0: @@ -474,7 +477,9 @@ AC_DEFUN([AC_CHECK_STRICT_COMPILE], michael@0: if test "`$CC /help 2>&1 | head -c9`" = "Microsoft" michael@0: then michael@0: CFLAGS="$CFLAGS /W4" michael@0: - fi michael@0: + fi ;; michael@0: + *-*-mingw32|*-*-mingw64) michael@0: + CFLAGS="$CFLAGS -W4" ;; michael@0: esac michael@0: fi michael@0: if test "$GXX" = yes michael@0: @@ -486,7 +491,9 @@ AC_DEFUN([AC_CHECK_STRICT_COMPILE], michael@0: if test "`$CXX /help 2>&1 | head -c9`" = "Microsoft" michael@0: then michael@0: CXXFLAGS="$CXXFLAGS /W4" michael@0: - fi michael@0: + fi ;; michael@0: + *-*-mingw32|*-*-mingw64) michael@0: + CFLAGS="$CFLAGS -W4" ;; michael@0: esac michael@0: fi michael@0: fi michael@0: diff --git a/intl/icu/source/config/mh-cygwin-msvc b/intl/icu/source/config/mh-msys-msvc michael@0: copy from intl/icu/source/config/mh-cygwin-msvc michael@0: copy to intl/icu/source/config/mh-msys-msvc michael@0: --- a/intl/icu/source/config/mh-cygwin-msvc michael@0: +++ b/intl/icu/source/config/mh-msys-msvc michael@0: @@ -1,4 +1,4 @@ michael@0: -## Cygwin with Microsoft Visual C++ compiler specific setup michael@0: +## MSYS with Microsoft Visual C++ compiler specific setup michael@0: ## Copyright (c) 2001-2013, International Business Machines Corporation and michael@0: ## others. All Rights Reserved. michael@0: michael@0: @@ -10,8 +10,8 @@ sbindir=$(bindir) michael@0: ## Commands to generate dependency files michael@0: GEN_DEPS.c= : michael@0: GEN_DEPS.cc= : michael@0: -#GEN_DEPS.c= $(COMPILE.c) /E michael@0: -#GEN_DEPS.cc= $(COMPILE.cc) /E michael@0: +#GEN_DEPS.c= $(COMPILE.c) -E michael@0: +#GEN_DEPS.cc= $(COMPILE.cc) -E michael@0: michael@0: ## Flags to create/use a static library michael@0: ifneq ($(ENABLE_SHARED),YES) michael@0: @@ -41,41 +41,41 @@ CPPFLAGS+=-D_DEBUG=1#M# michael@0: ICULIBSUFFIX:=$(ICULIBSUFFIX)d#M# michael@0: endif michael@0: michael@0: -# /GF pools strings and places them into read-only memory michael@0: -# /EHsc enables exception handling michael@0: -# /Zc:wchar_t makes wchar_t a native type. Required for C++ ABI compatibility. michael@0: +# -GF pools strings and places them into read-only memory michael@0: +# -EHsc enables exception handling michael@0: +# -Zc:wchar_t makes wchar_t a native type. Required for C++ ABI compatibility. michael@0: # -D_CRT_SECURE_NO_DEPRECATE is needed to quiet warnings about using standard C functions. michael@0: -CFLAGS+=/GF /nologo michael@0: -CXXFLAGS+=/GF /nologo /EHsc /Zc:wchar_t michael@0: +CFLAGS+=-GF -nologo michael@0: +CXXFLAGS+=-GF -nologo -EHsc -Zc:wchar_t michael@0: CPPFLAGS+=-D_CRT_SECURE_NO_DEPRECATE michael@0: DEFS+=-DWIN32 -DCYGWINMSVC michael@0: -LDFLAGS+=/nologo michael@0: +LDFLAGS+=-nologo michael@0: michael@0: # Commands to compile michael@0: -COMPILE.c= $(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) /c michael@0: -COMPILE.cc= $(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) /c michael@0: +COMPILE.c= $(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) -c michael@0: +COMPILE.cc= $(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -c michael@0: michael@0: # Commands to link michael@0: -LINK.c= LINK.EXE /subsystem:console $(LDFLAGS) michael@0: -LINK.cc= LINK.EXE /subsystem:console $(LDFLAGS) michael@0: +LINK.c= LINK.EXE -subsystem:console $(LDFLAGS) michael@0: +LINK.cc= LINK.EXE -subsystem:console $(LDFLAGS) michael@0: michael@0: ## Commands to make a shared library michael@0: -SHLIB.c= LINK.EXE /DLL $(LDFLAGS) michael@0: -SHLIB.cc= LINK.EXE /DLL $(LDFLAGS) michael@0: +SHLIB.c= LINK.EXE -DLL $(LDFLAGS) michael@0: +SHLIB.cc= LINK.EXE -DLL $(LDFLAGS) michael@0: michael@0: ## Compiler switch to embed a runtime search path michael@0: LD_RPATH= michael@0: LD_RPATH_PRE= michael@0: michael@0: ## Compiler switch to embed a library name michael@0: -LD_SONAME = /IMPLIB:$(SO_TARGET:.dll=.lib) michael@0: +LD_SONAME = -IMPLIB:$(SO_TARGET:.dll=.lib) michael@0: michael@0: ## Shared object suffix michael@0: SO = dll michael@0: ## Non-shared intermediate object suffix michael@0: STATIC_O = ao michael@0: # OUTOPT is for creating a specific output name michael@0: -OUTOPT = /out: michael@0: +OUTOPT = -out: michael@0: michael@0: # Static library prefix and file extension michael@0: LIBSICU = $(STATIC_PREFIX)$(ICUPREFIX) michael@0: @@ -83,11 +83,11 @@ A = lib michael@0: michael@0: # Cygwin's ar can't handle Win64 right now. So we use Microsoft's tool instead. michael@0: AR = LIB.EXE#M# michael@0: -ARFLAGS := /nologo $(ARFLAGS:r=)#M# michael@0: +ARFLAGS := -nologo $(ARFLAGS:r=)#M# michael@0: RANLIB = ls -s#M# michael@0: -AR_OUTOPT = /OUT:#M# michael@0: +AR_OUTOPT = -OUT:#M# michael@0: michael@0: -## An import library is needed for z/OS, MSVC and Cygwin michael@0: +## An import library is needed for z-OS, MSVC and Cygwin michael@0: IMPORT_LIB_EXT = .lib michael@0: michael@0: LIBPREFIX= michael@0: @@ -114,37 +114,25 @@ LIBCTESTFW= $(top_builddir)/tools/ctestf michael@0: LIBICUTOOLUTIL= $(LIBDIR)/$(LIBICU)$(TOOLUTIL_STUBNAME)$(ICULIBSUFFIX).lib michael@0: michael@0: ## These are the library specific LDFLAGS michael@0: -LDFLAGSICUDT+= /base:"0x4ad00000" /NOENTRY# The NOENTRY option is required for creating a resource-only DLL. michael@0: -LDFLAGSICUUC= /base:"0x4a800000"# in-uc = 1MB michael@0: -LDFLAGSICUI18N= /base:"0x4a900000"# io-in = 2MB michael@0: -LDFLAGSICUIO= /base:"0x4ab00000"# le-io = 1MB michael@0: -LDFLAGSICULE= /base:"0x4ac00000"# lx-le = 512KB michael@0: -LDFLAGSICULX= /base:"0x4ac80000" michael@0: +LDFLAGSICUDT+= -base:"0x4ad00000" -NOENTRY# The NOENTRY option is required for creating a resource-only DLL. michael@0: +LDFLAGSICUUC= -base:"0x4a800000"# in-uc = 1MB michael@0: +LDFLAGSICUI18N= -base:"0x4a900000"# io-in = 2MB michael@0: +LDFLAGSICUIO= -base:"0x4ab00000"# le-io = 1MB michael@0: +LDFLAGSICULE= -base:"0x4ac00000"# lx-le = 512KB michael@0: +LDFLAGSICULX= -base:"0x4ac80000" michael@0: LDFLAGSCTESTFW=# Unused for now. michael@0: -LDFLAGSICUTOOLUTIL= /base:"0x4ac00000"# Same as layout. Layout and tools probably won't mix. michael@0: - michael@0: -# The #M# is used to delete lines for icu-config michael@0: -# Current full path directory. michael@0: -CURR_FULL_DIR?=$(subst \,/,$(shell cygpath -da .))#M# -m isn't used because it doesn't work on Win98 michael@0: -# Current full path directory for use in source code in a -D compiler option. michael@0: -CURR_SRCCODE_FULL_DIR=$(subst \,\\,$(shell cygpath -da .))#M# michael@0: - michael@0: -ifeq ($(srcdir),.) michael@0: -SOURCE_FILE=$< michael@0: -else michael@0: -SOURCE_FILE=$(shell cygpath -dma $<)#M# michael@0: -endif michael@0: +LDFLAGSICUTOOLUTIL= -base:"0x4ac00000"# Same as layout. Layout and tools probably won't mix. michael@0: michael@0: ## Compilation rules michael@0: %.$(STATIC_O): $(srcdir)/%.c michael@0: - $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) /Fo$@ $(SOURCE_FILE) michael@0: + $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -Fo$@ $< michael@0: %.o: $(srcdir)/%.c michael@0: - $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) /Fo$@ $(SOURCE_FILE) michael@0: + $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -Fo$@ $< michael@0: michael@0: %.$(STATIC_O): $(srcdir)/%.cpp michael@0: - $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) /Fo$@ $(SOURCE_FILE) michael@0: + $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -Fo$@ $< michael@0: %.o: $(srcdir)/%.cpp michael@0: - $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) /Fo$@ $(SOURCE_FILE) michael@0: + $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -Fo$@ $< michael@0: michael@0: michael@0: ## Dependency rules michael@0: @@ -175,7 +163,7 @@ endif michael@0: michael@0: ## Compile a Windows resource file michael@0: %.res : $(srcdir)/%.rc michael@0: - rc.exe /fo$@ $(CPPFLAGS) $(SOURCE_FILE) michael@0: + rc.exe -fo$@ $(CPPFLAGS) $< michael@0: michael@0: ## Versioned target for a shared library. michael@0: FINAL_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO) michael@0: @@ -191,8 +179,8 @@ MIDDLE_SO_TARGET=$(FINAL_SO_TARGET) michael@0: michael@0: ## Special pkgdata information that is needed michael@0: PKGDATA_VERSIONING = -r $(SO_TARGET_VERSION_MAJOR) michael@0: -ICUPKGDATA_INSTALL_DIR = $(shell mkdir -p $(DESTDIR)$(ICUPKGDATA_DIR) ; cygpath -dma $(DESTDIR)$(ICUPKGDATA_DIR))#M# michael@0: -ICUPKGDATA_INSTALL_LIBDIR = $(shell mkdir -p $(DESTDIR)$(libdir) ; cygpath -dma $(DESTDIR)$(libdir))#M# michael@0: +ICUPKGDATA_INSTALL_DIR = $(shell mkdir -p $(DESTDIR)$(ICUPKGDATA_DIR) ; echo $(DESTDIR)$(ICUPKGDATA_DIR))#M# michael@0: +ICUPKGDATA_INSTALL_LIBDIR = $(shell mkdir -p $(DESTDIR)$(libdir) ; echo $(DESTDIR)$(libdir))#M# michael@0: michael@0: ## Versioned import library names. The library names are versioned, michael@0: ## but the import libraries do not need versioning. michael@0: @@ -225,5 +213,5 @@ PKGDATA_INVOKE_OPTS = MAKEFLAGS= michael@0: # Include the version information in the shared library michael@0: ENABLE_SO_VERSION_DATA=1 michael@0: michael@0: -## End Cygwin-specific setup michael@0: +## End MSYS-specific setup michael@0: michael@0: diff --git a/intl/icu/source/configure b/intl/icu/source/configure michael@0: --- a/intl/icu/source/configure michael@0: +++ b/intl/icu/source/configure michael@0: @@ -4100,7 +4100,9 @@ fi michael@0: if test "`$CC /help 2>&1 | head -c9`" = "Microsoft" michael@0: then michael@0: CFLAGS="$CFLAGS /W4" michael@0: - fi michael@0: + fi ;; michael@0: + *-*-mingw32|*-*-mingw64) michael@0: + CFLAGS="$CFLAGS -W4" ;; michael@0: esac michael@0: fi michael@0: if test "$GXX" = yes michael@0: @@ -4112,7 +4114,9 @@ fi michael@0: if test "`$CXX /help 2>&1 | head -c9`" = "Microsoft" michael@0: then michael@0: CXXFLAGS="$CXXFLAGS /W4" michael@0: - fi michael@0: + fi ;; michael@0: + *-*-mingw32|*-*-mingw64) michael@0: + CFLAGS="$CFLAGS -W4" ;; michael@0: esac michael@0: fi michael@0: fi michael@0: @@ -4915,7 +4919,10 @@ else michael@0: fi michael@0: rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext michael@0: else michael@0: - icu_cv_host_frag=mh-cygwin-msvc michael@0: + case "${host}" in michael@0: + *-*-cygwin) icu_cv_host_frag=mh-cygwin-msvc ;; michael@0: + *-*-mingw32|*-*-mingw64) icu_cv_host_frag=mh-msys-msvc ;; michael@0: + esac michael@0: fi ;; michael@0: *-*-*bsd*|*-*-dragonfly*) icu_cv_host_frag=mh-bsd-gcc ;; michael@0: *-*-aix*) michael@0: @@ -5157,7 +5164,7 @@ fi michael@0: MSVC_RELEASE_FLAG="" michael@0: if test $enabled = yes michael@0: then michael@0: - if test $icu_cv_host_frag = mh-cygwin-msvc michael@0: + if test $icu_cv_host_frag = mh-cygwin-msvc -o $icu_cv_host_frag = mh-msys-msvc michael@0: then michael@0: cat confdefs.h - <<_ACEOF >conftest.$ac_ext michael@0: /* end confdefs.h. */ michael@0: diff --git a/intl/icu/source/configure.ac b/intl/icu/source/configure.ac michael@0: --- a/intl/icu/source/configure.ac michael@0: +++ b/intl/icu/source/configure.ac michael@0: @@ -330,7 +330,7 @@ AC_SUBST(UCLN_NO_AUTO_CLEANUP) michael@0: MSVC_RELEASE_FLAG="" michael@0: if test $enabled = yes michael@0: then michael@0: - if test $icu_cv_host_frag = mh-cygwin-msvc michael@0: + if test $icu_cv_host_frag = mh-cygwin-msvc -o $icu_cv_host_frag = mh-msys-msvc michael@0: then michael@0: AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ michael@0: #if defined _MSC_VER && _MSC_VER >= 1400 michael@0: diff --git a/intl/icu/source/data/Makefile.in b/intl/icu/source/data/Makefile.in michael@0: --- a/intl/icu/source/data/Makefile.in michael@0: +++ b/intl/icu/source/data/Makefile.in michael@0: @@ -350,7 +350,8 @@ ifeq ($(ENABLE_SO_VERSION_DATA),1) michael@0: ifeq ($(PKGDATA_MODE),dll) michael@0: SO_VERSION_DATA = $(OUTTMPDIR)/icudata.res michael@0: $(SO_VERSION_DATA) : $(MISCSRCDIR)/icudata.rc michael@0: - rc.exe /i$(srcdir)/../common /i$(top_builddir)/common /fo$@ $(CPPFLAGS) $(SOURCE_FILE) michael@0: + # fixme: need to tell whether to use - or /, $(SOURCEFILE) or $< michael@0: + rc.exe -i$(srcdir)/../common -i$(top_builddir)/common -fo$@ $(CPPFLAGS) $< michael@0: endif michael@0: endif michael@0: michael@0: diff --git a/intl/icu/source/runConfigureICU b/intl/icu/source/runConfigureICU michael@0: --- a/intl/icu/source/runConfigureICU michael@0: +++ b/intl/icu/source/runConfigureICU michael@0: @@ -315,6 +315,17 @@ case $platform in michael@0: CXXFLAGS="--std=c++03" michael@0: export CXXFLAGS michael@0: ;; michael@0: + MSYS/MSVC) michael@0: + THE_OS="MSYS" michael@0: + THE_COMP="Microsoft Visual C++" michael@0: + CC=cl; export CC michael@0: + CXX=cl; export CXX michael@0: + RELEASE_CFLAGS='-Gy -MD' michael@0: + RELEASE_CXXFLAGS='-Gy -MD' michael@0: + DEBUG_CFLAGS='-Zi -MDd' michael@0: + DEBUG_CXXFLAGS='-Zi -MDd' michael@0: + DEBUG_LDFLAGS='-DEBUG' michael@0: + ;; michael@0: *BSD) michael@0: THE_OS="BSD" michael@0: THE_COMP="the GNU C++"