[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

extconf.rb >> mkmf

K. R.

11/12/2007 4:16:00 PM

hi @all

I would like to extend my rubyapp with a c++ program. I used the
features of mkmf (require 'mkmf') and saved it into the extconf.rb. So
already the whole program is running, but I want to compile the c-file
with g++ instead of gcc compiler.

How can I change this options?
Thanks for your posting!
--
Posted via http://www.ruby-....

1 Answer

Young Hyun

11/13/2007 6:06:00 PM

0

On Nov 12, 2007, at 8:15 AM, K. R. wrote:

> hi @all
>
> I would like to extend my rubyapp with a c++ program. I used the
> features of mkmf (require 'mkmf') and saved it into the extconf.rb. So
> already the whole program is running, but I want to compile the c-file
> with g++ instead of gcc compiler.
>
> How can I change this options?

I had a similar problem and came up with this ugly hack (hopefully
there's a more official way to do this) which works at least under
MacOS X and FreeBSD:

# XXX hack to get C++ standard library properly linked into shared
object
# $libs = append_library($libs, "supc++") # doesn't work
if Config::CONFIG["arch"] =~ /-darwin\d/
CONFIG['LDSHARED']="g++ -dynamic -bundle -undefined suppress -
flat_namespace"
else
CONFIG['LDSHARED'] = "g++ -shared"
end

--Young