From: Athanasopoulos Date: 2006-08-28T21:50:13+09:00 Subject: Re: Version Check in C Extension Hello! ts wrote: > >>>>> "e" == elias athanasopoulos writes: > > e> How can I check for the Ruby version inside a C extension? > > Try to avoid to test the ruby version, but rather test the functionality > that you want in extconf.rb. > > For example > > moulon% ruby -rmkmf -ve 'have_func("rb_frame_this_func")' > ruby 1.8.4 (2005-12-24) [i486-linux] > checking for rb_frame_this_func()... no > moulon% > > > moulon% ./ruby -rmkmf -ve 'have_func("rb_frame_this_func")' > ruby 1.9.0 (2006-07-14) [i686-linux] > checking for rb_frame_this_func()... yes > moulon% Right. This is the problem I have to deal with. My extension uses rb_frame_last_func() which is subsituted with rb_frame_this_func() in 1.9. So, I have to alter the actual code to use rb_frame_last_func() or rb_frame_this_func() according to the ruby version installed in the system. So, checking in the Makefile will not help. Regards, Elias