Sha256: e87aa01df55be855059c0155aa56402e0df31c4ef258bd950327156d32201b68

Contents?: true

Size: 849 Bytes

Versions: 3

Compression:

Stored size: 849 Bytes

Contents

require 'mkmf'

LIBDIR      = RbConfig::CONFIG['libdir']
INCLUDEDIR  = RbConfig::CONFIG['includedir']

HEADER_DIRS = [
  '/usr/local/include',

  INCLUDEDIR,

  '/usr/include'
]

LIB_DIRS = [
  '/usr/local/lib',

  LIBDIR,

  '/usr/lib'
]

HUNSPELL_TEST_HEADERS = ['hunspell/hunspell.h']
HUNSPELL_TEST_FUNCTION = 'Hunspell_create'

# Hunspell libraries to test for, in order of precedence
HUNSPELL_LIBRARIES = %w(1.6 1.5 1.4 1.3).map {|ver| "hunspell-#{ver}"}

HUNSPELL_LIBRARIES.each do |library|
  dir_config(library, HEADER_DIRS, LIB_DIRS)
end

# Link with first matching library
if HUNSPELL_LIBRARIES.any? { |library| have_library(library, HUNSPELL_TEST_FUNCTION, HUNSPELL_TEST_HEADERS) }
then
  create_makefile('Hunspell')
else
  STDERR.puts('Missing hunspell library')
  STDERR.puts('Supported versions: ' + HUNSPELL_LIBRARIES.join(' '))
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
hunspell-1.0.0 extconf.rb
hunspell-0.1.7 extconf.rb
hunspell-0.1.6 extconf.rb