Hi Bram,

2016/9/3 Sat 2:34:31 UTC+9 Bram Moolenaar wrote:
> Ken Takata wrote:
> 
> > 2016/9/2 Fri 3:51:35 UTC+9 Bram Moolenaar wrote:
> > > Patch 7.4.2302
> > > Problem:    Default interface versions for MS-Windows are outdated.
> > > Solution:   Use Active Perl 5.24, Python 3.5.2.  Could only make it work 
> > > with
> > >             Ruby 1.9.2.
> > > Files:      src/bigvim.bat, src/bigvim64.bat
> > 
> > As I wrote in INSTALLpc.txt, you need a hack to link with recent Ruby.
> > (If you use a binary from rubyinstaller.org .)
> > You need to generate config.h from Ruby's source code. Also you need to set
> > RUBY_MSVCRT_NAME=msvcrt .
> > The build script in vim-win32-installer uses this hack.
> > https://github.com/vim/vim-win32-installer/blob/master/appveyor.bat#L113-L122
> > https://github.com/vim/vim-win32-installer/blob/master/appveyor.bat#L163
> 
> I tried part of this and it failed.  I'll give it another try.
> 
> > BTW, which ruby binary do you use?  Maybe ruby-1.9.2-p136-i386-mswin32.zip
> > form http://www.garbagecollect.jp/ruby/mswin32/en/download/release.html ?
> > If you use this, you also need to set RUBY_VER_LONG=1.9.1 instead of 1.9.2.
> > Because Ruby 1.9.2's API version is 1.9.1 and RUBY_VER_LONG is used for
> > specifying API version.
> 
> Yes, that's what I used before.  I renamed the directory.

Oh, that was incorrect. RUBY_VER_LONG is also used for the name of ruby's DLL.
The Vim binary with your configuration will try to load msvcrt-ruby192.dll, but
actual filename is msvcrt-ruby191.dll.


> > I think the name RUBY_VER_LONG is confusing. Renaming to RUBY_API_VER_LONG
> > makes the thing clearer. (But the name is long.)
> 
> Yes, that's better.

Okay, I wrote a patch for this. RUBY_VER_LONG can be still used for backward
compatibility, but if RUBY_API_VER_LONG is defined, it overrides RUBY_VER_LONG.

And, when I wrote the patch, I found that makefiles for cygwin/mingw don't
have modelines. So I copied them from Make_mvc.mak. (But they differ from
Makefile. I'm not sure which modelines are prefer.)

Regards,
Ken Takata

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
# HG changeset patch
# Parent  c1ae2fa18e083d54bc7c8bbf219557f1559675df

diff --git a/src/INSTALLpc.txt b/src/INSTALLpc.txt
--- a/src/INSTALLpc.txt
+++ b/src/INSTALLpc.txt
@@ -598,11 +598,11 @@ you need some tricks described below.
 
 When building, you need to set the following variables at least:
 
-    RUBY:          Where ruby is installed. E.g. C:\Ruby22
-    DYNAMIC_RUBY:  Whether dynamic linking is used. Usually, set to yes.
-    RUBY_VER:      Ruby version. E.g. 22 for Ruby 2.2.X.
-    RUBY_VER_LONG: Ruby API version in a long format.
-                   E.g. 2.2.0 for Ruby 2.2.X.
+    RUBY:              Where ruby is installed. E.g. C:\Ruby22
+    DYNAMIC_RUBY:      Whether dynamic linking is used. Usually, set to yes.
+    RUBY_VER:          Ruby version. E.g. 22 for Ruby 2.2.X.
+    RUBY_API_VER_LONG: Ruby API version in a long format.
+                       E.g. 2.2.0 for Ruby 2.2.X.
 
 Ruby version vs. Ruby API version:
 
@@ -653,7 +653,7 @@ config.h and Ruby's DLL name. Here are t
   4) Build Vim. Note that you need to adjust some variables (as one line):
 
       nmake -f Make_mvc.mak
-          RUBY=C:\Ruby22 DYNAMIC_RUBY=yes RUBY_VER=22 RUBY_VER_LONG=2.2.0
+          RUBY=C:\Ruby22 DYNAMIC_RUBY=yes RUBY_VER=22 RUBY_API_VER_LONG=2.2.0
           RUBY_MSVCRT_NAME=msvcrt
           WINVER=0x501
 
@@ -668,7 +668,7 @@ Using MinGW is easier than using MSVC wh
 After you install RubyInstaller, just type this (as one line):
 
     mingw32-make -f Make_ming.mak
-        RUBY=C:/Ruby22 DYNAMIC_RUBY=yes RUBY_VER=22 RUBY_VER_LONG=2.2.0
+        RUBY=C:/Ruby22 DYNAMIC_RUBY=yes RUBY_VER=22 RUBY_API_VER_LONG=2.2.0
         WINVER=0x501
 
 If you set WINVER explicitly, it must be set to >=0x500, when building with
