summaryrefslogtreecommitdiff
path: root/ext/dbm
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-11-13 10:58:18 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-11-13 10:58:18 +0000
commitbfed16a21f057a1b0fed51936ff11a64ac7c4ea3 (patch)
tree54f97b224fa059fdcfcce0caeb8e3d70d1dd39b2 /ext/dbm
parente8ca9cc343dcdf11641bd8a9d73bf7aa291b5572 (diff)
* ext/dbm/extconf.rb: rollback for each headers for each libraries.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/dbm')
-rw-r--r--ext/dbm/extconf.rb12
1 files changed, 5 insertions, 7 deletions
diff --git a/ext/dbm/extconf.rb b/ext/dbm/extconf.rb
index 3170056..c3ebe89 100644
--- a/ext/dbm/extconf.rb
+++ b/ext/dbm/extconf.rb
@@ -29,10 +29,10 @@ end
headers.found = []
headers.defs = nil
-def headers.db_check(db)
+def headers.db_check(db, hdr)
old_libs = $libs.dup
old_defs = $defs.dup
- result = db_check2(db)
+ result = db_check2(db, hdr)
if !result
$libs = old_libs
$defs = old_defs
@@ -40,19 +40,17 @@ def headers.db_check(db)
result
end
-def headers.db_check2(db)
+def headers.db_check2(db, hdr)
hsearch = nil
case db
when /^db[2-5]?$/
hsearch = "-DDB_DBM_HSEARCH"
- when "gdbm"
when "gdbm_compat"
have_library("gdbm") or return false
end
- hdrs = self.fetch(db, ["ndbm.h"])
- if (hdr = hdrs.find {|h| have_type("DBM", h, hsearch)} || hdrs.find {|h| have_type("DBM", ["db.h", h], hsearch)}) and
+ if (have_type("DBM", hdr, hsearch) || have_type("DBM", ["db.h", hdr], hsearch)) and
(db == 'libc' ? have_func('dbm_open("", 0, 0)', hdr, hsearch) :
have_library(db, 'dbm_open("", 0, 0)', hdr, hsearch)) and
have_func('dbm_clearerr((DBM *)0)', hdr, hsearch)
@@ -68,7 +66,7 @@ def headers.db_check2(db)
end
end
-if dblib.any? {|db| headers.db_check(db)}
+if dblib.any? {|db| headers.fetch(db, ["ndbm.h"]).any? {|hdr| headers.db_check(db, hdr) } }
have_header("cdefs.h")
have_header("sys/cdefs.h")
have_func("dbm_pagfno((DBM *)0)", headers.found, headers.defs)