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

Wed, 31 Dec 2014 07:22:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:22:50 +0100
branch
TOR_BUG_3246
changeset 4
fc2d59ddac77
permissions
-rw-r--r--

Correct previous dual key logic pending first delivery installment.

michael@0 1 ## Cygwin with Microsoft Visual C++ compiler specific setup
michael@0 2 ## Copyright (c) 2001-2013, International Business Machines Corporation and
michael@0 3 ## others. All Rights Reserved.
michael@0 4
michael@0 5 # We install sbin tools into the same bin directory because
michael@0 6 # pkgdata needs some of the tools in sbin, and we can't always depend on
michael@0 7 # icu-config working on Windows.
michael@0 8 sbindir=$(bindir)
michael@0 9
michael@0 10 ## Commands to generate dependency files
michael@0 11 GEN_DEPS.c= :
michael@0 12 GEN_DEPS.cc= :
michael@0 13 #GEN_DEPS.c= $(COMPILE.c) /E
michael@0 14 #GEN_DEPS.cc= $(COMPILE.cc) /E
michael@0 15
michael@0 16 ## Flags to create/use a static library
michael@0 17 ifneq ($(ENABLE_SHARED),YES)
michael@0 18 ## Make sure that the static libraries can be built and used
michael@0 19 CPPFLAGS += -DU_STATIC_IMPLEMENTATION#M#
michael@0 20 else
michael@0 21 ## Make sure that the static libraries can be built
michael@0 22 STATICCPPFLAGS = -DU_STATIC_IMPLEMENTATION
michael@0 23 endif
michael@0 24
michael@0 25 ## Flags for position independent code
michael@0 26 SHAREDLIBCFLAGS =
michael@0 27 SHAREDLIBCXXFLAGS =
michael@0 28 SHAREDLIBCPPFLAGS =
michael@0 29
michael@0 30 ## Additional flags when building libraries and with threads
michael@0 31 LIBCPPFLAGS =
michael@0 32
michael@0 33 ifeq ($(ENABLE_RELEASE),1)
michael@0 34 # Make sure that assertions are disabled
michael@0 35 CPPFLAGS+=-DU_RELEASE=1#M#
michael@0 36 endif
michael@0 37
michael@0 38 ifeq ($(ENABLE_DEBUG),1)
michael@0 39 # Pass debugging flag through
michael@0 40 CPPFLAGS+=-D_DEBUG=1#M#
michael@0 41 ICULIBSUFFIX:=$(ICULIBSUFFIX)d#M#
michael@0 42 endif
michael@0 43
michael@0 44 # /GF pools strings and places them into read-only memory
michael@0 45 # /EHsc enables exception handling
michael@0 46 # /Zc:wchar_t makes wchar_t a native type. Required for C++ ABI compatibility.
michael@0 47 # -D_CRT_SECURE_NO_DEPRECATE is needed to quiet warnings about using standard C functions.
michael@0 48 CFLAGS+=/GF /nologo
michael@0 49 CXXFLAGS+=/GF /nologo /EHsc /Zc:wchar_t
michael@0 50 CPPFLAGS+=-D_CRT_SECURE_NO_DEPRECATE
michael@0 51 DEFS+=-DWIN32 -DCYGWINMSVC
michael@0 52 LDFLAGS+=/nologo
michael@0 53
michael@0 54 # Commands to compile
michael@0 55 COMPILE.c= $(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) /c
michael@0 56 COMPILE.cc= $(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) /c
michael@0 57
michael@0 58 # Commands to link
michael@0 59 LINK.c= LINK.EXE /subsystem:console $(LDFLAGS)
michael@0 60 LINK.cc= LINK.EXE /subsystem:console $(LDFLAGS)
michael@0 61
michael@0 62 ## Commands to make a shared library
michael@0 63 SHLIB.c= LINK.EXE /DLL $(LDFLAGS)
michael@0 64 SHLIB.cc= LINK.EXE /DLL $(LDFLAGS)
michael@0 65
michael@0 66 ## Compiler switch to embed a runtime search path
michael@0 67 LD_RPATH=
michael@0 68 LD_RPATH_PRE=
michael@0 69
michael@0 70 ## Compiler switch to embed a library name
michael@0 71 LD_SONAME = /IMPLIB:$(SO_TARGET:.dll=.lib)
michael@0 72
michael@0 73 ## Shared object suffix
michael@0 74 SO = dll
michael@0 75 ## Non-shared intermediate object suffix
michael@0 76 STATIC_O = ao
michael@0 77 # OUTOPT is for creating a specific output name
michael@0 78 OUTOPT = /out:
michael@0 79
michael@0 80 # Static library prefix and file extension
michael@0 81 LIBSICU = $(STATIC_PREFIX)$(ICUPREFIX)
michael@0 82 A = lib
michael@0 83
michael@0 84 # Cygwin's ar can't handle Win64 right now. So we use Microsoft's tool instead.
michael@0 85 AR = LIB.EXE#M#
michael@0 86 ARFLAGS := /nologo $(ARFLAGS:r=)#M#
michael@0 87 RANLIB = ls -s#M#
michael@0 88 AR_OUTOPT = /OUT:#M#
michael@0 89
michael@0 90 ## An import library is needed for z/OS, MSVC and Cygwin
michael@0 91 IMPORT_LIB_EXT = .lib
michael@0 92
michael@0 93 LIBPREFIX=
michael@0 94 DEFAULT_LIBS = advapi32.lib
michael@0 95
michael@0 96 # Change the stubnames so that poorly working FAT disks and installation programs can work.
michael@0 97 # This is also for backwards compatibility.
michael@0 98 DATA_STUBNAME = dt
michael@0 99 I18N_STUBNAME = in
michael@0 100 LIBICU = $(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)
michael@0 101
michael@0 102 ## Link commands to link to ICU libs
michael@0 103 ifeq ($(wildcard $(LIBDIR)/$(LIBICU)$(DATA_STUBNAME)$(ICULIBSUFFIX).lib),)
michael@0 104 LIBICUDT= $(top_builddir)/stubdata/$(LIBICU)$(DATA_STUBNAME)$(ICULIBSUFFIX).lib
michael@0 105 else
michael@0 106 LIBICUDT= $(LIBDIR)/$(LIBICU)$(DATA_STUBNAME)$(ICULIBSUFFIX).lib
michael@0 107 endif
michael@0 108 LIBICUUC= $(LIBDIR)/$(LIBICU)$(COMMON_STUBNAME)$(ICULIBSUFFIX).lib $(LIBICUDT)
michael@0 109 LIBICUI18N= $(LIBDIR)/$(LIBICU)$(I18N_STUBNAME)$(ICULIBSUFFIX).lib
michael@0 110 LIBICULE= $(LIBDIR)/$(LIBICU)$(LAYOUT_STUBNAME)$(ICULIBSUFFIX).lib
michael@0 111 LIBICULX= $(LIBDIR)/$(LIBICU)$(LAYOUTEX_STUBNAME)$(ICULIBSUFFIX).lib
michael@0 112 LIBICUIO= $(LIBDIR)/$(LIBICU)$(IO_STUBNAME)$(ICULIBSUFFIX).lib
michael@0 113 LIBCTESTFW= $(top_builddir)/tools/ctestfw/$(LIBICU)$(CTESTFW_STUBNAME)$(ICULIBSUFFIX).lib
michael@0 114 LIBICUTOOLUTIL= $(LIBDIR)/$(LIBICU)$(TOOLUTIL_STUBNAME)$(ICULIBSUFFIX).lib
michael@0 115
michael@0 116 ## These are the library specific LDFLAGS
michael@0 117 LDFLAGSICUDT+= /base:"0x4ad00000" /NOENTRY# The NOENTRY option is required for creating a resource-only DLL.
michael@0 118 LDFLAGSICUUC= /base:"0x4a800000"# in-uc = 1MB
michael@0 119 LDFLAGSICUI18N= /base:"0x4a900000"# io-in = 2MB
michael@0 120 LDFLAGSICUIO= /base:"0x4ab00000"# le-io = 1MB
michael@0 121 LDFLAGSICULE= /base:"0x4ac00000"# lx-le = 512KB
michael@0 122 LDFLAGSICULX= /base:"0x4ac80000"
michael@0 123 LDFLAGSCTESTFW=# Unused for now.
michael@0 124 LDFLAGSICUTOOLUTIL= /base:"0x4ac00000"# Same as layout. Layout and tools probably won't mix.
michael@0 125
michael@0 126 # The #M# is used to delete lines for icu-config
michael@0 127 # Current full path directory.
michael@0 128 CURR_FULL_DIR?=$(subst \,/,$(shell cygpath -da .))#M# -m isn't used because it doesn't work on Win98
michael@0 129 # Current full path directory for use in source code in a -D compiler option.
michael@0 130 CURR_SRCCODE_FULL_DIR=$(subst \,\\,$(shell cygpath -da .))#M#
michael@0 131
michael@0 132 ifeq ($(srcdir),.)
michael@0 133 SOURCE_FILE=$<
michael@0 134 else
michael@0 135 SOURCE_FILE=$(shell cygpath -dma $<)#M#
michael@0 136 endif
michael@0 137
michael@0 138 ## Compilation rules
michael@0 139 %.$(STATIC_O): $(srcdir)/%.c
michael@0 140 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) /Fo$@ $(SOURCE_FILE)
michael@0 141 %.o: $(srcdir)/%.c
michael@0 142 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) /Fo$@ $(SOURCE_FILE)
michael@0 143
michael@0 144 %.$(STATIC_O): $(srcdir)/%.cpp
michael@0 145 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) /Fo$@ $(SOURCE_FILE)
michael@0 146 %.o: $(srcdir)/%.cpp
michael@0 147 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) /Fo$@ $(SOURCE_FILE)
michael@0 148
michael@0 149
michael@0 150 ## Dependency rules
michael@0 151 ## This is a start to how depdendencies could work
michael@0 152 # The commented out rules may not properly delete the file when ^C is pressed
michael@0 153 # or the compiler fails.
michael@0 154 # make currently doesn't like rules with C:\\PROGRA~1\\.. in the depedency.
michael@0 155 # So system headers are ignored by ignoring \\
michael@0 156 %.d : $(srcdir)/%.c
michael@0 157 @echo "generating dependency information for $<"
michael@0 158 @$(GEN_DEPS.c) $< > $@
michael@0 159 # @echo -n "generating dependency information for "
michael@0 160 # @echo -n "$@ $(basename $<).o : " > $@
michael@0 161 # @$(SHELL) -ec '$(GEN_DEPS.c) $< \
michael@0 162 # | grep "#line 1 " | grep -v \\\\ | cut -d " " -f 3 \
michael@0 163 # | /usr/bin/sort -u | sed s/\"$$/\\\\/ | sed s/^\"/\ / >> $@ \
michael@0 164 # || (rm -f $@ && echo $@ && false)'
michael@0 165
michael@0 166 %.d : $(srcdir)/%.cpp
michael@0 167 @echo "generating dependency information for $<"
michael@0 168 @$(GEN_DEPS.cc) $< > $@
michael@0 169 # @echo -n "generating dependency information for "
michael@0 170 # @echo -n "$@ $(basename $<).o : " > $@
michael@0 171 # @$(SHELL) -ec '$(GEN_DEPS.cc) $< \
michael@0 172 # | grep "#line 1 " | grep -v \\\\ | cut -d " " -f 3 \
michael@0 173 # | /usr/bin/sort -u | sed s/\"$$/\\\\/ | sed s/^\"/\ / >> $@ \
michael@0 174 # || (rm -f $@ && echo $@ && false)'
michael@0 175
michael@0 176 ## Compile a Windows resource file
michael@0 177 %.res : $(srcdir)/%.rc
michael@0 178 rc.exe /fo$@ $(CPPFLAGS) $(SOURCE_FILE)
michael@0 179
michael@0 180 ## Versioned target for a shared library.
michael@0 181 FINAL_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO)
michael@0 182 MIDDLE_SO_TARGET=$(FINAL_SO_TARGET)
michael@0 183
michael@0 184 ## Starting in MSVC 2005, manifest files are required. This reduces the obnoxiousness of this feature.
michael@0 185 POST_SO_BUILD_STEP = @([ -e $<.manifest ] && \
michael@0 186 ( echo Embedding manifest into $< && mt.exe -nologo -manifest $<.manifest -outputresource:"$<;2" && rm -rf $<.manifest )) \
michael@0 187 || true
michael@0 188 POST_BUILD_STEP = @([ -e $@.manifest ] && \
michael@0 189 ( echo Embedding manifest into $@ && mt.exe -nologo -manifest $@.manifest -outputresource:"$@;1" && rm -rf $@.manifest )) \
michael@0 190 || true
michael@0 191
michael@0 192 ## Special pkgdata information that is needed
michael@0 193 PKGDATA_VERSIONING = -r $(SO_TARGET_VERSION_MAJOR)
michael@0 194 ICUPKGDATA_INSTALL_DIR = $(shell mkdir -p $(DESTDIR)$(ICUPKGDATA_DIR) ; cygpath -dma $(DESTDIR)$(ICUPKGDATA_DIR))#M#
michael@0 195 ICUPKGDATA_INSTALL_LIBDIR = $(shell mkdir -p $(DESTDIR)$(libdir) ; cygpath -dma $(DESTDIR)$(libdir))#M#
michael@0 196
michael@0 197 ## Versioned import library names. The library names are versioned,
michael@0 198 ## but the import libraries do not need versioning.
michael@0 199 IMPORT_LIB = $(basename $(SO_TARGET))$(IMPORT_LIB_EXT)#M#
michael@0 200 MIDDLE_IMPORT_LIB = $(IMPORT_LIB)#M#
michael@0 201 FINAL_IMPORT_LIB = $(MIDDLE_IMPORT_LIB)#M#
michael@0 202
michael@0 203 # The following is for Makefile.inc's use.
michael@0 204 ICULIBSUFFIX_VERSION = $(LIB_VERSION_MAJOR)
michael@0 205
michael@0 206 ## Versioned libraries rules
michael@0 207 #%$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO)
michael@0 208 # $(RM) $@ && cp ${<F} $@
michael@0 209
michael@0 210 # The following rule is sometimes a no op.
michael@0 211 # We only want to do a post-build step when a manifest file doesn't exist.
michael@0 212 %.$(SO): %$(SO_TARGET_VERSION_MAJOR).$(SO)
michael@0 213 @echo -n
michael@0 214 $(POST_SO_BUILD_STEP)
michael@0 215
michael@0 216 ## Install libraries as executable
michael@0 217 INSTALL-L=$(INSTALL_PROGRAM)
michael@0 218
michael@0 219 # Environment variable to set a runtime search path
michael@0 220 LDLIBRARYPATH_ENVVAR = PATH
michael@0 221
michael@0 222 # These are needed to allow the pkgdata nmake files to work
michael@0 223 PKGDATA_INVOKE_OPTS = MAKEFLAGS=
michael@0 224
michael@0 225 # Include the version information in the shared library
michael@0 226 ENABLE_SO_VERSION_DATA=1
michael@0 227
michael@0 228 ## End Cygwin-specific setup
michael@0 229

mercurial