io-console 0.4.6 → 0.5.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
  require 'mkmf'
3
3
 
4
- ok = true
4
+ ok = true if RUBY_ENGINE == "ruby"
5
5
  hdr = nil
6
6
  case
7
7
  when macro_defined?("_WIN32", "")
@@ -14,16 +14,20 @@ when have_header(hdr = "sgtty.h")
14
14
  %w"stty gtty".each {|f| have_func(f, hdr)}
15
15
  else
16
16
  ok = false
17
- end
18
- if ok
17
+ end if ok
18
+ case ok
19
+ when true
19
20
  have_header("sys/ioctl.h") if hdr
20
- have_func("rb_funcallv")
21
- have_func("rb_sym2str")
22
21
  # rb_check_hash_type: 1.9.3
23
22
  # rb_io_get_write_io: 1.9.1
24
23
  # rb_cloexec_open: 2.0.0
24
+ # rb_funcallv: 2.1.0
25
+ # RARRAY_CONST_PTR: 2.1.0
26
+ # rb_sym2str: 2.2.0
25
27
  $defs << "-D""ENABLE_IO_GETPASS=1"
26
28
  create_makefile("io/console") {|conf|
27
29
  conf << "\n""VK_HEADER = #{vk_header}\n"
28
30
  }
31
+ when nil
32
+ File.write("Makefile", dummy_makefile($srcdir).join(""))
29
33
  end