1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/intl/icu/source/config/mh-msys-msvc Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,217 @@ 1.4 +## MSYS with Microsoft Visual C++ compiler specific setup 1.5 +## Copyright (c) 2001-2013, International Business Machines Corporation and 1.6 +## others. All Rights Reserved. 1.7 + 1.8 +# We install sbin tools into the same bin directory because 1.9 +# pkgdata needs some of the tools in sbin, and we can't always depend on 1.10 +# icu-config working on Windows. 1.11 +sbindir=$(bindir) 1.12 + 1.13 +## Commands to generate dependency files 1.14 +GEN_DEPS.c= : 1.15 +GEN_DEPS.cc= : 1.16 +#GEN_DEPS.c= $(COMPILE.c) -E 1.17 +#GEN_DEPS.cc= $(COMPILE.cc) -E 1.18 + 1.19 +## Flags to create/use a static library 1.20 +ifneq ($(ENABLE_SHARED),YES) 1.21 +## Make sure that the static libraries can be built and used 1.22 +CPPFLAGS += -DU_STATIC_IMPLEMENTATION#M# 1.23 +else 1.24 +## Make sure that the static libraries can be built 1.25 +STATICCPPFLAGS = -DU_STATIC_IMPLEMENTATION 1.26 +endif 1.27 + 1.28 +## Flags for position independent code 1.29 +SHAREDLIBCFLAGS = 1.30 +SHAREDLIBCXXFLAGS = 1.31 +SHAREDLIBCPPFLAGS = 1.32 + 1.33 +## Additional flags when building libraries and with threads 1.34 +LIBCPPFLAGS = 1.35 + 1.36 +ifeq ($(ENABLE_RELEASE),1) 1.37 +# Make sure that assertions are disabled 1.38 +CPPFLAGS+=-DU_RELEASE=1#M# 1.39 +endif 1.40 + 1.41 +ifeq ($(ENABLE_DEBUG),1) 1.42 +# Pass debugging flag through 1.43 +CPPFLAGS+=-D_DEBUG=1#M# 1.44 +ICULIBSUFFIX:=$(ICULIBSUFFIX)d#M# 1.45 +endif 1.46 + 1.47 +# -GF pools strings and places them into read-only memory 1.48 +# -EHsc enables exception handling 1.49 +# -Zc:wchar_t makes wchar_t a native type. Required for C++ ABI compatibility. 1.50 +# -D_CRT_SECURE_NO_DEPRECATE is needed to quiet warnings about using standard C functions. 1.51 +CFLAGS+=-GF -nologo 1.52 +CXXFLAGS+=-GF -nologo -EHsc -Zc:wchar_t 1.53 +CPPFLAGS+=-D_CRT_SECURE_NO_DEPRECATE 1.54 +DEFS+=-DWIN32 -DCYGWINMSVC 1.55 +LDFLAGS+=-nologo 1.56 + 1.57 +# Commands to compile 1.58 +COMPILE.c= $(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) -c 1.59 +COMPILE.cc= $(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -c 1.60 + 1.61 +# Commands to link 1.62 +LINK.c= LINK.EXE -subsystem:console $(LDFLAGS) 1.63 +LINK.cc= LINK.EXE -subsystem:console $(LDFLAGS) 1.64 + 1.65 +## Commands to make a shared library 1.66 +SHLIB.c= LINK.EXE -DLL $(LDFLAGS) 1.67 +SHLIB.cc= LINK.EXE -DLL $(LDFLAGS) 1.68 + 1.69 +## Compiler switch to embed a runtime search path 1.70 +LD_RPATH= 1.71 +LD_RPATH_PRE= 1.72 + 1.73 +## Compiler switch to embed a library name 1.74 +LD_SONAME = -IMPLIB:$(SO_TARGET:.dll=.lib) 1.75 + 1.76 +## Shared object suffix 1.77 +SO = dll 1.78 +## Non-shared intermediate object suffix 1.79 +STATIC_O = ao 1.80 +# OUTOPT is for creating a specific output name 1.81 +OUTOPT = -out: 1.82 + 1.83 +# Static library prefix and file extension 1.84 +LIBSICU = $(STATIC_PREFIX)$(ICUPREFIX) 1.85 +A = lib 1.86 + 1.87 +# Cygwin's ar can't handle Win64 right now. So we use Microsoft's tool instead. 1.88 +AR = LIB.EXE#M# 1.89 +ARFLAGS := -nologo $(ARFLAGS:r=)#M# 1.90 +RANLIB = ls -s#M# 1.91 +AR_OUTOPT = -OUT:#M# 1.92 + 1.93 +## An import library is needed for z-OS, MSVC and Cygwin 1.94 +IMPORT_LIB_EXT = .lib 1.95 + 1.96 +LIBPREFIX= 1.97 +DEFAULT_LIBS = advapi32.lib 1.98 + 1.99 +# Change the stubnames so that poorly working FAT disks and installation programs can work. 1.100 +# This is also for backwards compatibility. 1.101 +DATA_STUBNAME = dt 1.102 +I18N_STUBNAME = in 1.103 +LIBICU = $(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX) 1.104 + 1.105 +## Link commands to link to ICU libs 1.106 +ifeq ($(wildcard $(LIBDIR)/$(LIBICU)$(DATA_STUBNAME)$(ICULIBSUFFIX).lib),) 1.107 +LIBICUDT= $(top_builddir)/stubdata/$(LIBICU)$(DATA_STUBNAME)$(ICULIBSUFFIX).lib 1.108 +else 1.109 +LIBICUDT= $(LIBDIR)/$(LIBICU)$(DATA_STUBNAME)$(ICULIBSUFFIX).lib 1.110 +endif 1.111 +LIBICUUC= $(LIBDIR)/$(LIBICU)$(COMMON_STUBNAME)$(ICULIBSUFFIX).lib $(LIBICUDT) 1.112 +LIBICUI18N= $(LIBDIR)/$(LIBICU)$(I18N_STUBNAME)$(ICULIBSUFFIX).lib 1.113 +LIBICULE= $(LIBDIR)/$(LIBICU)$(LAYOUT_STUBNAME)$(ICULIBSUFFIX).lib 1.114 +LIBICULX= $(LIBDIR)/$(LIBICU)$(LAYOUTEX_STUBNAME)$(ICULIBSUFFIX).lib 1.115 +LIBICUIO= $(LIBDIR)/$(LIBICU)$(IO_STUBNAME)$(ICULIBSUFFIX).lib 1.116 +LIBCTESTFW= $(top_builddir)/tools/ctestfw/$(LIBICU)$(CTESTFW_STUBNAME)$(ICULIBSUFFIX).lib 1.117 +LIBICUTOOLUTIL= $(LIBDIR)/$(LIBICU)$(TOOLUTIL_STUBNAME)$(ICULIBSUFFIX).lib 1.118 + 1.119 +## These are the library specific LDFLAGS 1.120 +LDFLAGSICUDT+= -base:"0x4ad00000" -NOENTRY# The NOENTRY option is required for creating a resource-only DLL. 1.121 +LDFLAGSICUUC= -base:"0x4a800000"# in-uc = 1MB 1.122 +LDFLAGSICUI18N= -base:"0x4a900000"# io-in = 2MB 1.123 +LDFLAGSICUIO= -base:"0x4ab00000"# le-io = 1MB 1.124 +LDFLAGSICULE= -base:"0x4ac00000"# lx-le = 512KB 1.125 +LDFLAGSICULX= -base:"0x4ac80000" 1.126 +LDFLAGSCTESTFW=# Unused for now. 1.127 +LDFLAGSICUTOOLUTIL= -base:"0x4ac00000"# Same as layout. Layout and tools probably won't mix. 1.128 + 1.129 +## Compilation rules 1.130 +%.$(STATIC_O): $(srcdir)/%.c 1.131 + $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -Fo$@ $< 1.132 +%.o: $(srcdir)/%.c 1.133 + $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -Fo$@ $< 1.134 + 1.135 +%.$(STATIC_O): $(srcdir)/%.cpp 1.136 + $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -Fo$@ $< 1.137 +%.o: $(srcdir)/%.cpp 1.138 + $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -Fo$@ $< 1.139 + 1.140 + 1.141 +## Dependency rules 1.142 +## This is a start to how depdendencies could work 1.143 +# The commented out rules may not properly delete the file when ^C is pressed 1.144 +# or the compiler fails. 1.145 +# make currently doesn't like rules with C:\\PROGRA~1\\.. in the depedency. 1.146 +# So system headers are ignored by ignoring \\ 1.147 +%.d : $(srcdir)/%.c 1.148 + @echo "generating dependency information for $<" 1.149 + @$(GEN_DEPS.c) $< > $@ 1.150 +# @echo -n "generating dependency information for " 1.151 +# @echo -n "$@ $(basename $<).o : " > $@ 1.152 +# @$(SHELL) -ec '$(GEN_DEPS.c) $< \ 1.153 +# | grep "#line 1 " | grep -v \\\\ | cut -d " " -f 3 \ 1.154 +# | /usr/bin/sort -u | sed s/\"$$/\\\\/ | sed s/^\"/\ / >> $@ \ 1.155 +# || (rm -f $@ && echo $@ && false)' 1.156 + 1.157 +%.d : $(srcdir)/%.cpp 1.158 + @echo "generating dependency information for $<" 1.159 + @$(GEN_DEPS.cc) $< > $@ 1.160 +# @echo -n "generating dependency information for " 1.161 +# @echo -n "$@ $(basename $<).o : " > $@ 1.162 +# @$(SHELL) -ec '$(GEN_DEPS.cc) $< \ 1.163 +# | grep "#line 1 " | grep -v \\\\ | cut -d " " -f 3 \ 1.164 +# | /usr/bin/sort -u | sed s/\"$$/\\\\/ | sed s/^\"/\ / >> $@ \ 1.165 +# || (rm -f $@ && echo $@ && false)' 1.166 + 1.167 +## Compile a Windows resource file 1.168 +%.res : $(srcdir)/%.rc 1.169 + rc.exe -fo$@ $(CPPFLAGS) $< 1.170 + 1.171 +## Versioned target for a shared library. 1.172 +FINAL_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO) 1.173 +MIDDLE_SO_TARGET=$(FINAL_SO_TARGET) 1.174 + 1.175 +## Starting in MSVC 2005, manifest files are required. This reduces the obnoxiousness of this feature. 1.176 + POST_SO_BUILD_STEP = @([ -e $<.manifest ] && \ 1.177 + ( echo Embedding manifest into $< && mt.exe -nologo -manifest $<.manifest -outputresource:"$<;2" && rm -rf $<.manifest )) \ 1.178 + || true 1.179 + POST_BUILD_STEP = @([ -e $@.manifest ] && \ 1.180 + ( echo Embedding manifest into $@ && mt.exe -nologo -manifest $@.manifest -outputresource:"$@;1" && rm -rf $@.manifest )) \ 1.181 + || true 1.182 + 1.183 +## Special pkgdata information that is needed 1.184 +PKGDATA_VERSIONING = -r $(SO_TARGET_VERSION_MAJOR) 1.185 +ICUPKGDATA_INSTALL_DIR = $(shell mkdir -p $(DESTDIR)$(ICUPKGDATA_DIR) ; echo $(DESTDIR)$(ICUPKGDATA_DIR))#M# 1.186 +ICUPKGDATA_INSTALL_LIBDIR = $(shell mkdir -p $(DESTDIR)$(libdir) ; echo $(DESTDIR)$(libdir))#M# 1.187 + 1.188 +## Versioned import library names. The library names are versioned, 1.189 +## but the import libraries do not need versioning. 1.190 +IMPORT_LIB = $(basename $(SO_TARGET))$(IMPORT_LIB_EXT)#M# 1.191 +MIDDLE_IMPORT_LIB = $(IMPORT_LIB)#M# 1.192 +FINAL_IMPORT_LIB = $(MIDDLE_IMPORT_LIB)#M# 1.193 + 1.194 +# The following is for Makefile.inc's use. 1.195 +ICULIBSUFFIX_VERSION = $(LIB_VERSION_MAJOR) 1.196 + 1.197 +## Versioned libraries rules 1.198 +#%$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO) 1.199 +# $(RM) $@ && cp ${<F} $@ 1.200 + 1.201 +# The following rule is sometimes a no op. 1.202 +# We only want to do a post-build step when a manifest file doesn't exist. 1.203 +%.$(SO): %$(SO_TARGET_VERSION_MAJOR).$(SO) 1.204 + @echo -n 1.205 + $(POST_SO_BUILD_STEP) 1.206 + 1.207 +## Install libraries as executable 1.208 +INSTALL-L=$(INSTALL_PROGRAM) 1.209 + 1.210 +# Environment variable to set a runtime search path 1.211 +LDLIBRARYPATH_ENVVAR = PATH 1.212 + 1.213 +# These are needed to allow the pkgdata nmake files to work 1.214 +PKGDATA_INVOKE_OPTS = MAKEFLAGS= 1.215 + 1.216 +# Include the version information in the shared library 1.217 +ENABLE_SO_VERSION_DATA=1 1.218 + 1.219 +## End MSYS-specific setup 1.220 +