NOTES.UNIX 1.2 KB

123456789101112131415161718192021222324252627282930
  1. NOTES FOR UNIX LIKE PLATFORMS
  2. =============================
  3. For Unix/POSIX runtime systems on Windows, please see NOTES.WIN.
  4. Shared libraries and installation in non-standard locations
  5. -----------------------------------------------------------
  6. Binaries on Unix variants expect to find shared libraries in standard
  7. locations, such as /usr/lib, /usr/local/lib and some other locations
  8. configured in the system (for example /etc/ld.so.conf on some systems).
  9. If the libraries are installed in non-standard locations, binaries
  10. will not find them and therefore fail to run unless they get a bit of
  11. help from a defined RPATH or RUNPATH. This can be applied by adding
  12. the appropriate linker flags to the configuration command, such as
  13. this (/usr/local/ssl was the default location for OpenSSL installation
  14. in versions before 1.1.0):
  15. $ ./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl \
  16. -Wl,-rpath,/usr/local/ssl/lib
  17. Because the actual library location may vary further (for example on
  18. multilib installations), there is a convenience variable in Makefile
  19. that holds the exact installation directory and that can be used like
  20. this:
  21. $ ./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl \
  22. -Wl,-rpath,'$(LIBRPATH)'