Sha256: bd49f6283fbb0436b29d204d6920ecbc6d83909bd6bb91b319ee329e4e26784e

Contents?: true

Size: 958 Bytes

Versions: 8

Compression:

Stored size: 958 Bytes

Contents

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']

# search our gem root first to pick up libyajl2 that we vendored
gem_root = File.expand_path(File.join(File.dirname(__FILE__), "../../../.."))
$CFLAGS = "-I#{gem_root}/include -L#{gem_root}/lib #{$CFLAGS}"
$LDFLAGS = "-L#{gem_root}/lib #{$CFLAGS}"

puts gem_root
puts $CFLAGS
puts $LDFLAGS

# 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

$LDFLAGS << " -lyajl"

dir_config 'encoder'

create_makefile 'ffi_yajl/ext/encoder'

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
ffi-yajl-0.0.4 ext/ffi_yajl/ext/encoder/extconf.rb
ffi-yajl-0.0.4-universal-java ext/ffi_yajl/ext/encoder/extconf.rb
ffi-yajl-0.0.3-universal-java ext/ffi_yajl/ext/encoder/extconf.rb
ffi-yajl-0.0.3 ext/ffi_yajl/ext/encoder/extconf.rb
ffi-yajl-0.0.2-universal-java ext/ffi_yajl/ext/encoder/extconf.rb
ffi-yajl-0.0.2 ext/ffi_yajl/ext/encoder/extconf.rb
ffi-yajl-0.0.1-universal-java ext/ffi_yajl/ext/encoder/extconf.rb
ffi-yajl-0.0.1 ext/ffi_yajl/ext/encoder/extconf.rb