diff --git a/src/Make_cyg_ming.mak b/src/Make_cyg_ming.mak
--- a/src/Make_cyg_ming.mak
+++ b/src/Make_cyg_ming.mak
@@ -349,12 +349,12 @@ endif
 #	  RUBY=[Path to Ruby directory] (Set inside Make_cyg.mak or Make_ming.mak)
 #	  DYNAMIC_RUBY=yes (to load the Ruby DLL dynamically)
 #	  RUBY_VER=[Ruby version, eg 18, 19, 20] (default is 18)
-#	  RUBY_VER_LONG=[Ruby version, eg 1.8, 1.9.1, 2.0.0] (default is 1.8)
-#	    You must set RUBY_VER_LONG when changing RUBY_VER.
-#	    RUBY_API_VER is derived from RUBY_VER_LONG.
+#	  RUBY_API_VER_LONG=[Ruby API version, eg 1.8, 1.9.1, 2.0.0]
+#			    (default is 1.8)
+#	    You must set RUBY_API_VER_LONG when changing RUBY_VER.
 #	    Note: If you use Ruby 1.9.3, set as follows:
 #	      RUBY_VER=19
-#	      RUBY_VER_LONG=1.9.1 (not 1.9.3, because the API version is 1.9.1.)
+#	      RUBY_API_VER_LONG=1.9.1 (not 1.9.3, because the API version is 1.9.1.)
 ifdef RUBY
 ifndef DYNAMIC_RUBY
 DYNAMIC_RUBY=yes
@@ -366,18 +366,21 @@ endif
 ifndef RUBY_VER_LONG
 RUBY_VER_LONG = 1.8
 endif
+ifndef RUBY_API_VER_LONG
+RUBY_API_VER_LONG = $(RUBY_API_VER_LONG)
+endif
 ifndef RUBY_API_VER
-RUBY_API_VER = $(subst .,,$(RUBY_VER_LONG))
+RUBY_API_VER = $(subst .,,$(RUBY_API_VER_LONG))
 endif
 
 ifndef RUBY_PLATFORM
 ifeq ($(RUBY_VER), 16)
 RUBY_PLATFORM = i586-mswin32
 else
-ifneq ($(wildcard $(RUBY)/lib/ruby/$(RUBY_VER_LONG)/i386-mingw32),)
+ifneq ($(wildcard $(RUBY)/lib/ruby/$(RUBY_API_VER_LONG)/i386-mingw32),)
 RUBY_PLATFORM = i386-mingw32
 else
-ifneq ($(wildcard $(RUBY)/lib/ruby/$(RUBY_VER_LONG)/x64-mingw32),)
+ifneq ($(wildcard $(RUBY)/lib/ruby/$(RUBY_API_VER_LONG)/x64-mingw32),)
 RUBY_PLATFORM = x64-mingw32
 else
 RUBY_PLATFORM = i386-mswin32
