X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/374ca955a76ecab1204ca8bfa63ff9238d998416..3d1f044b704633e2e541231cd17ae9ecf9ad5c7a:/icuSources/config/mh-cygwin diff --git a/icuSources/config/mh-cygwin b/icuSources/config/mh-cygwin index c06b7974..1b09a5bf 100644 --- a/icuSources/config/mh-cygwin +++ b/icuSources/config/mh-cygwin @@ -1,11 +1,13 @@ ## -*-makefile-*- +## Copyright (C) 2016 and later: Unicode, Inc. and others. +## License & terms of use: http://www.unicode.org/copyright.html ## Cygwin-specific setup -## Copyright (c) 2001-2004, International Business Machines Corporation and +## Copyright (c) 2001-2010, International Business Machines Corporation and ## others. All Rights Reserved. ## Commands to generate dependency files GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS) -GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS) +GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS) $(CXXFLAGS) ## Flags to create/use a static library ifneq ($(ENABLE_SHARED),YES) @@ -16,22 +18,36 @@ else STATICCPPFLAGS = -DU_STATIC_IMPLEMENTATION endif +## ICU requires a minimum target of Windows 7, and WINVER is not set to this by default. +## https://msdn.microsoft.com/en-us/library/aa383745.aspx +CPPFLAGS += -DWINVER=0x0601 -D_WIN32_WINNT=0x0601 + ## Flags for position independent code SHAREDLIBCFLAGS = SHAREDLIBCXXFLAGS = SHAREDLIBCPPFLAGS = -DPIC ## Additional flags when building libraries and with threads -LIBCPPFLAGS = -D_REENTRANT THREADSCPPFLAGS = -D_REENTRANT +LIBCPPFLAGS = # Commands to link. Link with C++ in case static libraries are used. LINK.c= $(CXX) $(CXXFLAGS) $(LDFLAGS) #LINK.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) +## Shared library options +LD_SOOPTIONS= -Wl,-Bsymbolic + ## Commands to make a shared library -SHLIB.c= $(CC) $(CFLAGS) $(LDFLAGS) -shared -SHLIB.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared +# $(subst) won't work in shell script. #M# at the end omits these +# lines from the shell script (Make only) +SHLIB.c= $(CC) $(CFLAGS) $(LDFLAGS) -shared $(LD_SOOPTIONS) -Wl,--enable-auto-import -Wl,--out-implib=$(subst cyg,lib,$@).$(A)#M# +SHLIB.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(LD_SOOPTIONS) -Wl,--enable-auto-import -Wl,--out-implib=$(subst cyg,lib,$@).$(A)#M# +# the #SH# lines don't go through further postprocessing. +# so, they must be valid shell script starting from column 4 +#SH#SHLIB_c="$(CC) $(CFLAGS) $(LDFLAGS) -shared " +#SH#SHLIB_cc="$(CXX) $(CXXFLAGS) $(LDFLAGS) -shared " + ## Compiler switch to embed a runtime search path LD_RPATH= @@ -45,11 +61,8 @@ SO = dll ## Non-shared intermediate object suffix STATIC_O = ao LIBICU = cyg$(ICUPREFIX) - -# Change the stubnames so that poorly working FAT disks and installation programs can work. -# This is also for backwards compatibility. -DATA_STUBNAME = dt -I18N_STUBNAME = in +## To have an import library is better on Cygwin +IMPORT_LIB_EXT = .dll.a ## Compilation rules %.$(STATIC_O): $(srcdir)/%.c @@ -67,12 +80,12 @@ I18N_STUBNAME = in %.d: $(srcdir)/%.c @echo "generating dependency information for $<" @echo -n "$@ " > $@ - @$(SHELL) -ec '$(GEN_DEPS.c) $< >> $@; [ -s $@ ] || rm -f $@' + @$(GEN_DEPS.c) $< >> $@ || (rm -f $@ && FALSE) %.d: $(srcdir)/%.cpp @echo "generating dependency information for $<" @echo -n "$@ " > $@ - @$(SHELL) -ec '$(GEN_DEPS.cc) $< >> $@; [ -s $@ ] || rm -f $@' + @$(GEN_DEPS.cc) $< >> $@ || (rm -f $@ && FALSE) ## Versioned target for a shared library. ## Since symbolic links don't work the same way on Windows, @@ -81,20 +94,27 @@ I18N_STUBNAME = in FINAL_SO_TARGET=$(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO) MIDDLE_SO_TARGET=$(FINAL_SO_TARGET) +IMPORT_LIB = $(subst cyg,lib,$(FINAL_SO_TARGET)).$(A)#M# +MIDDLE_IMPORT_LIB = $(subst cyg,lib,$(basename $(SO_TARGET)))$(SO_TARGET_VERSION_MAJOR).$(SO).$(A)#M# +FINAL_IMPORT_LIB = $(IMPORT_LIB)#M# + +# The following is for Makefile.inc's use. +ICULIBSUFFIX_VERSION = $(LIB_VERSION_MAJOR) + ## Versioned libraries rules #%$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO) # $(RM) $@ && cp ${