summaryrefslogtreecommitdiffstats
path: root/src/Make_cyg.mak
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2010-07-17 21:19:38 +0200
committerBram Moolenaar <Bram@vim.org>2010-07-17 21:19:38 +0200
commitbd5e15fd5c7e42505d6b0e20f4198d24fc7e219d (patch)
tree70e3f86ae76494fc094bbe25c58ba2befbcf4872 /src/Make_cyg.mak
parent02c707a87da1b0f78d10a689cc03941a2e8acbc6 (diff)
Added support for Python 3. (Roland Puntaier)
Diffstat (limited to 'src/Make_cyg.mak')
-rw-r--r--src/Make_cyg.mak34
1 files changed, 33 insertions, 1 deletions
diff --git a/src/Make_cyg.mak b/src/Make_cyg.mak
index b3650bb05b..0ca7115ce9 100644
--- 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 @@ $(OUTDIR)/if_cscope.o: if_cscope.c $(INCL) if_cscope.h
$(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
+