summaryrefslogtreecommitdiff
path: root/ext/dbm
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-11-13 07:25:40 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-11-13 07:25:40 +0000
commite8ca9cc343dcdf11641bd8a9d73bf7aa291b5572 (patch)
tree76726fa1a5d346292e75effeaf04fbabfe1f33ab /ext/dbm
parent3e5bff7ec18cb834f7e05ed5f973edd35f990617 (diff)
* ext/dbm/extconf.rb: treat libc as a choice for a library which
provide ndbm API. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33733 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/dbm')
-rw-r--r--ext/dbm/extconf.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/dbm/extconf.rb b/ext/dbm/extconf.rb
index 302b551..3170056 100644
--- a/ext/dbm/extconf.rb
+++ b/ext/dbm/extconf.rb
@@ -5,10 +5,11 @@ dir_config("dbm")
if dblib = with_config("dbm-type", nil)
dblib = dblib.split(/[ ,]+/)
else
- dblib = %w(db db2 db1 db5 db4 db3 dbm gdbm gdbm_compat qdbm)
+ dblib = %w(libc db db2 db1 db5 db4 db3 dbm gdbm gdbm_compat qdbm)
end
headers = {
+ "libc" => ["ndbm.h"],
"db" => ["db.h"],
"db1" => ["db1/ndbm.h", "db1.h", "ndbm.h"],
"db2" => ["db2/db.h", "db2.h", "db.h"],
@@ -52,7 +53,8 @@ def headers.db_check2(db)
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
- (have_library(db, 'dbm_open("", 0, 0)', hdr, hsearch) || have_func('dbm_open("", 0, 0)', 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)
if hsearch
$defs << hsearch