@@ -406,9 +409,9 @@ ifeq (19, $(word 1,$(sort 19 $(RUBY_VER)
 RUBY_19_OR_LATER = 1
 endif
 
-RUBYINC = -I $(RUBY)/lib/ruby/$(RUBY_VER_LONG)/$(RUBY_PLATFORM)
+RUBYINC = -I $(RUBY)/lib/ruby/$(RUBY_API_VER_LONG)/$(RUBY_PLATFORM)
 ifdef RUBY_19_OR_LATER
-RUBYINC += -I $(RUBY)/include/ruby-$(RUBY_VER_LONG) -I $(RUBY)/include/ruby-$(RUBY_VER_LONG)/$(RUBY_PLATFORM)
+RUBYINC += -I $(RUBY)/include/ruby-$(RUBY_API_VER_LONG) -I $(RUBY)/include/ruby-$(RUBY_API_VER_LONG)/$(RUBY_PLATFORM)
 endif
 ifeq (no, $(DYNAMIC_RUBY))
 RUBYLIB = -L$(RUBY)/lib -l$(RUBY_INSTALL_NAME)
diff --git a/src/Make_mvc.mak b/src/Make_mvc.mak
--- a/src/Make_mvc.mak
+++ b/src/Make_mvc.mak
@@ -68,12 +68,12 @@
 #	  RUBY=[Path to Ruby directory]
 #	  DYNAMIC_RUBY=yes (to load the Ruby DLL dynamically)
 #	  RUBY_VER=[Ruby version, eg 18, 19, 20] (default is 18)
-#	  RUBY_VER_LONG=[Ruby version, eg 1.8, 1.9.1, 2.0.0] (default is 1.8)
-#	    You must set RUBY_VER_LONG when change RUBY_VER.
-#	    RUBY_API_VER is derived from RUBY_VER_LONG.
+#	  RUBY_API_VER_LONG=[Ruby API version, eg 1.8, 1.9.1, 2.0.0]
+#	  		    (default is 1.8)
+#	    You must set RUBY_API_VER_LONG when change RUBY_VER.
 #	    Note: If you use Ruby 1.9.3, set as follows:
 #	      RUBY_VER=19
-#	      RUBY_VER_LONG=1.9.1 (not 1.9.3, because the API version is 1.9.1.)
+#	      RUBY_API_VER_LONG=1.9.1 (not 1.9.3, because the API version is 1.9.1.)
 #
 #	Tcl interface:
 #	  TCL=[Path to Tcl directory]
@@ -922,8 +922,11 @@ RUBY_VER = 18
 !ifndef RUBY_VER_LONG
 RUBY_VER_LONG = 1.8
 !endif
+!ifndef RUBY_API_VER_LONG
+RUBY_API_VER_LONG = $(RUBY_VER_LONG)
+!endif
 !ifndef RUBY_API_VER
-RUBY_API_VER = $(RUBY_VER_LONG:.=)
+RUBY_API_VER = $(RUBY_API_VER_LONG:.=)
 !endif
 
 !if $(RUBY_VER) >= 18
@@ -966,9 +969,9 @@ RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_A
 CFLAGS = $(CFLAGS) -DFEAT_RUBY
 RUBY_OBJ = $(OUTDIR)\if_ruby.obj
 !if $(RUBY_VER) >= 19
-RUBY_INC = /I "$(RUBY)\lib\ruby\$(RUBY_VER_LONG)\$(RUBY_PLATFORM)" /I "$(RUBY)\include\ruby-$(RUBY_VER_LONG)" /I "$(RUBY)\include\ruby-$(RUBY_VER_LONG)\$(RUBY_PLATFORM)"
+RUBY_INC = /I "$(RUBY)\lib\ruby\$(RUBY_API_VER_LONG)\$(RUBY_PLATFORM)" /I "$(RUBY)\include\ruby-$(RUBY_API_VER_LONG)" /I "$(RUBY)\include\ruby-$(RUBY_API_VER_LONG)\$(RUBY_PLATFORM)"
 !else
-RUBY_INC = /I "$(RUBY)\lib\ruby\$(RUBY_VER_LONG)\$(RUBY_PLATFORM)"
+RUBY_INC = /I "$(RUBY)\lib\ruby\$(RUBY_API_VER_LONG)\$(RUBY_PLATFORM)"
 !endif
 RUBY_LIB = $(RUBY)\lib\$(RUBY_INSTALL_NAME).lib
 # Do we want to load Ruby dynamically?
diff --git a/src/bigvim.bat b/src/bigvim.bat
--- a/src/bigvim.bat
+++ b/src/bigvim.bat
@@ -1,5 +1,5 @@
 :: command to build big Vim with OLE, Perl, Python, Ruby and Tcl
 SET VCDIR="C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\"
 SET TOOLDIR=E:\
-%VCDIR%nmake -f Make_mvc.mak GUI=yes OLE=yes PERL=%TOOLDIR%perl524 DYNAMIC_PERL=yes PERL_VER=524 PYTHON=%TOOLDIR%python27 DYNAMIC_PYTHON=yes PYTHON_VER=27 PYTHON3=%TOOLDIR%python35 DYNAMIC_PYTHON3=yes PYTHON3_VER=35 RUBY=%TOOLDIR%ruby192 DYNAMIC_RUBY=yes RUBY_VER=19 RUBY_VER_LONG=1.9.2 RUBY_MSVCRT_NAME=msvcrt TCL=%TOOLDIR%tcl TCL_VER=86 TCL_VER_LONG=8.6 DYNAMIC_TCL=yes %1 IME=yes CSCOPE=yes
+%VCDIR%nmake -f Make_mvc.mak GUI=yes OLE=yes PERL=%TOOLDIR%perl524 DYNAMIC_PERL=yes PERL_VER=524 PYTHON=%TOOLDIR%python27 DYNAMIC_PYTHON=yes PYTHON_VER=27 PYTHON3=%TOOLDIR%python35 DYNAMIC_PYTHON3=yes PYTHON3_VER=35 RUBY=%TOOLDIR%ruby192 DYNAMIC_RUBY=yes RUBY_VER=19 RUBY_API_VER_LONG=1.9.1 RUBY_MSVCRT_NAME=msvcrt TCL=%TOOLDIR%tcl TCL_VER=86 TCL_VER_LONG=8.6 DYNAMIC_TCL=yes %1 IME=yes CSCOPE=yes
 
# HG changeset patch
# Parent  0fb58bb166dd9506eb4d21bf27227faaf9647862

diff --git a/src/Make_cyg.mak b/src/Make_cyg.mak
--- a/src/Make_cyg.mak
+++ b/src/Make_cyg.mak
@@ -50,3 +50,5 @@ CROSS_COMPILE = i686-pc-mingw32-
 # Do not change this.
 UNDER_CYGWIN = yes
 include Make_cyg_ming.mak
+
+# vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0:
diff --git a/src/Make_cyg_ming.mak b/src/Make_cyg_ming.mak
--- a/src/Make_cyg_ming.mak
+++ b/src/Make_cyg_ming.mak
@@ -953,3 +953,5 @@ else
 	@echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> pathdef.c
 	@echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> pathdef.c
 endif
+
+# vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0:
diff --git a/src/Make_ming.mak b/src/Make_ming.mak
--- a/src/Make_ming.mak
+++ b/src/Make_ming.mak
@@ -47,3 +47,5 @@
 # Do not change this.
 UNDER_CYGWIN = no
 include Make_cyg_ming.mak
+
+# vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0:

Raspunde prin e-mail lui