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
@ -464,19 +486,19 @@ the file format from "unix" to "dos".
After you've built the Vim binaries as described above, you're ready to
install Vim on your system. However, if you've obtained the Vim sources
using Mercurial or by downloading them as a unix tar file, you must first
using Mercurial or by downloading them as a unix tar file, you must first
create a "vim73" directory. If you instead downloaded the sources as
zip files, you can skip this setup as the zip archives already have the
correct directory structure.
correct directory structure.
A. Create a Vim "runtime" subdirectory named "vim73"
-----------------------------------------------------
If you obtained your Vim sources as zip files, you can skip this step.
If you obtained your Vim sources as zip files, you can skip this step.
Otherwise, continue reading.
Go to the directory that contains the Vim "src" and "runtime"
directories and create a new subdirectory named "vim73".
directories and create a new subdirectory named "vim73".
Copy the "runtime" files into "vim73":
copy runtime\* vim73
@ -492,9 +514,9 @@ correct directory structure.
C. Move the "vim73" directory into the Vim installation subdirectory
---------------------------------------------------------------------
Move the "vim73" subdirectory into the subdirectory where you want Vim
to be installed. Typically, this subdirectory will be named "vim".
to be installed. Typically, this subdirectory will be named "vim".
If you already have a "vim73" subdirectory in "vim", delete it first
by running its uninstal.exe program.
by running its uninstal.exe program.
D. Install Vim
---------------
@ -507,7 +529,7 @@ correct directory structure.
popup menu.
- You can have it create batch files, so that you can run Vim from the
console or in a shell. You can select one of the directories in your
PATH or add the directory to PATH using the Windows Control Panel.
PATH or add the directory to PATH using the Windows Control Panel.
- Create entries for Vim on the desktop and in the Start menu.
Happy Vimming!

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,
/**/