I am building an autotools application that links to two shared libraries, libA.so and libB.so. Both of them in turn comprise of shared libraries and static (yes, against recommendation static) libraries. The static library, libmetis is contained in both of libA and libB, but unfortunately, different versions.
Say libA.so has libA1.so, libA2.so.... libmetis5.a
Say libB.so has libB1.so, libB2.so.... libmetis4.a
On machine 1, running Ubuntu, the link line for the final application looks like
libtool mode=link application.c -lA -lB -o application
On machine 2, running CentOS, the link line for the final application looks like
libtool mode=link application.c -lA -lA1 -lA2... -lmetis5 -lB -lB1 -lB2... -lmetis4 -o application
Since both libA and libB are relinked from their contituent libraries in machine 2, I end up getting both libA and libB having one and the same version of libmetis, which causes the application to crash.
How can I control or where is the setting that prohibits Libtool from relinking already good to go libraries? I have tried not using autotools only for the application, manually giving the link line, but the behaviour is the same.
Thanks for your help,
Elan