1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
akr 2011-11-11 14:01:25 +00:00
parent 268f6c3680
commit db48bbdf0b
2 changed files with 8 additions and 7 deletions

View file

@ -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.

View file

@ -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