Bug #16773 Add configure option to only build the client library
Submitted: 25 Jan 2006 10:14 Modified: 24 Apr 2018 13:54
Reporter: Sebastian Bergmann Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S4 (Feature request)
Version:Irrelevant OS:Any (Irrelevant)
Assigned to: Kent Boortz CPU Architecture:Any

[25 Jan 2006 10:14] Sebastian Bergmann
Description:
It would be nice if MySQL's configure script provided an option to build only libmysql. A subsequent "make && make install" would only build libmysql and install only the library and its headers.

The reason I ask this is related to the work I do on Gentoo Linux's PHP packages.
Building PHP with MySQL support on Gentoo Linux currently requires a full installation of MySQL (so that libmysql and its headers are available). This does not make much sense in a scenario where MySQL does not run on the same machine as PHP.
For PostgreSQL, for instance, Gentoo Linux provides separate packages for the server and the client library, the former depending on the latter. As similar solution for MySQL would be appreciated.

How to repeat:
wopr-mobile ~ # USE=mysql emerge -vp dev-lang/php

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild  N    ] dev-db/mysql-5.0.18  USE="berkdb ssl -big-tables -cluster -debug -extraengine -max-idx-128 -minimal -perl -static -utf8" 18,787 kB
[ebuild   R   ] dev-lang/php-5.1.2  USE="bzip2 cgi cli fastbuild ipv6 mysql* pcre readline reflection session simplexml spl xml zlib -adabas -apache -apache2 -bcmath -berkdb -birdstep -calendar -cdb -cjk -crypt -ctype -curl -curlwrappers -db2 -dba -dbase -dbmaker -debug -discard-path -doc -empress -empress-bcs -esoob -exif -fdftk -filepro -firebird -flatfile -force-cgi-redirect -frontbase -ftp -gd -gd-external -gdbm -gmp -hardenedphp -hash -hyperwave-api -iconv -imap -informix -inifile -interbase -iodbc -java-external -kerberos -ldap -libedit -mcve -memlimit -mhash -ming -msql -mssql -mysqli -ncurses -nls -oci8 -oci8-instant-client -odbc -pcntl -pdo -pdo-external -pic -posix -postgres -qdbm -recode -sapdb -sasl -sharedext -sharedmem -snmp -soap -sockets -solid -spell -sqlite -ssl -sybase -sybase-ct -sysvipc -threads -tidy -tokenizer -truetype -vm-goto -vm-switch -wddx -xmlreader -xmlrpc -xmlwriter -xpm -xsl -yaz -zip" 0 kB [3]

Total size of downloads: 18,787 kB
Portage overlays:
 [1] /usr/local/overlay/personal
 [2] /usr/local/overlay/cvs
 [3] /usr/local/overlay/php/testing
 [4] /usr/local/overlay/php/experimental
 [5] /usr/local/overlay/gentopia
 [6] /usr/local/overlay/xgl

wopr-mobile ~ # USE=postgres emerge -vp dev-lang/php

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild  N    ] dev-db/libpq-8.1.1  USE="nls pam readline ssl zlib -kerberos" 7,858 kB
[ebuild   R   ] dev-lang/php-5.1.2  USE="bzip2 cgi cli fastbuild ipv6 pcre postgres* readline reflection session simplexml spl xml zlib -adabas -apache -apache2 -bcmath -berkdb -birdstep -calendar -cdb -cjk -crypt -ctype -curl -curlwrappers -db2 -dba -dbase -dbmaker -debug -discard-path -doc -empress -empress-bcs -esoob -exif -fdftk -filepro -firebird -flatfile -force-cgi-redirect -frontbase -ftp -gd -gd-external -gdbm -gmp -hardenedphp -hash -hyperwave-api -iconv -imap -informix -inifile -interbase -iodbc -java-external -kerberos -ldap -libedit -mcve -memlimit -mhash -ming -msql -mssql -mysql -mysqli -ncurses -nls -oci8 -oci8-instant-client -odbc -pcntl -pdo -pdo-external -pic -posix -qdbm -recode -sapdb -sasl -sharedext -sharedmem -snmp -soap -sockets -solid -spell -sqlite -ssl -sybase -sybase-ct -sysvipc -threads -tidy -tokenizer -truetype -vm-goto -vm-switch -wddx -xmlreader -xmlrpc -xmlwriter -xpm -xsl -yaz -zip" 0 kB [3]

Total size of downloads: 7,858 kB
Portage overlays:
 [1] /usr/local/overlay/personal
 [2] /usr/local/overlay/cvs
 [3] /usr/local/overlay/php/testing
 [4] /usr/local/overlay/php/experimental
 [5] /usr/local/overlay/gentopia
 [6] /usr/local/overlay/xgl
[16 Mar 2009 10:50] Daniel Fischer
Please note that you can build --without-server. Installing this will install the client library, the header files, the client binary, and some supporting files, but not the server itself:

./configure --without-server --without-extra-tools --enable-shared --enable-thread-safe-client
[24 Apr 2018 13:54] Terje Røsten
With cmake this is supported out of the box:

$ mkdir build && cd build
$ cmake ..
$ cd libmysql
$ make -j$(nproc)
$ make install