summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-11-10 06:43:46 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-11-10 06:43:46 +0000
commit6c9a235938ff60b6958e4cf2d4c066e99f010228 (patch)
tree8ee1f270098ef84b7c38f5c3ada3a5517f01e583
parentfb1836ab4854d5da9f4600ef9053cae95f7ca577 (diff)
* ext/dbm/extconf.rb: set DB_DBM_HSEARCH macro to check dbm_pagfno and
dbm_dirfno on older Debian. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33699 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ext/dbm/extconf.rb13
1 files changed, 9 insertions, 4 deletions
diff --git a/ext/dbm/extconf.rb b/ext/dbm/extconf.rb
index 6d1de2e..1109101 100644
--- a/ext/dbm/extconf.rb
+++ b/ext/dbm/extconf.rb
@@ -23,8 +23,10 @@ headers = {
class << headers
attr_accessor :found
+ attr_accessor :defs
end
headers.found = []
+headers.defs = nil
def headers.db_check(db)
db_prefix = nil
@@ -34,7 +36,7 @@ def headers.db_check(db)
case db
when /^db[2-5]?$/
db_prefix = "__db_n"
- hsearch = "-DDB_DBM_HSEARCH "
+ hsearch = "-DDB_DBM_HSEARCH"
when "gdbm"
have_gdbm = true
when "gdbm_compat"
@@ -47,7 +49,10 @@ def headers.db_check(db)
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
- $defs << hsearch if hsearch
+ if hsearch
+ $defs << hsearch
+ @defs = hsearch
+ end
$defs << '-DDBM_HDR="<'+hdr+'>"'
@found << hdr
true
@@ -59,8 +64,8 @@ end
if dblib.any? {|db| headers.db_check(db)}
have_header("cdefs.h")
have_header("sys/cdefs.h")
- have_func("dbm_pagfno", headers.found)
- have_func("dbm_dirfno", headers.found)
+ have_func("dbm_pagfno", headers.found, headers.defs)
+ have_func("dbm_dirfno", headers.found, headers.defs)
type = checking_for "sizeof(datum.dsize)", STRING_OR_FAILED_FORMAT do
pre = headers.found + [["static datum conftest_key;"]]
%w[int long LONG_LONG].find do |t|