Compiling with Ruby on Win32 (mvc.mak) fails?

classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

Compiling with Ruby on Win32 (mvc.mak) fails?

tux.
Weird: I can't compile vim73 with Ruby (v1.9.1) anymore.
Environment: Windows 7, Visual Studio 2008.

My Ruby is installed in C:\Ruby, I set RUBY_VER to 19 and RUBY_VER_LONG to 1.9.1, nmake got RUBY=yes DYNAMIC_RUBY=yes.
However, the particular log line says:

------------------------------------------------------------

    cl -c /W3 /nologo  -I. -Iproto -DHAVE_PATHDEF -DWIN32  -DFEAT_SNIFF -DFEAT_CSCOPE -DFEAT_NETBEANS_INTG   -DFEAT_XPM_W32   -DWINVER=0x0400 -D_WIN32_WINNT=0x0400  /Fo.\ObjGOLYTR/ /Ox /GL -DNDEBUG  /Zl /MT -DFEAT_OLE -DFEAT_MBYTE_IME -DDYNAMIC_IME -DGLOBAL_IME -DFEAT_MBYTE -DFEAT_GUI_W32 -DDYNAMIC_ICONV -DDYNAMIC_GETTEXT -DFEAT_TCL -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"tcl85.dll\"  -DDYNAMIC_TCL_VER=\"8.5\" -DFEAT_PYTHON -DDYNAMIC_PYTHON  -DDYNAMIC_PYTHON_DLL=\"python26.dll\" -DFEAT_PERL -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl512.dll\" -DFEAT_RUBY -DDYNAMIC_RUBY -DDYNAMIC_RUBY_VER=19  -DDYNAMIC_RUBY_DLL=\"msvcrt-ruby19.dll\" -DMSWINPS -DFEAT_huge /Fd.\ObjGOLYTR/ /Zi /I "C:\Ruby\lib\ruby\1.9.1\i386-mswin32" if_ruby.c

if_ruby.c

if_ruby.c(68) : fatal error C1083: Datei (Include) kann nicht ge”ffnet werden: "ruby.h": No such file or directory

------------------------------------------------------------

When I was using Ruby v1.8.6, everything worked fine with exactly this configuration. Now even rolling back to Ruby v1.8.7 does not work anymore.

Any ideas?

--
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
Reply | Threaded
Open this post in threaded view
|

Re: Compiling with Ruby on Win32 (mvc.mak) fails?

Charles-14
On Tue, Jun 29, 2010 at 9:32 AM, Tux <[hidden email]> wrote:
> Weird: I can't compile vim73 with Ruby (v1.9.1) anymore.
> Environment: Windows 7, Visual Studio 2008.
>
> My Ruby is installed in C:\Ruby, I set RUBY_VER to 19 and RUBY_VER_LONG to
> 1.9.1, nmake got RUBY=yes DYNAMIC_RUBY=yes.
> However, the particular log line says:

Make_mvc.mak is configured for ruby 1.8. For ruby 1.9 you need to
change line 784

RUBY_INC = /I "$(RUBY)\lib\ruby\$(RUBY_VER_LONG)\$(RUBY_PLATFORM)"

to

RUBY_INC = /I "$(RUBY)\include\ruby-$(RUBY_VER_LONG)\ruby"

--
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
Reply | Threaded
Open this post in threaded view
|

Re: Compiling with Ruby on Win32 (mvc.mak) fails?

tux.
Charles schrob am 30.06.2010 15:07:
For ruby 1.9 you need to
change line 784

RUBY_INC = /I "$(RUBY)\lib\ruby\$(RUBY_VER_LONG)\$(RUBY_PLATFORM)"

to

RUBY_INC = /I "$(RUBY)\include\ruby-$(RUBY_VER_LONG)\ruby"

When I do this, it fails to find ruby/config.h.

--
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
Reply | Threaded
Open this post in threaded view
|

Re: Compiling with Ruby on Win32 (mvc.mak) fails?

Charles-14
On Wed, Jun 30, 2010 at 8:14 PM, Tux <[hidden email]> wrote:

> Charles schrob am 30.06.2010 15:07:
>
> For ruby 1.9 you need to
>
> change line 784
>
> RUBY_INC = /I "$(RUBY)\lib\ruby\$(RUBY_VER_LONG)\$(RUBY_PLATFORM)"
>
> to
>
> RUBY_INC = /I "$(RUBY)\include\ruby-$(RUBY_VER_LONG)\ruby"
>
> When I do this, it fails to find ruby/config.h.

How about if you set RUBY_INC to

