In /opt, I unpacked a GTK tarball, modified a couple .c files in minor ways, ran ./configure (without any options) and make (but not make install), then ran one of GTK’s tests to confirm my changes were implemented. They are.
I renamed the linux distribution’s libgtk in /usr to back it up. In it’s place I created a symbolic link to the libgtk in /opt that has my mods.
I’ve carried this out for both the 2.0 and 3.0 versions.
Yet apps, Firefox for example, still seem to be using the distribution’s default libraries.
What steps am I missing?
I’ll add to ergosys comment about running
ldconfig, that what you may want to do is to add the path to your customized version libraries directory (something like in/opt/gtk-2.xx-customized/libor/opt/gtk-3.xx-customized/libusing the right version number) in/etc/ld.so.conf. By runningldconfigas root afterwards, it should update the linker cache. The path to your customized version needs however to be specified before the one to the system’s. That way the change is system wide, and you don’t mess with the files created by you distro, which will please your package manager. Original and customized versions will lie in separate directories, easing the maintenance. Use the--prefixoption like this:./configure --prefix /opt/gtk-2.xx-customizedto specify where to install your built software. Remember to previously creating that directory, and giving your user the corresponding rights to write there.Please read
man ldconfigfor more information.If you want for some reason to run just once in a while an application using the original set of libraries, just use the
LD_LIBRARY_PATHenvironment var to point to the dir you want to inspect before all others already known byld, which would this time be the one where lies your original library. The syntax isLD_LIBRARY_PATH="/usr/lib" name-of-your-application. Don’t forget that on 64bits systems, the library dir may be named lib64.