summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/Make.common.rules19
-rw-r--r--cpp/INSTALL.MINGW128
-rw-r--r--cpp/Makefile6
-rwxr-xr-xcpp/allTests.py70
-rw-r--r--cpp/config/Make.rules150
-rw-r--r--cpp/config/Make.rules.MINGW56
-rw-r--r--cpp/config/Make.rules.common33
-rwxr-xr-xcpp/config/cygpath-unix.sh4
-rwxr-xr-xcpp/config/cygpath-win.sh4
-rw-r--r--cpp/include/Ice/DynamicLibrary.h1
-rw-r--r--cpp/include/IceUtil/FileUtil.h2
-rw-r--r--cpp/include/Makefile21
-rw-r--r--cpp/include/Slice/Parser.h2
-rw-r--r--cpp/src/Ice/Application.cpp4
-rw-r--r--cpp/src/Ice/Makefile36
-rw-r--r--cpp/src/Ice/Network.cpp2
-rw-r--r--cpp/src/Ice/Network.h17
-rw-r--r--cpp/src/Ice/Service.cpp9
-rw-r--r--cpp/src/Ice/StringConverter.cpp5
-rw-r--r--cpp/src/Ice/TcpAcceptor.cpp2
-rw-r--r--cpp/src/Ice/TcpTransceiver.cpp4
-rw-r--r--cpp/src/Ice/ThreadPool.h2
-rw-r--r--cpp/src/Ice/UdpTransceiver.cpp4
-rw-r--r--cpp/src/IceSSL/AcceptorI.cpp2
-rw-r--r--cpp/src/IceSSL/Makefile28
-rw-r--r--cpp/src/IceSSL/TransceiverI.cpp4
-rw-r--r--cpp/src/IceUtil/Exception.cpp8
-rw-r--r--cpp/src/IceUtil/FileUtil.cpp31
-rw-r--r--cpp/src/IceUtil/InputUtil.cpp8
-rw-r--r--cpp/src/IceUtil/Makefile29
-rw-r--r--cpp/src/IceUtil/Random.cpp8
-rw-r--r--cpp/src/IceUtil/RecMutex.cpp4
-rw-r--r--cpp/src/IceUtil/Thread.cpp2
-rw-r--r--cpp/src/IceUtil/Time.cpp10
-rw-r--r--cpp/src/Makefile63
-rw-r--r--cpp/src/Slice/Makefile28
-rw-r--r--cpp/src/slice2cpp/Makefile15
-rw-r--r--cpp/src/slice2rb/Makefile14
-rw-r--r--cpp/test/Ice/info/Makefile8
-rw-r--r--cpp/test/IceSSL/configuration/Makefile8
-rw-r--r--cpp/test/IceUtil/unicode/Client.cpp16
-rw-r--r--cpp/test/Makefile18
-rw-r--r--distribution/src/thirdparty/README.txt41
-rwxr-xr-xdistribution/src/thirdparty/bzip2/Makefile57
-rw-r--r--rb/INSTALL.WINDOWS104
-rw-r--r--rb/Makefile.mak27
-rwxr-xr-xrb/allTests.py2
-rw-r--r--rb/config/Make.rules159
-rw-r--r--rb/config/Make.rules.mak177
-rw-r--r--rb/ruby/Makefile.mak122
-rw-r--r--rb/src/IceRuby/IceRuby.rc38
-rw-r--r--rb/src/IceRuby/Makefile29
-rw-r--r--rb/src/IceRuby/Makefile.mak55
-rw-r--r--rb/src/IceRuby/Types.cpp4
-rw-r--r--rb/src/IceRuby/Util.cpp8
-rw-r--r--rb/src/Makefile.mak19
-rwxr-xr-xrb/test/Ice/binding/Client.rb2
-rwxr-xr-xrb/test/Ice/checksum/Client.rb2
-rwxr-xr-xrb/test/Ice/defaultValue/Client.rb2
-rwxr-xr-xrb/test/Ice/exceptions/Client.rb2
-rwxr-xr-xrb/test/Ice/facets/Client.rb2
-rwxr-xr-xrb/test/Ice/info/Client.rb2
-rwxr-xr-xrb/test/Ice/inheritance/Client.rb2
-rwxr-xr-xrb/test/Ice/location/Client.rb2
-rw-r--r--rb/test/Ice/objects/AllTests.rb2
-rwxr-xr-xrb/test/Ice/objects/Client.rb2
-rw-r--r--rb/test/Ice/operations/AllTests.rb4
-rwxr-xr-xrb/test/Ice/operations/Client.rb2
-rw-r--r--rb/test/Ice/properties/Client.rb1
-rwxr-xr-xrb/test/Ice/proxy/Client.rb2
-rwxr-xr-xrb/test/Ice/retry/Client.rb2
-rwxr-xr-xrb/test/Ice/slicing/exceptions/Client.rb2
-rwxr-xr-xrb/test/Ice/slicing/objects/Client.rb2
-rwxr-xr-xrb/test/Ice/timeout/Client.rb2
-rwxr-xr-xscripts/TestUtil.py14
75 files changed, 1002 insertions, 776 deletions
diff --git a/config/Make.common.rules b/config/Make.common.rules
index e9b8df250ed..3fa0a71b733 100644
--- a/config/Make.common.rules
+++ b/config/Make.common.rules
@@ -73,6 +73,25 @@ else
binsubdir := bin
endif
+
+ifeq ($(MinGW), yes)
+ ifneq ($(ICE_HOME), )
+ tmp = $(shell $(top_srcdir)/../cpp/config/cygpath-unix.sh "$(ICE_HOME)")
+ ifeq ($(shell test -d $(tmp) && echo 0), 0)
+ ICE_HOME := $(shell $(top_srcdir)/../cpp/config/cygpath-unix.sh "$(ICE_HOME)")
+ ICE_HOME_WIN := $(shell $(top_srcdir)/../cpp/config/cygpath-win.sh "$(ICE_HOME)")
+ endif
+ endif
+ ifneq ($(prefix),)
+ prefix := $(shell $(top_srcdir)/../cpp/config/cygpath-unix.sh "$(prefix)")
+ endif
+ ifeq ($(THIRDPARTY_HOME),)
+ THIRDPARTY_HOME = $(PROGRAMFILES)\ZeroC\Ice-$(VERSION)-ThirdParty
+ endif
+ THIRDPARTY_HOME := $(shell $(top_srcdir)/../cpp/config/cygpath-unix.sh "$(THIRDPARTY_HOME)")
+ THIRDPARTY_HOME_WIN = $(shell $(top_srcdir)/../cpp/config/cygpath-win.sh $(THIRDPARTY_HOME))
+endif
+
#
# The following variables might also be defined:
#
diff --git a/cpp/INSTALL.MINGW b/cpp/INSTALL.MINGW
new file mode 100644
index 00000000000..cc6e3cf22b4
--- /dev/null
+++ b/cpp/INSTALL.MINGW
@@ -0,0 +1,128 @@
+======================================================================
+Introduction
+======================================================================
+
+This file describes the Ice source distribution, including information
+about compiler requirements, third-party dependencies, and
+instructions for building and testing the distribution.
+
+ http://www.zeroc.com/download.html
+
+MinGW is only supported for building the Ice extension for Ruby.
+
+MinGW is not supported for general application development in this
+release.
+
+
+======================================================================
+Requirements
+======================================================================
+
+
+Windows version
+---------------
+
+Ice for MinGW is only supported in Windows XP and Windows 7.
+
+
+MinGW Setup
+------------
+
+The only supported MinGW version is the one that is included in the
+Ruby Development Kit, which you can download here:
+
+ http://rubyinstaller.org/downloads/
+
+You must download the file DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe,
+which is a self-extracting archive.
+
+To build Ice with MinGW, you also need to install Cygwin. The Cygwin
+installer is available at:
+
+ http://www.cygwin.com/install.html
+
+When installing Cygwin, make sure you select "make" in the package
+list. You do not need to install the MinGW packages from Cygwin.
+
+
+Third-party libraries
+---------------------
+
+Ice has dependencies on a number of third-party libraries:
+
+- OpenSSL 1.0 or later
+- bzip2 1.0.x
+- mcpp 2.7.2 (with patches)
+
+You do not need to build these packages yourself, as ZeroC supplies a
+Windows installer that contains all of the third-party dependencies.
+
+If you intend to build the third-party dependencies from source, we
+recommend downloading the Ice third-party source archive from
+
+ http://www.zeroc.com/download.html
+
+This archive contains the source distributions for each of the
+third-party dependencies, as well as required source patches and
+configuration instructions.
+
+For more information about these dependencies, please refer to
+the links below:
+
+OpenSSL http://www.openssl.org
+bzip2 http://sources.redhat.com/bzip2
+mcpp http://mcpp.sourceforge.net
+
+
+======================================================================
+Compilation and Testing
+======================================================================
+
+Using your favorite Zip tool, unzip the Ice source archive anywhere
+you like.
+
+Open a Cygwin command prompt and change the working directory to the
+location of the extracted source archive. For example:
+
+$ cd ~/Ice-@ver@/cpp
+
+Update your PATH to include MinGW from the Ruby Development Kit. For
+example, if you installed the kit into C:\RubyDevKit-4.5.2, you would
+update PATH as follows:
+
+$ export PATH=/cygdrive/c/RubyDevKit-4.5.2/mingw/bin:$PATH
+
+Edit config/Make.rules to establish your build configuration. The
+comments in the file provide more information. In particular, if
+Ice third-party packages are not installed in the default location,
+set THIRDPARTY_HOME to the Ice third-party installation directory.
+
+Now you are ready to build Ice:
+
+$ make
+
+This will build the Ice core, libraries, and tests.
+
+Python is required to run the test suite:
+
+ http://www.python.org/download
+
+After a successful build, you can run the test suite. Open a Windows
+(not Cygwin) command prompt and change the working directory to
+Ice-@ver@:
+
+> cd C:\Ice-@ver@\cpp
+> set CPP_COMPILER=MINGW
+> python allTests.py
+
+If everything worked out, you should see lots of "ok" messages. In
+case of a failure, the tests abort with "failed".
+
+
+======================================================================
+Installation
+======================================================================
+
+From a Cygwin command prompt, simply run "make install". This will
+install Ice in the directory specified by the "prefix" variable in
+config/Make.rules.
diff --git a/cpp/Makefile b/cpp/Makefile
index b2f079a30a2..67d4542b71c 100644
--- a/cpp/Makefile
+++ b/cpp/Makefile
@@ -11,7 +11,11 @@ top_srcdir = .
include $(top_srcdir)/config/Make.rules
-SUBDIRS = config src include test demo
+SUBDIRS = config src include test
+
+ifneq ($(MinGW), yes)
+SUBDIRS := $(SUBDIRS) demo
+endif
INSTALL_SUBDIRS = $(install_bindir) $(install_libdir) $(install_includedir) $(install_configdir)
diff --git a/cpp/allTests.py b/cpp/allTests.py
index 095a203853b..c0432217228 100755
--- a/cpp/allTests.py
+++ b/cpp/allTests.py
@@ -35,7 +35,7 @@ tests = [
("Slice/errorDetection", ["once"]),
("Slice/keyword", ["once"]),
("Slice/structure", ["once"]),
- ("Ice/properties", ["once", "novc6"]),
+ ("Ice/properties", ["once", "novc6", "nomingw"]),
("Ice/proxy", ["core"]),
("Ice/operations", ["core"]),
("Ice/exceptions", ["core"]),
@@ -58,7 +58,7 @@ tests = [
("Ice/custom", ["core", "novc6", "nossl"]),
("Ice/retry", ["core"]),
("Ice/timeout", ["core"]),
- ("Ice/background", ["core"]),
+ ("Ice/background", ["core", "nomingw"]),
("Ice/servantLocator", ["core"]),
("Ice/interceptor", ["core"]),
("Ice/stringConverter", ["core"]),
@@ -67,39 +67,39 @@ tests = [
("Ice/defaultValue", ["core"]),
("Ice/invoke", ["core", "novc6"]),
("IceSSL/configuration", ["once", "novalgrind"]), # valgrind doesn't work well with openssl
- ("IceBox/configuration", ["core", "noipv6", "novc6"]),
- ("Freeze/dbmap", ["once", "novc6"]),
- ("Freeze/complex", ["once", "novc6"]),
- ("Freeze/evictor", ["core", "novc6"]),
- ("Freeze/fileLock", ["core", "novc6"]),
- ("IceStorm/single", ["service", "novc6", "noappverifier"]), # This test doensn't work with appverifier is sensitive to timeouts.
- ("IceStorm/federation", ["service", "novc6"]),
- ("IceStorm/federation2", ["service", "novc6"]),
- ("IceStorm/stress", ["service", "stress", "novc6", "noappverifier"]), # This test is very slow with appverifier.
- ("IceStorm/rep1", ["service", "novc6"]),
- ("IceStorm/repgrid", ["service", "novc6"]),
- ("IceStorm/repstress", ["service", "noipv6", "stress", "novc6"]),
- ("FreezeScript/dbmap", ["once", "novc6"]),
- ("FreezeScript/evictor", ["once", "novc6"]),
- ("IceGrid/simple", ["service", "novc6"]),
- ("IceGrid/fileLock", ["service", "novc6"]),
- ("IceGrid/deployer", ["service", "novc6"]),
- ("IceGrid/session", ["service", "novc6"]),
- ("IceGrid/update", ["service", "novc6"]),
- ("IceGrid/activation", ["service", "novc6"]),
- ("IceGrid/replicaGroup", ["service", "novc6"]),
- ("IceGrid/replication", ["service", "novc6"]),
- ("IceGrid/allocation", ["service", "novc6"]),
- ("IceGrid/distribution", ["service", "novc6"]),
- ("IceGrid/admin", ["service", "novc6"]),
- ("Glacier2/router", ["service", "novc6"]),
- ("Glacier2/attack", ["service", "novc6"]),
- ("Glacier2/override", ["service", "novc6"]),
- ("Glacier2/sessionControl", ["service", "novc6"]),
- ("Glacier2/ssl", ["service", "novalgrind", "novc6"]), # valgrind doesn't work well with openssl
- ("Glacier2/dynamicFiltering", ["service", "novc6"]),
- ("Glacier2/staticFiltering", ["service", "noipv6", "novc6"]),
- ("Glacier2/sessionHelper", ["service", "novc6"]),
+ ("IceBox/configuration", ["core", "noipv6", "novc6", "nomingw"]),
+ ("Freeze/dbmap", ["once", "novc6", "nomingw"]),
+ ("Freeze/complex", ["once", "novc6", "nomingw"]),
+ ("Freeze/evictor", ["core", "novc6", "nomingw"]),
+ ("Freeze/fileLock", ["core", "novc6", "nomingw"]),
+ ("IceStorm/single", ["service", "novc6", "noappverifier", "nomingw"]), # This test doensn't work with appverifier is sensitive to timeouts.
+ ("IceStorm/federation", ["service", "novc6", "nomingw"]),
+ ("IceStorm/federation2", ["service", "novc6", "nomingw"]),
+ ("IceStorm/stress", ["service", "stress", "novc6", "noappverifier", "nomingw"]), # This test is very slow with appverifier.
+ ("IceStorm/rep1", ["service", "novc6", "nomingw"]),
+ ("IceStorm/repgrid", ["service", "novc6", "nomingw"]),
+ ("IceStorm/repstress", ["service", "noipv6", "stress", "novc6", "nomingw"]),
+ ("FreezeScript/dbmap", ["once", "novc6", "nomingw"]),
+ ("FreezeScript/evictor", ["once", "novc6", "nomingw"]),
+ ("IceGrid/simple", ["service", "novc6", "nomingw"]),
+ ("IceGrid/fileLock", ["service", "novc6", "nomingw"]),
+ ("IceGrid/deployer", ["service", "novc6", "nomingw"]),
+ ("IceGrid/session", ["service", "novc6", "nomingw"]),
+ ("IceGrid/update", ["service", "novc6", "nomingw"]),
+ ("IceGrid/activation", ["service", "novc6", "nomingw"]),
+ ("IceGrid/replicaGroup", ["service", "novc6", "nomingw"]),
+ ("IceGrid/replication", ["service", "novc6", "nomingw"]),
+ ("IceGrid/allocation", ["service", "novc6", "nomingw"]),
+ ("IceGrid/distribution", ["service", "novc6", "nomingw"]),
+ ("IceGrid/admin", ["service", "novc6", "nomingw"]),
+ ("Glacier2/router", ["service", "novc6", "nomingw"]),
+ ("Glacier2/attack", ["service", "novc6", "nomingw"]),
+ ("Glacier2/override", ["service", "novc6", "nomingw"]),
+ ("Glacier2/sessionControl", ["service", "novc6", "nomingw"]),
+ ("Glacier2/ssl", ["service", "novalgrind", "novc6", "nomingw"]), # valgrind doesn't work well with openssl
+ ("Glacier2/dynamicFiltering", ["service", "novc6", "nomingw"]),
+ ("Glacier2/staticFiltering", ["service", "noipv6", "novc6", "nomingw"]),
+ ("Glacier2/sessionHelper", ["service", "novc6", "nomingw"]),
]
#
diff --git a/cpp/config/Make.rules b/cpp/config/Make.rules
index 9fbff56550c..e159318b676 100644
--- a/cpp/config/Make.rules
+++ b/cpp/config/Make.rules
@@ -130,6 +130,13 @@ USE_READLINE ?= no
#GENPIC ?= yes
#
+# If building with MinGW and Ice third party packages is not installed
+# in the default location set THIRDPARTY_HOME to the Ice third party
+# installation directory.
+#
+#THIRDPARTY_HOME ?= C:\Program Files\ZeroC\Ice-$(VERSION)-ThirdParty
+
+#
# Default Mutex protocol: one of PrioNone or PrioInherit.
#
#DEFAULT_MUTEX_PROTOCOL ?= PrioNone
@@ -138,12 +145,22 @@ USE_READLINE ?= no
# Don't change anything below this line!
# ----------------------------------------------------------------------
+ifeq ($(shell test -f $(top_srcdir)/config/Make.rules.common && echo 0),0)
+ include $(top_srcdir)/config/Make.rules.common
+else
+ include $(top_srcdir)/../cpp/config/Make.rules.common
+endif
+
#
# Common definitions
#
ice_language = cpp
ifneq ($(shell test "$(USE_BIN_DIST)" != "yes" -a -d $(top_srcdir)/../$(ice_language) && echo 0),0)
- slice_translator = slice2cpp
+ ifeq ($(MinGW), yes)
+ slice_translator = slice2cpp.exe
+ else
+ slice_translator = slice2cpp
+ endif
ice_require_cpp = 1
endif
@@ -170,7 +187,11 @@ endif
#
# Platform specific definitions
#
-include $(top_srcdir)/config/Make.rules.$(UNAME)
+ifeq ($(MinGW), yes)
+ include $(top_srcdir)/config/Make.rules.MinGW
+else
+ include $(top_srcdir)/config/Make.rules.$(UNAME)
+endif
install_includedir := $(prefix)/include
install_docdir := $(prefix)/doc
@@ -188,58 +209,71 @@ ifeq ($(DEFAULT_MUTEX_PROTOCOL), PrioInherit)
ICEUTIL_FLAGS = -DICE_PRIO_INHERIT
endif
-OPENSSL_FLAGS = $(if $(OPENSSL_HOME),-I$(OPENSSL_HOME)/include)
-OPENSSL_LIBS = $(if $(OPENSSL_HOME),-L$(OPENSSL_HOME)/$(libsubdir)) -lssl -lcrypto
-OPENSSL_RPATH_LINK = $(if $(OPENSSL_HOME),$(call rpathlink,$(OPENSSL_HOME)/$(libsubdir)))
-
-BZIP2_FLAGS = $(if $(BZIP2_HOME),-I$(BZIP2_HOME)/include)
-BZIP2_LIBS = $(if $(BZIP2_HOME),-L$(BZIP2_HOME)/$(libsubdir)) -lbz2
-BZIP2_RPATH_LINK = $(if $(BZIP2_HOME),$(call rpathlink,$(BZIP2_HOME)/$(libsubdir)))
-
-ICONV_LIBS = $(if $(ICONV_HOME),-L$(ICONV_HOME)/$(libsubdir)) $(ICONV_LIB)
-
-ifneq ($(DB_HOME),)
- DB_FLAGS = -I$(DB_HOME)/include
- DB_LIBS = -L$(DB_HOME)/$(libsubdir) -ldb_cxx
- DB_RPATH_LINK = $(call rpathlink,$(DB_HOME)/$(libsubdir))
+ifeq ($(MinGW), yes)
+ OPENSSL_LIBS = -leay32_mingw -lssleay32_mingw
+ BZIP2_LIBS = -lbzip2_mingw
+ MCPP_LIBS = -lmcpp
+ slicedir_win = $(shell $(top_srcdir)/../cpp/config/cygpath-win.sh $(slicedir))
+ ICECPPFLAGS = -I"$(slicedir_win)"
else
- ifeq ($(shell if [ -d /usr/include/db48 -a -d /usr/$(libsubdir)/db48 ] ; then echo yes; fi), yes)
- DB_FLAGS = -I/usr/include/db48
- DB_LIBS = -L/usr/$(libsubdir)/db48 -ldb_cxx
- else
- DB_LIBS = -ldb_cxx
- endif
+ OPENSSL_FLAGS = $(if $(OPENSSL_HOME),-I$(OPENSSL_HOME)/include)
+ OPENSSL_LIBS = $(if $(OPENSSL_HOME),-L$(OPENSSL_HOME)/$(libsubdir)) -lssl -lcrypto
+ OPENSSL_RPATH_LINK = $(if $(OPENSSL_HOME),$(call rpathlink,$(OPENSSL_HOME)/$(libsubdir)))
+ BZIP2_FLAGS = $(if $(BZIP2_HOME),-I$(BZIP2_HOME)/include)
+ BZIP2_LIBS = $(if $(BZIP2_HOME),-L$(BZIP2_HOME)/$(libsubdir)) -lbz2
+ BZIP2_RPATH_LINK = $(if $(BZIP2_HOME),$(call rpathlink,$(BZIP2_HOME)/$(libsubdir)))
+ ICONV_LIBS = $(if $(ICONV_HOME),-L$(ICONV_HOME)/$(libsubdir)) $(ICONV_LIB)
+
+ ifneq ($(DB_HOME),)
+ DB_FLAGS = -I$(DB_HOME)/include
+ DB_LIBS = -L$(DB_HOME)/$(libsubdir) -ldb_cxx
+ DB_RPATH_LINK = $(call rpathlink,$(DB_HOME)/$(libsubdir))
+ else
+ ifeq ($(shell if [ -d /usr/include/db48 -a -d /usr/$(libsubdir)/db48 ] ; then echo yes; fi), yes)
+ DB_FLAGS = -I/usr/include/db48
+ DB_LIBS = -L/usr/$(libsubdir)/db48 -ldb_cxx
+ else
+ DB_LIBS = -ldb_cxx
+ endif
+ endif
+ EXPAT_FLAGS = $(if $(EXPAT_HOME),-I$(EXPAT_HOME)/include)
+ EXPAT_LIBS = $(if $(EXPAT_HOME),-L$(EXPAT_HOME)/$(libsubdir)) -lexpat
+ EXPAT_RPATH_LINK = $(if $(EXPAT_HOME),$(call rpathlink,$(EXPAT_HOME)/$(libsubdir)))
+ MCPP_LIBS = $(if $(MCPP_HOME),-L$(MCPP_HOME)/$(libsubdir)) -lmcpp
+ MCPP_RPATH_LINK = $(if $(MCPP_HOME),$(call rpathlink,$(MCPP_HOME)/$(libsubdir)))
+
+ ifeq ($(PLATFORM_HAS_READLINE),yes)
+ ifeq ($(USE_READLINE),yes)
+ READLINE_FLAGS = -DHAVE_READLINE $(if $(READLINE_HOME),-I$(READLINE_HOME)/include)
+ READLINE_LIBS = $(if $(READLINE_HOME),-L$(READLINE_HOME)/$(libsubdir)) -lreadline -lncurses
+ endif
+ endif
+ ICECPPFLAGS = -I$(slicedir)
endif
-EXPAT_FLAGS = $(if $(EXPAT_HOME),-I$(EXPAT_HOME)/include)
-EXPAT_LIBS = $(if $(EXPAT_HOME),-L$(EXPAT_HOME)/$(libsubdir)) -lexpat
-EXPAT_RPATH_LINK = $(if $(EXPAT_HOME),$(call rpathlink,$(EXPAT_HOME)/$(libsubdir)))
-MCPP_LIBS = $(if $(MCPP_HOME),-L$(MCPP_HOME)/$(libsubdir)) -lmcpp
-MCPP_RPATH_LINK = $(if $(MCPP_HOME),$(call rpathlink,$(MCPP_HOME)/$(libsubdir)))
-
-ifeq ($(PLATFORM_HAS_READLINE),yes)
- ifeq ($(USE_READLINE),yes)
- READLINE_FLAGS = -DHAVE_READLINE $(if $(READLINE_HOME),-I$(READLINE_HOME)/include)
- READLINE_LIBS = $(if $(READLINE_HOME),-L$(READLINE_HOME)/$(libsubdir)) -lreadline -lncurses
- endif
-endif
-
-ifneq ($(DB_HOME),)
-endif
-
-ICECPPFLAGS = -I$(slicedir)
SLICE2CPPFLAGS = $(ICECPPFLAGS)
ifeq ($(ice_dir), /usr)
CPPFLAGS =
LDFLAGS = $(LDPLATFORMFLAGS) $(CXXFLAGS)
else
- CPPFLAGS = -I$(includedir)
- ifdef ice_src_dist
- LDFLAGS = $(LDPLATFORMFLAGS) $(CXXFLAGS) -L$(libdir)
+ ifeq ($(MinGW), yes)
+ includedir_win = $(shell $(top_srcdir)/../cpp/config/cygpath-win.sh $(includedir))
+ CPPFLAGS = -I"$(includedir_win)"
+ ice_dir_win = $(shell $(top_srcdir)/../cpp/config/cygpath-win.sh $(ice_dir))
+ ifdef ice_src_dist
+ LDFLAGS = $(LDPLATFORMFLAGS) $(CXXFLAGS) -L$(libdir)
+ else
+ LDFLAGS = $(LDPLATFORMFLAGS) $(CXXFLAGS) -L"$(ice_dir_win)\$(binsubdir)"
+ endif
else
- LDFLAGS = $(LDPLATFORMFLAGS) $(CXXFLAGS) -L$(ice_dir)/$(libsubdir)
+ CPPFLAGS = -I$(includedir)
+ ifdef ice_src_dist
+ LDFLAGS = $(LDPLATFORMFLAGS) $(CXXFLAGS) -L$(libdir)
+ else
+ LDFLAGS = $(LDPLATFORMFLAGS) $(CXXFLAGS) -L$(ice_dir)/$(libsubdir)
+ endif
endif
endif
@@ -255,18 +289,35 @@ else
BISONFLAGS := -dvt
endif
+ifneq ($(MinGW), yes)
ifeq ($(mkshlib),)
$(error You need to define mkshlib in Make.rules.$(UNAME))
endif
+endif
ifdef ice_src_dist
- SLICEPARSERLIB = $(libdir)/$(call mklibfilename,Slice,$(VERSION))
- SLICE2CPP = $(bindir)/slice2cpp
- SLICE2FREEZE = $(bindir)/slice2freeze
+ ifeq ($(MinGW), yes)
+ SLICEPARSERLIB = $(bindir)/$(SLICE_LIBNAME).dll
+ SLICE2CPP = $(bindir)/slice2cpp.exe
+ else
+ SLICEPARSERLIB = $(libdir)/$(call mklibfilename,Slice,$(VERSION))
+ SLICE2CPP = $(bindir)/slice2cpp
+ SLICE2FREEZE = $(bindir)/slice2freeze
+ endif
else
- SLICEPARSERLIB = $(ice_dir)/$(libsubdir)/$(call mklibfilename,Slice,$(VERSION))
- SLICE2CPP = $(ice_dir)/$(binsubdir)/slice2cpp
- SLICE2FREEZE = $(ice_dir)/$(binsubdir)/slice2freeze
+ ifeq ($(MinGW), yes)
+ SLICEPARSERLIB = $(ice_dir)/$(binsubdir)/$(SLICE_LIBNAME).dll
+ SLICE2CPP = $(ice_dir)/$(binsubdir)/slice2cpp.exe
+ else
+ SLICEPARSERLIB = $(ice_dir)/$(libsubdir)/$(call mklibfilename,Slice,$(VERSION))
+ SLICE2CPP = $(ice_dir)/$(binsubdir)/slice2cpp
+ SLICE2FREEZE = $(ice_dir)/$(binsubdir)/slice2freeze
+ endif
+endif
+
+ifeq ($(MinGW), yes)
+ CPPFLAGS := $(CPPFLAGS) -I"$(THIRDPARTY_HOME_WIN)\include"
+ LDFLAGS := $(LDFLAGS) -L"$(THIRDPARTY_HOME_WIN)\lib\mingw" -L"$(THIRDPARTY_HOME_WIN)\bin" -L$(libdir) -L$(bindir)
endif
EVERYTHING = all depend clean install
@@ -280,7 +331,6 @@ EVERYTHING = all depend clean install
.c.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) $<
-
$(HDIR)/%F.h: $(SDIR)/%F.ice $(SLICE2CPP) $(SLICEPARSERLIB)
rm -f $(HDIR)/$(*F)F.h $(*F)F.cpp
$(SLICE2CPP) $(SLICE2CPPFLAGS) $<
diff --git a/cpp/config/Make.rules.MINGW b/cpp/config/Make.rules.MINGW
new file mode 100644
index 00000000000..2342da1e3c7
--- /dev/null
+++ b/cpp/config/Make.rules.MINGW
@@ -0,0 +1,56 @@
+# **********************************************************************
+#
+# Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved.
+#
+# This copy of Ice is licensed to you under the terms described in the
+# ICE_LICENSE file included in this distribution.
+#
+# **********************************************************************
+
+#
+# This file is included by Make.rules when building with MinGW.
+#
+
+#
+# build with CygWin MinGW?
+#
+#ifeq ($(CygWin), yes)
+# CXX = i686-pc-mingw32-c++
+#endif
+
+#
+# Default compiler is c++ (aka g++).
+#
+ifeq ($(CXX),)
+ CXX = c++
+endif
+
+CXXFLAGS = $(CXXARCHFLAGS) -fexceptions -mthreads -Wall -DWIN32_LEAN_AND_MEAN
+LDFLAGS = -Wl,-no-undefined
+
+ifeq ($(CXX), i686-pc-mingw32-c++)
+ LDPLATFORMFLAGS := $(LDFLAGS) -static-libstdc++ -static-libgcc
+endif
+
+ifeq ($(OPTIMIZE),yes)
+ CXXFLAGS += -O2 -DNDEBUG
+else
+ CXXFLAGS += -g -D_DEBUG
+ LIBSUFFIX = d
+endif
+
+COMPSUFFIX = mingw_
+
+#
+# MinGW lib names
+#
+ICEUTIL_LIBNAME = iceutil$(COMPSUFFIX)$(SOVERSION)$(LIBSUFFIX)
+SLICE_LIBNAME = slice$(COMPSUFFIX)$(SOVERSION)$(LIBSUFFIX)
+ICE_LIBNAME = ice$(COMPSUFFIX)$(SOVERSION)$(LIBSUFFIX)
+ICESSL_LIBNAME = icessl$(COMPSUFFIX)$(SOVERSION)$(LIBSUFFIX)
+
+BASELIBS = -l$(ICEUTIL_LIBNAME)
+LIBS = -l$(ICE_LIBNAME) $(BASELIBS)
+ICEUTIL_OS_LIBS = -lrpcrt4 -ladvapi32
+ICE_OS_LIBS = $(ICEUTIL_OS_LIBS) -lIphlpapi -lws2_32
+
diff --git a/cpp/config/Make.rules.common b/cpp/config/Make.rules.common
new file mode 100644
index 00000000000..5a5ded6a947
--- /dev/null
+++ b/cpp/config/Make.rules.common
@@ -0,0 +1,33 @@
+UNAME = $(shell uname)
+
+#
+# CygWin on Windows XP x86
+#
+ifeq ($(UNAME), CYGWIN_NT-5.1)
+ CygWin = yes
+ MinGW = yes
+endif
+
+#
+# CygWin on Windows XP x64
+#
+ifeq ($(UNAME), CYGWIN_NT-5.1-WOW64)
+ CygWin = yes
+ MinGW = yes
+endif
+
+#
+# CygWin on Windows 7 x64
+#
+ifeq ($(UNAME), CYGWIN_NT-6.1)
+ CygWin = yes
+ MinGW = yes
+endif
+
+#
+# CygWin on Windows 7 x64
+#
+ifeq ($(UNAME), CYGWIN_NT-6.1-WOW64)
+ CygWin = yes
+ MinGW = yes
+endif
diff --git a/cpp/config/cygpath-unix.sh b/cpp/config/cygpath-unix.sh
new file mode 100755
index 00000000000..9f0bd94c704
--- /dev/null
+++ b/cpp/config/cygpath-unix.sh
@@ -0,0 +1,4 @@
+#
+# Convert Windows path to Unix path, also escape whitespace.
+#
+v=`cygpath -u "$1"`; v=${v//[[:blank:]]/\\ }; v=${v/(/\\(}; echo ${v/)/\\)}
diff --git a/cpp/config/cygpath-win.sh b/cpp/config/cygpath-win.sh
new file mode 100755
index 00000000000..dd3e36e25fb
--- /dev/null
+++ b/cpp/config/cygpath-win.sh
@@ -0,0 +1,4 @@
+#
+# Convert Unix path to Windows path.
+#
+echo `cygpath -w $1`
diff --git a/cpp/include/Ice/DynamicLibrary.h b/cpp/include/Ice/DynamicLibrary.h
index 3e4d6e1c257..dd1aa9f9526 100644
--- a/cpp/include/Ice/DynamicLibrary.h
+++ b/cpp/include/Ice/DynamicLibrary.h
@@ -86,7 +86,6 @@ private:
#else
void* _hnd;
#endif
-
std::string _err;
const Ice::StringConverterPtr _stringConverter;
};
diff --git a/cpp/include/IceUtil/FileUtil.h b/cpp/include/IceUtil/FileUtil.h
index 666ea5ec6a7..054a8c9fef0 100644
--- a/cpp/include/IceUtil/FileUtil.h
+++ b/cpp/include/IceUtil/FileUtil.h
@@ -38,7 +38,7 @@ ICE_UTIL_API bool directoryExists(const std::string&);
#ifdef _WIN32
-#if (defined(_MSC_VER) && (_MSC_VER < 1300))
+#if defined(__MINGW32__) || (defined(_MSC_VER) && (_MSC_VER < 1300))
typedef struct _stat structstat;
#else
typedef struct _stat64i32 structstat;
diff --git a/cpp/include/Makefile b/cpp/include/Makefile
index e0cc01b3c42..5de48e060d4 100644
--- a/cpp/include/Makefile
+++ b/cpp/include/Makefile
@@ -11,17 +11,22 @@ top_srcdir = ..
include $(top_srcdir)/config/Make.rules
-SUBDIRS = Freeze \
- Glacier2 \
- Ice \
- IceBox \
- IceGrid \
- IcePatch2 \
+SUBDIRS = Ice \
IceSSL \
- IceStorm \
IceUtil \
- IceXML \
Slice
+
+ifneq ($(MinGW), yes)
+SUBDIRS := $(SUBDIRS) \
+ Freeze \
+ Glacier2 \
+ IceBox \
+ IceGrid \
+ IcePatch2 \
+ IceStorm \
+ IceXML
+endif
+
$(EVERYTHING)::
@for subdir in $(SUBDIRS); \
diff --git a/cpp/include/Slice/Parser.h b/cpp/include/Slice/Parser.h
index 1075caa7e1a..6c5a4f5d75b 100644
--- a/cpp/include/Slice/Parser.h
+++ b/cpp/include/Slice/Parser.h
@@ -30,7 +30,7 @@
namespace Slice
{
-#if defined(_WIN32)
+#if defined(_WIN32) && !defined(__MINGW32__)
const IceUtil::Int64 Int32Max = 0x7fffffffi64;
const IceUtil::Int64 Int32Min = -Int32Max - 1i64;
diff --git a/cpp/src/Ice/Application.cpp b/cpp/src/Ice/Application.cpp
index c7abb540a69..2a879eeaaee 100644
--- a/cpp/src/Ice/Application.cpp
+++ b/cpp/src/Ice/Application.cpp
@@ -141,7 +141,7 @@ destroyOnInterruptCallback(int signal)
//
return;
}
- if(_nohup && signal == SIGHUP)
+ if(_nohup && signal == static_cast<int>(SIGHUP))
{
return;
}
@@ -197,7 +197,7 @@ shutdownOnInterruptCallback(int signal)
//
return;
}
- if(_nohup && signal == SIGHUP)
+ if(_nohup && signal == static_cast<int>(SIGHUP))
{
return;
}
diff --git a/cpp/src/Ice/Makefile b/cpp/src/Ice/Makefile
index 150f27d89e6..e95f66163da 100644
--- a/cpp/src/Ice/Makefile
+++ b/cpp/src/Ice/Makefile
@@ -9,11 +9,17 @@
top_srcdir = ../..
-LIBFILENAME = $(call mklibfilename,Ice,$(VERSION))
-SONAME = $(call mksoname,Ice,$(SOVERSION))
-LIBNAME = $(call mklibname,Ice)
-
-TARGETS = $(call mklibtargets,$(libdir)/$(LIBFILENAME),$(libdir)/$(SONAME),$(libdir)/$(LIBNAME))
+include $(top_srcdir)/config/Make.rules.common
+
+ifeq ($(MinGW), yes)
+ DLLNAME = $(top_srcdir)/bin/ice$(COMPSUFFIX)$(SOVERSION)$(LIBSUFFIX).dll
+ TARGETS = $(DLLNAME) $(LIBNAME)
+else
+ LIBFILENAME = $(call mklibfilename,Ice,$(VERSION))
+ SONAME = $(call mksoname,Ice,$(SOVERSION))
+ LIBNAME = $(call mklibname,Ice)
+ TARGETS = $(call mklibtargets,$(libdir)/$(LIBFILENAME),$(libdir)/$(SONAME),$(libdir)/$(LIBNAME))
+endif
OBJS = Acceptor.o \
Application.o \
@@ -95,8 +101,7 @@ OBJS = Acceptor.o \
Stats.o \
StreamI.o \
Stream.o \
- StringConverter.o \
- SysLoggerI.o \
+ StringConverter.o \
TcpAcceptor.o \
TcpConnector.o \
TcpEndpointI.o \
@@ -109,6 +114,12 @@ OBJS = Acceptor.o \
UdpEndpointI.o \
UdpTransceiver.o
+ifneq ($(MinGW), yes)
+OBJS := $(OBJS) \
+ SysLoggerI.o
+endif
+
+
SRCS = $(OBJS:.o=.cpp) \
DLLMain.cpp
@@ -156,8 +167,16 @@ include $(top_srcdir)/config/Make.rules
CPPFLAGS := -I.. $(CPPFLAGS) -DICE_API_EXPORTS $(BZIP2_FLAGS)
SLICE2CPPFLAGS := --ice --include-dir Ice --dll-export ICE_API $(SLICE2CPPFLAGS)
+ifeq ($(MinGW), yes)
+CPPFLAGS := $(CPPFLAGS) -DCOMPSUFFIX=\"$(COMPSUFFIX)\"
+LINKWITH := $(ICE_OS_LIBS) -l$(ICEUTIL_LIBNAME) $(BZIP2_LIBS)
+$(DLLNAME): $(OBJS)
+ $(CXX) -shared $(LDFLAGS) -o $(DLLNAME) $(OBJS) $(LINKWITH)
+
+install:: all
+ $(call installprogram,$(DLLNAME),$(install_bindir))
+else
LINKWITH := -lIceUtil $(BZIP2_LIBS) $(ICONV_LIBS) $(ICE_OS_LIBS)
-
$(libdir)/$(LIBFILENAME): $(OBJS)
rm -f $@
$(call mkshlib,$@,$(SONAME),$(OBJS),$(LINKWITH))
@@ -172,6 +191,7 @@ $(libdir)/$(LIBNAME): $(libdir)/$(SONAME)
install:: all
$(call installlib,$(install_libdir),$(libdir),$(LIBFILENAME),$(SONAME),$(LIBNAME))
+endif
$(HDIR)/BuiltinSequences.h BuiltinSequences.cpp: $(SDIR)/BuiltinSequences.ice $(SLICE2CPP) $(SLICEPARSERLIB)
rm -f $(HDIR)/BuiltinSequences.h BuiltinSequences.cpp
diff --git a/cpp/src/Ice/Network.cpp b/cpp/src/Ice/Network.cpp
index ed730a8bb88..c29cd00a78b 100644
--- a/cpp/src/Ice/Network.cpp
+++ b/cpp/src/Ice/Network.cpp
@@ -2277,7 +2277,7 @@ IceInternal::doFinishConnectAsync(SOCKET fd, AsyncInfo& info)
// failure to connect. The socket isn't closed by this method.
//
- if(info.count == SOCKET_ERROR)
+ if(static_cast<int>(info.count) == SOCKET_ERROR)
{
WSASetLastError(info.error);
if(connectionRefused())
diff --git a/cpp/src/Ice/Network.h b/cpp/src/Ice/Network.h
index b8e30a34876..1643c5eae8f 100644
--- a/cpp/src/Ice/Network.h
+++ b/cpp/src/Ice/Network.h
@@ -24,7 +24,9 @@
#elif defined(_WIN32)
# include <winsock2.h>
# include <ws2tcpip.h>
+# if !defined(__MINGW32__)
typedef int ssize_t;
+# endif
#else
# include <unistd.h>
# include <fcntl.h>
@@ -85,6 +87,21 @@ typedef int socklen_t;
# define NETDB_SUCCESS 0
#endif
+#if defined(__MINGW32__) && !defined WSAID_CONNECTEX
+# define WSAID_CONNECTEX {0x25a207b9,0xddf3,0x4660,{0x8e,0xe9,0x76,0xe5,0x8c,0x74,0x06,0x3e}}
+# define WSAID_ACCEPTEX {0xb5367df1,0xcbac,0x11cf,{0x95,0xca,0x00,0x80,0x5f,0x48,0xa1,0x92}}
+# define SO_UPDATE_ACCEPT_CONTEXT 0x700B
+# define SO_UPDATE_CONNECT_CONTEXT 0x7010
+ typedef BOOL (PASCAL FAR * LPFN_CONNECTEX) (IN SOCKET s, IN const struct sockaddr FAR *name, IN int namelen,
+ IN PVOID lpSendBuffer OPTIONAL, IN DWORD dwSendDataLength,
+ OUT LPDWORD lpdwBytesSent, IN LPOVERLAPPED lpOverlapped);
+
+ typedef BOOL (PASCAL FAR * LPFN_ACCEPTEX)(IN SOCKET sListenSocket, IN SOCKET sAcceptSocket,
+ IN PVOID lpOutputBuffer, IN DWORD dwReceiveDataLength,
+ IN DWORD dwLocalAddressLength, IN DWORD dwRemoteAddressLength,
+ OUT LPDWORD lpdwBytesReceived, IN LPOVERLAPPED lpOverlapped);
+#endif
+
namespace IceInternal
{
diff --git a/cpp/src/Ice/Service.cpp b/cpp/src/Ice/Service.cpp
index 3c5c8df8f85..196e31ae6b7 100644
--- a/cpp/src/Ice/Service.cpp
+++ b/cpp/src/Ice/Service.cpp
@@ -852,7 +852,16 @@ Ice::Service::main(int argc, char* const argv[], const InitializationData& initi
int
Ice::Service::main(int& argc, wchar_t* argv[], const InitializationData& initializationData)
{
+
+# ifdef __MINGW32__ // COMPILER FIX
+ //
+ // MinGW doesn't see the main overload if we don't create the temp args object here.
+ //
+ Ice::StringSeq args = Ice::argsToStringSeq(argc, argv, initializationData.stringConverter);
+ return main(args, initializationData);
+# else
return main(Ice::argsToStringSeq(argc, argv, initializationData.stringConverter), initializationData);
+# endif
}
#endif
diff --git a/cpp/src/Ice/StringConverter.cpp b/cpp/src/Ice/StringConverter.cpp
index f8e385e7a23..35269b6cf23 100644
--- a/cpp/src/Ice/StringConverter.cpp
+++ b/cpp/src/Ice/StringConverter.cpp
@@ -16,10 +16,15 @@
#include <Ice/LocalException.h>
#include <Ice/LoggerUtil.h>
#include <Ice/Communicator.h>
+
#ifndef _WIN32
#include <Ice/IconvStringConverter.h>
#endif
+#ifdef __MINGW32__
+# include <limits.h>
+#endif
+
using namespace IceUtil;
using namespace IceUtilInternal;
using namespace std;
diff --git a/cpp/src/Ice/TcpAcceptor.cpp b/cpp/src/Ice/TcpAcceptor.cpp
index 0fc4fbc710c..8453863a25b 100644
--- a/cpp/src/Ice/TcpAcceptor.cpp
+++ b/cpp/src/Ice/TcpAcceptor.cpp
@@ -126,7 +126,7 @@ IceInternal::TcpAcceptor::startAccept()
void
IceInternal::TcpAcceptor::finishAccept()
{
- if(_info.count == SOCKET_ERROR || _fd == INVALID_SOCKET)
+ if(static_cast<int>(_info.count) == SOCKET_ERROR || _fd == INVALID_SOCKET)
{
closeSocketNoThrow(_acceptFd);
_acceptFd = INVALID_SOCKET;
diff --git a/cpp/src/Ice/TcpTransceiver.cpp b/cpp/src/Ice/TcpTransceiver.cpp
index 3d59ae68bf1..61fda069922 100644
--- a/cpp/src/Ice/TcpTransceiver.cpp
+++ b/cpp/src/Ice/TcpTransceiver.cpp
@@ -313,7 +313,7 @@ IceInternal::TcpTransceiver::finishWrite(Buffer& buf)
return;
}
- if(_write.count == SOCKET_ERROR)
+ if(static_cast<int>(_write.count) == SOCKET_ERROR)
{
WSASetLastError(_write.error);
if(connectionLost())
@@ -385,7 +385,7 @@ IceInternal::TcpTransceiver::startRead(Buffer& buf)
void
IceInternal::TcpTransceiver::finishRead(Buffer& buf)
{
- if(_read.count == SOCKET_ERROR)
+ if(static_cast<int>(_read.count) == SOCKET_ERROR)
{
WSASetLastError(_read.error);
if(connectionLost())
diff --git a/cpp/src/Ice/ThreadPool.h b/cpp/src/Ice/ThreadPool.h
index 5d45363a494..e46f244dce1 100644
--- a/cpp/src/Ice/ThreadPool.h
+++ b/cpp/src/Ice/ThreadPool.h
@@ -337,7 +337,7 @@ public:
// of the event handler. We need to lock the event handler here to call
// finishMessage.
//
-#if (defined(_MSC_VER) && (_MSC_VER < 1300))
+#if defined(__MINGW32__) || (defined(_MSC_VER) && (_MSC_VER < 1300))
IceUtil::LockT<T> sync(_mutex);
#else
IceUtil::LockT<typename T> sync(_mutex);
diff --git a/cpp/src/Ice/UdpTransceiver.cpp b/cpp/src/Ice/UdpTransceiver.cpp
index 855527b144d..b1aa39ddd96 100644
--- a/cpp/src/Ice/UdpTransceiver.cpp
+++ b/cpp/src/Ice/UdpTransceiver.cpp
@@ -545,7 +545,7 @@ IceInternal::UdpTransceiver::finishWrite(Buffer& buf)
return;
}
- if(_write.count == SOCKET_ERROR)
+ if(static_cast<int>(_write.count) == SOCKET_ERROR)
{
#ifndef ICE_OS_WINRT
WSASetLastError(_write.error);
@@ -675,7 +675,7 @@ IceInternal::UdpTransceiver::finishRead(Buffer& buf)
checkErrorCode(__FILE__, __LINE__, ex->HResult);
}
#else
- if(_read.count == SOCKET_ERROR)
+ if(static_cast<int>(_read.count) == SOCKET_ERROR)
{
WSASetLastError(_read.error);
diff --git a/cpp/src/IceSSL/AcceptorI.cpp b/cpp/src/IceSSL/AcceptorI.cpp
index 96fc56f2d19..f1b45d6afc7 100644
--- a/cpp/src/IceSSL/AcceptorI.cpp
+++ b/cpp/src/IceSSL/AcceptorI.cpp
@@ -132,7 +132,7 @@ IceSSL::AcceptorI::startAccept()
void
IceSSL::AcceptorI::finishAccept()
{
- if(_info.count == SOCKET_ERROR || _fd == INVALID_SOCKET)
+ if(static_cast<int>(_info.count) == SOCKET_ERROR || _fd == INVALID_SOCKET)
{
IceInternal::closeSocketNoThrow(_acceptFd);
_acceptFd = INVALID_SOCKET;
diff --git a/cpp/src/IceSSL/Makefile b/cpp/src/IceSSL/Makefile
index 868cdb0acaa..ab2d6ca690b 100644
--- a/cpp/src/IceSSL/Makefile
+++ b/cpp/src/IceSSL/Makefile
@@ -10,11 +10,17 @@
top_srcdir = ../..
-LIBFILENAME = $(call mklibfilename,IceSSL,$(VERSION))
-SONAME = $(call mksoname,IceSSL,$(SOVERSION))
-LIBNAME = $(call mklibname,IceSSL)
-
-TARGETS = $(call mklibtargets,$(libdir)/$(LIBFILENAME),$(libdir)/$(SONAME),$(libdir)/$(LIBNAME))
+include $(top_srcdir)/config/Make.rules.common
+
+ifeq ($(MinGW), yes)
+ DLLNAME = $(top_srcdir)/bin/icessl$(COMPSUFFIX)$(SOVERSION)$(LIBSUFFIX).dll
+ TARGETS = $(DLLNAME) $(LIBNAME)
+else
+ LIBFILENAME = $(call mklibfilename,IceSSL,$(VERSION))
+ SONAME = $(call mksoname,IceSSL,$(SOVERSION))
+ LIBNAME = $(call mklibname,IceSSL)
+ TARGETS = $(call mklibtargets,$(libdir)/$(LIBFILENAME),$(libdir)/$(SONAME),$(libdir)/$(LIBNAME))
+endif
OBJS = AcceptorI.o \
Certificate.o \
@@ -42,6 +48,17 @@ include $(top_srcdir)/config/Make.rules
CPPFLAGS := -I.. $(CPPFLAGS) -DICE_SSL_API_EXPORTS $(OPENSSL_FLAGS)
SLICE2CPPFLAGS := --ice --include-dir IceSSL --dll-export ICE_SSL_API $(SLICE2CPPFLAGS)
+ifeq ($(MinGW), yes)
+
+LINKWITH := -lice$(COMPSUFFIX)$(SOVERSION)$(LIBSUFFIX) -liceutil$(COMPSUFFIX)$(SOVERSION)$(LIBSUFFIX) $(ICE_OS_LIBS) $(OPENSSL_LIBS)
+
+$(DLLNAME): $(OBJS)
+ $(CXX) -shared $(LDFLAGS) -o $(DLLNAME) $(OBJS) $(LINKWITH)
+
+install:: all
+ $(call installprogram,$(DLLNAME),$(install_bindir))
+
+else
LINKWITH := $(BZIP2_RPATH_LINK) -lIce -lIceUtil $(OPENSSL_LIBS) $(CXXLIBS)
$(libdir)/$(LIBFILENAME): $(OBJS)
@@ -58,5 +75,6 @@ $(libdir)/$(LIBNAME): $(libdir)/$(SONAME)
install:: all
$(call installlib,$(install_libdir),$(libdir),$(LIBFILENAME),$(SONAME),$(LIBNAME))
+endif
include .depend
diff --git a/cpp/src/IceSSL/TransceiverI.cpp b/cpp/src/IceSSL/TransceiverI.cpp
index 3c75c6331bc..a052fbd8f00 100644
--- a/cpp/src/IceSSL/TransceiverI.cpp
+++ b/cpp/src/IceSSL/TransceiverI.cpp
@@ -692,7 +692,7 @@ IceSSL::TransceiverI::finishWrite(IceInternal::Buffer& buf)
return;
}
- if(_write.count == SOCKET_ERROR)
+ if(static_cast<int>(_write.count) == SOCKET_ERROR)
{
WSASetLastError(_write.error);
if(IceInternal::connectionLost())
@@ -763,7 +763,7 @@ IceSSL::TransceiverI::startRead(IceInternal::Buffer& buf)
void
IceSSL::TransceiverI::finishRead(IceInternal::Buffer& buf)
{
- if(_read.count == SOCKET_ERROR)
+ if(static_cast<int>(_read.count) == SOCKET_ERROR)
{
WSASetLastError(_read.error);
if(IceInternal::connectionLost())
diff --git a/cpp/src/IceUtil/Exception.cpp b/cpp/src/IceUtil/Exception.cpp
index 350df152b29..fac85e5e01e 100644
--- a/cpp/src/IceUtil/Exception.cpp
+++ b/cpp/src/IceUtil/Exception.cpp
@@ -14,7 +14,7 @@
#include <ostream>
#include <cstdlib>
-#if defined(__GNUC__) && !defined(__sun) && !defined(__FreeBSD__)
+#if defined(__GNUC__) && !defined(__sun) && !defined(__FreeBSD__) && !defined(__MINGW32__)
# include <execinfo.h>
# include <cxxabi.h>
#endif
@@ -52,7 +52,7 @@ public:
Init init;
-#if defined(__GNUC__) && !defined(__sun) && !defined(__FreeBSD__)
+#if defined(__GNUC__) && !defined(__sun) && !defined(__FreeBSD__) && !defined(__MINGW32__)
string
getStackTrace()
{
@@ -183,7 +183,7 @@ getStackTrace()
IceUtil::Exception::Exception() :
_file(0),
_line(0)
-#if defined(__GNUC__) && !defined(__sun) && !defined(__FreeBSD__)
+#if defined(__GNUC__) && !defined(__sun) && !defined(__FreeBSD__) && !defined(__MINGW32__)
, _stackTrace(getStackTrace())
#endif
{
@@ -192,7 +192,7 @@ IceUtil::Exception::Exception() :
IceUtil::Exception::Exception(const char* file, int line) :
_file(file),
_line(line)
-#if defined(__GNUC__) && !defined(__sun) && !defined(__FreeBSD__)
+#if defined(__GNUC__) && !defined(__sun) && !defined(__FreeBSD__) && !defined(__MINGW32__)
, _stackTrace(getStackTrace())
#endif
{
diff --git a/cpp/src/IceUtil/FileUtil.cpp b/cpp/src/IceUtil/FileUtil.cpp
index 0888ff8281c..b69e8d6b20a 100644
--- a/cpp/src/IceUtil/FileUtil.cpp
+++ b/cpp/src/IceUtil/FileUtil.cpp
@@ -170,7 +170,7 @@ IceUtilInternal::unlink(const string& path)
int
IceUtilInternal::close(int fd)
{
-#if defined(_MSC_VER) && (_MSC_VER >= 1400)
+#if defined(_MSC_VER) && (_MSC_VER >= 1400) || defined(__MINGW32__)
return _close(fd);
#else
return ::close(fd);
@@ -197,6 +197,12 @@ IceUtilInternal::FileLock::FileLock(const std::string& path) :
throw IceUtil::FileLockException(__FILE__, __LINE__, GetLastError(), _path);
}
+#ifdef __MINGW32__
+ if(::LockFile(_fd, 0, 0, 0, 0) == 0)
+ {
+ throw IceUtil::FileLockException(__FILE__, __LINE__, GetLastError(), _path);
+ }
+#else
OVERLAPPED overlaped;
overlaped.Internal = 0;
overlaped.InternalHigh = 0;
@@ -208,6 +214,7 @@ IceUtilInternal::FileLock::FileLock(const std::string& path) :
::CloseHandle(_fd);
throw IceUtil::FileLockException(__FILE__, __LINE__, GetLastError(), _path);
}
+#endif
//
// In Windows implementation we don't write the process pid to the file, as is
// not posible to read the file from other process while it is locked here.
@@ -310,14 +317,23 @@ IceUtilInternal::ifstream::open(const string& path, ios_base::openmode mode)
#else
-IceUtilInternal::ifstream::ifstream(const string& path, ios_base::openmode mode) : std::ifstream(IceUtil::stringToWstring(path).c_str(), mode)
+IceUtilInternal::ifstream::ifstream(const string& path, ios_base::openmode mode) :
+#ifdef __MINGW32__
+ std::ifstream(path.c_str(), mode)
+#else
+ std::ifstream(IceUtil::stringToWstring(path).c_str(), mode)
+#endif
{
}
void
IceUtilInternal::ifstream::open(const string& path, ios_base::openmode mode)
{
+#ifdef __MINGW32__
+ std::ifstream::open(path.c_str(), mode);
+#else
std::ifstream::open(IceUtil::stringToWstring(path).c_str(), mode);
+#endif
}
#endif
@@ -371,14 +387,23 @@ IceUtilInternal::ofstream::open(const string& path, ios_base::openmode mode)
#else
-IceUtilInternal::ofstream::ofstream(const string& path, ios_base::openmode mode) : std::ofstream(IceUtil::stringToWstring(path).c_str(), mode)
+IceUtilInternal::ofstream::ofstream(const string& path, ios_base::openmode mode) :
+#ifdef __MINGW32__
+ std::ofstream(path.c_str(), mode)
+#else
+ std::ofstream(IceUtil::stringToWstring(path).c_str(), mode)
+#endif
{
}
void
IceUtilInternal::ofstream::open(const string& path, ios_base::openmode mode)
{
+#ifdef __MINGW32__
+ std::ofstream::open(path.c_str(), mode);
+#else
std::ofstream::open(IceUtil::stringToWstring(path).c_str(), mode);
+#endif
}
#endif
diff --git a/cpp/src/IceUtil/InputUtil.cpp b/cpp/src/IceUtil/InputUtil.cpp
index 1b29658afbe..8f5edab81f9 100644
--- a/cpp/src/IceUtil/InputUtil.cpp
+++ b/cpp/src/IceUtil/InputUtil.cpp
@@ -11,7 +11,7 @@
#include <stdlib.h>
#include <errno.h>
-#if defined(_MSC_VER) && (_MSC_VER < 1300)
+#if (defined(_MSC_VER) && (_MSC_VER < 1300) ) || (__MINGW32__)
#include <limits.h>
#endif
@@ -25,7 +25,9 @@ using namespace IceUtil;
namespace IceUtilInternal
{
-#if (defined(_MSC_VER) && (_MSC_VER < 1300))
+
+#if defined(__MINGW32__) || (defined(_MSC_VER) && (_MSC_VER < 1300))
+
//
// The VC60 runtime does not include _strtoi64, so we provide our own implementation
//
@@ -177,7 +179,7 @@ Int64
strToInt64(const char* s, char** endptr, int base)
{
#if defined(_WIN32)
-# if (defined(_MSC_VER) && (_MSC_VER < 1300))
+# if defined(__MINGW32__) || (defined(_MSC_VER) && (_MSC_VER < 1300))
return strToInt64Impl(s, endptr, base);
# else
return _strtoi64(s, endptr, base);
diff --git a/cpp/src/IceUtil/Makefile b/cpp/src/IceUtil/Makefile
index 4fb25718adf..a3e19c0914f 100644
--- a/cpp/src/IceUtil/Makefile
+++ b/cpp/src/IceUtil/Makefile
@@ -9,11 +9,17 @@
top_srcdir = ../..
-LIBFILENAME = $(call mklibfilename,IceUtil,$(VERSION))
-SONAME = $(call mksoname,IceUtil,$(SOVERSION))
-LIBNAME = $(call mklibname,IceUtil)
+include $(top_srcdir)/config/Make.rules.common
-TARGETS = $(call mklibtargets,$(libdir)/$(LIBFILENAME),$(libdir)/$(SONAME),$(libdir)/$(LIBNAME))
+ifeq ($(MinGW), yes)
+ DLLNAME = $(top_srcdir)/bin/iceutil$(COMPSUFFIX)$(SOVERSION)$(LIBSUFFIX).dll
+ TARGETS = $(DLLNAME) $(LIBNAME)
+else
+ LIBFILENAME = $(call mklibfilename,IceUtil,$(VERSION))
+ SONAME = $(call mksoname,IceUtil,$(SOVERSION))
+ LIBNAME = $(call mklibname,IceUtil)
+ TARGETS = $(call mklibtargets,$(libdir)/$(LIBFILENAME),$(libdir)/$(SONAME),$(libdir)/$(LIBNAME))
+endif
OBJS = ArgVector.o \
Cond.o \
@@ -21,7 +27,6 @@ OBJS = ArgVector.o \
CountDownLatch.o \
CtrlCHandler.o \
Exception.o \
- FileUtil.o \
InputUtil.o \
Options.o \
OutputUtil.o \
@@ -35,7 +40,8 @@ OBJS = ArgVector.o \
Timer.o \
UUID.o \
Unicode.o \
- MutexProtocol.o
+ MutexProtocol.o \
+ FileUtil.o
SRCS = $(OBJS:.o=.cpp)
@@ -43,8 +49,15 @@ include $(top_srcdir)/config/Make.rules
CPPFLAGS := $(CPPFLAGS) $(ICEUTIL_FLAGS) -DICE_UTIL_API_EXPORTS -I..
-LINKWITH := $(STLPORT_LIBS) $(ICEUTIL_OS_LIBS)
+LINKWITH := $(ICEUTIL_OS_LIBS)
+ifeq ($(MinGW), yes)
+$(DLLNAME): $(OBJS)
+ $(CXX) -shared $(LDFLAGS) -o $(DLLNAME) $(OBJS) $(LINKWITH)
+
+install:: all
+ $(call installprogram,$(DLLNAME),$(install_bindir))
+else
ifeq ($(STATICLIBS),yes)
$(libdir)/$(LIBNAME): $(OBJS)
rm -f $@
@@ -62,9 +75,9 @@ $(libdir)/$(LIBNAME): $(libdir)/$(SONAME)
rm -f $@
ln -s $(SONAME) $@
endif
-
install:: all
$(call installlib,$(install_libdir),$(libdir),$(LIBFILENAME),$(SONAME),$(LIBNAME))
+endif
include .depend
diff --git a/cpp/src/IceUtil/Random.cpp b/cpp/src/IceUtil/Random.cpp
index e82a55d93ab..d47d424357f 100644
--- a/cpp/src/IceUtil/Random.cpp
+++ b/cpp/src/IceUtil/Random.cpp
@@ -44,7 +44,7 @@ namespace
//
Mutex* staticMutex = 0;
#ifdef _WIN32
-HCRYPTPROV context = NULL;
+HCRYPTPROV context = 0;
#else
int fd = -1;
#endif
@@ -61,10 +61,10 @@ public:
~Init()
{
#ifdef _WIN32
- if(context != NULL)
+ if(context != 0)
{
CryptReleaseContext(context, 0);
- context = NULL;
+ context = 0;
}
#else
if(fd != -1)
@@ -102,7 +102,7 @@ IceUtilInternal::generateRandom(char* buffer, int size)
//
IceUtilInternal::MutexPtrLock<IceUtil::Mutex> lock(staticMutex);
- if(context == NULL)
+ if(context == 0)
{
if(!CryptAcquireContext(&context, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT))
{
diff --git a/cpp/src/IceUtil/RecMutex.cpp b/cpp/src/IceUtil/RecMutex.cpp
index c632f4b7b63..9558a6fed2b 100644
--- a/cpp/src/IceUtil/RecMutex.cpp
+++ b/cpp/src/IceUtil/RecMutex.cpp
@@ -33,7 +33,11 @@ IceUtil::RecMutex::RecMutex(const IceUtil::MutexProtocol protocol) :
void
IceUtil::RecMutex::init(const MutexProtocol)
{
+# ifdef ICE_OS_WINRT
InitializeCriticalSectionEx(&_mutex, 0, 0);
+# else
+ InitializeCriticalSection(&_mutex);
+# endif
}
IceUtil::RecMutex::~RecMutex()
diff --git a/cpp/src/IceUtil/Thread.cpp b/cpp/src/IceUtil/Thread.cpp
index a629586a43b..4c63bd7b0e2 100644
--- a/cpp/src/IceUtil/Thread.cpp
+++ b/cpp/src/IceUtil/Thread.cpp
@@ -251,7 +251,7 @@ IceUtil::Thread::start(size_t stackSize, int priority)
{
throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
}
- if(ResumeThread(_handle) == -1)
+ if(static_cast<int>(ResumeThread(_handle)) == -1)
{
__decRef();
throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
diff --git a/cpp/src/IceUtil/Time.cpp b/cpp/src/IceUtil/Time.cpp
index 585335191e8..bef48d9ab3d 100644
--- a/cpp/src/IceUtil/Time.cpp
+++ b/cpp/src/IceUtil/Time.cpp
@@ -95,8 +95,13 @@ IceUtil::Time::now(Clock clock)
if(clock == Realtime)
{
#ifdef _WIN32
+# if defined(_MSC_VER)
struct _timeb tb;
_ftime(&tb);
+# elif defined(__MINGW32__)
+ struct timeb tb;
+ ftime(&tb);
+# endif
return Time(static_cast<Int64>(tb.time) * ICE_INT64(1000000) + tb.millitm * 1000);
#else
struct timeval tv;
@@ -123,8 +128,13 @@ IceUtil::Time::now(Clock clock)
}
else
{
+# if defined(_MSC_VER)
struct _timeb tb;
_ftime(&tb);
+# elif defined(__MINGW32__)
+ struct timeb tb;
+ ftime(&tb);
+# endif
return Time(static_cast<Int64>(tb.time) * ICE_INT64(1000000) + tb.millitm * 1000);
}
#elif defined(__hpux)
diff --git a/cpp/src/Makefile b/cpp/src/Makefile
index a7930b2e6ec..4917e0a96ef 100644
--- a/cpp/src/Makefile
+++ b/cpp/src/Makefile
@@ -11,33 +11,42 @@ top_srcdir = ..
include $(top_srcdir)/config/Make.rules
-SUBDIRS = IceUtil \
- Slice \
- slice2cpp \
- slice2cs \
- slice2freeze \
- slice2freezej \
- slice2java \
- slice2php \
- slice2py \
- slice2rb \
- slice2html \
- Ice \
- IceXML \
- IceSSL \
- Freeze \
- FreezeScript \
- IceBox \
- Glacier2Lib \
- Glacier2 \
- IceDB \
- IcePatch2Lib \
- IcePatch2 \
- IceStormLib \
- IceGridLib \
- IceStorm \
- IceGrid \
- ca
+ifeq ($(MinGW), yes)
+ SUBDIRS = IceUtil \
+ Slice \
+ slice2cpp \
+ slice2rb \
+ Ice \
+ IceSSL
+else
+ SUBDIRS = IceUtil \
+ Slice \
+ slice2cpp \
+ slice2cs \
+ slice2freeze \
+ slice2freezej \
+ slice2java \
+ slice2php \
+ slice2py \
+ slice2rb \
+ slice2html \
+ Ice \
+ IceXML \
+ IceSSL \
+ Freeze \
+ FreezeScript \
+ IceBox \
+ Glacier2Lib \
+ Glacier2 \
+ IceDB \
+ IcePatch2Lib \
+ IcePatch2 \
+ IceStormLib \
+ IceGridLib \
+ IceStorm \
+ IceGrid \
+ ca
+endif
$(EVERYTHING)::
@for subdir in $(SUBDIRS); \
diff --git a/cpp/src/Slice/Makefile b/cpp/src/Slice/Makefile
index c6e5718f866..f07c97d1340 100644
--- a/cpp/src/Slice/Makefile
+++ b/cpp/src/Slice/Makefile
@@ -9,11 +9,17 @@
top_srcdir = ../..
-LIBFILENAME = $(call mklibfilename,Slice,$(VERSION))
-SONAME = $(call mksoname,Slice,$(SOVERSION))
-LIBNAME = $(call mklibname,Slice)
+include $(top_srcdir)/config/Make.rules.common
-TARGETS = $(call mklibtargets,$(libdir)/$(LIBFILENAME),$(libdir)/$(SONAME),$(libdir)/$(LIBNAME))
+ifeq ($(MinGW), yes)
+ DLLNAME = $(top_srcdir)/bin/slice$(COMPSUFFIX)$(SOVERSION)$(LIBSUFFIX).dll
+ TARGETS = $(DLLNAME) $(LIBNAME)
+else
+ LIBFILENAME = $(call mklibfilename,Slice,$(VERSION))
+ SONAME = $(call mksoname,Slice,$(SOVERSION))
+ LIBNAME = $(call mklibname,Slice)
+ TARGETS = $(call mklibtargets,$(libdir)/$(LIBFILENAME),$(libdir)/$(SONAME),$(libdir)/$(LIBNAME))
+endif
OBJS = Scanner.o \
../Slice/Grammar.o \
@@ -36,10 +42,19 @@ SRCS = $(OBJS:.o=.cpp)
include $(top_srcdir)/config/Make.rules
+
CPPFLAGS := -I.. $(CPPFLAGS) -DSLICE_API_EXPORTS
-LINKWITH := -lIceUtil $(MCPP_LIBS)
BISONFLAGS := --name-prefix "slice_" $(BISONFLAGS)
+ifeq ($(MinGW), yes)
+LINKWITH := -l$(ICEUTIL_LIBNAME) $(MCPP_LIBS)
+$(DLLNAME): $(OBJS)
+ $(CXX) -shared $(LDFLAGS) -o $(DLLNAME) $(OBJS) $(LINKWITH)
+
+install:: all
+ $(call installprogram,$(DLLNAME),$(install_bindir))
+else
+LINKWITH := -lIceUtil $(MCPP_LIBS)
ifeq ($(STATICLIBS),yes)
$(libdir)/$(LIBNAME): $(OBJS)
rm -f $@
@@ -57,9 +72,8 @@ $(libdir)/$(LIBNAME): $(libdir)/$(SONAME)
rm -f $@
ln -s $(SONAME) $@
endif
-
install:: all
$(call installlib,$(install_libdir),$(libdir),$(LIBFILENAME),$(SONAME),$(LIBNAME))
-
+endif
include .depend
diff --git a/cpp/src/slice2cpp/Makefile b/cpp/src/slice2cpp/Makefile
index dc15e514e7e..167f35e7dc8 100644
--- a/cpp/src/slice2cpp/Makefile
+++ b/cpp/src/slice2cpp/Makefile
@@ -9,7 +9,13 @@
top_srcdir = ../..
-NAME = $(top_srcdir)/bin/slice2cpp
+include $(top_srcdir)/config/Make.rules.common
+
+ifeq ($(MinGW), yes)
+ NAME = $(top_srcdir)/bin/slice2cpp.exe
+else
+ NAME = $(top_srcdir)/bin/slice2cpp
+endif
TARGETS = $(NAME)
@@ -22,10 +28,15 @@ include $(top_srcdir)/config/Make.rules
CPPFLAGS := -I. $(CPPFLAGS)
+ifeq ($(MinGW), yes)
+$(NAME): $(OBJS)
+ rm -f $@
+ $(CXX) $(LDFLAGS) -o $@ $(OBJS) -lslice$(COMPSUFFIX)$(SOVERSION)$(LIBSUFFIX) $(BASELIBS) $(MCPP_RPATH_LINK)
+else
$(NAME): $(OBJS)
rm -f $@
$(CXX) $(LDFLAGS) -o $@ $(OBJS) -lSlice $(BASELIBS) $(MCPP_RPATH_LINK)
-
+endif
install:: all
$(call installprogram,$(NAME),$(install_bindir))
diff --git a/cpp/src/slice2rb/Makefile b/cpp/src/slice2rb/Makefile
index 7e014004b32..1e4df68e074 100644
--- a/cpp/src/slice2rb/Makefile
+++ b/cpp/src/slice2rb/Makefile
@@ -9,7 +9,13 @@
top_srcdir = ../..
-NAME = $(top_srcdir)/bin/slice2rb
+include $(top_srcdir)/config/Make.rules.common
+
+ifeq ($(MinGW), yes)
+ NAME = $(top_srcdir)/bin/slice2rb.exe
+else
+ NAME = $(top_srcdir)/bin/slice2rb
+endif
TARGETS = $(NAME)
@@ -21,9 +27,15 @@ include $(top_srcdir)/config/Make.rules
CPPFLAGS := -I. $(CPPFLAGS)
+ifeq ($(MinGW), yes)
+$(NAME): $(OBJS)
+ rm -f $@
+ $(CXX) $(LDFLAGS) -o $@ $(OBJS) -lslice$(COMPSUFFIX)$(SOVERSION)$(LIBSUFFIX) $(BASELIBS) $(MCPP_RPATH_LINK)
+else
$(NAME): $(OBJS)
rm -f $@
$(CXX) $(LDFLAGS) -o $@ $(OBJS) -lSlice $(BASELIBS) $(MCPP_RPATH_LINK)
+endif
install:: all
$(call installprogram,$(NAME),$(install_bindir))
diff --git a/cpp/test/Ice/info/Makefile b/cpp/test/Ice/info/Makefile
index fabbe5521b0..5df66daac71 100644
--- a/cpp/test/Ice/info/Makefile
+++ b/cpp/test/Ice/info/Makefile
@@ -31,14 +31,18 @@ SLICE_SRCS = Test.ice
include $(top_srcdir)/config/Make.rules
+ifneq ($(MinGW), yes)
+ ICESSL_LIBNAME = IceSSL
+endif
+
CPPFLAGS := -I. -I../../include $(CPPFLAGS)
$(CLIENT): $(COBJS)
rm -f $@
- $(CXX) $(LDFLAGS) -o $@ $(COBJS) $(OPENSSL_RPATH_LINK) -lIceSSL $(LIBS)
+ $(CXX) $(LDFLAGS) -o $@ $(COBJS) $(OPENSSL_RPATH_LINK) -l$(ICESSL_LIBNAME) $(LIBS)
$(SERVER): $(SOBJS)
rm -f $@
- $(CXX) $(LDFLAGS) -o $@ $(SOBJS) $(LIBS)
+ $(CXX) $(LDFLAGS) -o $@ $(SOBJS) $(LIBS) -l$(ICESSL_LIBNAME)
include .depend
diff --git a/cpp/test/IceSSL/configuration/Makefile b/cpp/test/IceSSL/configuration/Makefile
index e8b3203729c..776f8219eea 100644
--- a/cpp/test/IceSSL/configuration/Makefile
+++ b/cpp/test/IceSSL/configuration/Makefile
@@ -31,14 +31,18 @@ GENPIC = no
include $(top_srcdir)/config/Make.rules
+ifneq ($(MinGW), yes)
+ICESSL_LIBNAME = IceSSL
+endif
+
CPPFLAGS := -I. -I../../include $(CPPFLAGS)
$(CLIENT): $(COBJS)
rm -f $@
- $(CXX) $(LDFLAGS) -o $@ $(COBJS) $(LIBS) $(OPENSSL_RPATH_LINK) -lIceSSL
+ $(CXX) $(LDFLAGS) -o $@ $(COBJS) $(LIBS) $(OPENSSL_RPATH_LINK) -l$(ICESSL_LIBNAME)
$(SERVER): $(SOBJS)
rm -f $@
- $(CXX) $(LDFLAGS) -o $@ $(SOBJS) $(LIBS) $(OPENSSL_RPATH_LINK) -lIceSSL
+ $(CXX) $(LDFLAGS) -o $@ $(SOBJS) $(LIBS) $(OPENSSL_RPATH_LINK) -l$(ICESSL_LIBNAME)
include .depend
diff --git a/cpp/test/IceUtil/unicode/Client.cpp b/cpp/test/IceUtil/unicode/Client.cpp
index 3f703e0f7f2..f05cb7646b7 100644
--- a/cpp/test/IceUtil/unicode/Client.cpp
+++ b/cpp/test/IceUtil/unicode/Client.cpp
@@ -23,7 +23,8 @@ using namespace std;
// converts these BOMs back and forth.
//
-#ifdef _WIN32
+//COMPILERFIX: MINGW doesn't support wmain for console applications.
+#if defined(_WIN32) && !defined(__MINGW32__)
int
wmain(int argc, wchar_t* argv[])
@@ -40,7 +41,12 @@ main(int argc, char* argv[])
if(argc > 1)
{
#ifdef _WIN32
+
+# ifdef __MINGW32__
+ dir = argv[1];
+# else
dir = IceUtil::wstringToString(argv[1]);
+# endif
dir += "\\";
#else
dir = argv[1];
@@ -174,6 +180,7 @@ main(int argc, char* argv[])
cout << "ok" << endl;
}
+#ifndef __MINGW32__
{
cout << "testing UTF-8 filename... ";
IceUtilInternal::ifstream fn(dir + "filename.txt");
@@ -200,11 +207,11 @@ main(int argc, char* argv[])
int fd = IceUtilInternal::open(filepath, O_RDONLY);
test(fd > 0);
-#if defined(_MSC_VER) && (_MSC_VER >= 1400)
+# if defined(_MSC_VER) && (_MSC_VER >= 1400)
test(_close(fd) == 0);
-#else
+# else
test(close(fd) == 0);
-#endif
+# endif
FILE* f = IceUtilInternal::fopen(filepath, "r");
test(f != 0);
@@ -245,5 +252,6 @@ main(int argc, char* argv[])
cout << "ok" << endl;
}
+#endif
return EXIT_SUCCESS;
}
diff --git a/cpp/test/Makefile b/cpp/test/Makefile
index 4dbb8f55c7e..a56cf17c9f0 100644
--- a/cpp/test/Makefile
+++ b/cpp/test/Makefile
@@ -14,13 +14,17 @@ include $(top_srcdir)/config/Make.rules
SUBDIRS = IceUtil \
Slice \
Ice \
- IceSSL \
- IceBox \
- IceStorm \
- Freeze \
- FreezeScript \
- Glacier2 \
- IceGrid
+ IceSSL
+
+ifneq ($(MinGW), yes)
+SUBDIRS := $(SUBDIRS) \
+ IceBox \
+ IceStorm \
+ Freeze \
+ FreezeScript \
+ Glacier2 \
+ IceGrid
+endif
$(EVERYTHING)::
@for subdir in $(SUBDIRS); \
diff --git a/distribution/src/thirdparty/README.txt b/distribution/src/thirdparty/README.txt
index 2939f678b00..75ded20af2e 100644
--- a/distribution/src/thirdparty/README.txt
+++ b/distribution/src/thirdparty/README.txt
@@ -178,17 +178,31 @@ bzip2
If you have not already applied the patch for bzip2, please read the
"Patches" section above before continuing.
-To build bzip2, change to the source directory and use the replacement
-makefile included in this archive:
+- Microsoft Visual C++
+
+ To build bzip2, change to the source directory and use the
+ replacement makefile included in this archive:
> nmake /f ..\bzip2\Makefile.mak
-This will build the release and debug versions of the bzip2 DLLs. If
-you are using Visual C++ 6.0, first set the CPP_COMPILER environment
-variable as shown below:
+ This will build the release and debug versions of the bzip2 DLLs. If
+ you are using Visual C++ 6.0, first set the CPP_COMPILER environment
+ variable as shown below:
> set CPP_COMPILER=VC60
+- MinGW
+
+ Open a Cygwin command window and set your PATH environment variable
+ to use the MinGW compiler from the Ruby Development Kit:
+
+ $ export PATH=/cygdrive/c/RubyDevKit-4.5.2/mingw/bin:$PATH
+
+ Change to the bzip2 source directory and use the replacement
+ makefile included in this archive:
+
+ $ make -f ../bzip2/Makefile
+
mcpp
----
@@ -204,10 +218,14 @@ Follow these instructions for building mcpp:
> patch --binary -p0 < ..\noconfig\vc2008.dif
- and for C++Builder 2010 you would run:
+ for C++Builder 2010 you would run:
> patch --binary -p0 < ..\noconfig\bc59.dif
+ and for MinGW:
+
+ > patch --binary -p0 < ..\noconfig\mingw345.dif
+
- Microsoft Visual C++:
Build the mcpp release library:
@@ -223,3 +241,14 @@ Follow these instructions for building mcpp:
Build the mcpp library:
> make -DMCPP_LIB -f..\noconfig\borlandc.mak mcpplib
+
+- MinGW
+
+ Open a Cygwin command window and set your PATH environment variable
+ to use the MinGW compiler from the Ruby Development Kit:
+
+ $ export PATH=/cygdrive/c/RubyDevKit-4.5.2/mingw/bin:$PATH
+
+ Build the mcpp library:
+
+ $ MCPP_LIB=1 make -f ../noconfig/Makefile.mingw mcpplib
diff --git a/distribution/src/thirdparty/bzip2/Makefile b/distribution/src/thirdparty/bzip2/Makefile
new file mode 100755
index 00000000000..fd629ae77f4
--- /dev/null
+++ b/distribution/src/thirdparty/bzip2/Makefile
@@ -0,0 +1,57 @@
+
+# This Makefile builds a shared version of the library,
+# libbz2.so.1.0.6, with soname libbz2.so.1.0,
+# at least on x86-Linux (RedHat 7.2),
+# with gcc-2.96 20000731 (Red Hat Linux 7.1 2.96-98).
+# Please see the README file for some important info
+# about building the library like this.
+
+# ------------------------------------------------------------------
+# This file is part of bzip2/libbzip2, a program and library for
+# lossless, block-sorting data compression.
+#
+# bzip2/libbzip2 version 1.0.6 of 6 September 2010
+# Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
+#
+# Please read the WARNING, DISCLAIMER and PATENTS sections in the
+# README file.
+#
+# This program is released under the terms of the license contained
+# in the file LICENSE.
+# ------------------------------------------------------------------
+
+
+SHELL=/bin/sh
+CC=gcc
+BIGFILES=-D_FILE_OFFSET_BITS=64
+CFLAGS=-Wall -Winline -O2 -g $(BIGFILES)
+
+OBJS= blocksort.o \
+ huffman.o \
+ crctable.o \
+ randtable.o \
+ compress.o \
+ decompress.o \
+ bzlib.o
+
+all: $(OBJS)
+ $(CC) -shared $(OBJS) -o bzip2_mingw.dll
+ $(CC) $(CFLAGS) -o bzip2-shared bzip2.c bzip2_mingw.dll
+
+clean:
+ rm -f $(OBJS) bzip2.o bzip2_mingw.dll bzip2-shared
+
+blocksort.o: blocksort.c
+ $(CC) $(CFLAGS) -c blocksort.c
+huffman.o: huffman.c
+ $(CC) $(CFLAGS) -c huffman.c
+crctable.o: crctable.c
+ $(CC) $(CFLAGS) -c crctable.c
+randtable.o: randtable.c
+ $(CC) $(CFLAGS) -c randtable.c
+compress.o: compress.c
+ $(CC) $(CFLAGS) -c compress.c
+decompress.o: decompress.c
+ $(CC) $(CFLAGS) -c decompress.c
+bzlib.o: bzlib.c
+ $(CC) $(CFLAGS) -c bzlib.c
diff --git a/rb/INSTALL.WINDOWS b/rb/INSTALL.WINDOWS
index c85e4ffdadd..bf75a3dbbba 100644
--- a/rb/INSTALL.WINDOWS
+++ b/rb/INSTALL.WINDOWS
@@ -6,7 +6,7 @@ Requirements
Operating System
----------------
-Ice for Ruby is only supported on Windows XP.
+Ice for Ruby is only supported on Windows XP and Windows 7.
Build Environment
@@ -15,17 +15,18 @@ Build Environment
To build Ice for Ruby you must have the following:
- Ice @ver@ for C++
- - Visual C++ 6.0 SP5 with STLport 4.6.2 (or later)*
- - Ruby 1.8.6
+ - Ruby 1.9.3
+ - MinGW from Ruby Development Kit
+ - Cygwin with make package
-* Ruby requires Visual C++ 6.0, therefore it is the only compiler
- supported by Ice for Ruby.
+The Ruby distribution for Windows uses the MinGW compiler, therefore
+MinGW is the only compiler supported by Ice for Ruby.
The instructions in this file make the following assumptions about
your build environment:
-1. You have installed the Ice @ver@ for Visual C++ 6.0 distribution
- using the installer available at the link below:
+1. You have installed the Ice @ver@ distribution using the installer
+ available at the link below:
http://www.zeroc.com/download.html
@@ -33,12 +34,24 @@ your build environment:
C:\Program Files\ZeroC\Ice-@ver@
-2. You have installed Ruby using the Windows installer available at
- RubyForge:
+2. You have installed Ruby 1.9.3 using the Windows installer available
+ at RubyInstaller:
- http://rubyforge.org/projects/rubyinstaller/
+ http://rubyinstaller.org/downloads/
+
+ The default installation directory is C:\Ruby193
+
+3. You have installed the Ruby Development Kit 4.5.2 available at
+ RubyInstaller:
+
+ http://rubyinstaller.org/downloads/
+
+4. You have installed Cygwin and included the "make" package in your
+ installation. See the link below for more information on installing
+ Cygwin:
+
+ http://cygwin.com/install.html
- The default installation directory is C:\ruby.
If you selected different installation directories, you will need to
modify the relevant path names in the steps below to match your
@@ -55,42 +68,31 @@ Compiling Ice for Ruby
Follow these steps to build the Ice extension for Ruby:
-1) Open a command prompt that supports command-line compilation with
- Visual C++. For example, you can execute the Visual C++ batch file
- vcvars32.bat to configure your environment. Alternatively, you can
- start a "Visual Studio Command Prompt" by selecting the appropriate
- entry from the Visual Studio program group in your Start menu.
-
-2) Change to the Ice for Ruby source directory:
+1) Open a Cygwin command prompt
- > cd Ice-@ver@\rb
+2) Add Ruby to your PATH:
-3) If you installed the Ice @ver@ for Visual C++ 6.0 distribution in a
- non-standard location, set the ICE_HOME environment variable with
- the Ice installation directory. For example:
+ $ export PATH=/cygdrive/c/Ruby193/bin:$PATH
- > set ICE_HOME=C:\Ice-@ver@
+3) Add MinGW from the Ruby Development Kit to your PATH:
-4) Edit config\Make.rules.mak and review the settings. In particular
- you must set CPP_COMPILER to the appropriate compiler.
+ $ export PATH=/cygdrive/c/RubyDevKit-4.5.2/mingw/bin:$PATH
-5) Run nmake:
+4) Change to the Ice for Ruby source directory:
- > nmake /f Makefile.mak
-
-If no errors occurred, you can now begin using Ice for Ruby.
+ $ cd Ice-@ver@/rb
-NOTES:
+5) If you installed the Ice @ver@ distribution in a non-standard
+ location, set the ICE_HOME environment variable with the Ice
+ installation directory. For example:
- * Normally you should build with OPTIMIZE=yes. If you are using a
- Ruby interpreter that was compiled in debug mode, set OPTIMIZE=no
- and edit ruby/Ice.rb to change the line below from
+ $ export ICE_HOME=C:\Ice-@ver@
- require "IceRuby"
+6) Run make:
- to the following:
+ $ make
- require "IceRubyd"
+If no errors occurred, you can now begin using Ice for Ruby.
Running the tests
@@ -104,8 +106,8 @@ test suite. Python is required to run the test suite:
The test suites require that the Ice for C++ tests be built in the cpp
subdirectory of this source distribution.
-Open a command window and change to the top-level directory. At the
-command prompt, execute:
+Open a Windows (not Cygwin) command window and change to the top-level
+directory. At the command prompt, execute:
> python allTests.py
@@ -124,12 +126,12 @@ Installation
You can perform an automated installation with the following command:
- > nmake /f Makefile.mak install
+ $ make install
-This process uses the "prefix" variable in config\Make.rules.mak as
+This process uses the "prefix" variable in config\Make.rules as
the installation's root directory. The subdirectory <prefix>\ruby is
created as a copy of the local "ruby" directory and contains the Ice
-for Ruby extension library (IceRuby.dll) as well as Ruby source code.
+for Ruby extension library (IceRuby.so) as well as Ruby source code.
Using this installation method requires that you modify your
environment as described in "Using Ice for Ruby" below.
@@ -218,23 +220,3 @@ ZeroC to implement server-side functionality, therefore Ice for Ruby
can only be used in client applications. If you have a need for this
feature and wish to sponsor its development, please contact us at
info@zeroc.com.
-
-
-OpenSSL Compatibility Issue
----------------------------
-
-The Ruby installer includes versions of the OpenSSL DLLs that are not
-compatible with the ones supplied with Ice. If you intend to use SSL
-in your Ice for Ruby applications, you will need to remove or rename
-the following files in the Ruby installation directory:
-
- libeay32.dll
- ssleay32.dll
-
-If you used the default installation directory, these files are
-located in C:\ruby\bin.
-
-Also be aware that the Ruby installer inserts C:\ruby\bin at the
-beginning of the system PATH, therefore the DLLs listed above can also
-have an adverse impact on other Ice language mappings that use
-OpenSSL, such as C++ and Python.
diff --git a/rb/Makefile.mak b/rb/Makefile.mak
deleted file mode 100644
index dc4f3b4e62d..00000000000
--- a/rb/Makefile.mak
+++ /dev/null
@@ -1,27 +0,0 @@
-# **********************************************************************
-#
-# Copyright (c) 2003-2012 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-top_srcdir = .
-
-!include $(top_srcdir)\config\Make.rules.mak
-
-SUBDIRS = src ruby
-
-install:: install-common
- @if not exist "$(install_rubydir)" \
- @echo "Creating $(install_rubydir)..." && \
- mkdir "$(install_rubydir)"
-
-$(EVERYTHING)::
- @for %i in ( $(SUBDIRS) ) do \
- @echo "making $@ in %i" && \
- cmd /c "cd %i && $(MAKE) -nologo -f Makefile.mak $@" || exit 1
-
-test::
- @python $(top_srcdir)/allTests.py
diff --git a/rb/allTests.py b/rb/allTests.py
index ab2686e47e0..2b918abcc4c 100755
--- a/rb/allTests.py
+++ b/rb/allTests.py
@@ -35,7 +35,7 @@ tests = [
("Ice/location", ["core"]),
("Ice/objects", ["core"]),
("Ice/proxy", ["core"]),
- ("Ice/properties", ["once"]),
+ ("Ice/properties", ["once", "nowin32"]),
("Ice/operations", ["core"]),
("Ice/retry", ["core"]),
("Ice/timeout", ["core"]),
diff --git a/rb/config/Make.rules b/rb/config/Make.rules
index aa99750538d..8085cc1fbf5 100644
--- a/rb/config/Make.rules
+++ b/rb/config/Make.rules
@@ -34,6 +34,13 @@ embedded_runpath_prefix ?= /opt/Ice-$(VERSION_MAJOR).$(VERSION_MINOR)
#LP64 := yes
#
+# If you have not built Ice for C++ from the cpp subdirectory or if
+# you have installed the Ice @ver@ for C++ development kit in a
+# non-standard location, set the ICE_HOME to the installation directory.
+#
+#ICE_HOME = C:\Program Files\ZeroC\Ice-$(VERSION)
+
+#
# If the Ruby interpreter is in your PATH, the settings below will
# work properly in most cases. If you want to use a particular
# installation of Ruby, set RUBY_HOME with the installation directory.
@@ -45,24 +52,46 @@ else
RUBY = ruby
endif
-RUBY_MAJOR_VERSION = $(shell $(RUBY) -e 'require "rbconfig"; puts Config::expand("$$(MAJOR)")')
-RUBY_MINOR_VERSION = $(shell $(RUBY) -e 'require "rbconfig"; puts Config::expand("$$(MINOR)")')
+ifeq ($(RUBY18), yes)
+ RUBY_MAJOR_VERSION = $(shell $(RUBY) -e 'require "rbconfig"; puts Config::expand("$$(MAJOR)")')
+ RUBY_MINOR_VERSION = $(shell $(RUBY) -e 'require "rbconfig"; puts Config::expand("$$(MINOR)")')
-ifeq ("$(RUBY_MAJOR_VERSION).$(RUBY_MINOR_VERSION)", "1.8")
- RUBY_FLAGS = -I$(shell $(RUBY) -e 'require "rbconfig"; puts Config::expand("$$(archdir)")')
-else
- RUBY_FLAGS = -I$(shell $(RUBY) -e 'require "rbconfig"; puts Config::expand("$$(rubyhdrdir)")') \
- -I$(shell $(RUBY) -e 'require "rbconfig"; puts Config::expand("$$(rubyhdrdir)/$$(arch)")')
-endif
+ ifeq ("$(RUBY_MAJOR_VERSION).$(RUBY_MINOR_VERSION)", "1.8")
+ RUBY_FLAGS = -I$(shell $(RUBY) -e 'require "rbconfig"; puts Config::expand("$$(archdir)")')
+ else
+ RUBY_FLAGS = -I$(shell $(RUBY) -e 'require "rbconfig"; puts Config::expand("$$(rubyhdrdir)")') \
+ -I$(shell $(RUBY) -e 'require "rbconfig"; puts Config::expand("$$(rubyhdrdir)/$$(arch)")')
+ endif
-RUBY_LIB_DIR = $(shell $(RUBY) -e 'require "rbconfig"; puts Config::expand("$$(libdir)")')
+ RUBY_LIB_DIR = $(shell $(RUBY) -e 'require "rbconfig"; puts Config::expand("$$(libdir)")')
-RUBY_SHARED = $(shell $(RUBY) -e 'require "rbconfig"; puts Config::MAKEFILE_CONFIG["ENABLE_SHARED"]')
+ RUBY_SHARED = $(shell $(RUBY) -e 'require "rbconfig"; puts Config::MAKEFILE_CONFIG["ENABLE_SHARED"]')
-ifeq ("$(RUBY_SHARED)","yes")
- RUBY_LIB = $(shell $(RUBY) -e 'require "rbconfig"; puts Config::expand("-l$$(RUBY_SO_NAME)")')
+ ifeq ("$(RUBY_SHARED)","yes")
+ RUBY_LIB = $(shell $(RUBY) -e 'require "rbconfig"; puts Config::expand("-l$$(RUBY_SO_NAME)")')
+ else
+ RUBY_LIB = $(shell $(RUBY) -e 'require "rbconfig"; puts Config::expand("-l$$(RUBY_SO_NAME)-static")')
+ endif
else
- RUBY_LIB = $(shell $(RUBY) -e 'require "rbconfig"; puts Config::expand("-l$$(RUBY_SO_NAME)-static")')
+ RUBY_MAJOR_VERSION = $(shell $(RUBY) -e 'require "rbconfig"; puts RbConfig::expand("$$(MAJOR)")')
+ RUBY_MINOR_VERSION = $(shell $(RUBY) -e 'require "rbconfig"; puts RbConfig::expand("$$(MINOR)")')
+
+ ifeq ("$(RUBY_MAJOR_VERSION).$(RUBY_MINOR_VERSION)", "1.8")
+ RUBY_FLAGS = -I$(shell $(RUBY) -e 'require "rbconfig"; puts RbConfig::expand("$$(archdir)")')
+ else
+ RUBY_FLAGS = -I$(shell $(RUBY) -e 'require "rbconfig"; puts RbConfig::expand("$$(rubyhdrdir)")') \
+ -I$(shell $(RUBY) -e 'require "rbconfig"; puts RbConfig::expand("$$(rubyhdrdir)/$$(arch)")')
+ endif
+
+ RUBY_LIB_DIR = $(shell $(RUBY) -e 'require "rbconfig"; puts RbConfig::expand("$$(libdir)")')
+
+ RUBY_SHARED = $(shell $(RUBY) -e 'require "rbconfig"; puts RbConfig::MAKEFILE_CONFIG["ENABLE_SHARED"]')
+
+ ifeq ("$(RUBY_SHARED)","yes")
+ RUBY_LIB = $(shell $(RUBY) -e 'require "rbconfig"; puts RbConfig::expand("-l$$(RUBY_SO_NAME)")')
+ else
+ RUBY_LIB = $(shell $(RUBY) -e 'require "rbconfig"; puts RbConfig::expand("-l$$(RUBY_SO_NAME)-static")')
+ endif
endif
RUBY_LIBS = -L$(RUBY_LIB_DIR) $(RUBY_LIB)
@@ -85,7 +114,14 @@ RUBY_LIBS = -L$(RUBY_LIB_DIR) $(RUBY_LIB)
#
ice_language = rb
ice_require_cpp = yes
-slice_translator = slice2rb
+
+include $(top_srcdir)/../cpp/config/Make.rules.common
+
+ifeq ($(MinGW), yes)
+ slice_translator = slice2rb.exe
+else
+ slice_translator = slice2rb
+endif
ifeq ($(shell test -f $(top_srcdir)/config/Make.common.rules && echo 0),0)
include $(top_srcdir)/config/Make.common.rules
@@ -93,36 +129,61 @@ else
include $(top_srcdir)/../config/Make.common.rules
endif
-libdir = $(top_srcdir)/ruby
+libdir = $(top_srcdir)/ruby
install_rubydir = $(prefix)/ruby
-install_libdir = $(prefix)/ruby
+install_libdir = $(prefix)/ruby
+install_bindir = $(prefix)/$(binsubdir)
#
# Platform specific definitions
#
-ifeq ($(shell test -f $(top_srcdir)/config/Make.rules.$(UNAME) && echo 0),0)
- configdir = $(top_srcdir)/config
+ifeq ($(MinGW), yes)
+ include $(top_srcdir)/../cpp/config/Make.rules.MINGW
else
- configdir = $(top_srcdir)/../cpp/config
-endif
-include $(configdir)/Make.rules.$(UNAME)
-
-ifdef ice_src_dist
- ifeq ($(ice_cpp_dir), $(ice_dir)/cpp)
- ICE_LIB_DIR = -L$(ice_cpp_dir)/lib
- else
- ICE_LIB_DIR = -L$(ice_cpp_dir)/$(libsubdir)
- endif
- ICE_FLAGS = -I$(ice_cpp_dir)/include
+ ifeq ($(shell test -f $(top_srcdir)/config/Make.rules.$(UNAME) && echo 0),0)
+ configdir = $(top_srcdir)/config
+ else
+ configdir = $(top_srcdir)/../cpp/config
+ endif
+ include $(configdir)/Make.rules.$(UNAME)
endif
-ifdef ice_bin_dist
- ICE_LIB_DIR = -L$(ice_dir)/$(libsubdir)
- ICE_FLAGS = -I$(ice_dir)/include
+
+ifeq ($(MinGW), yes)
+ ice_cpp_dir_win := $(shell $(top_srcdir)/../cpp/config/cygpath-win.sh $(ice_cpp_dir))
+ ifdef ice_src_dist
+ ifeq ($(ice_cpp_dir), $(ice_dir)/cpp)
+ ICE_BIN_DIR = -L"$(ice_cpp_dir_win)/bin"
+ else
+ ICE_BIN_DIR = -L"$(ice_cpp_dir_win)/$(binsubdir)"
+ endif
+ ICE_FLAGS = -I"$(ice_cpp_dir_win)\include"
+ endif
+
+ ifdef ice_bin_dist
+ ice_dir_win := $(shell $(top_srcdir)/../cpp/config/cygpath-win.sh $(ice_dir))
+ ICE_BIN_DIR = -L"$(ice_dir_win)/$(binsubdir)"
+ ICE_FLAGS = -I"$(ice_dir_win)/include"
+ endif
+ ICE_LIBS = $(ICE_BIN_DIR) -l$(ICE_LIBNAME) -l$(SLICE_LIBNAME) -l$(ICEUTIL_LIBNAME)
+else
+ ifdef ice_src_dist
+ ifeq ($(ice_cpp_dir), $(ice_dir)/cpp)
+ ICE_LIB_DIR = -L$(ice_cpp_dir)/lib
+ else
+ ICE_LIB_DIR = -L$(ice_cpp_dir)/$(libsubdir)
+ endif
+ ICE_FLAGS = -I$(ice_cpp_dir)/include
+ endif
+ ifdef ice_bin_dist
+ ICE_LIB_DIR = -L$(ice_dir)/$(libsubdir)
+ ICE_FLAGS = -I$(ice_dir)/include
+ endif
+ ICE_LIBS = $(ICE_LIB_DIR) -lIce -lSlice -lIceUtil
endif
-ICE_LIBS = $(ICE_LIB_DIR) -lIce -lSlice -lIceUtil
+
ifneq ($(embedded_runpath_prefix),)
- runpath_libdir := $(embedded_runpath_prefix)/$(libsubdir)
+ runpath_libdir := $(embedded_runpath_prefix)/$(libsubdir)
endif
CPPFLAGS =
@@ -131,16 +192,28 @@ SLICE2RBFLAGS = $(ICECPPFLAGS)
LDFLAGS = $(LDPLATFORMFLAGS) $(CXXFLAGS) -L$(libdir)
ifdef ice_src_dist
- ifeq ($(ice_cpp_dir), $(ice_dir)/cpp)
- SLICE2RB = $(ice_cpp_dir)/bin/slice2rb
- SLICEPARSERLIB = $(ice_cpp_dir)/lib/$(call mklibfilename,Slice,$(VERSION))
- else
- SLICE2RB = $(ice_cpp_dir)/$(binsubdir)/slice2rb
- SLICEPARSERLIB = $(ice_cpp_dir)/$(libsubdir)/$(call mklibfilename,Slice,$(VERSION))
- endif
+ ifeq ($(ice_cpp_dir), $(ice_dir)/cpp)
+ ifeq ($(MinGW), yes)
+ SLICEPARSERLIB = $(ice_cpp_dir)/bin/$(SLICE_LIBNAME).dll
+ else
+ SLICEPARSERLIB = $(ice_cpp_dir)/lib/$(call mklibfilename,Slice,$(VERSION))
+ endif
+ SLICE2RB = $(ice_cpp_dir)/bin/$(slice_translator)
+ else
+ ifeq ($(MinGW), yes)
+ SLICEPARSERLIB = $(ice_cpp_dir)/$(binsubdir)/$(SLICE_LIBNAME).dll
+ else
+ SLICEPARSERLIB = $(ice_cpp_dir)/$(libsubdir)/$(call mklibfilename,Slice,$(VERSION))
+ endif
+ SLICE2RB = $(ice_cpp_dir)/$(binsubdir)/$(slice_translator)
+ endif
else
- SLICE2RB = $(ice_dir)/$(binsubdir)/slice2rb
- SLICEPARSERLIB = $(ice_dir)/$(libsubdir)/$(call mklibfilename,Slice,$(VERSION))
+ ifeq ($(MinGW), yes)
+ SLICEPARSERLIB = $(ice_dir)/$(binsubdir)/$(SLICE_LIBNAME).dll
+ else
+ SLICEPARSERLIB = $(ice_dir)/$(libsubdir)/$(call mklibfilename,Slice,$(VERSION))
+ endif
+ SLICE2CPP = $(ice_dir)/$(binsubdir)/$(slice_translator)
endif
#
diff --git a/rb/config/Make.rules.mak b/rb/config/Make.rules.mak
deleted file mode 100644
index b7844e8c160..00000000000
--- a/rb/config/Make.rules.mak
+++ /dev/null
@@ -1,177 +0,0 @@
-# **********************************************************************
-#
-# Copyright (c) 2003-2012 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-#
-# Select an installation base directory. The directory will be created
-# if it does not exist.
-#
-
-prefix = C:\Ice-$(VERSION)
-
-#
-# Define OPTIMIZE as yes if you want to build with optimization.
-# Otherwise the Ice extension is built with debug information.
-#
-
-OPTIMIZE = yes
-
-#
-# Specify your C++ compiler. Supported values are:
-# VC60
-#
-!if "$(CPP_COMPILER)" == ""
-CPP_COMPILER = VC60
-!endif
-
-#
-# Set RUBY_HOME to your Ruby installation directory.
-#
-!if "$(RUBY_HOME)" == ""
-RUBY_HOME = C:\ruby
-!endif
-
-#
-# STLPort is required if using MSVC++ 6.0. Change if STLPort
-# is located in a different location.
-#
-!if "$(CPP_COMPILER)" == "VC60" && "$(STLPORT_HOME)" == ""
-!if "$(THIRDPARTY_HOME)" != ""
-STLPORT_HOME = $(THIRDPARTY_HOME)
-!else
-STLPORT_HOME = C:\Program Files\ZeroC\Ice-$(VERSION)-ThirdParty
-!endif
-!endif
-
-
-# ----------------------------------------------------------------------
-# Don't change anything below this line!
-# ----------------------------------------------------------------------
-
-#
-# Common definitions
-#
-ice_language = rb
-ice_require_cpp = yes
-slice_translator = slice2rb.exe
-
-!if exist ($(top_srcdir)\..\config\Make.common.rules.mak)
-!include $(top_srcdir)\..\config\Make.common.rules.mak
-!else
-!include $(top_srcdir)\config\Make.common.rules.mak
-!endif
-
-libdir = $(top_srcdir)\ruby
-install_rubydir = $(prefix)\ruby
-install_libdir = $(prefix)\ruby
-
-!if "$(CPP_COMPILER)" != "VC60"
-!error Invalid setting for CPP_COMPILER: $(CPP_COMPILER)
-!endif
-
-!include $(top_srcdir)\..\cpp\config\Make.rules.msvc
-
-!if "$(CPP_COMPILER)" == "VC60"
-libsuff = \vc6
-!else
-libsuff = $(x64suffix)
-!endif
-
-!if "$(ice_src_dist)" != ""
-!if "$(STLPORT_HOME)" != ""
-CPPFLAGS = -I"$(STLPORT_HOME)\include\stlport" $(CPPFLAGS)
-LDFLAGS = /LIBPATH:"$(STLPORT_HOME)\lib$(libsuff)" $(LDFLAGS)
-!endif
-!else
-!if "$(CPP_COMPILER)" == "VC60"
-CPPFLAGS = -I"$(ice_dir)\include\stlport" $(CPPFLAGS)
-!endif
-!endif
-
-!if "$(OPTIMIZE)" != "yes"
-LIBSUFFIX = $(LIBSUFFIX)d
-RCFLAGS = -D_DEBUG
-!endif
-
-ICE_LIBS = ice$(LIBSUFFIX).lib iceutil$(LIBSUFFIX).lib slice$(LIBSUFFIX).lib
-
-!if "$(ice_src_dist)" != ""
-ICE_CPPFLAGS = -I"$(ice_cpp_dir)\include"
-!if "$(ice_cpp_dir)" == "$(ice_dir)\cpp"
-ICE_LDFLAGS = /LIBPATH:"$(ice_cpp_dir)\lib"
-!else
-ICE_LDFLAGS = /LIBPATH:"$(ice_cpp_dir)\lib$(libsuff)"
-!endif
-!else
-ICE_CPPFLAGS = -I"$(ice_dir)\include"
-ICE_LDFLAGS = /LIBPATH:"$(ice_dir)\lib$(libsuff)"
-!endif
-
-slicedir = $(ice_dir)\slice
-
-#
-# Ruby 1.8
-#
-RUBY_CPPFLAGS = -I"$(RUBY_HOME)\lib\ruby\1.8\i386-mswin32"
-RUBY_LDFLAGS = /LIBPATH:"$(RUBY_HOME)\lib"
-RUBY_LIBS = msvcrt-ruby18.lib
-
-#
-# Ruby 1.9
-#
-# Without HAVE_VSNPRINTF the Ruby header files declare this function, which causes
-# a compilation error in Util.cpp.
-#
-#RUBY_CPPFLAGS = -I"$(RUBY_HOME)\include\ruby-1.9.1" -I"$(RUBY_HOME)\include\ruby-1.9.1\i386-mswin32" -DWIN32_LEAN_AND_MEAN -DHAVE_VSNPRINTF
-#RUBY_LDFLAGS = /LIBPATH:"$(RUBY_HOME)\lib"
-#RUBY_LIBS = msvcrt-ruby191.lib
-
-ICECPPFLAGS = -I"$(slicedir)"
-SLICE2RBFLAGS = $(ICECPPFLAGS)
-
-!if "$(ice_src_dist)" != ""
-!if "$(ice_cpp_dir)" == "$(ice_dir)\cpp"
-SLICE2RB = $(ice_cpp_dir)\bin\slice2rb.exe
-SLICEPARSERLIB = $(ice_cpp_dir)\lib\slice.lib
-!if !exist ("$(SLICEPARSERLIB)")
-SLICEPARSERLIB = $(ice_cpp_dir)\lib\sliced.lib
-!endif
-!else
-SLICE2RB = $(ice_cpp_dir)\bin$(x64suffix)\slice2rb.exe
-SLICEPARSERLIB = $(ice_cpp_dir)\lib$(libsuff)\slice.lib
-!if !exist ("$(SLICEPARSERLIB)")
-SLICEPARSERLIB = $(ice_cpp_dir)\lib$(libsuff)\sliced.lib
-!endif
-!endif
-!else
-SLICE2RB = $(ice_dir)\bin$(x64suffix)\slice2rb.exe
-SLICEPARSERLIB = $(ice_dir)\lib$(libsuff)\slice.lib
-!if !exist ("$(SLICEPARSERLIB)")
-SLICEPARSERLIB = $(ice_dir)\lib$(libsuff)\sliced.lib
-!endif
-!endif
-
-EVERYTHING = all clean install
-
-.SUFFIXES:
-.SUFFIXES: .cpp .obj .rb .res .rc
-
-all:: $(SRCS)
-
-.cpp.obj::
- $(CXX) /c $(CPPFLAGS) $(CXXFLAGS) $<
-
-.rc.res:
- rc $(RCFLAGS) $<
-
-clean::
- del /q $(TARGETS) core *.obj *.bak
-
-all:: $(SRCS) $(TARGETS)
-
-install::
diff --git a/rb/ruby/Makefile.mak b/rb/ruby/Makefile.mak
deleted file mode 100644
index 0ba68796c66..00000000000
--- a/rb/ruby/Makefile.mak
+++ /dev/null
@@ -1,122 +0,0 @@
-# **********************************************************************
-#
-# Copyright (c) 2003-2012 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-top_srcdir = ..
-
-!include $(top_srcdir)\config\Make.rules.mak
-
-#
-# IMPORTANT: If you add or remove Slice files, you also need to check Ice.rb!
-#
-ICE_SRCS = Ice\LocalException.rb \
- Ice\Communicator.rb \
- Ice\CommunicatorF.rb \
- Ice\Logger.rb \
- Ice\LoggerF.rb \
- Ice\BuiltinSequences.rb \
- Ice\ObjectAdapterF.rb \
- Ice\Properties.rb \
- Ice\PropertiesF.rb \
- Ice\ObjectFactory.rb \
- Ice\ObjectFactoryF.rb \
- Ice\Identity.rb \
- Ice\Current.rb \
- Ice\ImplicitContextF.rb \
- Ice\ImplicitContext.rb \
- Ice\Router.rb \
- Ice\RouterF.rb \
- Ice\Plugin.rb \
- Ice\PluginF.rb \
- Ice\Locator.rb \
- Ice\LocatorF.rb \
- Ice\StatsF.rb \
- Ice\Stats.rb \
- Ice\Process.rb \
- Ice\ProcessF.rb \
- Ice\FacetMap.rb \
- Ice\Connection.rb \
- Ice\ConnectionF.rb \
- Ice\SliceChecksumDict.rb \
- Ice\Endpoint.rb \
- Ice\EndpointF.rb \
- Ice\EndpointTypes.rb
-
-#
-# IMPORTANT: If you add or remove Slice files, you also need to check Glacier2.rb!
-#
-GLACIER2_SRCS = Glacier2\RouterF.rb \
- Glacier2\Router.rb \
- Glacier2\Session.rb \
- Glacier2\PermissionsVerifierF.rb \
- Glacier2\PermissionsVerifier.rb \
- Glacier2\SSLInfo.rb
-
-#
-# IMPORTANT: If you add or remove Slice files, you also need to check IceBox.rb!
-#
-ICEBOX_SRCS = IceBox\IceBox.rb
-
-#
-# IMPORTANT: If you add or remove Slice files, you also need to check IceGrid.rb!
-#
-ICEGRID_SRCS = IceGrid\Admin.rb \
- IceGrid\Descriptor.rb \
- IceGrid\Exception.rb \
- IceGrid\FileParser.rb \
- IceGrid\Locator.rb \
- IceGrid\Observer.rb \
- IceGrid\Query.rb \
- IceGrid\Registry.rb \
- IceGrid\Session.rb \
- IceGrid\UserAccountMapper.rb
-
-#
-# IMPORTANT: If you add or remove Slice files, you also need to check IcePatch2.rb!
-#
-ICEPATCH2_SRCS = IcePatch2\FileInfo.rb \
- IcePatch2\FileServer.rb
-
-#
-# IMPORTANT: If you add or remove Slice files, you also need to check IceStorm.rb!
-#
-ICESTORM_SRCS = IceStorm\IceStorm.rb
-
-ALL_SRCS = $(ICE_SRCS) \
- $(GLACIER2_SRCS) \
- $(ICEBOX_SRCS) \
- $(ICEGRID_SRCS) \
- $(ICEPATCH2_SRCS) \
- $(ICESTORM_SRCS)
-
-MODULES = Glacier2 Ice IceBox IceGrid IcePatch2 IceStorm
-
-SLICE2RBFLAGS = $(SLICE2RBFLAGS) --ice
-
-all:: $(ALL_SRCS)
-
-$(MODULES):
- -mkdir $@
-
-$(ALL_SRCS): $(MODULES) {$(slicedir)}$*.ice "$(SLICE2RB)" "$(SLICEPARSERLIB)"
- -"$(SLICE2RB)" $(SLICE2RBFLAGS) --output-dir $(*D) $(slicedir)\$*.ice
-
-
-install:: all
- @echo "Installing generated code"
- copy *.rb "$(install_rubydir)"
- @for %i in ( $(MODULES) ) do \
- @if not exist "$(install_rubydir)\%i" \
- mkdir "$(install_rubydir)\%i"
- @for %i in ( $(MODULES) ) do \
- copy %i\* "$(install_rubydir)\%i"
-
-clean::
- -rmdir /S /Q $(MODULES)
-
-include .depend.mak
diff --git a/rb/src/IceRuby/IceRuby.rc b/rb/src/IceRuby/IceRuby.rc
deleted file mode 100644
index 86cd70fb0f6..00000000000
--- a/rb/src/IceRuby/IceRuby.rc
+++ /dev/null
@@ -1,38 +0,0 @@
-#include "winver.h"
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION 3,4,2,0
- PRODUCTVERSION 3,4,2,0
- FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
-#ifdef _DEBUG
- FILEFLAGS VS_FF_DEBUG
- #define INTERNALNAME "IceRubyd\0"
- #define ORIGINALFILENAME "IceRubyd.so\0"
-#else
- FILEFLAGS 0x0L
- #define INTERNALNAME "IceRuby\0"
- #define ORIGINALFILENAME "IceRuby.so\0"
-#endif
- FILEOS 0x4L
- FILETYPE VFT_DLL
- FILESUBTYPE 0x0L
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "040904e4"
- BEGIN
- VALUE "CompanyName", "ZeroC, Inc.\0"
- VALUE "FileDescription", "Ice for Ruby Extension\0"
- VALUE "FileVersion", "3.4.2\0"
- VALUE "InternalName", INTERNALNAME
- VALUE "LegalCopyright", "Copyright (c) 2003-2012 ZeroC, Inc. All rights reserved.\0"
- VALUE "OriginalFilename", ORIGINALFILENAME
- VALUE "ProductName", "Ice\0"
- VALUE "ProductVersion", "3.4.2\0"
- END
- END
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x409, 1252
- END
-END
diff --git a/rb/src/IceRuby/Makefile b/rb/src/IceRuby/Makefile
index 946189e60f2..b57de8b3252 100644
--- a/rb/src/IceRuby/Makefile
+++ b/rb/src/IceRuby/Makefile
@@ -9,11 +9,17 @@
top_srcdir = ../..
-LIBFILENAME = $(call mkrblibfilename,IceRuby,$(VERSION))
-SONAME = $(call mkrbsoname,IceRuby,$(SOVERSION))
-LIBNAME = $(call mkrblibname,IceRuby)
+include $(top_srcdir)/../cpp/config/Make.rules.common
-TARGETS = $(call mklibtargets,$(libdir)/$(LIBFILENAME),$(libdir)/$(SONAME),$(libdir)/$(LIBNAME))
+ifeq ($(MinGW), yes)
+ DLLNAME = $(libdir)/IceRuby.so
+ TARGETS = $(DLLNAME)
+else
+ LIBFILENAME = $(call mkrblibfilename,IceRuby,$(VERSION))
+ SONAME = $(call mkrbsoname,IceRuby,$(SOVERSION))
+ LIBNAME = $(call mkrblibname,IceRuby)
+ TARGETS = $(call mklibtargets,$(libdir)/$(LIBFILENAME),$(libdir)/$(SONAME),$(libdir)/$(LIBNAME))
+endif
OBJS = Connection.o \
Communicator.o \
@@ -34,8 +40,17 @@ SRCS = $(OBJS:.o=.cpp)
include $(top_srcdir)/config/Make.rules
CPPFLAGS := -I. -I.. $(CPPFLAGS) $(ICE_FLAGS) $(RUBY_FLAGS)
+LINKWITH := -L"$(libdir)" $(ICE_LIBS) $(RUBY_LIBS) $(CXXLIBS)
-LINKWITH := -L$(libdir) $(ICE_LIBS) $(RUBY_LIBS) $(CXXLIBS)
+ifeq ($(MinGW), yes)
+
+$(DLLNAME): $(OBJS)
+ $(CXX) -shared $(LDFLAGS) -o $(DLLNAME) $(OBJS) $(LINKWITH)
+
+install:: all
+ $(call installprogram,$(DLLNAME),$(install_libdir))
+
+else
$(libdir)/$(LIBFILENAME): $(OBJS)
rm -f $@
@@ -52,4 +67,6 @@ $(libdir)/$(LIBNAME): $(libdir)/$(SONAME)
install:: all
$(call installlib,$(install_libdir),$(libdir),$(LIBFILENAME),$(SONAME),$(LIBNAME))
-include .depend
+endif
+
+#include .depend
diff --git a/rb/src/IceRuby/Makefile.mak b/rb/src/IceRuby/Makefile.mak
deleted file mode 100644
index 0301b08d0bb..00000000000
--- a/rb/src/IceRuby/Makefile.mak
+++ /dev/null
@@ -1,55 +0,0 @@
-# **********************************************************************
-#
-# Copyright (c) 2003-2012 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-top_srcdir = ..\..
-
-LIBNAME = IceRuby$(LIBSUFFIX).lib
-DLLNAME = $(libdir)\IceRuby$(LIBSUFFIX).so
-
-TARGETS = $(LIBNAME) $(DLLNAME)
-
-OBJS = Connection.obj \
- Communicator.obj \
- Endpoint.obj \
- Init.obj \
- ImplicitContext.obj \
- Logger.obj \
- ObjectFactory.obj \
- Operation.obj \
- Properties.obj \
- Proxy.obj \
- Slice.obj \
- Types.obj \
- Util.obj
-
-SRCS = $(OBJS:.obj=.cpp)
-
-!include $(top_srcdir)\config\Make.rules.mak
-
-CPPFLAGS = -I. -I.. $(CPPFLAGS) $(ICE_CPPFLAGS) $(RUBY_CPPFLAGS)
-!if "$(OPTIMIZE)" != "yes"
-PDBFLAGS = /pdb:$(LIBNAME:.lib=.pdb)
-!endif
-
-LINKWITH = $(ICE_LIBS) $(RUBY_LIBS) $(CXXLIBS)
-
-$(LIBNAME): $(DLLNAME)
-
-$(DLLNAME): $(OBJS) IceRuby.res
- $(LINK) $(RUBY_LDFLAGS) $(ICE_LDFLAGS) $(LD_DLLFLAGS) $(PDBFLAGS) /export:Init_IceRuby $(OBJS) \
- $(PREOUT)$(DLLNAME) $(PRELIBS)$(LINKWITH) IceRuby.res
- move $(DLLNAME:.so=.lib) $(LIBNAME)
-
-clean::
- -del /q IceRuby.res
-
-install:: all
- copy $(DLLNAME) "$(install_libdir)"
-
-!include .depend.mak
diff --git a/rb/src/IceRuby/Types.cpp b/rb/src/IceRuby/Types.cpp
index f9648123349..cb37125bff7 100644
--- a/rb/src/IceRuby/Types.cpp
+++ b/rb/src/IceRuby/Types.cpp
@@ -840,11 +840,7 @@ IceRuby::SequenceInfo::marshalPrimitiveSequence(const PrimitiveInfoPtr& pi, VALU
{
seq[i] = RTEST(RARRAY_PTR(arr)[i]);
}
-#if defined(_MSC_VER) && (_MSC_VER < 1300)
- os->writeBoolSeq(seq);
-#else
os->write(seq);
-#endif
break;
}
case PrimitiveInfo::KindByte:
diff --git a/rb/src/IceRuby/Util.cpp b/rb/src/IceRuby/Util.cpp
index 0674c80f352..e842e1bb67e 100644
--- a/rb/src/IceRuby/Util.cpp
+++ b/rb/src/IceRuby/Util.cpp
@@ -11,6 +11,10 @@
#include <Ice/LocalException.h>
#include <stdarg.h>
+#ifdef HAVE_RUBY_ENCODING_H
+# include <ruby/encoding.h>
+#endif
+
using namespace std;
using namespace IceRuby;
@@ -106,7 +110,11 @@ IceRuby::getString(VALUE val)
VALUE
IceRuby::createString(const string& str)
{
+#ifdef HAVE_RUBY_ENCODING_H
+ return callRuby(rb_enc_str_new, str.c_str(), static_cast<long>(str.size()), rb_utf8_encoding());
+#else
return callRuby(rb_str_new, str.c_str(), static_cast<long>(str.size()));
+#endif
}
long
diff --git a/rb/src/Makefile.mak b/rb/src/Makefile.mak
deleted file mode 100644
index b05528da89d..00000000000
--- a/rb/src/Makefile.mak
+++ /dev/null
@@ -1,19 +0,0 @@
-# **********************************************************************
-#
-# Copyright (c) 2003-2012 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-top_srcdir = ..
-
-!include $(top_srcdir)\config\Make.rules.mak
-
-SUBDIRS = IceRuby
-
-$(EVERYTHING)::
- @for %i in ( $(SUBDIRS) ) do \
- @echo "making $@ in %i" && \
- cmd /c "cd %i && $(MAKE) -nologo -f Makefile.mak $@" || exit 1
diff --git a/rb/test/Ice/binding/Client.rb b/rb/test/Ice/binding/Client.rb
index daab03aa8e2..fa9cd722496 100755
--- a/rb/test/Ice/binding/Client.rb
+++ b/rb/test/Ice/binding/Client.rb
@@ -12,7 +12,7 @@ require 'pathname'
require 'Ice'
Ice::loadSlice('Test.ice')
-require 'AllTests'
+require './AllTests'
def run(args, communicator)
allTests(communicator)
diff --git a/rb/test/Ice/checksum/Client.rb b/rb/test/Ice/checksum/Client.rb
index 830d23440a7..c5993d66aaa 100755
--- a/rb/test/Ice/checksum/Client.rb
+++ b/rb/test/Ice/checksum/Client.rb
@@ -17,7 +17,7 @@ if slice_dir.empty?
end
Ice::loadSlice("'-I" + slice_dir + "' --checksum Test.ice CTypes.ice")
-require 'AllTests'
+require './AllTests'
def run(args, communicator)
checksum = allTests(communicator)
diff --git a/rb/test/Ice/defaultValue/Client.rb b/rb/test/Ice/defaultValue/Client.rb
index 1d380e30676..c44195cb286 100755
--- a/rb/test/Ice/defaultValue/Client.rb
+++ b/rb/test/Ice/defaultValue/Client.rb
@@ -12,7 +12,7 @@ require 'pathname'
require 'Ice'
Ice::loadSlice('Test.ice')
-require 'AllTests'
+require './AllTests'
def test(b)
if !b
diff --git a/rb/test/Ice/exceptions/Client.rb b/rb/test/Ice/exceptions/Client.rb
index cfc6e1e0aa5..d1ddfb2adce 100755
--- a/rb/test/Ice/exceptions/Client.rb
+++ b/rb/test/Ice/exceptions/Client.rb
@@ -12,7 +12,7 @@ require 'pathname'
require 'Ice'
Ice::loadSlice('Test.ice')
-require 'AllTests'
+require './AllTests'
def run(args, communicator)
thrower = allTests(communicator)
diff --git a/rb/test/Ice/facets/Client.rb b/rb/test/Ice/facets/Client.rb
index 9b24ca54e7e..1471dc59275 100755
--- a/rb/test/Ice/facets/Client.rb
+++ b/rb/test/Ice/facets/Client.rb
@@ -11,7 +11,7 @@
require 'pathname'
require 'Ice'
Ice::loadSlice('Test.ice')
-require 'AllTests'
+require './AllTests'
def run(args, communicator)
g = allTests(communicator)
diff --git a/rb/test/Ice/info/Client.rb b/rb/test/Ice/info/Client.rb
index bf8650a4ac4..ce0bb3625dc 100755
--- a/rb/test/Ice/info/Client.rb
+++ b/rb/test/Ice/info/Client.rb
@@ -16,7 +16,7 @@ if slice_dir.empty?
end
Ice::loadSlice("'-I" + slice_dir + "' Test.ice")
-require 'AllTests'
+require './AllTests'
def test(b)
if !b
diff --git a/rb/test/Ice/inheritance/Client.rb b/rb/test/Ice/inheritance/Client.rb
index 97002128b9b..912301bfe33 100755
--- a/rb/test/Ice/inheritance/Client.rb
+++ b/rb/test/Ice/inheritance/Client.rb
@@ -11,7 +11,7 @@
require 'pathname'
require 'Ice'
Ice::loadSlice('Test.ice')
-require 'AllTests'
+require './AllTests'
def run(args, communicator)
initial = allTests(communicator)
diff --git a/rb/test/Ice/location/Client.rb b/rb/test/Ice/location/Client.rb
index 9186518dd66..1b2934ad55a 100755
--- a/rb/test/Ice/location/Client.rb
+++ b/rb/test/Ice/location/Client.rb
@@ -17,7 +17,7 @@ if slice_dir.empty?
end
Ice::loadSlice("'-I" + slice_dir + "' Test.ice")
-require 'AllTests'
+require './AllTests'
def run(args, communicator)
allTests(communicator, "ServerManager:default -p 12010")
diff --git a/rb/test/Ice/objects/AllTests.rb b/rb/test/Ice/objects/AllTests.rb
index 32fac6fa023..767c70e036b 100644
--- a/rb/test/Ice/objects/AllTests.rb
+++ b/rb/test/Ice/objects/AllTests.rb
@@ -7,7 +7,7 @@
#
# **********************************************************************
-require 'TestI.rb'
+require './TestI.rb'
#
# Ice for Ruby behaves differently than Ice for C++, because
diff --git a/rb/test/Ice/objects/Client.rb b/rb/test/Ice/objects/Client.rb
index dd8d14a0e4e..852ab47b7b8 100755
--- a/rb/test/Ice/objects/Client.rb
+++ b/rb/test/Ice/objects/Client.rb
@@ -12,7 +12,7 @@ require 'pathname'
require 'Ice'
Ice::loadSlice('Test.ice')
Ice::loadSlice('ClientPrivate.ice')
-require 'AllTests'
+require './AllTests'
def run(args, communicator)
initial = allTests(communicator)
diff --git a/rb/test/Ice/operations/AllTests.rb b/rb/test/Ice/operations/AllTests.rb
index 771fd325111..c4fcde8ff02 100644
--- a/rb/test/Ice/operations/AllTests.rb
+++ b/rb/test/Ice/operations/AllTests.rb
@@ -7,8 +7,8 @@
#
# **********************************************************************
-require 'Twoways'
-require 'BatchOneways'
+require './Twoways'
+require './BatchOneways'
def allTests(communicator)
ref = "test:default -p 12010"
diff --git a/rb/test/Ice/operations/Client.rb b/rb/test/Ice/operations/Client.rb
index a3e53e37b51..8bb0b438a21 100755
--- a/rb/test/Ice/operations/Client.rb
+++ b/rb/test/Ice/operations/Client.rb
@@ -13,7 +13,7 @@ require 'Ice'
slice_dir = Ice.getSliceDir
Ice::loadSlice("'-I" + slice_dir + "' Test.ice")
-require 'AllTests'
+require './AllTests'
def test(b)
if !b
diff --git a/rb/test/Ice/properties/Client.rb b/rb/test/Ice/properties/Client.rb
index 17beb9ff0a3..cf9480ec78b 100644
--- a/rb/test/Ice/properties/Client.rb
+++ b/rb/test/Ice/properties/Client.rb
@@ -11,7 +11,6 @@
require 'Ice'
-require 'iconv'
def test(b)
if !b
diff --git a/rb/test/Ice/proxy/Client.rb b/rb/test/Ice/proxy/Client.rb
index 3273227f06e..7548bb8b49d 100755
--- a/rb/test/Ice/proxy/Client.rb
+++ b/rb/test/Ice/proxy/Client.rb
@@ -16,7 +16,7 @@ if slice_dir.empty?
end
Ice::loadSlice("'-I" + slice_dir + "' Test.ice")
-require 'AllTests'
+require './AllTests'
def test(b)
if !b
diff --git a/rb/test/Ice/retry/Client.rb b/rb/test/Ice/retry/Client.rb
index b97942d32d1..b5b53275fb4 100755
--- a/rb/test/Ice/retry/Client.rb
+++ b/rb/test/Ice/retry/Client.rb
@@ -16,7 +16,7 @@ if slice_dir.empty?
end
Ice::loadSlice("'-I" + slice_dir + "' Test.ice")
-require 'AllTests'
+require './AllTests'
def run(args, communicator)
ret = allTests(communicator)
diff --git a/rb/test/Ice/slicing/exceptions/Client.rb b/rb/test/Ice/slicing/exceptions/Client.rb
index d1c5135d3d5..2872976c661 100755
--- a/rb/test/Ice/slicing/exceptions/Client.rb
+++ b/rb/test/Ice/slicing/exceptions/Client.rb
@@ -11,7 +11,7 @@
require 'pathname'
require 'Ice'
Ice::loadSlice('Test.ice')
-require 'AllTests'
+require './AllTests'
def run(args, communicator)
t = allTests(communicator)
diff --git a/rb/test/Ice/slicing/objects/Client.rb b/rb/test/Ice/slicing/objects/Client.rb
index 7f4803e5ae9..0c0b8a3e141 100755
--- a/rb/test/Ice/slicing/objects/Client.rb
+++ b/rb/test/Ice/slicing/objects/Client.rb
@@ -9,7 +9,7 @@
# **********************************************************************
require 'pathname'
-require 'AllTests'
+require './AllTests'
def run(args, communicator)
t = allTests(communicator)
diff --git a/rb/test/Ice/timeout/Client.rb b/rb/test/Ice/timeout/Client.rb
index 7189d579697..5b4d84dc6c1 100755
--- a/rb/test/Ice/timeout/Client.rb
+++ b/rb/test/Ice/timeout/Client.rb
@@ -16,7 +16,7 @@ if slice_dir.empty?
end
Ice::loadSlice("'-I" + slice_dir + "' Test.ice")
-require 'AllTests'
+require './AllTests'
def test(b)
if !b
diff --git a/scripts/TestUtil.py b/scripts/TestUtil.py
index d25f7434540..3cdce99ad47 100755
--- a/scripts/TestUtil.py
+++ b/scripts/TestUtil.py
@@ -86,6 +86,10 @@ def getCppCompiler():
compiler = re.search("CPP_COMPILER[\t\s]*= ([A-Z0-9]*)", config.read()).group(1)
return compiler
+def isMINGW():
+ if not isWin32():
+ return False
+ return getCppCompiler() == "MINGW"
def isVC6():
if not isWin32():
@@ -686,7 +690,7 @@ def getGlacier2Router():
return getIceExe("glacier2router")
def getIceExe(name):
- if isVC6():
+ if isVC6() or isMINGW():
return os.path.join(getServiceDir(), name)
else:
return os.path.join(getCppBinDir(), name)
@@ -1679,6 +1683,14 @@ def runTests(start, expanded, num = 0, script = False):
print("%s*** test not supported with VC++ 6.0%s" % (prefix, suffix))
continue
+ if isMINGW() and "nomingw" in config:
+ print "%s*** test not supported with MINGW%s" % (prefix, suffix)
+ continue
+
+ if isWin32() and "nowin32" in config:
+ print "%s*** test not supported with MINGW%s" % (prefix, suffix)
+ continue
+
# If this is mono and we're running ssl protocol tests
# then skip. This occurs when using --all.
if mono and ("nomono" in config or (i.find(os.path.join("cs","test")) != -1 and args.find("ssl") != -1)):