# # mkmf-gnome2.rb # # Extended mkmf for Ruby-GNOME2 and Ruby/GLib based libraries. # # Copyright(C) 2003-2005 Ruby-GNOME2 Project. # # This program is licenced under the same # license of Ruby-GNOME2. # require 'mkmf' begin require 'pkg-config' rescue LoadError require 'rubygems' gem 'pkg-config' require 'pkg-config' end require 'glib-mkenums' unless defined?(macro_defined?) def macro_defined?(macro, src, opt="") try_cpp(src + < (major) || \\ (#{app_name}_MAJOR_VERSION == (major) && #{app_name}_MINOR_VERSION > (minor)) || \\ (#{app_name}_MAJOR_VERSION == (major) && #{app_name}_MINOR_VERSION == (minor) && \\ #{app_name}_MICRO_VERSION >= (micro))) #endif /* __RB#{app_name}_VERSION_H__ */ ] out.close end def check_ruby_func #Other options ruby_header = "ruby.h" have_func("rb_define_alloc_func", ruby_header) # for ruby-1.8 have_func("rb_block_proc", ruby_header) # for ruby-1.8 STDOUT.print("checking for new allocation framework... ") # for ruby-1.7 if Object.respond_to? :allocate STDOUT.print "yes\n" $defs << "-DHAVE_OBJECT_ALLOCATE" else STDOUT.print "no\n" end STDOUT.print("checking for attribute assignment... ") # for ruby-1.7 STDOUT.flush if defined? try_compile and try_compile <