summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp')
-rwxr-xr-xcpp/config/Make.rules.mak2
-rw-r--r--cpp/config/Make.rules.mak.icesl50
-rwxr-xr-xcpp/config/Make.rules.msvc11
-rwxr-xr-xcpp/iceslmakedist.py446
-rwxr-xr-xcpp/src/slice2sl/Gen.cpp3
-rw-r--r--cpp/src/slice2sl/Makefile.mak4
6 files changed, 33 insertions, 483 deletions
diff --git a/cpp/config/Make.rules.mak b/cpp/config/Make.rules.mak
index 3e2feb50d0a..9ee37012387 100755
--- a/cpp/config/Make.rules.mak
+++ b/cpp/config/Make.rules.mak
@@ -20,7 +20,7 @@ prefix = C:\Ice-$(VERSION)
#OPTIMIZE = yes
#
-# Define if you want to build the Ice-E slice compilers with
+# Define if you want to build the Ice-E/Ice-SL slice compilers with
# static libraries.
#
#STATICLIBS = yes
diff --git a/cpp/config/Make.rules.mak.icesl b/cpp/config/Make.rules.mak.icesl
index 63de6207c3c..cf6d9cf7791 100644
--- a/cpp/config/Make.rules.mak.icesl
+++ b/cpp/config/Make.rules.mak.icesl
@@ -20,26 +20,12 @@ prefix = C:\IceSL-$(VERSION)
OPTIMIZE = yes
#
-# Specify your C++ compiler. Supported values are:
-# VC80, VC80_EXPRESS
+# If third party libraries are not installed in the default location
+# or THIRDPARTY_HOME is not set in your environment variables then
+# change the following setting to reflect the installation location.
#
-!if "$(CPP_COMPILER)" == ""
-CPP_COMPILER = VC80
-!endif
-
-#
-# For VC80 and VC80 Express it is necessary to set the location of the
-# manifest tool. This must be the 6.x version of mt.exe, not the 5.x
-# version!
-#
-# For VC80 Express mt.exe 6.x is provided by the Windows Platform SDK.
-# It is necessary to set the location of the Platform SDK through the
-# PDK_HOME environment variable (see INSTALL.WINDOWS for details).
-#
-!if "$(CPP_COMPILER)" == "VC80"
-MT = "$(VS80COMNTOOLS)bin\mt.exe"
-!elseif "$(CPP_COMPILER)" == "VC80_EXPRESS"
-MT = "$(PDK_HOME)\bin\mt.exe"
+!if "$(THIRDPARTY_HOME)" == ""
+THIRDPARTY_HOME = C:\Ice-3.3b-ThirdParty-VC90
!endif
@@ -47,19 +33,33 @@ MT = "$(PDK_HOME)\bin\mt.exe"
# Don't change anything below this line!
# ----------------------------------------------------------------------
+CPP_COMPILER = VC90
+
+MT = mt.exe
+
+#
+# Common definitions
+#
+ice_language = cpp
+!if "$(USE_BIN_DIST)" == "yes" || !exist ($(top_srcdir)\..\cpp)
+slice_translator = slice2cpp.exe
+ice_require_cpp = 1
+!endif
+
STATICLIBS = yes
-SHELL = /bin/sh
+!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
bindir = $(top_srcdir)\bin
libdir = $(top_srcdir)\lib
includedir = $(top_srcdir)\include
-slicedir = $(top_srcdir)\slice
install_bindir = $(prefix)\bin
-OBJEXT = .obj
-
SETARGV = setargv.obj
!include $(top_srcdir)/config/Make.rules.msvc
@@ -74,12 +74,10 @@ LIBSUFFIX = $(LIBSUFFIX)d
CPPFLAGS = $(CPPFLAGS) -I$(includedir)
-
LDFLAGS = $(LDFLAGS) $(LDPLATFORMFLAGS) $(CXXFLAGS)
SLICEPARSERLIB = $(libdir)\slice$(LIBSUFFIX).lib
-
EVERYTHING = all clean install
.SUFFIXES:
@@ -102,6 +100,6 @@ clean::
!endif
clean::
- -del /q *.obj *.bak *.ilk *.exp *.pdb *.tds
+ -del /q *.obj *.bak *.ilk *.exp *.pdb *.tds *.idb
install::
diff --git a/cpp/config/Make.rules.msvc b/cpp/config/Make.rules.msvc
index fd29ddbc212..dca6e6a0682 100755
--- a/cpp/config/Make.rules.msvc
+++ b/cpp/config/Make.rules.msvc
@@ -54,20 +54,15 @@ CPPFLAGS = $(CPPFLAGS) -nologo -W3 -WX -GR -EHsc -FD -D_CONSOLE
!if "$(OPTIMIZE)" == "yes"
CPPFLAGS = $(CPPFLAGS) -O2 -DNDEBUG
-!if "$(STATICLIBS)" == "yes"
-CPPFLAGS = $(CPPFLAGS) -MT
-!else
+
CPPFLAGS = $(CPPFLAGS) -MD
-!endif
!else
CPPFLAGS = $(CPPFLAGS) -Zi -Gm -Od -D_DEBUG
-!if "$(STATICLIBS)" == "yes"
-CPPFLAGS = $(CPPFLAGS) -MTd
-!else
+
CPPFLAGS = $(CPPFLAGS) -MDd
-!endif
+
!if "$(CPP_COMPILER)" == "VC60" || "$(CPP_COMPILER)" == "VC71"
CPPFLAGS = $(CPPFLAGS) -GZ
!else
diff --git a/cpp/iceslmakedist.py b/cpp/iceslmakedist.py
deleted file mode 100755
index cf82d19b515..00000000000
--- a/cpp/iceslmakedist.py
+++ /dev/null
@@ -1,446 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2008 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.
-#
-# **********************************************************************
-
-import os, sys, shutil, fnmatch, re, glob
-
-#
-# Program usage.
-#
-def usage():
- print "Usage: " + sys.argv[0] + " [options] [tag]"
- print
- print "Options:"
- print "-h Show this message."
- print "-v Be verbose."
- print
- print "If no tag is specified, HEAD is used."
-
-#
-# Find files matching a pattern.
-#
-def find(path, patt):
- result = [ ]
- files = os.listdir(path)
- for x in files:
- fullpath = os.path.join(path, x);
- if os.path.isdir(fullpath) and not os.path.islink(fullpath):
- result.extend(find(fullpath, patt))
- elif fnmatch.fnmatch(x, patt):
- result.append(fullpath)
- return result
-
-#
-# Comment out rules in a Makefile.
-#
-def fixMakefile(file, target):
- origfile = file + ".orig"
- os.rename(file, origfile)
- oldMakefile = open(origfile, "r")
- newMakefile = open(file, "w")
- origLines = oldMakefile.readlines()
-
- doComment = 0
- doCheck = 0
- newLines = []
- for x in origLines:
- #
- # If the rule contains the target string, then
- # comment out this rule.
- #
- if not x.startswith("\t") and x.find(target) != -1 and x.find(target + ".o") == -1:
- doComment = 1
- #
- # If the line starts with "clean::", then check
- # the following lines and comment out any that
- # contain the target string.
- #
- elif x.startswith("clean::"):
- doCheck = 1
- #
- # Stop when we encounter an empty line.
- #
- elif len(x.strip()) == 0:
- doComment = 0
- doCheck = 0
-
- if doComment or (doCheck and x.find(target) != -1):
- x = "#" + x
- newLines.append(x)
-
- newMakefile.writelines(newLines)
- newMakefile.close()
- oldMakefile.close()
- os.remove(origfile)
-
-#
-# Remove lines containing a keyword from a file.
-#
-def editFile(file, target):
- origfile = file + ".orig"
- os.rename(file, origfile)
- oldFile = open(origfile, "r")
- newFile = open(file, "w")
- origLines = oldFile.readlines()
-
- newLines = []
- for x in origLines:
- if x.find(target) == -1:
- newLines.append(x)
-
- newFile.writelines(newLines)
- newFile.close()
- oldFile.close()
- os.remove(origfile)
-
-#
-# Comment out implicit parser/scanner rules in config/Make.rules.
-#
-def fixMakeRules(file):
- origfile = file + ".orig"
- os.rename(file, origfile)
- oldFile = open(origfile, "r")
- newFile = open(file, "w")
- origLines = oldFile.readlines()
-
- doComment = 0
- newLines = []
- for x in origLines:
- if x.find("%.y") != -1 or x.find("%.l") != -1:
- doComment = 1
- #
- # Stop when we encounter an empty line.
- #
- elif len(x.strip()) == 0:
- doComment = 0
-
- if doComment:
- x = "#" + x
- newLines.append(x)
-
- newFile.writelines(newLines)
- newFile.close()
- oldFile.close()
- os.remove(origfile)
-
-#
-# Fix version in README, INSTALL files
-#
-def fixVersion(files, version):
- for file in files:
- origfile = file + ".orig"
- os.rename(file, origfile)
- oldFile = open(origfile, "r")
- newFile = open(file, "w")
- newFile.write(re.sub("@ver@", version, oldFile.read()))
- newFile.close()
- oldFile.close()
- os.remove(origfile)
-
-#
-# Check arguments
-#
-tag = "HEAD"
-verbose = 0
-for x in sys.argv[1:]:
- if x == "-h":
- usage()
- sys.exit(0)
- elif x == "-v":
- verbose = 1
- elif x.startswith("-"):
- print sys.argv[0] + ": unknown option `" + x + "'"
- print
- usage()
- sys.exit(1)
- else:
- tag = x
-
-#
-# Remove any existing "dist" directory and create a new one.
-#
-distdir = "dist"
-if os.path.exists(distdir):
- shutil.rmtree(distdir)
-os.mkdir(distdir)
-os.mkdir(os.path.join(distdir, "icesl"))
-tmpdir = "tmp"
-os.mkdir(os.path.join(distdir, tmpdir))
-
-#
-# Export sources from git.
-#
-print "Checking out sources " + tag + "..."
-if verbose:
- quiet = "-v"
-else:
- quiet = ""
-os.system("git archive " + quiet + " " + tag + " . | (cd dist/icesl && tar xf -)")
-
-os.chdir(os.path.join("..", "sl", "src"))
-os.system("git archive " + quiet + " " + tag + " . | (cd ../../cpp/dist/tmp && tar xf -)")
-
-os.chdir(os.path.join("..", "..", "distribution", "src", "icesl"))
-os.system("git archive " + quiet + " " + tag + " . | (cd ../../../cpp/dist/tmp && tar xf -)")
-
-os.chdir(os.path.join("..", "..", "..", "cpp", distdir))
-
-#
-# Copy IceSL specific install files.
-#
-print "Copying icesl install files..."
-shutil.copyfile(os.path.join("tmp", "ICE_LICENSE"), os.path.join("icesl", "ICE_LICENSE"))
-shutil.copyfile(os.path.join("tmp", "README.txt"), os.path.join("icesl", "README.txt"))
-shutil.copyfile(os.path.join("tmp", "INSTALL.txt"), os.path.join("icesl", "INSTALL.txt"))
-
-#
-# Move Make.rules.mak.icesl
-#
-shutil.move(os.path.join("icesl", "config", "Make.rules.mak.icesl"), os.path.join("icesl", "config", "Make.rules.mak"))
-
-#
-# Generate bison files.
-#
-print "Generating bison files..."
-cwd = os.getcwd()
-grammars = find("icesl", "*.y")
-for x in grammars:
- #
- # Change to the directory containing the file.
- #
- (dir,file) = os.path.split(x)
- os.chdir(dir)
- (base,ext) = os.path.splitext(file)
- #
- # Run gmake to create the output files.
- #
- if verbose:
- quiet = ""
- else:
- quiet = "-s"
- if file == "cexp.y":
- os.system("gmake " + quiet + " cexp.c")
- else:
- os.system("gmake " + quiet + " " + base + ".cpp")
- #
- # Edit the Makefile to comment out the grammar rules.
- #
- fixMakefile("Makefile.mak", base)
-
- os.chdir(cwd)
-
-#
-# Generate flex files.
-#
-print "Generating flex files..."
-scanners = find("icesl", "*.l")
-for x in scanners:
- #
- # Change to the directory containing the file.
- #
- (dir,file) = os.path.split(x)
- os.chdir(dir)
- (base,ext) = os.path.splitext(file)
- #
- # Run gmake to create the output files.
- #
- if verbose:
- quiet = ""
- else:
- quiet = "-s"
- os.system("gmake " + quiet + " " + base + ".cpp")
- #
- # Edit the Makefile to comment out the flex rules.
- #
- fixMakefile("Makefile.mak", base)
-
- os.chdir(cwd)
-
-#
-# Remove files.
-#
-print "Removing unnecessary files..."
-filesToRemove = [ \
- os.path.join("icesl", "CHANGES"), \
- os.path.join("icesl", "README"), \
- os.path.join("icesl", "INSTALL.HP-UX"), \
- os.path.join("icesl", "INSTALL.MACOSX"), \
- os.path.join("icesl", "INSTALL.SOLARIS"), \
- os.path.join("icesl", "INSTALL.WINDOWS"), \
- os.path.join("icesl", "INSTALL.LINUX"), \
- os.path.join("icesl", "iceemakedist.py"), \
- os.path.join("icesl", "iceslmakedist.py"), \
- os.path.join("icesl", "WINDOWS_SERVICE.txt"), \
- os.path.join("icesl", "makedist.py"), \
- os.path.join("icesl", "fixCopyright.py"), \
- os.path.join("icesl", "fixVersion.py"), \
- os.path.join("icesl", "allTests.py"), \
- os.path.join("icesl", "allDemos.py"), \
- os.path.join("icesl", "config", "convertssl.py"), \
- os.path.join("icesl", "config", "findSliceFiles.py"), \
- os.path.join("icesl", "config", "glacier2router.cfg"), \
- os.path.join("icesl", "config", "ice_ca.cnf"), \
- os.path.join("icesl", "config", "icegridnode.cfg"), \
- os.path.join("icesl", "config", "icegridregistry.cfg"), \
- os.path.join("icesl", "config", "icegrid-slice.3.1.ice.gz"), \
- os.path.join("icesl", "config", "makedepend.py"), \
- os.path.join("icesl", "config", "makegitignore.py"), \
- os.path.join("icesl", "config", "Make.rules"), \
- os.path.join("icesl", "config", "Make.rules.AIX"), \
- os.path.join("icesl", "config", "Make.rules.bcc"), \
- os.path.join("icesl", "config", "Make.rules.Darwin"), \
- os.path.join("icesl", "config", "Make.rules.FreeBSD"), \
- os.path.join("icesl", "config", "Make.rules.HP-UX"), \
- os.path.join("icesl", "config", "Make.rules.Linux"), \
- os.path.join("icesl", "config", "Make.rules.OSF1"), \
- os.path.join("icesl", "config", "Make.rules.SunOS"), \
- os.path.join("icesl", "config", "Make.rules.icee"), \
- os.path.join("icesl", "config", "Make.rules.mak.icee"), \
- os.path.join("icesl", "config", "templates.xml"), \
- os.path.join("icesl", "config", "upgradeicegrid.py"), \
- os.path.join("icesl", "config", "upgradeicestorm.py"), \
- ]
-filesToRemove.extend(find("icesl", ".gitignore"))
-filesToRemove.extend(find("icesl", "Makefile"))
-for x in filesToRemove:
- os.remove(x)
-shutil.rmtree(os.path.join("icesl", "demo"))
-shutil.rmtree(os.path.join("icesl", "doc"))
-shutil.rmtree(os.path.join("icesl", "test"))
-shutil.rmtree(os.path.join("icesl", "include", "Freeze"))
-shutil.rmtree(os.path.join("icesl", "include", "Glacier2"))
-shutil.rmtree(os.path.join("icesl", "include", "Ice"))
-shutil.rmtree(os.path.join("icesl", "include", "IceBox"))
-shutil.rmtree(os.path.join("icesl", "include", "IceGrid"))
-shutil.rmtree(os.path.join("icesl", "include", "IcePatch2"))
-shutil.rmtree(os.path.join("icesl", "include", "IceSSL"))
-shutil.rmtree(os.path.join("icesl", "include", "IceStorm"))
-shutil.rmtree(os.path.join("icesl", "include", "IceXML"))
-shutil.rmtree(os.path.join("icesl", "src", "ca"))
-shutil.rmtree(os.path.join("icesl", "src", "Freeze"))
-shutil.rmtree(os.path.join("icesl", "src", "FreezeScript"))
-shutil.rmtree(os.path.join("icesl", "src", "Glacier2"))
-shutil.rmtree(os.path.join("icesl", "src", "Ice"))
-shutil.rmtree(os.path.join("icesl", "src", "IceBox"))
-shutil.rmtree(os.path.join("icesl", "src", "IceGrid"))
-shutil.rmtree(os.path.join("icesl", "src", "IcePatch2"))
-shutil.rmtree(os.path.join("icesl", "src", "iceserviceinstall"))
-shutil.rmtree(os.path.join("icesl", "src", "IceSSL"))
-shutil.rmtree(os.path.join("icesl", "src", "IceStorm"))
-shutil.rmtree(os.path.join("icesl", "src", "IceXML"))
-shutil.rmtree(os.path.join("icesl", "src", "slice2cpp"))
-shutil.rmtree(os.path.join("icesl", "src", "slice2cppe"))
-shutil.rmtree(os.path.join("icesl", "src", "slice2cs"))
-shutil.rmtree(os.path.join("icesl", "src", "slice2docbook"))
-shutil.rmtree(os.path.join("icesl", "src", "slice2freeze"))
-shutil.rmtree(os.path.join("icesl", "src", "slice2freezej"))
-shutil.rmtree(os.path.join("icesl", "src", "slice2html"))
-shutil.rmtree(os.path.join("icesl", "src", "slice2java"))
-shutil.rmtree(os.path.join("icesl", "src", "slice2javae"))
-shutil.rmtree(os.path.join("icesl", "src", "slice2py"))
-shutil.rmtree(os.path.join("icesl", "src", "slice2rb"))
-
-#
-# Get IceSL version.
-#
-config = open(os.path.join("tmp", "Ice", "AssemblyInfo.cs"), "r")
-version = re.search("AssemblyVersion.*\"([0-9\.]*)\".*", config.read()).group(1)
-
-print "Fixing makefiles..."
-
-for makeRulesName in [os.path.join("icesl", "config", "Make.rules.mak")]:
- fixMakeRules(makeRulesName)
- makeRules = open(makeRulesName, "r")
- lines = makeRules.readlines()
- makeRules.close()
- for i in range(len(lines)):
- if lines[i].find("prefix") == 0:
- lines[i] = lines[i].replace("IceE-$(VERSION)", "IceE-" + version)
- makeRules = open(makeRulesName, "w")
- makeRules.writelines(lines)
- makeRules.close()
-
-
-#
-# Change SUBDIRS and INSTALL_SUBDIRS in top-level Makefile.
-#
-for makeFileName in [os.path.join("icesl", "Makefile.mak")]:
- makeFile = open(makeFileName, "r")
- lines = makeFile.readlines()
- makeFile.close()
- for i in range(len(lines)):
- if lines[i].find("SUBDIRS") == 0:
- lines[i] = "SUBDIRS = src\n"
- if lines[i].find("INSTALL_SUBDIRS") == 0:
- lines[i] = "INSTALL_SUBDIRS = $(install_bindir) $(install_libdir)\n"
- makeFile = open(makeFileName, "w")
- makeFile.writelines(lines)
- makeFile.close()
-
-#
-# Disable install targets for libIceUtil, libSlice.
-#
-for makeFileName in [os.path.join("icesl", "src", "IceUtil", "Makefile.mak"), \
- os.path.join("icesl", "src", "Slice", "Makefile.mak")]:
- makeFile = open(makeFileName, "r")
- lines = makeFile.readlines()
- makeFile.close()
-
- doComment = 0
- for i in range(len(lines)):
- if lines[i].find("install::") == 0:
- doComment = 1
- elif len(lines[i].strip()) == 0:
- doComment = 0
- elif doComment:
- lines[i] = "#" + lines[i]
-
- makeFile = open(makeFileName, "w")
- makeFile.writelines(lines)
- makeFile.close()
-
-#
-# Fix versions in README and INSTALL files.
-#
-print "Fixing version in README and INSTALL files..."
-fixVersion(find("icesl", "README*"), version)
-fixVersion(find("icesl", "INSTALL*"), version)
-
-#
-# Create archives.
-#
-print "Creating distribution..."
-icever = "IceSL-trans-" + version
-os.rename("icesl", icever)
-if verbose:
- quiet = "v"
-else:
- quiet = ""
-os.system("chmod -R u+rw,go+r . " + icever)
-os.system("find " + icever + " -type d -exec chmod a+x {} \\;")
-os.system("tar c" + quiet + "f " + icever + ".tar " + icever)
-os.system("gzip -9 " + icever + ".tar")
-if verbose:
- quiet = ""
-else:
- quiet = "q"
-os.system("zip -9r" + quiet + " " + icever + ".zip " + icever)
-
-#
-# Copy files (README, etc.).
-#
-#shutil.copyfile(os.path.join(icever, "CHANGES"), "Ice-" + version + "-CHANGES")
-
-#
-# Done.
-#
-print "Cleaning up..."
-shutil.rmtree(icever)
-shutil.rmtree(tmpdir)
-print "Done."
diff --git a/cpp/src/slice2sl/Gen.cpp b/cpp/src/slice2sl/Gen.cpp
index 928c019f67d..7f90053584a 100755
--- a/cpp/src/slice2sl/Gen.cpp
+++ b/cpp/src/slice2sl/Gen.cpp
@@ -2678,7 +2678,6 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p)
_out << eb;
_out << nl << "catch(System.InvalidCastException)";
_out << sb;
- _out << nl << "Ice.UnexpectedObjectException ex = new Ice.UnexpectedObjectException();";
_out << nl << "ret__ = null;";
_out << nl << "IceInternal.Ex.throwUOE(ret___PP.type(), ret___PP.value.ice_id());";
_out << eb;
@@ -3438,7 +3437,7 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p)
{
_out << nl << "catch(Ice.UserException ex__)";
_out << sb;
- _out << nl << "ice_exception(ex__);";
+ _out << nl << "exception_(ex__);";
_out << nl << "return;";
_out << eb;
}
diff --git a/cpp/src/slice2sl/Makefile.mak b/cpp/src/slice2sl/Makefile.mak
index 7a8ec7a873e..819f5c79b41 100644
--- a/cpp/src/slice2sl/Makefile.mak
+++ b/cpp/src/slice2sl/Makefile.mak
@@ -32,6 +32,10 @@ RES_FILE = ,, Slice2Sl.res
RES_FILE = Slice2Sl.res
!endif
+!if "$(STATICLIBS)" == "yes"
+BASELIBS = $(MCPP_LIBS) $(BASELIBS)
+!endif
+
$(NAME): $(OBJS) Slice2Sl.res
$(LINK) $(LD_EXEFLAGS) $(PDBFLAGS) $(OBJS) $(SETARGV) $(PREOUT)$@ $(PRELIBS)slice$(LIBSUFFIX).lib \
$(BASELIBS) $(RES_FILE)