summaryrefslogtreecommitdiff
path: root/ext/dbm/extconf.rb
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-06-11 15:40:39 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-06-11 15:40:39 +0000
commit8af5f01a1775958654de459c47c3d2f2032d6701 (patch)
tree7504d02a2e543936eef97d0ac42a387db1baa69c /ext/dbm/extconf.rb
parent8c7786bf5831918da34d6614755ac303d8b21925 (diff)
* ext/dbm/extconf.rb: accept Berkley DB version 3, 4 and 5.
[ruby-dev:41531] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28284 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/dbm/extconf.rb')
-rw-r--r--ext/dbm/extconf.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/ext/dbm/extconf.rb b/ext/dbm/extconf.rb
index 4d12264..e5973a9 100644
--- a/ext/dbm/extconf.rb
+++ b/ext/dbm/extconf.rb
@@ -5,13 +5,16 @@ dir_config("dbm")
if dblib = with_config("dbm-type", nil)
dblib = dblib.split(/[ ,]+/)
else
- dblib = %w(db db2 db1 dbm gdbm gdbm_compat qdbm)
+ dblib = %w(db db2 db1 db5 db4 db3 dbm gdbm gdbm_compat qdbm)
end
headers = {
"db" => ["db.h"],
"db1" => ["db1/ndbm.h", "db1.h", "ndbm.h"],
"db2" => ["db2/db.h", "db2.h", "db.h"],
+ "db3" => ["db3/db.h", "db3.h", "db.h"],
+ "db4" => ["db4/db.h", "db4.h", "db.h"],
+ "db5" => ["db5/db.h", "db5.h", "db.h"],
"dbm" => ["ndbm.h"],
"gdbm" => ["gdbm-ndbm.h", "ndbm.h"],
"gdbm_compat" => ["gdbm-ndbm.h", "ndbm.h"],
@@ -24,7 +27,7 @@ def headers.db_check(db)
hsearch = nil
case db
- when /^db2?$/
+ when /^db[2-5]?$/
db_prefix = "__db_n"
hsearch = "-DDB_DBM_HSEARCH "
when "gdbm"
@@ -36,7 +39,8 @@ def headers.db_check(db)
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)}
+ 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
$defs << '-DDBM_HDR="<'+hdr+'>"'