summaryrefslogtreecommitdiff
path: root/cpp/src/slice2py
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2015-08-24 22:56:14 +0200
committerJose <jose@zeroc.com>2015-08-24 22:56:14 +0200
commit5e650cf283518073a15b1afa355a885f95f0b869 (patch)
treedbbe1a9dd712ccd42432d883df2c4b81085abe29 /cpp/src/slice2py
parentUpdated AssemblyInfo and StringFileInfo on Windows (diff)
downloadice-5e650cf283518073a15b1afa355a885f95f0b869.tar.bz2
ice-5e650cf283518073a15b1afa355a885f95f0b869.tar.xz
ice-5e650cf283518073a15b1afa355a885f95f0b869.zip
Add back slice2py command
Diffstat (limited to 'cpp/src/slice2py')
-rwxr-xr-xcpp/src/slice2py/.depend.mak12
-rw-r--r--cpp/src/slice2py/Main.cpp44
-rw-r--r--cpp/src/slice2py/Makefile30
-rw-r--r--cpp/src/slice2py/Makefile.mak46
-rw-r--r--cpp/src/slice2py/Slice2Py.rc34
5 files changed, 166 insertions, 0 deletions
diff --git a/cpp/src/slice2py/.depend.mak b/cpp/src/slice2py/.depend.mak
new file mode 100755
index 00000000000..f3beb849c0f
--- /dev/null
+++ b/cpp/src/slice2py/.depend.mak
@@ -0,0 +1,12 @@
+
+Main.obj: \
+ Main.cpp \
+ "$(includedir)\Slice\PythonUtil.h" \
+ "$(includedir)\Slice\Parser.h" \
+ "$(includedir)\IceUtil\Shared.h" \
+ "$(includedir)\IceUtil\Config.h" \
+ "$(includedir)\IceUtil\Atomic.h" \
+ "$(includedir)\IceUtil\Handle.h" \
+ "$(includedir)\IceUtil\Exception.h" \
+ "$(includedir)\IceUtil\OutputUtil.h" \
+ "$(includedir)\Slice\Util.h" \
diff --git a/cpp/src/slice2py/Main.cpp b/cpp/src/slice2py/Main.cpp
new file mode 100644
index 00000000000..749749ff1bd
--- /dev/null
+++ b/cpp/src/slice2py/Main.cpp
@@ -0,0 +1,44 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2015 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.
+//
+// **********************************************************************
+
+#include <Slice/PythonUtil.h>
+#include <Slice/Util.h>
+
+using namespace std;
+using namespace Slice;
+using namespace Slice::Python;
+
+int
+main(int argc, char* argv[])
+{
+ try
+ {
+ return Slice::Python::compile(argc, argv);
+ }
+ catch(const std::exception& ex)
+ {
+ getErrorStream() << argv[0] << ": error:" << ex.what() << endl;
+ return EXIT_FAILURE;
+ }
+ catch(const std::string& msg)
+ {
+ getErrorStream() << argv[0] << ": error:" << msg << endl;
+ return EXIT_FAILURE;
+ }
+ catch(const char* msg)
+ {
+ getErrorStream() << argv[0] << ": error:" << msg << endl;
+ return EXIT_FAILURE;
+ }
+ catch(...)
+ {
+ getErrorStream() << argv[0] << ": error:" << "unknown exception" << endl;
+ return EXIT_FAILURE;
+ }
+}
diff --git a/cpp/src/slice2py/Makefile b/cpp/src/slice2py/Makefile
new file mode 100644
index 00000000000..fdd58cf87c6
--- /dev/null
+++ b/cpp/src/slice2py/Makefile
@@ -0,0 +1,30 @@
+# **********************************************************************
+#
+# Copyright (c) 2003-2015 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 = ../..
+
+NAME = $(bindir)/slice2py
+
+TARGETS = $(NAME)
+
+OBJS = Main.o
+
+RPATH_DIR = $(LOADER_PATH)/../$(libsubdir)
+
+include $(top_srcdir)/config/Make.rules
+
+CPPFLAGS := -I. $(CPPFLAGS)
+
+$(NAME): $(OBJS)
+ rm -f $@
+ $(CXX) $(LDFLAGS) $(LDEXEFLAGS) -o $@ $(OBJS) $(SLICE_LIBS) $(MCPP_RPATH_LINK)
+
+install:: all
+ $(call installprogram,$(NAME),$(DESTDIR)$(install_bindir))
+ $(call installdata,$(top_srcdir)/../man/man1/slice2py.1,$(DESTDIR)$(install_mandir))
diff --git a/cpp/src/slice2py/Makefile.mak b/cpp/src/slice2py/Makefile.mak
new file mode 100644
index 00000000000..26f0247f146
--- /dev/null
+++ b/cpp/src/slice2py/Makefile.mak
@@ -0,0 +1,46 @@
+# **********************************************************************
+#
+# Copyright (c) 2003-2015 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 = ..\..
+
+NAME = $(top_srcdir)\bin\slice2py.exe
+
+TARGETS = $(NAME)
+
+OBJS = .\Main.obj
+
+!include $(top_srcdir)/config/Make.rules.mak
+
+CPPFLAGS = -I. $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN
+
+!if "$(GENERATE_PDB)" == "yes"
+PDBFLAGS = /pdb:$(NAME:.exe=.pdb)
+!endif
+
+RES_FILE = Slice2Py.res
+
+$(NAME): $(OBJS) Slice2Py.res
+ $(LINK) $(LD_EXEFLAGS) $(PDBFLAGS) $(OBJS) $(SETARGV) $(PREOUT)$@ $(PRELIBS) \
+ $(BASELIBS) $(RES_FILE)
+ @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \
+ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest
+
+clean::
+ del /q $(NAME:.exe=.*)
+ del /q Slice2Py.res
+
+install:: all
+ copy $(NAME) "$(install_bindir)"
+
+!if "$(GENERATE_PDB)" == "yes"
+
+install:: all
+ copy $(NAME:.exe=.pdb) "$(install_bindir)"
+
+!endif
diff --git a/cpp/src/slice2py/Slice2Py.rc b/cpp/src/slice2py/Slice2Py.rc
new file mode 100644
index 00000000000..f53b13c973f
--- /dev/null
+++ b/cpp/src/slice2py/Slice2Py.rc
@@ -0,0 +1,34 @@
+#include "winver.h"
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 3,6,0,0
+ PRODUCTVERSION 3,6,0,0
+ FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
+#ifdef _DEBUG
+ FILEFLAGS VS_FF_DEBUG
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE VFT_APP
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904e4"
+ BEGIN
+ VALUE "CompanyName", "ZeroC, Inc.\0"
+ VALUE "FileDescription", "Slice To Python Translator\0"
+ VALUE "FileVersion", "3.6.0\0"
+ VALUE "InternalName", "slice2py\0"
+ VALUE "LegalCopyright", "Copyright (c) 2003-2015 ZeroC, Inc. All rights reserved.\0"
+ VALUE "OriginalFilename", "slice2py.exe\0"
+ VALUE "ProductName", "Ice\0"
+ VALUE "ProductVersion", "3.6.0\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1252
+ END
+END