patch 7.4.1031

Problem:    Can't build with Python interface using MingW.
Solution:   Update the Makefile. (Yasuhiro Matsumoto)
This commit is contained in:
Bram Moolenaar
2016-01-02 20:26:36 +01:00
parent a2cce86307
commit 3c6f92e52e
3 changed files with 49 additions and 17 deletions

View File

@ -232,6 +232,10 @@ or you can use 'MinGW-w64' compiler.
http://mingw-w64.sourceforge.net/
Or a compiler provided on msys2:
https://msys2.github.io/
Once you have downloaded the compiler binaries, unpack them on your hard disk
somewhere, and put them on your PATH. If you are on Win95/98 you can edit
your AUTOEXEC.BAT file with a line like:
@ -239,7 +243,14 @@ your AUTOEXEC.BAT file with a line like:
set PATH=C:\MinGW\bin;%PATH%
or on NT/2000/XP, go to the Control Panel, (Performance and Maintenance),
System, Advanced, and edit the environment from there.
System, Advanced, and edit the environment from there. If you use msys2
compilers, set your installed paths:
C:\msys2\mingw32\bin
for 32bit. And 64bit:
C:\msys2\mingw64\bin
Test if gcc is on your path. From a CMD (or COMMAND on '95/98) window:
@ -341,21 +352,32 @@ Building with the mingw32 compiler, and the ActiveState ActivePython:
After installing the ActivePython, you will have to create a 'mingw32'
'libpython20.a' to link with:
cd $PYTHON/libs
pexports python20.dll > python20.def
dlltool -d python20.def -l libpython20.a
cd $PYTHON/libs
pexports python20.dll > python20.def
dlltool -d python20.def -l libpython20.a
Once that is done, edit the 'Make_ming.mak' so the PYTHON variable points to
the root of the Python installation (C:\Python20, for example). If you are
cross-compiling on Linux with the mingw32 setup, you need to also convert all
the 'Include' files to *unix* line-endings. This bash command will do it
easily:
for fil in *.h ; do vim -e -c 'set ff=unix|w|q' $fil
for fil in *.h ; do vim -e -c 'set ff=unix|w|q' $fil
Now just do:
make -f Make_ming.mak gvim.exe
make -f Make_ming.mak gvim.exe
and you will end up with a Python-enabled, Win32 version. Enjoy!
And if you use msys2 to build python support (as one line):
mingw32-make -f Make_ming.mak PYTHON=c:/msys64/mingw64
PYTHON_HOME=c:/msys64/mingw64
PYTHONINC=-Ic:/msys64/mingw64/include/python2.7
DYNAMIC_PYTHON=yes
PYTHON_VER=27
DYNAMIC_PYTHON_DLL=libpython2.7.dll
ARCH=x86-64
STATIC_STDCPLUS=yes
You will end up with a Python-enabled, Win32 version. Enjoy!
7. Building with MzScheme support

View File

@ -212,7 +212,13 @@ DYNAMIC_PYTHON=yes
endif
ifndef PYTHON_VER
PYTHON_VER=22
PYTHON_VER=27
endif
ifndef DYNAMIC_PYTHON_DLL
DYNAMIC_PYTHON_DLL=python$(PYTHON_VER).dll
endif
ifdef PYTHON_HOME
PYTHON_HOME_DEF=-DPYTHON_HOME=\"$(PYTHON_HOME)\"
endif
ifeq (no,$(DYNAMIC_PYTHON))
@ -220,12 +226,14 @@ PYTHONLIB=-L$(PYTHON)/libs -lpython$(PYTHON_VER)
endif
# my include files are in 'win32inc' on Linux, and 'include' in the standard
# NT distro (ActiveState)
ifndef PYTHONINC
ifeq ($(CROSS),no)
PYTHONINC=-I $(PYTHON)/include
else
PYTHONINC=-I $(PYTHON)/win32inc
endif
endif
endif
# Python3 interface:
# PYTHON3=[Path to Python3 directory] (Set inside Make_cyg.mak or Make_ming.mak)
@ -772,7 +780,7 @@ INCL = vim.h feature.h os_win32.h os_dos.h ascii.h keymap.h term.h macros.h \
gui.h
$(OUTDIR)/if_python.o : if_python.c if_py_both.h $(INCL)
$(CC) -c $(CFLAGS) $(PYTHONINC) -DDYNAMIC_PYTHON_DLL=\"python$(PYTHON_VER).dll\" $< -o $@
$(CC) -c $(CFLAGS) $(PYTHONINC) $(PYTHON_HOME_DEF) -DDYNAMIC_PYTHON_DLL=\"$(DYNAMIC_PYTHON_DLL)\" $< -o $@
$(OUTDIR)/if_python3.o : if_python3.c if_py_both.h $(INCL)
$(CC) -c $(CFLAGS) $(PYTHON3INC) -DDYNAMIC_PYTHON3_DLL=\"PYTHON$(PYTHON3_VER).dll\" $< -o $@

View File

@ -741,6 +741,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1031,
/**/
1030,
/**/