diff --git a/docs/hanging-after-inactivity.md b/docs/hanging-after-inactivity.md index f303d700..888d05f6 100644 --- a/docs/hanging-after-inactivity.md +++ b/docs/hanging-after-inactivity.md @@ -39,7 +39,7 @@ by the `tcp_keepalive_time` property. It is supported on the following platforms since ruby-oci8 2.2.4. * Linux i386 and x86_64 -* macOS +* macOS x86_64 * Windows x86 and x64 * Solaris x86_64 diff --git a/ext/oci8/extconf.rb b/ext/oci8/extconf.rb index d4b31566..77637c78 100644 --- a/ext/oci8/extconf.rb +++ b/ext/oci8/extconf.rb @@ -150,22 +150,29 @@ def fmt.%(x) case RUBY_PLATFORM when /mswin32|cygwin|mingw/ plthook_src = "plthook_win32.c" -when /darwin/ +when /x86_64-darwin/ plthook_src = "plthook_osx.c" +when /darwin/ + # macOS arm64 + plthook_src = nil + puts "skip" else plthook_src = "plthook_elf.c" end -FileUtils.copy(File.dirname(__FILE__) + "/" + plthook_src, CONFTEST_C) -if xsystem(cc_command("")) - FileUtils.rm_f("#{CONFTEST}.#{$OBJEXT}") - puts plthook_src - $objs << plthook_src.gsub(/\.c$/, '.o') - $objs << "hook_funcs.o" - $defs << "-DHAVE_PLTHOOK" - have_library('dbghelp', 'ImageDirectoryEntryToData', ['windows.h', 'dbghelp.h']) if RUBY_PLATFORM =~ /cygwin/ - $libs += ' -lws2_32' if RUBY_PLATFORM =~ /cygwin/ -else - puts "no" + +if plthook_src + FileUtils.copy(File.dirname(__FILE__) + "/" + plthook_src, CONFTEST_C) + if xsystem(cc_command("")) + FileUtils.rm_f("#{CONFTEST}.#{$OBJEXT}") + puts plthook_src + $objs << plthook_src.gsub(/\.c$/, '.o') + $objs << "hook_funcs.o" + $defs << "-DHAVE_PLTHOOK" + have_library('dbghelp', 'ImageDirectoryEntryToData', ['windows.h', 'dbghelp.h']) if RUBY_PLATFORM =~ /cygwin/ + $libs += ' -lws2_32' if RUBY_PLATFORM =~ /cygwin/ + else + puts "no" + end end $defs << "-DInit_oci8lib=Init_#{so_basename}"