> If I copy libgif.so.4.16 to libgif.so, then ndk-build is happy.
> However, due to the SONAME entry in libgif, my JNI library contains a
> reference to the library named libgif.so.4.16 (because that's the
> SONAME the linker found when it linked built the .so for my library),
> and when the application is deployed to the emulator/device, loading
> the library fails because it's looking for libgif.so.4.16.
I'm running into the same problem trying to link to other libraries
built with libtool. I've found a terribly dirty hack to solve the
problem: changing the soname after the library is compiled.
Some people [1] say that doing this in the proper way isn't easy, but
in my case I only want to remove the soversion part of the soname. The
new name would be shorter and allocations for more room in the library
aren't needed, so I perform a simple search & replace, filling the
extra characters (".4.16", now unneeded) with "\0".
In your case, try this command from the root of your project after the
ndk-build stage:
rpl -R -e libgif.so.4.16 "libgif.so\x00\x00\x00\x00\x00" libs obj
If you follow these instructions, you'll see that now the child
library is resolved. When linking from Java, however, I've needed to
open the children libraries first and the main library in the end with
System.loadLibrary().
Of course all these dirty hacks wouldn't be needed if proper support
for versioned libraries was added to ndk-build.
Let me know if it solves the problem for you. :-)