summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2012-12-14 18:45:42 -0500
committerBernard Normier <bernard@zeroc.com>2012-12-14 18:45:42 -0500
commit651ba7fae91cb978281b922ad1a5864d3f846f78 (patch)
treed24b306255ea2e6c3661a0ad980eba367f356101 /cpp
parentBetter detection of CPP_COMPILER (diff)
downloadice-651ba7fae91cb978281b922ad1a5864d3f846f78.tar.bz2
ice-651ba7fae91cb978281b922ad1a5864d3f846f78.tar.xz
ice-651ba7fae91cb978281b922ad1a5864d3f846f78.zip
* It is no longer necessary to set CPP_COMPILER for any compiler
(I recommend not setting CPP_COMPILER) * Replaced _EXPRESS CPP_COMPILER by HAS_MFC macro, set to "yes" by default
Diffstat (limited to 'cpp')
-rw-r--r--cpp/INSTALL.WINDOWS7
-rw-r--r--cpp/INSTALL.WINRT5
-rwxr-xr-xcpp/config/Make.rules.mak88
-rw-r--r--cpp/demo/Database/Oracle/occi/Makefile.mak2
-rw-r--r--cpp/demo/Ice/Makefile.mak2
-rw-r--r--cpp/demo/Makefile.mak4
-rwxr-xr-xcpp/src/IcePatch2/Makefile.mak7
-rw-r--r--cpp/src/Makefile.mak2
-rwxr-xr-xcpp/src/iceserviceinstall/Makefile.mak9
-rw-r--r--cpp/test/Ice/hash/Makefile.mak2
-rw-r--r--cpp/test/Makefile.mak2
11 files changed, 62 insertions, 68 deletions
diff --git a/cpp/INSTALL.WINDOWS b/cpp/INSTALL.WINDOWS
index 25929691b85..5479b2fe1ff 100644
--- a/cpp/INSTALL.WINDOWS
+++ b/cpp/INSTALL.WINDOWS
@@ -130,12 +130,7 @@ Change the working directory to Ice-@ver@. For example:
> cd C:\Ice-@ver@\cpp
Edit config\Make.rules.mak to establish your build configuration. The
-comments in the file provide more information. If you are not using
-Visual Studio 2010 (VC100) or Visual Studio 2012 (VC110), you must set
-CPP_COMPILER to the appropriate value, for example:
-
-> set CPP_COMPILER=VC110_EXPRESS
-for Visual Studio 2012 Express
+comments in the file provide more information.
Now you're ready to build Ice:
diff --git a/cpp/INSTALL.WINRT b/cpp/INSTALL.WINRT
index db7e3cc849a..d6775e77e39 100644
--- a/cpp/INSTALL.WINRT
+++ b/cpp/INSTALL.WINRT
@@ -73,10 +73,9 @@ Change the working directory to Ice-@ver@. For example:
> cd C:\Ice-@ver@\cpp
Edit config\Make.rules.mak to establish your build configuration. The
-comments in the file provide more information. If you are using
-Visual Studio 2012 Express, you must set CPP_COMPILER to VC110_EXPRESS.
+comments in the file provide more information. You must in particular
+set WINRT to yes in Make.rules.mak or in your environment:
-You must also set WINRT to yes:
> set WINRT=yes
Now you're ready to build Ice for WinRT:
diff --git a/cpp/config/Make.rules.mak b/cpp/config/Make.rules.mak
index 964a2cef9e8..2298eb3b01a 100755
--- a/cpp/config/Make.rules.mak
+++ b/cpp/config/Make.rules.mak
@@ -11,7 +11,6 @@
# Select an installation base directory. The directory will be created
# if it does not exist.
#
-
prefix = C:\Ice-$(VERSION)
#
@@ -24,37 +23,27 @@ prefix = C:\Ice-$(VERSION)
# Define if you want pdb files to be generated for optimized/release
# builds
#
-#RELEASEPDBS = yes
+#RELEASEPDBS = yes
#
-# Specify your C++ compiler. Supported values are:
-# VC90, VC90_EXPRESS, VC100, VC100_EXPRESS, VC110, VC110_EXPRESS
+# Specify your C++ compiler, or leave unset for auto-detection.
+# Supported values are: VC90, VC100, VC110
#
-# CPP_COMPILER = VC
+# CPP_COMPILER = VCxxx
#
-# Otherwise, try to detect the compiler:
+# Define if you want to build for WinRT
#
-!if "$(CPP_COMPILER)" == ""
-
-!if "$(VISUALSTUDIOVERSION)" == "11.0"
-CPP_COMPILER = VC110
-!elseif ([cl 2>&1 | findstr "Version\ 16" > nul] == 0)
-CPP_COMPILER = VC100
-!elseif ([cl 2>&1 | findstr "Version\ 17" > nul] == 0)
-CPP_COMPILER = VC110
-!elseif ([cl 2>&1 | findstr "Version\ 15" > nul] == 0)
-CPP_COMPILER = VC90
-!else
-!error Cannot detect C++ compiler
-!endif
-#!message CPP_COMPILER set to $(CPP_COMPILER)
-!endif
+#WINRT = yes
#
-# Define if you want to build for WinRT
+# Is the MFC library available?
+# Set to no if you are using Visual Studio Express
+# A few Ice demos use MFC
#
-#WINRT = yes
+!if "$(HAS_MFC)" == ""
+HAS_MFC = yes
+!endif
#
# If third party libraries are not installed in the default location
@@ -71,17 +60,46 @@ THIRDPARTY_HOME = $(PROGRAMFILES)\ZeroC\Ice-$(VERSION)-ThirdParty
#
# Define if you want the Ice DLLs to have compiler specific names.
-# Defined by default for VC9.
+# Will be set to yes by default when CPP_COMPILER=VC90, and unset
+# otherwise
#
-!if "$(CPP_COMPILER)" == "VC90" || "$(CPP_COMPILER)" == "VC90_EXPRESS"
-UNIQUE_DLL_NAMES = yes
-!endif
+#UNIQUE_DLL_NAMES = yes
+
# ----------------------------------------------------------------------
# Don't change anything below this line!
# ----------------------------------------------------------------------
#
+# Check CPP_COMPILER
+#
+!if "$(CPP_COMPILER)" == ""
+
+!if "$(VISUALSTUDIOVERSION)" == "11.0"
+CPP_COMPILER = VC110
+!elseif ([cl 2>&1 | findstr "Version\ 16" > nul] == 0)
+CPP_COMPILER = VC100
+!elseif ([cl 2>&1 | findstr "Version\ 17" > nul] == 0)
+CPP_COMPILER = VC110
+!elseif ([cl 2>&1 | findstr "Version\ 15" > nul] == 0)
+CPP_COMPILER = VC90
+!else
+!error Cannot detect C++ compiler
+!endif
+
+#!message CPP_COMPILER set to $(CPP_COMPILER)
+!elseif "$(CPP_COMPILER)" != "VC90" && "$(CPP_COMPILER)" != "VC100" && "$(CPP_COMPILER)" != "VC110"
+!error Invalid CPP_COMPILER setting: $(CPP_COMPILER). Must be one of: VC90, VC100 or VC110.
+!endif
+
+#
+# With VC90, we want unique dll names
+#
+!if "$(CPP_COMPILER)" == "VC90" && "$(UNIQUE_DLL_NAMES)" == ""
+UNIQUE_DLL_NAMES = yes
+!endif
+
+#
# Common definitions
#
ice_language = cpp
@@ -117,21 +135,15 @@ SETARGV = setargv.obj
#
# Compiler specific definitions
#
-!if "$(CPP_COMPILER)" == "VC90" || "$(CPP_COMPILER)" == "VC90_EXPRESS" || \
- "$(CPP_COMPILER)" == "VC100" || "$(CPP_COMPILER)" == "VC100_EXPRESS" || \
- "$(CPP_COMPILER)" == "VC110" || "$(CPP_COMPILER)" == "VC110_EXPRESS"
!include $(top_srcdir)/config/Make.rules.msvc
-! else
-!error Invalid setting for CPP_COMPILER: $(CPP_COMPILER)
-!endif
-!if "$(WINRT)" == "yes" && "$(CPP_COMPILER)" != "VC110" && "$(CPP_COMPILER)" != "VC110_EXPRESS"
+!if "$(WINRT)" == "yes" && "$(CPP_COMPILER)" != "VC110"
!error CPP_COMPILER: $(CPP_COMPILER) not supported to build Ice for WinRT
!endif
!if "$(CPP_COMPILER)" == "VC90"
libsuff = \vc90$(x64suffix)
-!elseif "$(CPP_COMPILER)" == "VC110" || "$(CPP_COMPILER)" == "VC110_EXPRESS"
+!elseif "$(CPP_COMPILER)" == "VC110"
libsuff = \vc110$(x64suffix)
!else
libsuff = $(x64suffix)
@@ -146,11 +158,11 @@ LDFLAGS = $(PRELIBPATH)"$(THIRDPARTY_HOME)\lib$(libsuff)" $(LDFLAGS)
!endif
!if "$(UNIQUE_DLL_NAMES)" == "yes"
-!if "$(CPP_COMPILER)" == "VC90" || "$(CPP_COMPILER)" == "VC90_EXPRESS"
+!if "$(CPP_COMPILER)" == "VC90"
COMPSUFFIX = vc90_
-!elseif "$(CPP_COMPILER)" == "VC100" || "$(CPP_COMPILER)" == "VC100_EXPRESS"
+!elseif "$(CPP_COMPILER)" == "VC100"
COMPSUFFIX = vc100_
-!elseif "$(CPP_COMPILER)" == "VC110" || "$(CPP_COMPILER)" == "VC110_EXPRESS"
+!elseif "$(CPP_COMPILER)" == "VC110"
COMPSUFFIX = vc110_
!endif
!endif
diff --git a/cpp/demo/Database/Oracle/occi/Makefile.mak b/cpp/demo/Database/Oracle/occi/Makefile.mak
index c62cca4fd53..fcdd0187b2f 100644
--- a/cpp/demo/Database/Oracle/occi/Makefile.mak
+++ b/cpp/demo/Database/Oracle/occi/Makefile.mak
@@ -48,7 +48,7 @@ SPDBFLAGS = /pdb:$(SERVER:.exe=.pdb)
#
# OCCI first
#
-!if "$(CPP_COMPILER)" == "VC100" || "$(CPP_COMPILER)" == "VC100_EXPRESS"
+!if "$(CPP_COMPILER)" == "VC100"
#
# OCCI libraries default location, adjust to match your setup.
diff --git a/cpp/demo/Ice/Makefile.mak b/cpp/demo/Ice/Makefile.mak
index 6a26a0e5690..dfe6227f219 100644
--- a/cpp/demo/Ice/Makefile.mak
+++ b/cpp/demo/Ice/Makefile.mak
@@ -31,7 +31,7 @@ SUBDIRS = minimal \
optional
-!if "$(CPP_COMPILER)" != "VC100_EXPRESS" && "$(CPP_COMPILER)" != "VC110_EXPRESS"
+!if "$(HAS_MFC)" == "yes"
SUBDIRS = $(SUBDIRS) \
MFC
!endif
diff --git a/cpp/demo/Makefile.mak b/cpp/demo/Makefile.mak
index 1c1b73b47d9..6392f469359 100644
--- a/cpp/demo/Makefile.mak
+++ b/cpp/demo/Makefile.mak
@@ -11,7 +11,7 @@ top_srcdir = ..
!include $(top_srcdir)/config/Make.rules.mak
-!if "$(CPP_COMPILER)" == "VC90" || "$(CPP_COMPILER)" == "VC90_EXPRESS"
+!if "$(CPP_COMPILER)" == "VC90"
SUBDIRS = IceUtil \
Ice
@@ -27,7 +27,7 @@ SUBDIRS = IceUtil \
IceGrid \
IceBox
-!if "$(CPP_COMPILER)" != "VC100_EXPRESS" && "$(CPP_COMPILER)" != "VC110_EXPRESS"
+!if "$(HAS_MFC)" == "yes"
SUBDIRS = $(SUBDIRS) \
IcePatch2
!endif
diff --git a/cpp/src/IcePatch2/Makefile.mak b/cpp/src/IcePatch2/Makefile.mak
index dc008732c1d..8b42e493b27 100755
--- a/cpp/src/IcePatch2/Makefile.mak
+++ b/cpp/src/IcePatch2/Makefile.mak
@@ -30,12 +30,7 @@ SRCS = $(SOBJS:.obj=.cpp) \
CPPFLAGS = -I. -I.. $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN
-!if "$(CPP_COMPILER)" == "VC90" || "$(CPP_COMPILER)" == "VC90_EXPRESS" || \
- "$(CPP_COMPILER)" == "VC100" || "$(CPP_COMPILER)" == "VC100_EXPRESS" || \
- "$(CPP_COMPILER)" == "VC110" || "$(CPP_COMPILER)" == "VC110_EXPRESS"
-LD_EXEFLAGS = /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" $(LD_EXEFLAGS)
-!endif
-
+LD_EXEFLAGS = /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" $(LD_EXEFLAGS)
!if "$(GENERATE_PDB)" == "yes"
SPDBFLAGS = /pdb:$(SERVER:.exe=.pdb)
diff --git a/cpp/src/Makefile.mak b/cpp/src/Makefile.mak
index 9ffdeb10bf0..5f20ae3022b 100644
--- a/cpp/src/Makefile.mak
+++ b/cpp/src/Makefile.mak
@@ -18,7 +18,7 @@ SUBDIRS = IceUtil\winrt \
IceStormLib\winrt \
IceGridLib\winrt
-!elseif "$(CPP_COMPILER)" == "VC90" || "$(CPP_COMPILER)" == "VC90_EXPRESS"
+!elseif "$(CPP_COMPILER)" == "VC90"
SUBDIRS = IceUtil \
Slice \
slice2cpp \
diff --git a/cpp/src/iceserviceinstall/Makefile.mak b/cpp/src/iceserviceinstall/Makefile.mak
index 8f422015259..362d56d5723 100755
--- a/cpp/src/iceserviceinstall/Makefile.mak
+++ b/cpp/src/iceserviceinstall/Makefile.mak
@@ -22,14 +22,7 @@ SRCS = $(OBJS:.obj=.cpp)
CPPFLAGS = -I. $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN
-LINKWITH = $(LIBS)
-!if "$(CPP_COMPILER)" == "VC90" || "$(CPP_COMPILER)" == "VC90_EXPRESS" || \
- "$(CPP_COMPILER)" == "VC100" || "$(CPP_COMPILER)" == "VC100_EXPRESS" || \
- "$(CPP_COMPILER)" == "VC110" || "$(CPP_COMPILER)" == "VC110_EXPRESS"
-LINKWITH = /MANIFEST /MANIFESTUAC:"level='requireAdministrator' uiAccess='false'" $(LINKWITH)
-!else
-EXTRA_MANIFEST = security.manifest
-!endif
+LINKWITH = /MANIFEST /MANIFESTUAC:"level='requireAdministrator' uiAccess='false'" $(LIBS)
!if "$(GENERATE_PDB)" == "yes"
PDBFLAGS = /pdb:$(TOOL:.exe=.pdb)
diff --git a/cpp/test/Ice/hash/Makefile.mak b/cpp/test/Ice/hash/Makefile.mak
index 90a51b99dd4..52fa101a5cb 100644
--- a/cpp/test/Ice/hash/Makefile.mak
+++ b/cpp/test/Ice/hash/Makefile.mak
@@ -42,7 +42,7 @@ CPDBFLAGS = /pdb:$(CLIENT).pdb
!endif
$(CLIENT)$(EXT): $(COBJS)
- $(LINK) $(LD_TESTFLAGS) $(CPDBFLAGS) $(SETARGV) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS)
+ $(LINK) $(LD_TESTFLAGS) $(CPDBFLAGS) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS)
@if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \
$(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest
diff --git a/cpp/test/Makefile.mak b/cpp/test/Makefile.mak
index 18343d43e47..adb71e2dd08 100644
--- a/cpp/test/Makefile.mak
+++ b/cpp/test/Makefile.mak
@@ -15,7 +15,7 @@ top_srcdir = ..
SUBDIRS = Ice
-!elseif "$(CPP_COMPILER)" == "VC90" || "$(CPP_COMPILER)" == "VC90_EXPRESS"
+!elseif "$(CPP_COMPILER)" == "VC90"
SUBDIRS = IceUtil \
Slice \