=begin
extconf.rb for LV extention library
  $Author: igarashi $
  $Date: 2000/06/08 17:22:58 $
=end

require 'mkmf'

cwd = `pwd`.chomp!
libdir = "#{cwd}/lv"
$CFLAGS << " -I#{libdir}/src"
$LDFLAGS << " -L#{libdir}/build"

if have_library("termcap", "tgetent")
  if have_header("import.h") and 
      have_header("ichar.h") and
      have_header("istr.h") and
      have_header("decode.h") and
      have_header("encode.h")
    if have_library("lv", "Decode")
      if have_func("Decode") and
	  have_func("Encode")
	create_makefile("lv")
      end
    end
  end
end

maintainer_makefile = with_config("--with-maintainer-makefile")
if not maintainer_makefile.nil?
  File.open("Makefile", "a") do |makefile|
    makefile.puts("######## for maintainer")
    makefile.puts("include #{maintainer_makefile}")
  end
end
