Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > extconf.rb >> mkmf

Reply
Thread Tools

extconf.rb >> mkmf

 
 
K. R.
Guest
Posts: n/a
 
      11-12-2007
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-forum.com/.

 
Reply With Quote
 
 
 
 
Young Hyun
Guest
Posts: n/a
 
      11-13-2007
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




 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with adding header files for 'mkmf' - new to Swig/mkmf james.d.masters@gmail.com Ruby 0 10-24-2007 08:19 PM
mkmf.rb broken in cvs? Brad Hilton Ruby 0 03-02-2004 11:40 PM
HP-UX+mkmf.rb -- compilation problems with 1.8.1 Kero Ruby 0 01-13-2004 07:24 PM
mkmf documentation? Kero van Gelder Ruby 2 08-03-2003 04:53 PM
static libraries with extconf.rb/mkmf maillist@bestworldweb.homelinux.com Ruby 0 08-01-2003 07:27 AM



Advertisments