extconf.rb does the wrong thing?

B

Bjoern

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
 
N

nobu.nokada

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

Bjoern

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.

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

nobu.nokada

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

Bjoern

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 :-( 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.
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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top