#!/usr/bin/env ruby # +----------------------------------------------------------------------+ # | Licensed Materials - Property of IBM | # | | # | (C) Copyright IBM Corporation 2006, 2007,2008 | # +----------------------------------------------------------------------+ require 'mkmf' WIN = RUBY_PLATFORM =~ /mswin/ # use ENV['DB2DIR'] or latest db2 you can find # (we need to revisit default when db2 10.x comes out) IBM_DB_INCLUDE = (ENV['IBM_DB_INCLUDE'] or (Dir['/opt/*/db2/*/include'].sort_by {|f| File.basename(f)}).last ) IBM_DB_LIB = (ENV['IBM_DB_LIB'] or (Dir['/opt/*/db2/*/lib32'].sort_by {|f| File.basename(f)}).last ) dir_config('IBM_DB',IBM_DB_INCLUDE,IBM_DB_LIB) def crash(str) printf(" extconf failure: %s\n", str) exit 1 end if( RUBY_VERSION =~ /1.9/) create_header('gil_release_version') end unless (have_library(WIN ? 'db2cli' : 'db2','SQLConnect') or find_library(WIN ? 'db2cli' : 'db2','SQLConnect', IBM_DB_LIB)) crash(<