Skip to content

Commit 3c6f92e

Browse files
committed
patch 7.4.1031
Problem: Can't build with Python interface using MingW. Solution: Update the Makefile. (Yasuhiro Matsumoto)
1 parent a2cce86 commit 3c6f92e

3 files changed

Lines changed: 49 additions & 17 deletions

File tree

src/INSTALLpc.txt

Lines changed: 37 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -232,14 +232,25 @@ or you can use 'MinGW-w64' compiler.
232232

233233
http://mingw-w64.sourceforge.net/
234234

235+
Or a compiler provided on msys2:
236+
237+
https://msys2.github.io/
238+
235239
Once you have downloaded the compiler binaries, unpack them on your hard disk
236240
somewhere, and put them on your PATH. If you are on Win95/98 you can edit
237241
your AUTOEXEC.BAT file with a line like:
238242

239243
set PATH=C:\MinGW\bin;%PATH%
240244

241245
or on NT/2000/XP, go to the Control Panel, (Performance and Maintenance),
242-
System, Advanced, and edit the environment from there.
246+
System, Advanced, and edit the environment from there. If you use msys2
247+
compilers, set your installed paths:
248+
249+
C:\msys2\mingw32\bin
250+
251+
for 32bit. And 64bit:
252+
253+
C:\msys2\mingw64\bin
243254

