[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

mkmf problems

Stu

12/4/2004 5:22:00 PM


I cant seem to find any substantial docs on the net for mkmf..

i'm trying to create a new C routine, but my compiler is mingw
yet mkmf/extconf keeps generating a Makefile for use with
cl.exe (microsoft compiler)...

how do I tell mkmf in extconf to use mingw instead of microsoft
compiler cl.exe ....... ???

the other thing is, how do I tell mkmf to include only certain
..c files rather than *.c? (or the inverse, what not to include?)

I have support files for unix/win32, and one cant be compiled
on the other (and shouldnt)..

but mkmf has just globbed *.c on me.. which is fine except for
1 or 2 files!!



-- Stu --
[FAQ] Write Your Own Operating System
http://www.mega-tokyo....
10 Answers

ts

12/4/2004 5:51:00 PM

0

>>>>> "S" == Stu <ceaser@rome.net> writes:

S> how do I tell mkmf in extconf to use mingw instead of microsoft
S> compiler cl.exe ....... ???

By default it use the compiler used to compile ruby.

If you really want to change

uln% ls
a.c b.c
uln%

uln% ruby -rmkmf -e 'CONFIG["CC"] = "xxx"; create_makefile("a")'
creating Makefile
uln%

uln% make
xxx -fPIC -g -O2 -I. -I/usr/local/lib/ruby/1.8/x86_64-linux -I/usr/local/lib/ruby/1.8/x86_64-linux -I. -c a.c
make: xxx: Command not found
make: *** [a.o] Error 127
uln%

S> the other thing is, how do I tell mkmf to include only certain
S> ..c files rather than *.c? (or the inverse, what not to include?)

define $objs

uln% ruby -rmkmf -e '$objs = ["a.o"]; create_makefile("a")'
creating Makefile
uln%

uln% make
gcc -fpic -fPIC -g -O2 -I. -I/usr/local/lib/ruby/1.8/x86_64-linux -I/usr/local/lib/ruby/1.8/x86_64-linux -I. -c a.c
gcc -fpic -shared -L"/usr/local/lib" -o a.so a.o -ldl -lcrypt -lm -lc
uln%


Guy Decoux





Stu

12/4/2004 7:12:00 PM

0

On Sun, 5 Dec 2004 02:50:48 +0900, ts <decoux@moulon.inra.fr> wrote:

>>>>>> "S" == Stu <ceaser@rome.net> writes:
>
>S> how do I tell mkmf in extconf to use mingw instead of microsoft
>S> compiler cl.exe ....... ???
>
> By default it use the compiler used to compile ruby.
>

doesnt that make it, pretty well broken then?
not everyone compiles their own ruby distribution...


now I just need to figure out how to package my little
dodad up properly...



-- Stu --
[FAQ] Write Your Own Operating System
http://www.mega-tokyo....

ts

12/5/2004 10:44:00 AM

0

>>>>> "S" == Stu <ceaser@rome.net> writes:

S> doesnt that make it, pretty well broken then?

no, you can have problems if you mix 2 differents compiler.


Guy Decoux



Stu

12/5/2004 11:19:00 AM

0

On Sun, 5 Dec 2004 19:44:06 +0900, ts <decoux@moulon.inra.fr> wrote:

>>>>>> "S" == Stu <ceaser@rome.net> writes:
>
>S> doesnt that make it, pretty well broken then?
>
> no, you can have problems if you mix 2 differents compiler.
>

so everyone downloading the 1click installer on windows
needs the exact same setup as those who built the installer
if they want to build anything... be it custom extensions or
just building gem's (ncurses is a nice example of this)...

it just means mkmf is kinda borked because it ASSUMES too much.


-- Stu --
[FAQ] Write Your Own Operating System
http://www.mega-tokyo....

ts

12/5/2004 11:43:00 AM

0

>>>>> "S" == Stu <ceaser@rome.net> writes:

S> so everyone downloading the 1click installer on windows
S> needs the exact same setup as those who built the installer

I know nothing about Windows, but I think that you can have
incompatibilities if you mix 2 differents compilers.

S> it just means mkmf is kinda borked because it ASSUMES too much.

This is not really the fault to mkmf


Guy Decoux




Ville Mattila

12/5/2004 11:51:00 AM

0

Stu <ceaser@rome.net> writes:
>
> so everyone downloading the 1click installer on windows
> needs the exact same setup as those who built the installer
> if they want to build anything... be it custom extensions or
> just building gem's (ncurses is a nice example of this)...
>
> it just means mkmf is kinda borked because it ASSUMES too much.

1click installer and mingw build extensions should be binary
compatible. However cygwin build extensions might cause troubles.

I think it would be good idea that, Mkmf.rb could warn if it finds
that different compiler is used to build extensions.

- Ville

nobu.nokada

12/5/2004 3:08:00 PM

0

Hi,

At Sun, 5 Dec 2004 20:52:37 +0900,
Ville Mattila wrote in [ruby-talk:122579]:
> I think it would be good idea that, Mkmf.rb could warn if it finds
> that different compiler is used to build extensions.

mkmf.rb just uses specified compiler, or how can it know what
it should call?

--
Nobu Nakada


Ville Mattila

12/5/2004 3:12:00 PM

0

nobu.nokada@softhome.net writes:

> Hi,
>
> At Sun, 5 Dec 2004 20:52:37 +0900,
> Ville Mattila wrote in [ruby-talk:122579]:
>> I think it would be good idea that, Mkmf.rb could warn if it finds
>> that different compiler is used to build extensions.
>
> mkmf.rb just uses specified compiler, or how can it know what
> it should call?

What I meant that mkmf could warn, if the current compiler differs with
rbconfig['CC'] compiler.

- Ville

nobu.nokada

12/5/2004 3:34:00 PM

0

Hi,

At Mon, 6 Dec 2004 00:12:42 +0900,
Ville Mattila wrote in [ruby-talk:122592]:
> >> I think it would be good idea that, Mkmf.rb could warn if it finds
> >> that different compiler is used to build extensions.
> >
> > mkmf.rb just uses specified compiler, or how can it know what
> > it should call?
>
> What I meant that mkmf could warn, if the current compiler differs with
> rbconfig['CC'] compiler.

Config::CONFIG['CC'] in rbconfig.rb is the current compiler.
There is nothing else.

--
Nobu Nakada


Ville Mattila

12/5/2004 4:41:00 PM

0

>> What I meant that mkmf could warn, if the current compiler differs with
>> rbconfig['CC'] compiler.
>
>
> Config::CONFIG['CC'] in rbconfig.rb is the current compiler.
> There is nothing else.
>
Oops, I just read the Guy's example again. You are right. Sorry
about the confusion. How about adding RUBY_CC that tells the complier
that was used to compiler ruby binary?

- Ville