File: extconf.rb

package info (click to toggle)
ruby-serialport 1.3.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 532 kB
  • sloc: ansic: 1,425; ruby: 74; sh: 16; makefile: 4
file content (16 lines) | stat: -rw-r--r-- 395 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
require 'mkmf'

printf("checking for OS... ")
STDOUT.flush
os = /-([a-z]+)/.match(RUBY_PLATFORM)[1]
puts(os)
$CFLAGS += " -DOS_#{os.upcase}"

if !(os == 'mswin' or os == 'bccwin' or os == 'mingw')
  exit(1) if not have_header("termios.h") or not have_header("unistd.h")
end

have_func("rb_io_descriptor") # ruby-3.1+
have_func("rb_io_open_descriptor") # ruby-3.3+

create_makefile('serialport')