#!/usr/bin/env ruby
require 'mkmf'

dir_config('IBM_DB2','/opt/IBM/db2/V8.1')

def crash(str)
  printf(" extconf failure: %s\n", str)
  exit 1
end

unless have_library('db2','SQLConnect')
  crash(<<EOL)
need db2.

        Install IBM DB2 Univeral Database or try passing one of the following
        options to extconf.rb:

        --with-IBM_DB2-dir=/path/to/db2
        --with-IBM_DB2-lib=/path/to/db2/lib
        --with-IBM_DB2-include=/path/to/db2/include
EOL
end

create_header()
create_makefile('ibm_db2')
