summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cpp/Makefile2
-rw-r--r--cpp/config/Make.rules.MINGW56
-rw-r--r--cpp/demo/IceDiscovery/Makefile4
-rw-r--r--cpp/demo/Makefile6
-rw-r--r--cpp/demo/Manual/Makefile5
-rw-r--r--demoscript/Util.py4
-rwxr-xr-xscripts/TestUtil.py12
7 files changed, 61 insertions, 28 deletions
diff --git a/cpp/Makefile b/cpp/Makefile
index b10cd5822c3..840c556f4d2 100644
--- a/cpp/Makefile
+++ b/cpp/Makefile
@@ -15,7 +15,7 @@ SUBDIRS = config src include
ifneq ($(MAKECMDGOALS),install)
SUBDIRS := $(SUBDIRS) test
- ifeq ($(shell uname | grep MINGW),)
+ ifneq ($(GEMBUILD),yes)
SUBDIRS := $(SUBDIRS) demo
endif
endif
diff --git a/cpp/config/Make.rules.MINGW b/cpp/config/Make.rules.MINGW
index e1d71a5f41f..9084f0dd3d9 100644
--- a/cpp/config/Make.rules.MINGW
+++ b/cpp/config/Make.rules.MINGW
@@ -8,6 +8,13 @@
# **********************************************************************
#
+# By default we setup everything to GEM builds.
+#
+ifeq ($(GEMBUILD),)
+GEMBUILD = yes
+endif
+
+#
# This file is included by Make.rules when building with MinGW.
#
@@ -22,11 +29,16 @@ CXX = c++
# 0x602 = Windows 8 / Windows Server 2012
ICE_WIN32_WINNT := 0x601
-CXXFLAGS = $(CXXARCHFLAGS) -mthreads -Wall -Werror -D_WIN32_WINNT=$(ICE_WIN32_WINNT) -DWIN32_LEAN_AND_MEAN -DICE_STATIC_LIBS
+CXXFLAGS = $(CXXARCHFLAGS) -mthreads -Wall -Werror -D_WIN32_WINNT=$(ICE_WIN32_WINNT) -DWIN32_LEAN_AND_MEAN
+
+ifeq ($(GEMBUILD),yes)
+STATICLIBS = yes
+endif
+
ifeq ($(STATICLIBS),yes)
CXXFLAGS += -DICE_STATIC_LIBS
-endif
LDFLAGS = -Wl,-no-undefined -static-libgcc -static-libstdc++
+endif
ifeq ($(OPTIMIZE),yes)
CXXFLAGS += -O2 -DNDEBUG
@@ -44,16 +56,35 @@ mkshlib = $(CXX) -shared $(LDFLAGS) -o $(1) $(3) \
$(subst -lIce,-lice$(SOVERSION)$(COMPSUFFIX), \
$(subst -lIceUtil,-liceutil$(SOVERSION)$(COMPSUFFIX), \
$(subst -lSlice,-lslice$(SOVERSION)$(COMPSUFFIX), \
- $(subst -lIceSSL,-licessl$(SOVERSION)$(COMPSUFFIX),$(4))))))
+ $(subst -lIceSSL,-lslice$(SOVERSION)$(COMPSUFFIX), \
+ $(subst -lIceDiscovery,-licessl$(SOVERSION)$(COMPSUFFIX),$(4)))))))
mklib = ar cr $(1) $(2)
-ifeq ($(STATICLIBS),yes)
-libsubdir := lib
+
+ifeq ($(GEMBUILD),yes)
+libsubdir := lib
+binsubdir := bin
+MCPP_LIBS = -lmcpp
+BZIP2_FLAGS = -I../../../bzip2
+BZIP2_LIBS = -lbz2
else
+
libsubdir := bin
+binsubdir := bin
+
+CPPFLAGS := -I"$(THIRDPARTY_HOME)/include" $(CPPFLAGS)
+LDPLATFORMFLAGS := -L"$(THIRDPARTY_HOME)/$(libsubdir)$(lp64suffix)" $(LDFLAGS)
+
+ifeq ($(LP64),yes)
+ MCPP_LIBS = -L"$(THIRDPARTY_HOME)/lib/mingw$(lp64suffix)" -lmcpp
+else
+ MCPP_LIBS = -L"$(THIRDPARTY_HOME)/lib/mingw" -lmcpp
+endif
+
+BZIP2_LIBS = -lbzip2$(COMPSUFFIX)
+
endif
-binsubdir := bin
libdir := $(top_srcdir)/$(libsubdir)
bindir := $(top_srcdir)/$(binsubdir)
@@ -64,35 +95,24 @@ installlib = $(INSTALL) $(2)/$(3) $(1); \
installprogram = $(INSTALL_PROGRAM) $(1) $(2); \
chmod a+rx $(2)/$(notdir $(1))
-CPPFLAGS := -I"$(THIRDPARTY_HOME)/include" $(CPPFLAGS)
-LDPLATFORMFLAGS := -L"$(THIRDPARTY_HOME)/$(libsubdir)" $(LDFLAGS)
SSL_OS_LIBS = -lsecur32 -lcrypt32 -lws2_32
+MCPP_RPATH_LINK = $(MCPP_LIBS)
-ICEWS_OS_LIBS = -lws2_32
-
-MCPP_LIBS = -lmcpp
-
-BZIP2_LIBS = -lbz2
ifeq ($(STATICLIBS),yes)
BASELIBS = -liceutil $(ICEUTIL_OS_LIBS)
LIBS = -lice $(BASELIBS)
ICESSL_LIBS = -licessl
-ICEWS_LIBS = -licews
SLICE_LIBS = -lslice $(BASELIBS)
else
BASELIBS = -liceutil$(SOVERSION)$(COMPSUFFIX) $(ICEUTIL_OS_LIBS)
LIBS = -lice$(SOVERSION)$(COMPSUFFIX) $(BASELIBS)
ICESSL_LIBS = -licessl$(SOVERSION)$(COMPSUFFIX)
-ICEWS_LIBS = -licews$(SOVERSION)$(COMPSUFFIX)
SLICE_LIBS = -lslice$(SOVERSION)$(COMPSUFFIX) $(BASELIBS)
endif
-MCPP_RPATH_LINK = -lmcpp
-BZIP2_FLAGS = -I../../../bzip2
ICEUTIL_OS_LIBS = -lrpcrt4 -ladvapi32
ICE_OS_LIBS = $(ICEUTIL_OS_LIBS) -lIphlpapi -lws2_32
-
EXE_EXT = .exe
diff --git a/cpp/demo/IceDiscovery/Makefile b/cpp/demo/IceDiscovery/Makefile
index ff8dd6d1c3c..23004986dff 100644
--- a/cpp/demo/IceDiscovery/Makefile
+++ b/cpp/demo/IceDiscovery/Makefile
@@ -11,8 +11,12 @@ top_srcdir = ../..
include $(top_srcdir)/config/Make.rules
+ifneq ($(findstring MINGW,$(UNAME)),)
+SUBDIRS = hello
+else
SUBDIRS = hello \
replication
+endif
.PHONY: $(EVERYTHING) $(SUBDIRS)
diff --git a/cpp/demo/Makefile b/cpp/demo/Makefile
index fe00cb95086..f0ef60d7d5d 100644
--- a/cpp/demo/Makefile
+++ b/cpp/demo/Makefile
@@ -11,6 +11,11 @@ top_srcdir = ..
include $(top_srcdir)/config/Make.rules
+ifneq ($(findstring MINGW,$(UNAME)),)
+SUBDIRS = Ice \
+ IceDiscovery \
+ Manual
+else
SUBDIRS = IceUtil \
Ice \
IceDiscovery \
@@ -20,6 +25,7 @@ SUBDIRS = IceUtil \
Glacier2 \
IceGrid \
Manual
+endif
.PHONY: $(EVERYTHING) $(SUBDIRS)
diff --git a/cpp/demo/Manual/Makefile b/cpp/demo/Manual/Makefile
index b3fcd2e416f..4da9597015d 100644
--- a/cpp/demo/Manual/Makefile
+++ b/cpp/demo/Manual/Makefile
@@ -11,11 +11,16 @@ top_srcdir = ../..
include $(top_srcdir)/config/Make.rules
+ifneq ($(findstring MINGW,$(UNAME)),)
+SUBDIRS = printer \
+ simple_filesystem
+else
SUBDIRS = printer \
simple_filesystem \
lifecycle \
evictor_filesystem \
map_filesystem
+endif
.PHONY: $(EVERYTHING) $(SUBDIRS)
diff --git a/demoscript/Util.py b/demoscript/Util.py
index 8e905813338..6f91e79fbb9 100644
--- a/demoscript/Util.py
+++ b/demoscript/Util.py
@@ -319,9 +319,7 @@ def configurePaths():
else:
addenv("PYTHONPATH", os.path.join(getIceDir("py"), "python"))
- if isWin32() and x64:
- addenv("RUBYLIB", os.path.join(getIceDir("rb"), "ruby", "x64"))
- else:
+ if not iceHome:
addenv("RUBYLIB", os.path.join(getIceDir("rb"), "ruby"))
if getMapping() == "js":
diff --git a/scripts/TestUtil.py b/scripts/TestUtil.py
index 986b1b7f8ab..434780bddfc 100755
--- a/scripts/TestUtil.py
+++ b/scripts/TestUtil.py
@@ -1713,7 +1713,7 @@ def getCppBinDir(lang = None):
return binDir
def getSliceTranslator(lang = "cpp"):
- return os.path.join(os.path.join(iceHome if iceHome else getIceDir("cpp"), "bin") , "slice2%s" % lang)
+ return os.path.join((iceHome if iceHome else getIceDir("cpp")) , "bin", "slice2%s" % lang)
def getCppLibDir(lang = None):
if isWin32():
@@ -1860,11 +1860,11 @@ def getTestEnv(lang, testdir):
else:
addPathToEnv("PYTHONPATH", pythonDir, env)
- if lang == "rb":
- if isWin32() and x64:
- addPathToEnv("RUBYLIB", os.path.join(getIceDir("rb", testdir), "ruby", "x64"), env)
- else:
- addPathToEnv("RUBYLIB", os.path.join(getIceDir("rb", testdir), "ruby"), env)
+ #
+ # If testing with source dist we need to set RUBYLIB
+ #
+ if lang == "rb" and not iceHome:
+ addPathToEnv("RUBYLIB", os.path.join(getIceDir("rb", testdir), "ruby"), env)
if lang == "js":
if os.environ.get("USE_BIN_DIST", "no") != "yes":