summaryrefslogtreecommitdiff
path: root/ext/dbm
diff options
context:
space:
mode:
authoreban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-05-07 10:56:01 +0000
committereban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-05-07 10:56:01 +0000
commit581f7b863b1019fb4f6cfdea26f839c8c7639e12 (patch)
tree30af21716f0d9fe422f55f6f7d28fa0a63d0a93b /ext/dbm
parent13cbec33c1335c5e582360797dfce7601bf60206 (diff)
* ext/dbm/extconf.rb: fix for FreeBSD and GDBM.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/dbm')
-rw-r--r--ext/dbm/extconf.rb15
1 files changed, 8 insertions, 7 deletions
diff --git a/ext/dbm/extconf.rb b/ext/dbm/extconf.rb
index 7afa7d9..f9dc708 100644
--- a/ext/dbm/extconf.rb
+++ b/ext/dbm/extconf.rb
@@ -2,20 +2,21 @@ require 'mkmf'
dir_config("dbm")
-$db_hdr = "ndbm.h"
-$db_prefix = ""
dblib = with_config("dbm-type", nil)
def db_check(db)
- if /^db2?$/ =~ db
+ $db_hdr = "ndbm.h"
+ $db_prefix = ""
+
+ case db
+ when /^db2?$/
$db_prefix = "__db_n"
$db_hdr = db+".h"
- end
- r = have_library(db, db_prefix("dbm_open"))
- if db == "gdbm"
+ when "gdbm"
$have_gdbm = true
end
- return r
+
+ have_func(db_prefix("dbm_open")) || have_library(db, db_prefix("dbm_open"))
end
def db_prefix(func)