From e031ef9a8edc08e36a6af36ff4eba288b598de04 Mon Sep 17 00:00:00 2001 From: Kubo Takehiro Date: Fri, 7 Jan 2022 23:00:03 +0900 Subject: [PATCH] Fix oraconf.rb for ruby 3.1 distributed by rubyinstaller.org Code for Borland C++ was removed also. --- ext/oci8/oraconf.rb | 38 +++++++++++--------------------------- 1 file changed, 11 insertions(+), 27 deletions(-) diff --git a/ext/oci8/oraconf.rb b/ext/oci8/oraconf.rb index c9d23a70..4ed33b6e 100644 --- a/ext/oci8/oraconf.rb +++ b/ext/oci8/oraconf.rb @@ -4,7 +4,7 @@ # compatibility for ruby-1.9 RbConfig = Config unless defined? RbConfig -if RUBY_PLATFORM =~ /mswin32|mswin64|cygwin|mingw32|bccwin32/ +if RUBY_PLATFORM =~ /mswin32|mswin64|cygwin|mingw/ # Windows require 'win32/registry' module Registry @@ -372,7 +372,7 @@ def self.guess_ic_dir is_32bit = size_of_pointer == 4 is_big_endian = "\x01\x02".unpack('s')[0] == 0x0102 case RUBY_PLATFORM - when /mswin32|mswin64|cygwin|mingw32|bccwin32/ + when /mswin32|mswin64|cygwin|mingw/ oci_basename = 'oci' oci_glob_postfix = '' nls_data_basename = ['oraociei*', 'oraociicus*'] @@ -530,7 +530,7 @@ def self.check_lib_in_path(paths, glob_name, check_proc) paths.split(File::PATH_SEPARATOR).each do |path| next if path.nil? or path == '' print " checking #{path}... " - path.gsub!(/\\/, '/') if /mswin32|mswin64|cygwin|mingw32|bccwin32/ =~ RUBY_PLATFORM + path.gsub!(/\\/, '/') if /mswin32|mswin64|cygwin|mingw/ =~ RUBY_PLATFORM files = Dir.glob(File.join(path, glob_name)).sort.reverse if files.empty? puts "no" @@ -624,11 +624,11 @@ def try_link_oci end end - if RUBY_PLATFORM =~ /mswin32|mswin64|cygwin|mingw32|bccwin32/ # when Windows + if RUBY_PLATFORM =~ /mswin32|mswin64|cygwin|mingw/ # when Windows def get_libs(lib_dir) case RUBY_PLATFORM - when /cygwin|x64-mingw32/ + when /cygwin/ regex = ([nil].pack('P').size == 8) ? / T (OCI\w+)/ : / T _(OCI\w+)/ oci_funcs = YAML.load(open(File.dirname(__FILE__) + '/apiwrap.yml')).keys.collect do |func| func =~ /_nb$/ ? $` : func @@ -647,22 +647,6 @@ def get_libs(lib_dir) system(command) puts("done") "-L. -lOCI" - when /bccwin32/ - # replace '/' to '\\' because bcc linker misunderstands - # 'C:/foo/bar/OCI.LIB' as unknown option. - lib = "#{lib_dir}/BORLAND/OCI.LIB" - return lib.tr('/', '\\') if File.exist?(lib) - raise <