ext/rs_232/extconf.rb in rs_232-2.3.2.pre vs ext/rs_232/extconf.rb in rs_232-3.0.0.pre2
- old
+ new
@@ -1,15 +1,18 @@
require 'mkmf'
require 'rbconfig'
-if ENV['DEBUG_C']
+EXTENSION_NAME = 'rs_232_native'.freeze
+dir_config(EXTENSION_NAME)
+
+if ENV['DEBUG']
$CFLAGS << ' -DDEBUG'
- $CFLAGS << ' -g -O'
+ $CFLAGS << ' -g'
$stdout.puts "compiling in debug mode... flags: #{$CFLAGS}"
end
-dir_config('rs_232')
+$CFLAGS << ' -Wall -g'
$warnflags = '-Wall'
OS = case RbConfig::CONFIG['host_os'].downcase
when /linux/
@@ -28,10 +31,11 @@
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')
@@ -47,19 +51,19 @@
have_header('string.h')
have_header('fcntl.h')
have_header('errno.h')
have_header('sys/ioctl.h')
else
- fail "RS-233 implementation is not tested for this #{OS} platform."
+ fail "RS-233 implementation wasn't been tested for #{OS} platform."
end
-$objs = %w(constants.o port.o initializer.o)
+$objs = %w(Constants.o Port.o Rs232.o).freeze
$CFLAGS += " -DOS_#{OS.upcase}"
$stdout.puts <<-MSG
Extending with: #{$CFLAGS}
MSG
-create_makefile('rs_232')
+create_makefile(EXTENSION_NAME)