summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp')
-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
5 files changed, 54 insertions, 19 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)