vim / vim

The official Vim repository
https://www.vim.org
Vim License
36.04k stars 5.38k forks source link

Mingw Vim doesn't compile with +ruby out of the box #1381

Open graywolf opened 7 years ago

graywolf commented 7 years ago

When I tried to build Vim using mingw on windows7, it didn't compile. I tracked down the issue and problem is, that while I'm supposed to use (for example)

./configure
make -f Make_ming.mak RUBY=c:/vr/ruby RUBY_VER=24 RUBY_API_VER_LONG=2.4.0

in the if_ruby.c is used RUBY_VERSION, which is supposed to be set by configure step. When I do it like this

./configure --enable-rubyinterp=yes
make -f Make_ming.mak RUBY=c:/vr/ruby RUBY_VER=24 RUBY_API_VER_LONG=2.4.0

it works as long as ruby is in the path.

Is there a reason why if_ruby.c doesn't just ise RUBY_VER instead of RUBY_VERSION?

k-takata commented 7 years ago

If you use Make_ming.mak, ./configure is not needed. RUBY_VER is used in the makefiles to decide the include path and DLL name.

graywolf commented 7 years ago

hm, didn't know. I I should just ignore ./configure and for straight for make? I'll give it a try, thanks :)

graywolf commented 7 years ago

hm that doesn't work, the RUBY_VERSION is undefined even when I do not run ./configure and go straight to the make part.

graywolf commented 7 years ago

hm, 64bit version works just fine ./configure --enable-rubyinterp=yes, 32bit fails either way.. Am I doing something wrong or is here really something wrong?

k-takata commented 7 years ago

Static linking with Ruby is not supported in Make_ming.mak now. When dynamic linking is used, DYNAMIC_RUBY_VER should be defined instead of RUBY_VERSION.

graywolf commented 7 years ago

Static linking with Ruby is not supported in Make_ming.mak now.

is there any reason beyond it not compiling? Because after defining RUBY_VERSION by hand it seems to work just fine (at least simple cases I actually tried).

So to me it seems that only issue is with build system, which should be (relatively) easy to fix.

k-takata commented 7 years ago

is there any reason beyond it not compiling?

Maybe no. Just no one had interest in it.

BTW, did you set DYNAMIC_RUBY=no explicitly? The default is yes. So without it Ruby should be linked dynamically and RUBY_VERSION should not be used.

graywolf commented 7 years ago

Yup, I set DYNAMIC_RUBY=no explicitly. I'll look into it than and will try to update mingw make files.