RUBY_INC = /I "$(RUBY)\include\ruby-$(RUBY_VER_LONG)" /I
"$(RUBY)\include\ruby-$(RUBY_VER_LONG)\$(RUBY_PLATFORM)"

Also please check that your ruby is the mswin32 version and not the
mingw32 version otherwise you will also need to set RUBY_PLATFORM to
i386-mingw32.

--
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
Reply | Threaded
Open this post in threaded view
|

Re: Compiling with Ruby on Win32 (mvc.mak) fails?

tux.
Indeed, it was mingw32.
Anyway, now it can't find inttypes.h.

What the heck has been changed there?

--
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
Reply | Threaded
Open this post in threaded view
|

Re: Compiling with Ruby on Win32 (mvc.mak) fails?

Charles-14
On Wed, Jun 30, 2010 at 9:14 PM, Tux <[hidden email]> wrote:
> Indeed, it was mingw32.
> Anyway, now it can't find inttypes.h.
>
> What the heck has been changed there?

inttypes.h is linux include header. Mingw provides it, so either you
use mingw to compile vim or use ruby compiled using mswin32 (vc6)

--
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
Reply | Threaded
Open this post in threaded view
|

Re: Compiling with Ruby on Win32 (mvc.mak) fails?

tux.
Charles schrob am 30.06.2010 16:22:
inttypes.h is linux include header. Mingw provides it, so either you
use mingw to compile vim or use ruby compiled using mswin32 (vc6)

