11.4. Installing a Shared Library

If a shared library is created with the $SHLIBVERSION variable set, scons will create symbolic links as needed based on that variable. To properly install such a library including the symbolic links, use the InstallVersionedLib function.

For example, on a Linux system, this instruction:

foo =  env.SharedLibrary(target="foo", source="foo.c", SHLIBVERSION="1.2.3")
    

Will produce a shared library libfoo.so.1.2.3 and symbolic links libfoo.so and libfoo.so.1 which point to libfoo.so.1.2.3. You can use the Node returned by the SharedLibrary builder in order to install the library and its symbolic links in one go without having to list them individually:

env.InstallVersionedLib(target="lib", source=foo)