require 'mkmf'

$objs = %w[
  bitvector.o
  bitvector_c.o
]

libs = $libs
libpath = $LIBPATH
unless have_func "ruby_init", "ruby.h"
  $libs = libs + " " + CONFIG["LIBRUBYARG"]
  $LIBPATH = libpath | [Config::CONFIG["libdir"]]
end
unless have_func "ruby_init", "ruby.h"
  $libs = libs
  find_library(CONFIG["RUBY_INSTALL_NAME"], "ruby_init")
end
have_func "rb_cvar_declare", "ruby.h"
$libs = libs
$LIBPATH = libpath

$CFLAGS << " -I#{$srcdir}/steffen_beyers_bit_vector"

create_makefile 'bitvector'
