Ken Takata wrote:

> 2016/1/5 Tue 21:40:45 UTC+9 Ken Takata wrote:
> > > > > I tried Ruby 2.2, but it appears it doesn't work with MSVC.
> > > > > The config.h include file is in include/ruby-2.2.0/i386-mingw32.
> > > > > Trying to change the path for that results in a missing "strings.h"
> > > > > include file, I assume that's from MingW.
> > > > 
> > > > As I wrote in this post, I do some hacks on AppVeyor:
> > > > https://groups.google.com/d/msg/vim_dev/dAXpcpHmVw4/zz_NoTUICwAJ
> > > > 
> > > > 1. Download Ruby 2.2's source code and generate config.h:
> > > > 
> > > >   cd C:\projects
> > > >   git clone https://github.com/ruby/ruby.git -b ruby_2_2
> > > >   cd ruby
> > > >   call win32\configure.bat
> > > >   nmake .config.h.time
> > > > 
> > > > There is no need to build whole Ruby, just config.h is needed.
> > > > The config.h is generated in the .ext\include\i386-mswin32_100 
> > > > directory.
> > > > 
> > > > 
> > > > 2. Adjust some variables when building Vim
> > > > 
> > > >   nmake -f Make_mvc.mak ^
> > > >         ... ^
> > > >         RUBY=C:\projects\ruby DYNAMIC_RUBY=yes RUBY_VER=22 
> > > > RUBY_VER_LONG=2.2.0 ^
> > > >         RUBY_INSTALL_NAME=msvcrt-ruby$(RUBY_API_VER) ^
> > > >         RUBY_PLATFORM=i386-mswin32_100 ^
> > > >         RUBY_INC="/I $(RUBY)\include /I 
> > > > $(RUBY)\.ext\include\$(RUBY_PLATFORM)" ^
> > > >         WINVER=0x500 
> > > > 
> > > > Normally we need to set only RUBY, DYNAMIC_RUBY, RUBY_VER, 
> > > > RUBY_VER_LONG and
> > > > WINVER. (WINVER must be set to >=0x500, when building with Ruby 2.1+.)
> > > > But when using this trick, we also need to set RUBY_INSTALL_NAME,
> > > > RUBY_PLATFORM and RUBY_INC.
> > > 
> > > Instead of that, can we copy the generated config.h into the installed
> > > Ruby directory, next to the MingW one?  Or does that not work?
> > 
> > If we copy ".ext\include\i386-mswin32_100\config.h" (when using 32-bit VC10)
> > to "C:\Ruby22\include\ruby-2.2.0\i386-mswin32_100\config.h", we don't need 
> > to
> > set RUBY_INC, but we still need to set RUBY_PLATFORM and RUBY_INSTALL_NAME.
> > Because:
> > 
> > 1. The current Make_mvc.mak doesn't set RUBY_PLATFORM properly when using 
> > VC7
> > or later.
> > 
> > 2. RUBY_INSTALL_NAME is used for the DLL name, and the name is different 
> > when
> > using different compiler. E.g.
> >   MSVC10 32 bits: msvcr100-ruby220.dll
> >   MinGW 32bits:   msvcrt-ruby220.dll
> >   MSVC10 64 bits: x64-msvcr100-ruby220.dll
> >   MinGW 64bits:   x64-msvcrt-ruby220.dll
> > We want to link Vim built by MSVC with RubyInstaller built by MinGW, so
> > RUBY_INSTALL_NAME must be set manually.
> > 
> > Now I'm trying to update Make_mvc.mak to set RUBY_PLATFORM properly,
> > but even if I succeeded this, we still need to set RUBY_INSTALL_NAME.
> 
> I wrote a patch for this.
> 
> After applying this patch, the following command:
> 
>   nmake -f Make_mvc.mak ^
>       ... ^
>       RUBY=C:\projects\ruby DYNAMIC_RUBY=yes RUBY_VER=22 RUBY_VER_LONG=2.2.0 ^
>       RUBY_INSTALL_NAME=msvcrt-ruby$(RUBY_API_VER) ^
>       RUBY_PLATFORM=i386-mswin32_100 ^
>       RUBY_INC="/I $(RUBY)\include /I $(RUBY)\.ext\include\$(RUBY_PLATFORM)" ^
>       WINVER=0x500 
> 
> becomes simpler as the following:
> 
>     nmake -f Make_mvc.mak ^
>       ... ^
>       RUBY=C:\Ruby22 DYNAMIC_RUBY=yes RUBY_VER=22 RUBY_VER_LONG=2.2.0 ^
>       RUBY_MSVCRT_NAME=msvcrt ^
>       WINVER=0x500 
> 
> (Assuming that the generated config.h has been copied to
> "C:\Ruby22\include\ruby-2.2.0\i386-mswin32_100\config.h".)

Thanks!

-- 
The Law, in its majestic equality, forbids the rich, as well as the
poor, to sleep under the bridges, to beg in the streets, and to steal
bread.                       -- Anatole France

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
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.

Raspunde prin e-mail lui