mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* eval.c (rb_yield_0): need argument adjustment for C defined
blocks too. * ext/dbm/extconf.rb: header search added. [new] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1443 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
315cd83418
commit
2287c526be
1 changed files with 28 additions and 9 deletions
|
@ -4,23 +4,42 @@ dir_config("dbm")
|
||||||
|
|
||||||
dblib = with_config("dbm-type", nil)
|
dblib = with_config("dbm-type", nil)
|
||||||
|
|
||||||
|
$dbm_conf_headers = {
|
||||||
|
"db" => ["db.h"],
|
||||||
|
"db1" => ["db1/ndbm.h", "db1.h"],
|
||||||
|
"db2" => ["db2/db.h", "db2.h", "db.h"],
|
||||||
|
"dbm" => ["ndbm.h"],
|
||||||
|
"gdbm" => ["gdbm-ndbm.h", "gdbm.h"],
|
||||||
|
}
|
||||||
|
|
||||||
def db_check(db)
|
def db_check(db)
|
||||||
$db_hdr = "ndbm.h"
|
$dbm_conf_db_prefix = ""
|
||||||
$db_prefix = ""
|
$dbm_conf_have_gdbm = false
|
||||||
|
hsearch = ""
|
||||||
|
|
||||||
case db
|
case db
|
||||||
when /^db2?$/
|
when /^db2?$/
|
||||||
$db_prefix = "__db_n"
|
$dbm_conf_db_prefix = "__db_n"
|
||||||
$db_hdr = db+".h"
|
hsearch = "-DDB_DBM_HSEARCH "
|
||||||
when "gdbm"
|
when "gdbm"
|
||||||
$have_gdbm = true
|
$dbm_conf_have_gdbm = true
|
||||||
end
|
end
|
||||||
|
|
||||||
have_func(db_prefix("dbm_open")) || have_library(db, db_prefix("dbm_open"))
|
if have_func(db_prefix("dbm_open")) || have_library(db, db_prefix("dbm_open"))
|
||||||
|
for hdr in $dbm_conf_headers.fetch(db, ["ndbm.h"])
|
||||||
|
if have_header(hdr.dup)
|
||||||
|
$CFLAGS = "-DDBM_HDR='<"+hdr+">'"
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
$CFLAGS = hsearch + "-DDBM_HDR='<"+hdr+">'"
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
def db_prefix(func)
|
def db_prefix(func)
|
||||||
$db_prefix+func
|
$dbm_conf_db_prefix+func
|
||||||
end
|
end
|
||||||
|
|
||||||
if dblib
|
if dblib
|
||||||
|
@ -33,7 +52,7 @@ end
|
||||||
|
|
||||||
have_header("cdefs.h")
|
have_header("cdefs.h")
|
||||||
have_header("sys/cdefs.h")
|
have_header("sys/cdefs.h")
|
||||||
if have_header($db_hdr) and have_func(db_prefix("dbm_open"))
|
if have_func(db_prefix("dbm_open"))
|
||||||
have_func(db_prefix("dbm_clearerr")) unless $have_gdbm
|
have_func(db_prefix("dbm_clearerr")) unless $dbm_conf_have_gdbm
|
||||||
create_makefile("dbm")
|
create_makefile("dbm")
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue