For iscygpty.c, how about adding `-UWINVER -DWINVER=0x0600`? (Not tested.)
iscygpty requires new Win32 APIs which were added in Windows Vista.
For the other problem, I think your MinGW is too old. (The above problem
should be caused by the same reason, though.)
I highly recommend you to use MinGW-w64 instead of the original MinGW (which
looks dead).
There are some distributions which provide binary packages of MinGW-w64,
and I think MSYS2 is the best. (https://www.msys2.org/)
If we still need to support the original MinGW, we might need some modifications
to the codes and makefiles. However, I can't help it, because I have already
uninstalled the original MinGW.
Regards,
Ken Takata
Sorry for the late reply.
I set up iscygpty to use dynamic loading so that it can be executed on XP.
Even though, it uses some definitions for Vista APIs, therefore it requires
WINVER=0x0600. This doesn't affect other parts of Vim, so we can use other
value for the default of WINVER (if needed).
> > For the other problem, I think your MinGW is too old. (The above problem
> > should be caused by the same reason, though.)
> > I highly recommend you to use MinGW-w64 instead of the original MinGW (which
> > looks dead).
>
> I ran the installer to update, but it appears nothing happened.
>
> > There are some distributions which provide binary packages of MinGW-w64,
> > and I think MSYS2 is the best. (https://www.msys2.org/)
> >
> > If we still need to support the original MinGW, we might need some
> > modifications to the codes and makefiles. However, I can't help it,
> > because I have already uninstalled the original MinGW.
>
> I think the main use of MinGW is to build without MSVC. And since it's
> freely available there shouldn't be much problem getting the latest
> version.
>
> So how about updating the instructions to add a step-by-step
> explanation how to build Vim with MinGW? Including hints how to get the
> latest version (and possibly deleting the old one, if that is needed).
Okay, we might need a step-by-step instruction how to setup MSYS2 for
building Vim. The msys2 installer just installs a basic environment.
Each user need to install GCC and other development packages by using
the `pacman` command.
# Setup msys2 environment for building Vim
1. Setup the basic msys2 environment
Go to the official page of MSYS2: https://www.msys2.org
Download an installer:
* msys2-x86_64-YYYYMMDD.exe for 64-bit Windows
(Even if you want to build 32-bit Vim)
* msys2-i686-YYYYMMDD.exe for 32-bit Windows
Follow the official instructions to update basic packages. Execute
`pacman -Syu` and restart MSYS2 window (select "MSYS2 MSYS" icon from the
Start Menu), then execute `pacman -Su`.
If pacman complains that `catgets` and `libcatgets` conflict with another
package, select `y` to remove them.
2. Install additional packages for building Vim
The following package groups are required for building Vim:
* base-devel
* mingw-w64-i686-toolchain (for building 32-bit Vim)
* mingw-w64-x86_64-toolchain (for building 64-bit Vim)
Open the "MSYS2 MSYS" icon from the Start Menu, then you can use the following
command to install them:
pacman -S base-devel mingw-w64-i686-toolchain mingw-w64-x86_64-toolchain
Or you can use the `pacboy` command to avoid long package names:
pacboy -S base-devel: toolchain:m
(See `pacboy help` for the help.)
3. Keep the build environment up-to-date
After you have installed the build environment, you may want to keep it
up-to-date (E.g. always use the latest GCC).
In that case, you just need to execute the command `pacman -Syu` once or twice.
# Build Vim
Select one of the following icon from the Start Menu:
* MSYS2 MinGW 32-bit (To build 32-bit versions of Vim)
* MSYS2 MinGW 64-bit (To build 64-bit versions of Vim)
Go to the source directory of Vim, then execute the make command. E.g.:
make -f Make_mingw.mak GUI=yes
Regards,
Ken Takata
If you only want to build 32-bit Vim, you don't need to install the x86_64
toolchain. In this case, you can use one of the following commands:
pacman -S base-devel mingw-w64-i686-toolchain
or:
pacboy -S base-devel: toolchain:i
(The ":i" suffix means i686 only.)
If you only want to build 64-bit Vim, you don't need to install the i686
toolchain. In this case, you can use one of the following commands:
pacman -S base-devel mingw-w64-x86_64-toolchain
or:
pacboy -S base-devel: toolchain:x
(The ":x" suffix means x86_64 only.)
Some of the package might not be needed for building Vim, but I haven't
checked which is necessary and which is not.
The above package groups are generally useful for building many kind of
programs.
> > (See `pacboy help` for the help.)
> >
> > 3. Keep the build environment up-to-date
> >
> > After you have installed the build environment, you may want to keep it
> > up-to-date (E.g. always use the latest GCC).
> > In that case, you just need to execute the command `pacman -Syu` once or twice.
> >
> >
> > # Build Vim
> >
> > Select one of the following icon from the Start Menu:
> >
> > * MSYS2 MinGW 32-bit (To build 32-bit versions of Vim)
> > * MSYS2 MinGW 64-bit (To build 64-bit versions of Vim)
> >
> > Go to the source directory of Vim, then execute the make command. E.g.:
> >
> > make -f Make_mingw.mak GUI=yes
>
> Hmm, I get "make: command not found". I guess I should have selected
> "all" when using pacboy.
The make command is included in the base-devel package group. Of course,
you can install the make package separately:
pacman -S make
or:
pacboy -S make:
> That uses the MSYS console, where just about nothing works. "git pull"
> doesn't work. Can't even run the Vim I just build in it. How to build
> Vim in a normal Windows console?
When the MSYS2 console is executed, MSYS2 stops exporting the current $PATH
by default. If you want to use git in MSYS2 console, there are two ways.
1. Change the MSYS2 setting to export the current $PATH
See C:\msys64\msys2_shell.cmd for detail.
2. Install the MSYS2 version of git
MSYS2 has its own version of git. You can install it by pacman/pacboy.
> I tried prepending "c:\msys64\usr\bin" to $PATH and that appears to
> work. No wait, that picks up an old MinGW version of gcc. OK, this
> seems to work: also prepend c:\msys64\mingw32\bin".
The gcc installed in C:\msys64\usr\bin is MSYS2's self compiler.
If you want to build Vim running in the MSYS2 console, you need to use this.
(This is almost the same as Cygwin, so Unix-like configure/make style is used.)
> I'll make a patch with these hints, we can further improve it afterwards.
Regards,
Ken Takata
You can refer Arch Wiki for general usage of the pacman command:
https://wiki.archlinux.org/index.php/pacman
To remove x64_86 toolchain, try:
pacman -R mingw-w64-x86_64-toolchain
or:
pacman -R toolchain:x
Also you can clean the package cache. The downloaded packages are stored in
the C:\msys64\var\cache\pacman\pkg directory.
See the following part for how to clean it:
https://wiki.archlinux.org/index.php/pacman#Cleaning_the_package_cache
(Or you can remove the files manually. It is not recommended, though.)
> > > That uses the MSYS console, where just about nothing works. "git pull"
> > > doesn't work. Can't even run the Vim I just build in it. How to build
> > > Vim in a normal Windows console?
> >
> > When the MSYS2 console is executed, MSYS2 stops exporting the current $PATH
> > by default. If you want to use git in MSYS2 console, there are two ways.
> >
> > 1. Change the MSYS2 setting to export the current $PATH
> > See C:\msys64\msys2_shell.cmd for detail.
> > 2. Install the MSYS2 version of git
> > MSYS2 has its own version of git. You can install it by pacman/pacboy.
>
> I don't really want to use the MSYS2 console, it's like using Linux on a
> Windows system. When doing "pwd" I see a different home directory,
> among other surprises. I prefer using the Windows console, since that
> is what most people will be using.
Okay, but some other people want to use the MSYS2 console.
We might be able to improve the instructions for those people.
Regards,
Ken Takata