From: Eric Wong Date: 2012-06-25T13:24:38+09:00 Subject: Re: have_func() does not find a func in the given .h file I単aki Baz Castillo wrote: > Hi, in my extconf.rb I check some Ruby functions (since I'm trying > Ruby trunk with rvm). I understand that the method have_func() does > not look into Ruby sources within my .rvm/ directory, so I call the > method by passing the exact file as argument: > > > /home/ibc/.rvm/repos/ruby$ grep ruby_thread_has_gvl_p vm_core.h > int ruby_thread_has_gvl_p(void); This is a private function, Ruby uses gcc -fvisibility=hidden to hide them and only exposes certain functions in vm_core.h via "#pragma GCC visibility ..." > But have_func() does not find it: ave_func() doesn't parse C headers to find functions, but instead tries to link a C program to find the function. > irb> require "mkmf" > irb> have_func("ruby_thread_has_gvl_p", "/home/ibc/.rvm/repos/ruby/vm_core.h") > checking for ruby_thread_has_gvl_p() in > /home/ibc/.rvm/repos/ruby/vm_core.h... no > > Am I doint something wrong? You're relying too much on ever-changing Ruby internals :)