make extconf.rb accept --va so the library can coexist with bdb2 release prior to transactions. Note, howerver the two libraries cannot be used at the same time
This commit is contained in:
parent
fd1dfef645
commit
8c6dc264b2
3
bdb.c
3
bdb.c
|
@ -1650,3 +1650,6 @@ void Init_bdb2() {
|
|||
rb_define_method(cTxn,"tid",txn_id,0);
|
||||
rb_define_method(cTxn,"set_timeout",txn_set_timeout,2);
|
||||
}
|
||||
void Init_bdb2a() {
|
||||
Init_bdb2();
|
||||
}
|
||||
|
|
24
extconf.rb
24
extconf.rb
|
@ -1,7 +1,21 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
require 'getoptlong'
|
||||
require 'mkmf'
|
||||
|
||||
target="bdb2"
|
||||
|
||||
opts = GetoptLong.new(
|
||||
[ "--va", GetoptLong::NO_ARGUMENT]
|
||||
)
|
||||
opts.each do |opt,arg|
|
||||
case opt
|
||||
when '--va'
|
||||
target="bdb2a"
|
||||
end
|
||||
end
|
||||
|
||||
message "Target is #{target}\n"
|
||||
|
||||
if CONFIG['INSTALL'] =~ %r{./install-sh}
|
||||
CONFIG.delete("INSTALL")
|
||||
end
|
||||
|
@ -13,7 +27,7 @@ if ri < 1008004
|
|||
exit(3)
|
||||
end
|
||||
|
||||
inc_dir,lib_dir = dir_config('bdb2')
|
||||
inc_dir,lib_dir = dir_config(target)
|
||||
|
||||
$stderr.puts("lib_dir=#{lib_dir} inc_dir=#{inc_dir}")
|
||||
|
||||
|
@ -54,7 +68,7 @@ message("header is #{header_loc}\n")
|
|||
|
||||
inc="#include <#{this_h}>"
|
||||
n=0
|
||||
message("Writing bdb_aux.c (defines), this takes a while")
|
||||
message("Writing bdb_aux._c (defines), this takes a while\n")
|
||||
defines=[]
|
||||
File.open(header_loc) {|fd|
|
||||
File.open("bdb_aux._c","w") {|hd|
|
||||
|
@ -71,14 +85,14 @@ File.open(header_loc) {|fd|
|
|||
end
|
||||
}
|
||||
}
|
||||
} unless File.exist?("bdb_aux._c")
|
||||
message("\nwrote #{n} defines\n")
|
||||
} unless File.exist?("bdb_aux._c")
|
||||
|
||||
$defs << $INCFLAGS
|
||||
|
||||
if lib_ok and inc_ok
|
||||
create_header
|
||||
create_makefile('bdb2')
|
||||
create_makefile(target)
|
||||
else
|
||||
$stderr.puts("cannot create Makefile")
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue