diff --git a/README.rdoc b/README.rdoc index 1c9b1e9..2b68b15 100644 --- a/README.rdoc +++ b/README.rdoc @@ -10,10 +10,10 @@ Simple FFI wrappers for things I need from ICU. For the full thing, check out IC = Dependencies -ICU. If you get messages that the library or functions are not found, you can -set some env vars to tell ffi-icu where to find it: +ICU. If you get messages that the library or functions are not found, you can +set some environment varibles to tell ffi-icu where to find it: -... +FFI_ICU_LIB="icui18n.so" FFI_ICU_VERSION_SUFFIX="_3_8" ruby -r ffi-icu = Features diff --git a/lib/ffi-icu/lib.rb b/lib/ffi-icu/lib.rb index 91bae2c..87bf21d 100644 --- a/lib/ffi-icu/lib.rb +++ b/lib/ffi-icu/lib.rb @@ -17,6 +17,7 @@ module ICU def self.find_icu suffix = '' + # let the user tell us where the lib is if ENV['FFI_ICU_LIB'] libs = ENV['FFI_ICU_LIB'].split(",") ffi_lib *libs @@ -25,9 +26,12 @@ module ICU return ENV['FFI_ICU_VERSION_SUFFIX'] elsif num = libs.first[/\d+$/] return num.split(//).join("_") + else + return suffix end end + # ok, try to find it case ICU.platform when :osx ffi_lib "icucore"