How do I tell extconf.rb/mkmf NOT to try and use cl.exe

I’m trying to compile an extension on Windows using ruby extconf.rb.

However, if I try it in Cygwin or in a command window (with MinGW’s bin
directory in the PATH), it fails and the mkmf.log file shows that the
“cl” executable is being run.

I don’t have a “cl” on my Windows system, so I need gcc to be used.

How do I indicate to mkmf.rb that I’m running under Cygwin or MinGW?

Thanks,
Wes

On Jan 23, 2007, at 10:52, Wes G. wrote:

I’m trying to compile an extension on Windows using ruby extconf.rb.

However, if I try it in Cygwin or in a command window (with MinGW’s
bin
directory in the PATH), it fails and the mkmf.log file shows that the
“cl” executable is being run.

I don’t have a “cl” on my Windows system, so I need gcc to be used.

How do I indicate to mkmf.rb that I’m running under Cygwin or MinGW?

Rebuild ruby with cygwin/mingw. You can’t necessarily link cygwin/
mingw libraries into your ruby.


Eric H. - [email protected] - http://blog.segment7.net

I LIT YOUR GEM ON FIRE!

Wes G. wrote:

Thanks,
Wes

Within your extconf.rb file, “$CC = gcc” should work

Or, set your CC environment variable.

Regards,

Dan

Neither of those seems to work, although I thought that they would.

Why am I doing Ruby development on a Windows box?!!???!!
@#$&*@)(#$&@$&#@)&

Thanks anyway.

Wes

On Wed, 24 Jan 2007, Wes G. wrote:

Neither of those seems to work, although I thought that they would.

Why am I doing Ruby development on a Windows box?!!???!!
@#$&*@)(#$&@$&#@)&

Thanks anyway.

Wes

you can do it. follow these steps

  • build ruby under cygwin/mingw
  • use THAT ruby to build extensions
  • you’ll have to hack the install process to go into
    one-click-installer
    space
  • test heavily - the binaries should work, but might not

i’ve done exactly this to produce a gsl (gnu scientific lib) that one
can
install under windows

http://codeforpeople.com/lib/ruby/rb-gsl-win/

alternatively you can

  • delete the one click installer
  • compile your self under mingw (don’t use cygwin or binaries will
    require it)
  • have a fully functional ruby

regards.

-a