Sha256: aa18b623cad7ff27e6978baed6436551c465bf0a415c2dbe6f4b2856a223d2b4

Contents?: true

Size: 1.37 KB

Versions: 3

Compression:

Stored size: 1.37 KB

Contents

require 'mkmf'
require 'rbconfig'

EXTENSION_NAME = 'rs_232_native'.freeze
dir_config(EXTENSION_NAME)

if ENV['DEBUG']
  $CFLAGS << ' -DDEBUG'
  $CFLAGS << ' -g'
  $stdout.puts "compiling in debug mode... flags: #{$CFLAGS}"
end

$CFLAGS << ' -Wall -g'

$warnflags = '-Wall'

OS = case RbConfig::CONFIG['host_os'].downcase
     when /linux/
       'linux'
     when /darwin/
       'darwin'
     when /freebsd/
       'freebsd'
     when /openbsd/
       'openbsd'
     when /sunos|solaris/
       'solaris'
     when /mswin|mingw/
       'windows'
     else
       RbConfig::CONFIG['host_os'].downcase
     end

have_header('ruby.h')
have_header('stdio.h')
have_library( 'stdc++' )

if OS == 'windows'
  $VPATH << '$(srcdir)/windows'
  $INCFLAGS += ' -I$(srcdir)/windows'
  have_header('windows.h')
  have_header('fcntl.h')
  have_header('io.h')
  have_header('ruby/io.h')
  have_header('rubyio.h')
elsif %w(linux darwin).include? OS
  $VPATH << ' $(srcdir)/posix'
  $INCFLAGS += ' -I$(srcdir)/posix'
  have_header('termios.h')
  have_header('unistd.h')
  have_header('string.h')
  have_header('fcntl.h')
  have_header('errno.h')
  have_header('sys/ioctl.h')
else
  fail "RS-233 implementation wasn't been tested for #{OS} platform."
end

$objs = %w(Constants.o Port.o Rs232.o).freeze

$CFLAGS += " -DOS_#{OS.upcase}"

$stdout.puts <<-MSG

Extending with: #{$CFLAGS}

MSG

create_makefile(EXTENSION_NAME)

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rs_232-3.0.0.pre4 ext/rs_232/extconf.rb
rs_232-3.0.0.pre3 ext/rs_232/extconf.rb
rs_232-3.0.0.pre2 ext/rs_232/extconf.rb