Sha256: 6c09666b88df40cde2f19aed453ace9bd855d28588e2643812e52a3a7820b0ef

Contents?: true

Size: 958 Bytes

Versions: 5

Compression:

Stored size: 958 Bytes

Contents

require 'mkmf'
require 'fileutils'

def patch_autogen
  # s/libtoolize/glibtoolize/
  File.write('autogen.sh', File.read('autogen.sh').gsub(/libtoolize/, 'glibtoolize'))
end

unless have_library 'snappy'
  # build vendor/snappy
  pwd = File.dirname File.expand_path __FILE__
  dir = File.join pwd, '..', 'vendor', 'snappy'

  Dir.chdir dir do
    unless system './autogen.sh'
      patch_autogen
      raise '`autogen.sh` failed' unless system './autogen.sh'
    end
    raise '`configure` failed'  unless system './configure --disable-option-checking --disable-dependency-tracking --disable-gtest --without-gflags'
  end

  src = %w(
   config.h
   snappy-c.cc
   snappy-c.h
   snappy-internal.h
   snappy-sinksource.cc
   snappy-sinksource.h
   snappy-stubs-internal.cc
   snappy-stubs-internal.h
   snappy-stubs-public.h
   snappy.cc
   snappy.h
  ).map { |e| File.join dir, e }
  FileUtils.cp src, pwd, :verbose => true
end

create_makefile 'snappy_ext'

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
snappy-0.0.14-java ext/extconf.rb
snappy-0.0.14 ext/extconf.rb
snappy-0.0.13 ext/extconf.rb
snappy-0.0.12-java ext/extconf.rb
snappy-0.0.12 ext/extconf.rb