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

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/intl/icu/source/config/mh-cygwin-msvc	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,229 @@
     1.4 +## Cygwin 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 +# The #M# is used to delete lines for icu-config
   1.130 +# Current full path directory.
   1.131 +CURR_FULL_DIR?=$(subst \,/,$(shell cygpath -da .))#M# -m isn't used because it doesn't work on Win98
   1.132 +# Current full path directory for use in source code in a -D compiler option.
   1.133 +CURR_SRCCODE_FULL_DIR=$(subst \,\\,$(shell cygpath -da .))#M#
   1.134 +
   1.135 +ifeq ($(srcdir),.)
   1.136 +SOURCE_FILE=$<
   1.137 +else
   1.138 +SOURCE_FILE=$(shell cygpath -dma $<)#M#
   1.139 +endif
   1.140 +
   1.141 +## Compilation rules
   1.142 +%.$(STATIC_O): $(srcdir)/%.c
   1.143 +	$(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) /Fo$@ $(SOURCE_FILE)
   1.144 +%.o: $(srcdir)/%.c
   1.145 +	$(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) /Fo$@ $(SOURCE_FILE)
   1.146 +
   1.147 +%.$(STATIC_O): $(srcdir)/%.cpp
   1.148 +	$(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) /Fo$@ $(SOURCE_FILE)
   1.149 +%.o: $(srcdir)/%.cpp
   1.150 +	$(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) /Fo$@ $(SOURCE_FILE)
   1.151 +
   1.152 +
   1.153 +## Dependency rules
   1.154 +## This is a start to how depdendencies could work
   1.155 +# The commented out rules may not properly delete the file when ^C is pressed
   1.156 +#   or the compiler fails.
   1.157 +# make currently doesn't like rules with C:\\PROGRA~1\\.. in the depedency.
   1.158 +#   So system headers are ignored by ignoring \\
   1.159 +%.d : $(srcdir)/%.c
   1.160 +	@echo "generating dependency information for $<"
   1.161 +	@$(GEN_DEPS.c) $< > $@
   1.162 +#	@echo -n "generating dependency information for "
   1.163 +#	@echo -n "$@ $(basename $<).o : " > $@
   1.164 +#	@$(SHELL) -ec '$(GEN_DEPS.c) $< \
   1.165 +#		| grep "#line 1 " | grep -v \\\\ | cut -d " " -f 3 \
   1.166 +#		| /usr/bin/sort -u | sed s/\"$$/\\\\/ | sed s/^\"/\	/ >> $@ \
   1.167 +#		|| (rm -f $@ && echo $@ && false)'
   1.168 +
   1.169 +%.d : $(srcdir)/%.cpp
   1.170 +	@echo "generating dependency information for $<"
   1.171 +	@$(GEN_DEPS.cc) $< > $@
   1.172 +#	@echo -n "generating dependency information for "
   1.173 +#	@echo -n "$@ $(basename $<).o : " > $@
   1.174 +#	@$(SHELL) -ec '$(GEN_DEPS.cc) $< \
   1.175 +#		| grep "#line 1 " | grep -v \\\\ | cut -d " " -f 3 \
   1.176 +#		| /usr/bin/sort -u | sed s/\"$$/\\\\/ | sed s/^\"/\	/ >> $@ \
   1.177 +#		|| (rm -f $@ && echo $@ && false)'
   1.178 +
   1.179 +## Compile a Windows resource file
   1.180 +%.res : $(srcdir)/%.rc
   1.181 +	rc.exe /fo$@ $(CPPFLAGS) $(SOURCE_FILE)
   1.182 +
   1.183 +## Versioned target for a shared library.
   1.184 +FINAL_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO)
   1.185 +MIDDLE_SO_TARGET=$(FINAL_SO_TARGET)
   1.186 +
   1.187 +## Starting in MSVC 2005, manifest files are required. This reduces the obnoxiousness of this feature.
   1.188 +	POST_SO_BUILD_STEP = @([ -e $<.manifest ] && \
   1.189 +	( echo Embedding manifest into $< && mt.exe -nologo -manifest $<.manifest -outputresource:"$<;2" && rm -rf $<.manifest )) \
   1.190 +	|| true
   1.191 +	POST_BUILD_STEP = @([ -e $@.manifest ] && \
   1.192 +	( echo Embedding manifest into $@ && mt.exe -nologo -manifest $@.manifest -outputresource:"$@;1" && rm -rf $@.manifest )) \
   1.193 +	|| true
   1.194 +
   1.195 +## Special pkgdata information that is needed
   1.196 +PKGDATA_VERSIONING = -r $(SO_TARGET_VERSION_MAJOR)
   1.197 +ICUPKGDATA_INSTALL_DIR = $(shell mkdir -p  $(DESTDIR)$(ICUPKGDATA_DIR) ;  cygpath -dma $(DESTDIR)$(ICUPKGDATA_DIR))#M#
   1.198 +ICUPKGDATA_INSTALL_LIBDIR = $(shell mkdir -p  $(DESTDIR)$(libdir) ; cygpath -dma $(DESTDIR)$(libdir))#M#
   1.199 +
   1.200 +## Versioned import library names. The library names are versioned,
   1.201 +## but the import libraries do not need versioning.
   1.202 +IMPORT_LIB = $(basename $(SO_TARGET))$(IMPORT_LIB_EXT)#M#
   1.203 +MIDDLE_IMPORT_LIB = $(IMPORT_LIB)#M#
   1.204 +FINAL_IMPORT_LIB = $(MIDDLE_IMPORT_LIB)#M#
   1.205 +
   1.206 +# The following is for Makefile.inc's use.
   1.207 +ICULIBSUFFIX_VERSION = $(LIB_VERSION_MAJOR)
   1.208 +
   1.209 +## Versioned libraries rules
   1.210 +#%$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO)
   1.211 +#	$(RM) $@ && cp ${<F} $@
   1.212 +
   1.213 +# The following rule is sometimes a no op.
   1.214 +# We only want to do a post-build step when a manifest file doesn't exist.
   1.215 +%.$(SO): %$(SO_TARGET_VERSION_MAJOR).$(SO)
   1.216 +	@echo -n
   1.217 +	$(POST_SO_BUILD_STEP)
   1.218 +
   1.219 +## Install libraries as executable
   1.220 +INSTALL-L=$(INSTALL_PROGRAM)
   1.221 +
   1.222 +# Environment variable to set a runtime search path
   1.223 +LDLIBRARYPATH_ENVVAR = PATH
   1.224 +
   1.225 +# These are needed to allow the pkgdata nmake files to work
   1.226 +PKGDATA_INVOKE_OPTS = MAKEFLAGS=
   1.227 +
   1.228 +# Include the version information in the shared library
   1.229 +ENABLE_SO_VERSION_DATA=1
   1.230 +
   1.231 +## End Cygwin-specific setup
   1.232 +

mercurial