summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--ext/dbm/extconf.rb11
2 files changed, 8 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 89af684..43c4eb9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Fri Nov 11 23:00:46 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/dbm/extconf.rb: db_prefix is not required now.
+
Fri Nov 11 21:13:30 2011 Tanaka Akira <akr@fsij.org>
* ext/gdbm/gdbm.c (fgdbm_initialize): use GDBM_CLOEXEC if available.
diff --git a/ext/dbm/extconf.rb b/ext/dbm/extconf.rb
index 608f4d4..a2c3b7c 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