Damn. I actually took the Ruby binaries from the Ruby website, so I need to search for vc6 builds now. :(
Or do you have any link for them?

--
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
Reply | Threaded
Open this post in threaded view
|

Re: Compiling with Ruby on Win32 (mvc.mak) fails?

Charles-14
On Wed, Jun 30, 2010 at 9:29 PM, Tux <[hidden email]> wrote:
> Charles schrob am 30.06.2010 16:22:
>
> inttypes.h is linux include header. Mingw provides it, so either you
> use mingw to compile vim or use ruby compiled using mswin32 (vc6)
>
> Damn. I actually took the Ruby binaries from the Ruby website, so I need to
> search for vc6 builds now. :(
> Or do you have any link for them?

It is provided here
http://www.garbagecollect.jp/ruby/mswin32/en/download/release.html

--
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
Reply | Threaded
Open this post in threaded view
|

Re: Compiling with Ruby on Win32 (mvc.mak) fails?

tux.
Charles schrob am 30.06.2010 16:35:
It is provided here
http://www.garbagecollect.jp/ruby/mswin32/en/download/release.html

I begin to despair, seriously. This one "works" but does not really like VS 2008 (read: won't compile). Ruby 1.8 did.

--
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
Reply | Threaded
Open this post in threaded view
|

Re: Compiling with Ruby on Win32 (mvc.mak) fails?

Charles-14
On Wed, Jun 30, 2010 at 9:46 PM, Tux <[hidden email]> wrote:
> Charles schrob am 30.06.2010 16:35:
>
> It is provided here
> http://www.garbagecollect.jp/ruby/mswin32/en/download/release.html
>
> I begin to despair, seriously. This one "works" but does not really like VS
> 2008 (read: won't compile). Ruby 1.8 did.

Going futher, the problem also lies on if_ruby.c

#ifdef _WIN32
            /* suggested by Ariya Mizutani */
            int argc = 1;
            char *argv[] = {"gvim.exe"};
            NtInitialize(&argc, &argv);
#endif
#ifdef RUBY19_OR_LATER
            RUBY_INIT_STACK;
#endif

while RUBY_INIT_STACK is defined as

#define RUBY_INIT_STACK VALUE variable_in_this_stack_frame;
ruby_init_stack(&variable_in_this_stack_frame);

This results in declaration after expression which is C99 standard and
not supported by VS C compiler which only supports C89 standard.

--
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
Reply | Threaded
Open this post in threaded view
|

Re: Compiling with Ruby on Win32 (mvc.mak) fails?

Charles-14
On Wed, Jun 30, 2010 at 10:03 PM, Charles <[hidden email]> wrote:
> On Wed, Jun 30, 2010 at 9:46 PM, Tux <[hidden email]> wrote:
>> Charles schrob am 30.06.2010 16:35:
>>
>> It is provided here
>> http://www.garbagecollect.jp/ruby/mswin32/en/download/release.html
>>
>> I begin to despair, seriously. This one "works" but does not really like VS
>> 2008 (read: won't compile). Ruby 1.8 did.

With a little change I have sucessfully compiled vim73 branch with VS
2010 and ruby 1.9.1-mswin32. Here are the changes I have done

ruby/config.h: comment the top 3 lines
//#if _MSC_VER != 1200
//#error MSC version unmatch: _MSC_VER: 1200 is expected.
//#endif

if_ruby.c: move NtInitialize after RUBY_INIT_STACK
#ifdef _WIN32
            /* suggested by Ariya Mizutani */
            int argc = 1;
            char *argv[] = {"gvim.exe"};
#endif
#ifdef RUBY19_OR_LATER
            RUBY_INIT_STACK;
#endif
#ifdef _WIN32
            NtInitialize(&argc, &argv);
#endif

My config line
RUBY=[path to]\ruby-1.9.1-mswin32 DYNAMIC_RUBY=yes RUBY_VER=191
RUBY_VER_LONG=1.9.1

The result: at least :ruby print 'Hello' works :D

--
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
Reply | Threaded
Open this post in threaded view
|

Re: Compiling with Ruby on Win32 (mvc.mak) fails?

tux.
In reply to this post by Charles-14
OK, so we can declare this as a Vim, ehm, issue for now?

--
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
Reply | Threaded
Open this post in threaded view
|

Re: Compiling with Ruby on Win32 (mvc.mak) fails?

tux.
In reply to this post by Charles-14
Charles schrob am 30.06.2010 17:15:
With a little change I have sucessfully compiled vim73 branch with VS
2010 and ruby 1.9.1-mswin32. 

Confirmed with VS2008. Seems to compile with Ruby now, despite some warnings. :)
Thank you very much!

--
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
Reply | Threaded
Open this post in threaded view
|

Re: Compiling with Ruby on Win32 (mvc.mak) fails?

Bram Moolenaar
In reply to this post by Charles-14

Charles Peacech wrote:

> On Wed, Jun 30, 2010 at 9:46 PM, Tux <[hidden email]> wrote:
> > Charles schrob am 30.06.2010 16:35:
> >
> > It is provided here
> > http://www.garbagecollect.jp/ruby/mswin32/en/download/release.html
> >
> > I begin to despair, seriously. This one "works" but does not really like VS
> > 2008 (read: won't compile). Ruby 1.8 did.
>
> Going futher, the problem also lies on if_ruby.c
>
> #ifdef _WIN32
>    /* suggested by Ariya Mizutani */
>    int argc = 1;
>    char *argv[] = {"gvim.exe"};
>    NtInitialize(&argc, &argv);
> #endif
> #ifdef RUBY19_OR_LATER
>    RUBY_INIT_STACK;
> #endif
>
> while RUBY_INIT_STACK is defined as
>
> #define RUBY_INIT_STACK VALUE variable_in_this_stack_frame;
> ruby_init_stack(&variable_in_this_stack_frame);
>
> This results in declaration after expression which is C99 standard and
> not supported by VS C compiler which only supports C89 standard.

How about doing it this way:

#ifdef DYNAMIC_RUBY
        if (ruby_enabled(TRUE))
        {
#endif
#ifdef _WIN32
            /* suggested by Ariya Mizutani */
            int argc = 1;
            char *argv[] = {"gvim.exe"};
            NtInitialize(&argc, &argv);
#endif
            {
#ifdef RUBY19_OR_LATER
                RUBY_INIT_STACK;
#endif
                ruby_init();
            }
#ifdef RUBY19_OR_LATER
            ruby_script("vim-ruby");

In other programs I often see RUBY_INIT_STACK and ruby_init() right
after each other, must be intentionally so.

--
Vi is clearly superior to emacs, since "vi" has only two characters
(and two keystrokes), while "emacs" has five.  (Randy C. Ford)

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.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
Reply | Threaded
Open this post in threaded view
|

Re: Compiling with Ruby on Win32 (mvc.mak) fails?

Bram Moolenaar
In reply to this post by tux.

Tux (der_tuxman ?) wrote:

>     <meta content="text/html; charset=ISO-8859-1"
>       http-equiv="Content-Type">

Can you please stop sending HTML to this list?

--
hundred-and-one symptoms of being an internet addict:
251. You've never seen your closest friends who usually live WAY too far away.

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.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
Reply | Threaded
Open this post in threaded view
|

Re: Compiling with Ruby on Win32 (mvc.mak) fails?

tux.
Bram Moolenaar schrob am 30.06.2010 22:10:
Can you please stop sending HTML to this list?

Sorry, misconfigured my Thunderbird. Gonna fix it, thank you for the hint.

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