]> granicus.if.org Git - python/commitdiff
Patch and new file by Geoff Furnish for C++ compilation.
authorGuido van Rossum <guido@python.org>
Thu, 16 Dec 1999 17:52:08 +0000 (17:52 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 16 Dec 1999 17:52:08 +0000 (17:52 +0000)
Modules/Makefile.pre.in
Modules/ccpython.cc [new file with mode: 0644]

index f25f2049eba676f60d5e1723bcacce0ce0df74a8..389227c56170e7f819b264fcb5319493209a9c64 100644 (file)
@@ -17,7 +17,7 @@ VERSION=      @VERSION@
 srcdir=                @srcdir@
 VPATH=         @srcdir@
 
-@SET_CCC@
+@SET_CXX@
 CC=            @CC@
 RANLIB=                @RANLIB@
 AR=            @AR@
@@ -95,7 +95,8 @@ MAKESETUP=    $(srcdir)/makesetup
 FIXOBJS=       config.o getpath.o main.o getbuildinfo.o
 OBJS=          $(MODOBJS) $(FIXOBJS)
 
-MAINOBJ=       python.o
+#MAINOBJ=      python.o
+MAINOBJ=       @MAINOBJ@
 
 SYSLIBS=       $(LIBM) $(LIBC)
 
@@ -243,4 +244,7 @@ $(DESTSHARED):
                        fi; \
                done
 
+ccpython.o: ccpython.cc
+       $(CXX) $(CFLAGS) -c $*.cc
+
 # Stuff is appended here by makesetup and make depend
diff --git a/Modules/ccpython.cc b/Modules/ccpython.cc
new file mode 100644 (file)
index 0000000..a6e97ff
--- /dev/null
@@ -0,0 +1,11 @@
+/* Minimal main program -- everything is loaded from the library */
+
+#include "Python.h"
+
+extern "C"
+DL_EXPORT(int) Py_Main( int argc, char *argv[] );
+
+int main( int argc, char *argv[] )
+{
+       return Py_Main(argc, argv);
+}