summaryrefslogtreecommitdiff
path: root/ext/dbm
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-16 15:05:46 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-16 15:05:46 +0000
commit078b3cf95e454e5e87a27dcff20f52f4a58ad2d8 (patch)
treec196a215b862ee8fc5b1e6c1c41eaeb89b560c89 /ext/dbm
parentfde3c421bea8bd514acddb4c1b2d5f81afd1af36 (diff)
* ext/dbm/extconf.rb: check _DB_H_ macro unavailable except
Berkeley DB library. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/dbm')
-rw-r--r--ext/dbm/extconf.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/dbm/extconf.rb b/ext/dbm/extconf.rb
index 9c4004814e..69889a333b 100644
--- a/ext/dbm/extconf.rb
+++ b/ext/dbm/extconf.rb
@@ -79,7 +79,8 @@ def headers.db_check2(db, hdr)
if have_type("DBM", 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)
+ have_func('dbm_clearerr((DBM *)0)', hdr, hsearch) and
+ (/\Adb\d?\z/ =~ db || db == 'libc' || !have_macro('_DB_H_', hdr, hsearch)) # _DB_H_ should not be defined except Berkeley DB.
case db
when /\Adb\d?\z/
have_func('db_version((int *)0, (int *)0, (int *)0)', hdr, hsearch)