diff options
author | Lars Kanis <lars@greiz-reinsdorf.de> | 2020-12-05 18:44:00 +0100 |
---|---|---|
committer | Lars Kanis <lars@greiz-reinsdorf.de> | 2020-12-05 18:44:00 +0100 |
commit | ba931d5e1f5c8fef2ea3bcb6b68e6c3f91e21cf0 (patch) | |
tree | 1ed3e0428dfa835acd8f7a2aca05b32c38ca473a | |
parent | d2637f37a698321c1cdb27ae79a84ca0d71774ec (diff) | |
download | ffi-ba931d5e1f5c8fef2ea3bcb6b68e6c3f91e21cf0.tar.gz |
Use case insensitive regex instead of downcase
-rw-r--r-- | ext/ffi_c/extconf.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/ffi_c/extconf.rb b/ext/ffi_c/extconf.rb index 0a642a7..8d8a602 100644 --- a/ext/ffi_c/extconf.rb +++ b/ext/ffi_c/extconf.rb @@ -65,16 +65,16 @@ if RUBY_ENGINE == 'ruby' || RUBY_ENGINE == 'rbx' unless system_libffi File.open("Makefile", "a") do |mf| mf.puts "LIBFFI_HOST=--host=#{RbConfig::CONFIG['host_alias']}" if RbConfig::CONFIG.has_key?("host_alias") - if RbConfig::CONFIG['host_os'].downcase =~ /darwin/ - if RbConfig::CONFIG['host'] =~ /arm/ + if RbConfig::CONFIG['host_os'] =~ /darwin/i + if RbConfig::CONFIG['host'] =~ /arm/i mf.puts "LIBFFI_HOST=--host=aarch64-apple-#{RbConfig::CONFIG['host_os']}" end mf.puts "include ${srcdir}/libffi.darwin.mk" - elsif RbConfig::CONFIG['host_os'].downcase =~ /bsd/ + elsif RbConfig::CONFIG['host_os'] =~ /bsd/i mf.puts '.include "${srcdir}/libffi.bsd.mk"' - elsif RbConfig::CONFIG['host_os'].downcase =~ /mswin64/ + elsif RbConfig::CONFIG['host_os'] =~ /mswin64/i mf.puts '!include $(srcdir)/libffi.vc64.mk' - elsif RbConfig::CONFIG['host_os'].downcase =~ /mswin32/ + elsif RbConfig::CONFIG['host_os'] =~ /mswin32/i mf.puts '!include $(srcdir)/libffi.vc.mk' else mf.puts "include ${srcdir}/libffi.mk" |