diff options
Diffstat (limited to 'ext/ffi_yajl/ext/encoder/extconf.rb')
-rw-r--r-- | ext/ffi_yajl/ext/encoder/extconf.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/ext/ffi_yajl/ext/encoder/extconf.rb b/ext/ffi_yajl/ext/encoder/extconf.rb new file mode 100644 index 0000000..bfe042a --- /dev/null +++ b/ext/ffi_yajl/ext/encoder/extconf.rb @@ -0,0 +1,18 @@ +require 'mkmf' + +# the customer is always right, ruby is always compiled to be stupid +$CFLAGS = ENV['CFLAGS'] if ENV['CFLAGS'] +$LDFLAGS = ENV['LDFLAGS'] if ENV['LDFLAGS'] +RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC'] if ENV['CC'] + +# except if you're doing an unoptimized gcc install we're going to help you out a bit +if RbConfig::MAKEFILE_CONFIG['CC'] =~ /gcc|clang/ + $CFLAGS << " -O3" unless $CFLAGS[/-O\d/] + # how many people realize that -Wall is a compiler-specific flag??? + # apparently not many based on reading lots of shitty extconf.rb's out there + $CFLAGS << " -Wall" +end + +dir_config 'encoder' + +create_makefile 'ffi_yajl/ext/encoder' |