libslim shared library problems on macOS
Brought to you by:
joe_fowler
There are numerous problems with the way the libslim library is compiled and installed on macOS.
It is compiled with the -shared flag. On macOS, it should instead be compiled with the -dynamiclib flag.
Its install name is not being set. This is mandatory on macOS. The install name must be the absolute path at which the library will ultimately be installed. This is specified by using the -install_name flag at the same time that you are using the -dynamiclib flag.
The library files and symlinks are named libslim.so, libslim.so.0, libslim.so.0.0. This is not correct naming on macOS, where the names should instead be libslim.dylib, libslim.0.dylib, libslim.0.0.dylib.
I see you're already using -dylib_install_name to set the install name, which is fine, except that you need to specify the absolute path, not just the filename. The attached patch resolves this part of the issue, and using -dynamiclib instead of -shared. The library name problem remains.