File: extconf.rb

package info (click to toggle)
ruby-termios 1.1.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 204 kB
  • sloc: ansic: 1,163; ruby: 377; sh: 4; makefile: 4
file content (28 lines) | stat: -rw-r--r-- 727 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
require 'mkmf'

Dir.glob('./lib/**/*.rb') do |f|
  $INSTALLFILES << [f, '$(RUBYLIBDIR)', 'lib']
end

if have_header('termios.h') &&
    have_header('unistd.h')
  have_header('sys/ioctl.h')

  if RUBY_VERSION >= '1.7'
    if have_header('ruby/io.h')
      have_type("rb_io_t", ["ruby/io.h"])
      have_struct_member("rb_io_t", "fd", ["ruby/io.h"])
    else
      if have_type("rb_io_t", ["ruby.h", "rubyio.h"])
        have_struct_member("rb_io_t", "fd", ["ruby.h", "rubyio.h"])
      else
        have_struct_member("OpenFile", "fd", ["ruby.h", "rubyio.h"])
      end
      if have_macro("OpenFile", ["ruby.h", "rubyio.h"])
        $defs.push("-DHAVE_MACRO_OPENFILE")
      end
    end
  end

  create_makefile('termios')
end