Extconf.rb does the wrong thing?

Hello,

I am trying to build a program that comes with a ruby extension. It seems extconf.rb does all the wrong things, though. For example it seems to set 'cl' as the compiler, whereas I want to use gcc (from MinGW). If I edit the makefile to change cl to gcc, I get a 'gcc: no input files'. However, I don't really know anything about gcc compiler flags.

How do I get extconf.rb to do the right thing? It is just the standard

require 'mkmf'
$CFLAGS += " -DRUBYINTERFACE "
create_makefile("Mars");

I am new to Ruby, too, but it would be great to gather experiences with it using that software I am trying to compile (exMars).

Also, I don't fully understand the 'extending Ruby' chapter - does it mean that I have to install every C-program I want to access in the Ruby home directory? I hope not... Can I even access a gcc-compiled program with a Ruby that has been compiled with VC++?

Many thanks in advance for any pointers!

Bjoern

Hi,

At Fri, 22 Jul 2005 18:00:56 +0900,
Bjoern wrote in [ruby-talk:149164]:

I am trying to build a program that comes with a ruby extension. It
seems extconf.rb does all the wrong things, though. For example it seems
to set 'cl' as the compiler, whereas I want to use gcc (from MinGW). If
I edit the makefile to change cl to gcc, I get a 'gcc: no input files'.
However, I don't really know anything about gcc compiler flags.

You use ruby compiled with VisualC++, but will need ruby
compiled with mingw to compile an extension with mingw.

What mkmf.rb does is system/platform dependent configuration,
so you can't use it for other platforms.

···

--
Nobu Nakada

Many thanks! Will the extension work with the VC++-Ruby, once it has been built for the MinGW Ruby?

I haven't figured out how to install the MinGW Ruby yet. The binary distribution unzips into a Linux-like file structure. The ruby.exe seems to work, but not irb for example - so I guess it's not yet a real installation.

···

nobu.nokada@softhome.net wrote:

I am trying to build a program that comes with a ruby extension. It seems extconf.rb does all the wrong things, though. For example it seems to set 'cl' as the compiler, whereas I want to use gcc (from MinGW). If I edit the makefile to change cl to gcc, I get a 'gcc: no input files'. However, I don't really know anything about gcc compiler flags.

You use ruby compiled with VisualC++, but will need ruby
compiled with mingw to compile an extension with mingw.

What mkmf.rb does is system/platform dependent configuration,
so you can't use it for other platforms.

Hi,

At Sat, 23 Jul 2005 05:55:57 +0900,
Bjoern wrote in [ruby-talk:149241]:

Many thanks! Will the extension work with the VC++-Ruby, once it has
been built for the MinGW Ruby?

Yes, for VC++ 6 and mingw. VC++ 7 has changed its runtime DLL,
but mingw hasn't supported it yet.

I haven't figured out how to install the MinGW Ruby yet. The binary
distribution unzips into a Linux-like file structure. The ruby.exe seems
to work, but not irb for example - so I guess it's not yet a real
installation.

There isn't irb.bat?

···

--
Nobu Nakada

Many thanks! Will the extension work with the VC++-Ruby, once it has been built for the MinGW Ruby?

Yes, for VC++ 6 and mingw. VC++ 7 has changed its runtime DLL,
but mingw hasn't supported it yet.

So not all DLLs are the same? That sounds like an awful situation :frowning: I was hoping that a DLL would be loadable by any other program.

I have been looking into Java Native Interface in the meantime, which is based on loading dlls. What I read about interfacing Ruby with C never mentioned DLLs, but somehow I assume it should work somewhat similiar? I hope it is possible to create a dll and use it from ruby, withouth the need of copying some 'extension' into the Ruby installation directory.

I haven't managed to get Java Native Interface to work yet, because I didn't know how to create DLLs with MinGW. In the meantime I found some instructions that make me feel hopeful, but I dindn't have time to try them yet. I hope from that I might get a better understanding of the Ruby interface, too, if not, I guess I'll do another project in Java and keep looking for another opportunity to use Ruby.

I haven't figured out how to install the MinGW Ruby yet. The binary distribution unzips into a Linux-like file structure. The ruby.exe seems to work, but not irb for example - so I guess it's not yet a real installation.

There isn't irb.bat?

No - I suspect the MinGW Ruby is built for use with MinSYS, which I haven't tried yet? But I think it should be possible to create a MinGW-Ruby that is Windows only, too?

···

nobu.nokada@softhome.net wrote:

If you need binary compatability with binaries from microsofts
compiler, why not use microsoft's compiler?

You can download it here: http://tinyurl.com/5myff
(I'd've used rubyurl.com, but it's broken.)

- Shad

···

On 7/25/05, Bjoern <sorry@not.valid> wrote:

nobu.nokada@softhome.net wrote:

>>Many thanks! Will the extension work with the VC++-Ruby, once it has
>>been built for the MinGW Ruby?
>
> Yes, for VC++ 6 and mingw. VC++ 7 has changed its runtime DLL,
> but mingw hasn't supported it yet.

--

----------

Please do not send personal (non-list-related) mail to this address.
Personal mail should be sent to polyergic@sterfish.com.