I have application in ruby which is using native extension made by my. It's linking to shared so library which cannot by installed automatically (it's distributed only as file). The question is, how can I add it to my gem file to be sure that my ruby native extension will be able to use it after gem install? This solution is made only for single architecture so I can use single so file for this purpose. As I understand, link to file in my ext directory should be passed somehow into makefile?
During development I've added path to my library using ldconfig, but right now I want to have "all in one solution" with simple installation. Sources for this library are not available so I have to use precompiled so library.
EDIT:
require 'mkmf'
THIS_DIR = File.expand_path(File.dirname(__FILE__))
NATIVE_DIR = File.join(THIS_DIR, 'native')
puts NATIVE_DIR
$LDFLAGS += " -L" + NATIVE_DIR + " -lmylibshared "
$LD_LIBRARY_PATH = NATIVE_DIR
create_makefile('myextension')
I've done something like that. It's working but only when I do exeute:
export LD_LIBRARY_PATH=/path/to/my/so/library
As I suppose I can add this path manually to environment variable for my rails applications. But I want to make it as simple as possible. Is it any way to workaround this?