diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-12-06 10:21:12 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-12-06 10:21:12 +0000 |
commit | bb1875175bd683014008e23cde429d8508d5524e (patch) | |
tree | 7235feac43f304607518683bdc582b9e1dd7d175 /ext/dbm/extconf.rb | |
parent | 1ff15071d05f343206318b6f06b45c43dec814f1 (diff) | |
download | ruby-bb1875175bd683014008e23cde429d8508d5524e.tar.gz |
* ext/dbm/dbm.c: use db_version() instead of DB_VERSION_STRING for
detect runtime Berkeley DB version.
use dpversion instead of _QDBM_VERSION for detect runtime QDBM
[ruby-dev:44948]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/dbm/extconf.rb')
-rw-r--r-- | ext/dbm/extconf.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/dbm/extconf.rb b/ext/dbm/extconf.rb index 6a4b8c069d..9c4004814e 100644 --- a/ext/dbm/extconf.rb +++ b/ext/dbm/extconf.rb @@ -80,12 +80,17 @@ def headers.db_check2(db, hdr) (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 /gdbm/ =~ db + case db + when /\Adb\d?\z/ + have_func('db_version((int *)0, (int *)0, (int *)0)', hdr, hsearch) + when /\Agdbm/ have_var("gdbm_version", hdr, hsearch) # gdbm_version is not declared by ndbm.h until gdbm 1.8.3. # We can't include ndbm.h and gdbm.h because they both define datum type. # ndbm.h includes gdbm.h and gdbm_version is declared since gdbm 1.9. have_libvar(["gdbm_version", "char *"], hdr, hsearch) + when /\Aqdbm\z/ + have_var("dpversion", hdr, hsearch) end if hsearch $defs << hsearch |