From db48bbdf0b4b8400d4ad0c1df5190d898fd9ed75 Mon Sep 17 00:00:00 2001 From: akr Date: Fri, 11 Nov 2011 14:01:25 +0000 Subject: * ext/dbm/extconf.rb: db_prefix is not required now. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/dbm/extconf.rb | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'ext/dbm/extconf.rb') diff --git a/ext/dbm/extconf.rb b/ext/dbm/extconf.rb index 608f4d472f..a2c3b7c1a3 100644 --- a/ext/dbm/extconf.rb +++ b/ext/dbm/extconf.rb @@ -29,13 +29,11 @@ headers.found = [] headers.defs = nil def headers.db_check(db) - db_prefix = nil have_gdbm = false hsearch = nil case db when /^db[2-5]?$/ - db_prefix = "__db_n" hsearch = "-DDB_DBM_HSEARCH" when "gdbm" have_gdbm = true @@ -43,12 +41,11 @@ def headers.db_check(db) have_gdbm = true have_library("gdbm") or return false end - db_prefix ||= "" - if (have_library(db, db_prefix+"dbm_open") || have_func(db_prefix+"dbm_open")) and - hdr = self.fetch(db, ["ndbm.h"]).find {|h| have_type("DBM", h, hsearch)} or - hdr = self.fetch(db, ["ndbm.h"]).find {|h| have_type("DBM", ["db.h", h], hsearch)} - have_func(db_prefix+"dbm_clearerr") unless have_gdbm + if (hdr = self.fetch(db, ["ndbm.h"]).find {|h| have_type("DBM", h, hsearch)} or + hdr = self.fetch(db, ["ndbm.h"]).find {|h| have_type("DBM", ["db.h", h], hsearch)}) and + (have_library(db, 'dbm_open("", 0, 0)', hdr, hsearch) || have_func('dbm_open("", 0, 0)', hdr, hsearch)) + have_func('dbm_clearerr((DBM *)0)', hdr, hsearch) unless have_gdbm if hsearch $defs << hsearch @defs = hsearch -- cgit v1.2.3