## -*-makefile-*-
## Cygwin-specific setup
-## Copyright (c) 2001-2006, International Business Machines Corporation and
+## Copyright (c) 2001-2010, International Business Machines Corporation and
## others. All Rights Reserved.
## Commands to generate dependency files
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=
## 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
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)
#%$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO)
# $(RM) $@ && cp ${<F} $@
%.$(SO): %$(SO_TARGET_VERSION_MAJOR).$(SO)
- $(RM) $@ && ln -s ${<F} $@
+ $(RM) $(subst cyg,lib,$@).$(A) && ln -s $(subst cyg,lib,${<F}).$(A) $(subst cyg,lib,$@).$(A)
## Install libraries as executable
INSTALL-L=$(INSTALL_PROGRAM)