MySQL source distribution contains sources for zlib (compression library), yaSSL (ssl library), libedit, and (in MySQL 5.5 only) readline. MySQL can be compiled using either libraries available on the system or, to minimize external dependencies, with bundled sources. For Unix/Linux packagers, using system libraries is a more natural option and CMake has support for that, using the following options:
-DWITH_ZLIB=system
(link with systemlibz.so
)-DWITH_SSL=system
(link with systemlibssl.so
,libcrypto.so
)-DWITH_EDITLINE=system
(link with systemlibedit.so
)-DWITH_READLINE=system
(link with systemlibreadline.so
; MySQL 5.5 only)
On Linux,--Wl,--as-needed
link options can also be used to remove unused dependencies. Although the CMake build tries to avoid unneeded dependencies,--as-needed
produces better results. For example, it removes unused dependencies onlibgcc_s.so
.
--Wl,--no-undefined
cannotbe used at the moment if plugins are built because plugins have direct dependency (use symbols) exported by MySQL server.