Mkmf strangeness - have_func issue

Hi all,

Ruby 1.6.7 on Solaris 9

I’m adding reentrant support for gethostbyname to the Sys/Host module.
So, in the extconf.rb file I have this:

have_func(‘gethostbyname_r’)

The source.c file contains #include <netdb.h>, which is where that
function is defined (under /usr/include)

When I run “ruby extconf.rb”, I get this: “checking for
gethostbyname_r()… no”. The same thing happens on Solaris 8 as well.

Why isn’t it finding gethostbyname_r ? On Linux, it returns “yes”, btw.

Any ideas?

Regards,

Dan

When I run "ruby extconf.rb", I get this: "checking for
gethostbyname_r()... no". The same thing happens on Solaris 8 as well.

You must add "netdb.h"

nasun% ruby -v extconf.rb
ruby 1.6.7 (2002-03-01) [sparc-solaris2.8]
checking for gethostbyname_r()... yes
nasun%

nasun% cat extconf.rb
require 'mkmf'
have_func('gethostbyname_r', 'netdb.h')
nasun%

Guy Decoux