fix solaris install problems
This commit is contained in:
parent
20a230483c
commit
612e248d08
7
bdb.h
7
bdb.h
|
@ -4,8 +4,13 @@
|
||||||
|
|
||||||
#include <ruby.h>
|
#include <ruby.h>
|
||||||
#include <version.h>
|
#include <version.h>
|
||||||
#include <db4/db.h>
|
#include <extconf.h>
|
||||||
|
|
||||||
|
#ifdef INC_DB4
|
||||||
|
#include <db4/db.h>
|
||||||
|
#else
|
||||||
|
#include <db.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#define NOTXN NULL
|
#define NOTXN NULL
|
||||||
|
|
||||||
|
|
20
extconf.rb
20
extconf.rb
|
@ -2,6 +2,10 @@
|
||||||
|
|
||||||
require 'mkmf'
|
require 'mkmf'
|
||||||
|
|
||||||
|
if CONFIG['INSTALL'] =~ %r{./install-sh}
|
||||||
|
CONFIG.delete("INSTALL")
|
||||||
|
end
|
||||||
|
|
||||||
mj,mi,rv=RUBY_VERSION.split('.').collect {|s| s.to_i}
|
mj,mi,rv=RUBY_VERSION.split('.').collect {|s| s.to_i}
|
||||||
ri=(((mj*1000)+mi)*1000)+rv
|
ri=(((mj*1000)+mi)*1000)+rv
|
||||||
if ri < 1008004
|
if ri < 1008004
|
||||||
|
@ -30,6 +34,15 @@ h_headers=%w(db4/db.h db.h)
|
||||||
until h_headers.empty?
|
until h_headers.empty?
|
||||||
(inc_ok=find_header(this_h=h_headers.shift,*h_locations)) && break
|
(inc_ok=find_header(this_h=h_headers.shift,*h_locations)) && break
|
||||||
end
|
end
|
||||||
|
puts "db header is #{this_h} #{inc_ok} #$INCFLAGS"
|
||||||
|
|
||||||
|
if this_h == "db4/db.h"
|
||||||
|
$defs << "-DINC_DB4"
|
||||||
|
else
|
||||||
|
$defs << "-UINC_DB4"
|
||||||
|
end
|
||||||
|
|
||||||
|
puts "defs: "+$defs.inspect
|
||||||
|
|
||||||
# Find db.h, not sure this will work everywhere, gcc is ok
|
# Find db.h, not sure this will work everywhere, gcc is ok
|
||||||
src=create_tmpsrc("#include <#{this_h}>")
|
src=create_tmpsrc("#include <#{this_h}>")
|
||||||
|
@ -48,7 +61,7 @@ File.open(header_loc) {|fd|
|
||||||
hd.puts("/* This file automatically generated by extconf.rb */\n")
|
hd.puts("/* This file automatically generated by extconf.rb */\n")
|
||||||
fd.each_line {|l|
|
fd.each_line {|l|
|
||||||
if l =~ %r{^#define\s+(DBC?_\w*)\s+(\"?)} and macro_defined?($1,inc)
|
if l =~ %r{^#define\s+(DBC?_\w*)\s+(\"?)} and macro_defined?($1,inc)
|
||||||
if $2 == '"'
|
if $2 == '\"'
|
||||||
hd.print(%Q{ cs(mBdb,%s);\n}%[$1])
|
hd.print(%Q{ cs(mBdb,%s);\n}%[$1])
|
||||||
else
|
else
|
||||||
hd.print(%Q{ ci(mBdb,%s);\n}%[$1])
|
hd.print(%Q{ ci(mBdb,%s);\n}%[$1])
|
||||||
|
@ -58,10 +71,13 @@ File.open(header_loc) {|fd|
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} unless File.exist?("bdb_aux._c")
|
||||||
message("\nwrote #{n} defines\n")
|
message("\nwrote #{n} defines\n")
|
||||||
|
|
||||||
|
$defs << $INCFLAGS
|
||||||
|
|
||||||
if lib_ok and inc_ok
|
if lib_ok and inc_ok
|
||||||
|
create_header
|
||||||
create_makefile('bdb2')
|
create_makefile('bdb2')
|
||||||
else
|
else
|
||||||
$stderr.puts("cannot create Makefile")
|
$stderr.puts("cannot create Makefile")
|
||||||
|
|
Loading…
Reference in a new issue