244255
Test if gcc is on your path. From a CMD (or COMMAND on '95/98) window:
245256

@@ -341,21 +352,32 @@ Building with the mingw32 compiler, and the ActiveState ActivePython:
341352

342353
After installing the ActivePython, you will have to create a 'mingw32'
343354
'libpython20.a' to link with:
344-
cd $PYTHON/libs
345-
pexports python20.dll > python20.def
346-
dlltool -d python20.def -l libpython20.a
355+
cd $PYTHON/libs
356+
pexports python20.dll > python20.def
357+
dlltool -d python20.def -l libpython20.a
347358

348359
Once that is done, edit the 'Make_ming.mak' so the PYTHON variable points to
349360
the root of the Python installation (C:\Python20, for example). If you are
350361
cross-compiling on Linux with the mingw32 setup, you need to also convert all
351362
the 'Include' files to *unix* line-endings. This bash command will do it
352363
easily:
353-
for fil in *.h ; do vim -e -c 'set ff=unix|w|q' $fil
364+
for fil in *.h ; do vim -e -c 'set ff=unix|w|q' $fil
354365

355366
Now just do:
356-
make -f Make_ming.mak gvim.exe
367+
make -f Make_ming.mak gvim.exe
368+
369+
And if you use msys2 to build python support (as one line):
357370

358-
and you will end up with a Python-enabled, Win32 version. Enjoy!
371+
mingw32-make -f Make_ming.mak PYTHON=c:/msys64/mingw64
372+
PYTHON_HOME=c:/msys64/mingw64
373+
PYTHONINC=-Ic:/msys64/mingw64/include/python2.7
374+
DYNAMIC_PYTHON=yes
375+
PYTHON_VER=27
376+
DYNAMIC_PYTHON_DLL=libpython2.7.dll
377+
ARCH=x86-64
378+
STATIC_STDCPLUS=yes
379+
380+
You will end up with a Python-enabled, Win32 version. Enjoy!
359381

360382

361383
7. Building with MzScheme support
@@ -464,19 +486,19 @@ the file format from "unix" to "dos".
464486

465487
After you've built the Vim binaries as described above, you're ready to
466488
install Vim on your system. However, if you've obtained the Vim sources
467-
using Mercurial or by downloading them as a unix tar file, you must first
489+
using Mercurial or by downloading them as a unix tar file, you must first
468490
create a "vim73" directory. If you instead downloaded the sources as
469491
zip files, you can skip this setup as the zip archives already have the
470-
correct directory structure.
492+
correct directory structure.
471493

472494
A. Create a Vim "runtime" subdirectory named "vim73"
473495
-----------------------------------------------------
474-
If you obtained your Vim sources as zip files, you can skip this step.
496+
If you obtained your Vim sources as zip files, you can skip this step.
475497
Otherwise, continue reading.
476498

477499
Go to the directory that contains the Vim "src" and "runtime"
478-
directories and create a new subdirectory named "vim73".
479-
500+
directories and create a new subdirectory named "vim73".
501+
480502
Copy the "runtime" files into "vim73":
481503
copy runtime\* vim73
482504

@@ -492,9 +514,9 @@ correct directory structure.
492514
C. Move the "vim73" directory into the Vim installation subdirectory
493515
---------------------------------------------------------------------
494516
Move the "vim73" subdirectory into the subdirectory where you want Vim
495-
to be installed. Typically, this subdirectory will be named "vim".
517+
to be installed. Typically, this subdirectory will be named "vim".
496518
If you already have a "vim73" subdirectory in "vim", delete it first
497-
by running its uninstal.exe program.
519+
by running its uninstal.exe program.
498520

499521
D. Install Vim
500522
---------------
@@ -507,7 +529,7 @@ correct directory structure.
507529
popup menu.
508530
- You can have it create batch files, so that you can run Vim from the
509531
console or in a shell. You can select one of the directories in your
510-
PATH or add the directory to PATH using the Windows Control Panel.
532+
PATH or add the directory to PATH using the Windows Control Panel.
511533
- Create entries for Vim on the desktop and in the Start menu.
512534

513535
Happy Vimming!

src/Make_cyg_ming.mak

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,20 +212,28 @@ DYNAMIC_PYTHON=yes
212212
endif
213213

214214
ifndef PYTHON_VER
215-
PYTHON_VER=22
215+
PYTHON_VER=27
216+
endif
217+
ifndef DYNAMIC_PYTHON_DLL
218+
DYNAMIC_PYTHON_DLL=python$(PYTHON_VER).dll
219+
endif
220+
ifdef PYTHON_HOME
221+
PYTHON_HOME_DEF=-DPYTHON_HOME=\"$(PYTHON_HOME)\"
216222
endif
217223

218224
ifeq (no,$(DYNAMIC_PYTHON))
219225
PYTHONLIB=-L$(PYTHON)/libs -lpython$(PYTHON_VER)
220226
endif
221227
# my include files are in 'win32inc' on Linux, and 'include' in the standard
222228
# NT distro (ActiveState)
229+
ifndef PYTHONINC
223230
ifeq ($(CROSS),no)
224231
PYTHONINC=-I $(PYTHON)/include
225232
else
226233
PYTHONINC=-I $(PYTHON)/win32inc
227234
endif
228235
endif
236+
endif
229237

230238
# Python3 interface:
231239
# 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 \
772780
gui.h
773781

774782
$(OUTDIR)/if_python.o : if_python.c if_py_both.h $(INCL)
775-
$(CC) -c $(CFLAGS) $(PYTHONINC) -DDYNAMIC_PYTHON_DLL=\"python$(PYTHON_VER).dll\" $< -o $@
783+
$(CC) -c $(CFLAGS) $(PYTHONINC) $(PYTHON_HOME_DEF) -DDYNAMIC_PYTHON_DLL=\"$(DYNAMIC_PYTHON_DLL)\" $< -o $@
776784

777785
$(OUTDIR)/if_python3.o : if_python3.c if_py_both.h $(INCL)
778786
$(CC) -c $(CFLAGS) $(PYTHON3INC) -DDYNAMIC_PYTHON3_DLL=\"PYTHON$(PYTHON3_VER).dll\" $< -o $@

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,8 @@ static char *(features[]) =
741741

742742
static int included_patches[] =
743743
{ /* Add new patch number below this line */
744+
/**/
745+
1031,
744746
/**/
745747
1030,
746748
/**/

0 commit comments

Comments
 (0)