Sha256: 9195699acdf081149871e8499f92d42ed9a6ddb1e7ac3ac0759b7182f12219c9

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

require "mkmf"
require "fileutils"

def sys(cmd)
  puts "  -- #{cmd}"
  unless ret = xsystem(cmd)
    raise "#{cmd} failed, please report issue on https://github.com/wordtreefoundation/melisa"
  end
  ret
end

if `which make`.strip.empty?
  STDERR.puts "\n\n"
  STDERR.puts "***************************************************************************************"
  STDERR.puts "*************** make required (apt-get install make build-essential) =( ***************"
  STDERR.puts "***************************************************************************************"
  exit(1)
end

MARISA_ROOT = File.expand_path(File.join(File.dirname(__FILE__), "marisa-0.2.4"))
PREFIX = File.expand_path(File.join(File.dirname(__FILE__), "pkg"))

FileUtils.cd(MARISA_ROOT) do
  sys "./configure --enable-sse3 --prefix='#{PREFIX}'"
  sys "make install"
end

$CFLAGS   << " -I#{File.join(PREFIX, 'include')}"
$CPPFLAGS << " -I#{File.join(PREFIX, 'include')}"
$LDFLAGS  << " -L#{File.join(PREFIX, 'lib')} -lmarisa"

create_makefile("marisa")

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
melisa-0.2.4 ext/extconf.rb