diff src/Make_cyg.mak @ 2329:ad2889f48843 vim73

Added support for Python 3. (Roland Puntaier)
author Bram Moolenaar <bram@vim.org>
date Sat, 17 Jul 2010 21:19:38 +0200
parents 966a5609669e
children 5c4b2fc4f067
line wrap: on
line diff
--- a/src/Make_cyg.mak
+++ b/src/Make_cyg.mak
@@ -14,6 +14,9 @@
 # PYTHON	define to path to Python dir to get PYTHON support (not defined)
 #   PYTHON_VER	    define to version of Python being used (22)
 #   DYNAMIC_PYTHON  no or yes: use yes to load the Python DLL dynamically (yes)
+# PYTHON3	define to path to Python3 dir to get PYTHON3 support (not defined)
+#   PYTHON3_VER	    define to version of Python3 being used (22)
+#   DYNAMIC_PYTHON3  no or yes: use yes to load the Python3 DLL dynamically (yes)
 # TCL		define to path to TCL dir to get TCL support (not defined)
 #   TCL_VER	define to version of TCL being used (83)
 #   DYNAMIC_TCL no or yes: use yes to load the TCL DLL dynamically (yes)
@@ -139,7 +142,6 @@ endif
 ##############################
 ifdef PYTHON
 DEFINES += -DFEAT_PYTHON
-INCLUDES += -I$(PYTHON)/include
 EXTRA_OBJS += $(OUTDIR)/if_python.o
 
 ifndef DYNAMIC_PYTHON
@@ -158,6 +160,29 @@ endif
 endif
 
 ##############################
+# DYNAMIC_PYTHON3=yes works.
+# DYNAMIC_PYTHON3=no does not (unresolved externals on link).
+##############################
+ifdef PYTHON3
+DEFINES += -DFEAT_PYTHON3
+EXTRA_OBJS += $(OUTDIR)/if_python3.o
+
+ifndef DYNAMIC_PYTHON3
+DYNAMIC_PYTHON3 = yes
+endif
+
+ifndef PYTHON3_VER
+PYTHON3_VER = 31
+endif
+
+ifeq (yes, $(DYNAMIC_PYTHON3))
+DEFINES += -DDYNAMIC_PYTHON3 -DDYNAMIC_PYTHON3_DLL=\"python$(PYTHON3_VER).dll\"
+else
+EXTRA_LIBS += $(PYTHON3)/libs/python$(PYTHON3_VER).lib
+endif
+endif
+
+##############################
 # DYNAMIC_RUBY=yes works.
 # DYNAMIC_RUBY=no does not (process exits).
 ##############################
@@ -563,6 +588,12 @@ distclean: clean
 $(OUTDIR)/if_ole.o:	if_ole.cpp $(INCL)
 	$(CC) -c $(CFLAGS) if_ole.cpp -o $(OUTDIR)/if_ole.o
 
+$(OUTDIR)/if_python.o : if_python.c $(INCL)
+	$(CC) -c $(CFLAGS) -I$(PYTHON)/include $< -o $@
+
+$(OUTDIR)/if_python3.o : if_python3.c $(INCL)
+	$(CC) -c $(CFLAGS) -I$(PYTHON3)/include $< -o $@
+
 if_perl.c: if_perl.xs typemap
 	$(PERL)/bin/perl `cygpath -d $(PERL)/lib/ExtUtils/xsubpp` \
 		-prototypes -typemap \
@@ -612,3 +643,4 @@ else
 	@echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> pathdef.c
 	@echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> pathdef.c
 endif
+