diff options
author | Wayne Meissner <wmeissner@gmail.com> | 2012-08-19 17:09:27 +1000 |
---|---|---|
committer | Wayne Meissner <wmeissner@gmail.com> | 2012-08-19 17:09:27 +1000 |
commit | 74229a383174ac674a562b2e74cb6e1aa3335517 (patch) | |
tree | 04ef36188ebb8dc867c5e32833379203a6185b86 | |
parent | d19b48bde5b1eb98571c6ee318d3dccf80318c93 (diff) | |
download | ffi-74229a383174ac674a562b2e74cb6e1aa3335517.tar.gz |
Attempt to eliminate any warning and ansi flags imposed upon ruby-ffi by the ruby version it is compiled against.
-rw-r--r-- | ext/ffi_c/extconf.rb | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/ext/ffi_c/extconf.rb b/ext/ffi_c/extconf.rb index 170f81d..bef6e80 100644 --- a/ext/ffi_c/extconf.rb +++ b/ext/ffi_c/extconf.rb @@ -4,7 +4,12 @@ if !defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby" require 'mkmf' require 'rbconfig' dir_config("ffi_c") - + + # recent versions of ruby add restrictive ansi and warning flags on a whim - kill them all + $warnflags = '' + $CFLAGS.gsub!(/-ansi/, '') + $CFLAGS.gsub!(/-std=[^\s]+/, '') + if ENV['RUBY_CC_VERSION'].nil? && (pkg_config("libffi") || have_header("ffi.h") || find_header("ffi.h", "/usr/local/include", "/usr/include/ffi")) @@ -31,11 +36,7 @@ if !defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby" $CFLAGS << " -mwin32 " if RbConfig::CONFIG['host_os'] =~ /cygwin/ $LOCAL_LIBS << " ./libffi/.libs/libffi_convenience.lib" if RbConfig::CONFIG['host_os'] =~ /mswin/ - #$CFLAGS << " -Werror -Wunused -Wformat -Wimplicit -Wreturn-type " - if (ENV['CC'] || RbConfig::MAKEFILE_CONFIG['CC']) =~ /gcc/ -# $CFLAGS << " -Wno-declaration-after-statement " - end - + create_makefile("ffi_c") unless libffi_ok File.open("Makefile", "a") do |mf| |