Bug #76131 Add support for pkg-config
Submitted: 3 Mar 2015 14:25 Modified: 31 Aug 2015 18:12
Reporter: Terje Røsten Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S4 (Feature request)
Version:5.7.6 OS:Any
Assigned to: CPU Architecture:Any

[3 Mar 2015 14:25] Terje Røsten
Description:
In addition to custom script (msyql_config) provide pkg-config file for
getting information about compiler flags and options when linking applications
to MySQL libs.

How to repeat:
Check for mysql support in pkg-config on installed system by running:

 pkg-config --libs mysql

Suggested fix:
Guide for writing pkg-config is available here:
 
 http://people.freedesktop.org/~dbn/pkg-config-guide.html

Generate file based on cmake template in scripts/mysql.pc.in and install as 

 /usr/share/pkgconfig/mysql.pc

or 

$BASEDIR/share/pkgconfig/mysql.pc with 0644 perms.

File should be included in -devel subpackages.
[31 Aug 2015 18:12] Paul DuBois
Noted in 5.7.9, 5.8.0 changelogs.

MySQL distributions now contain a mysqlclient.pc file that provides
information about MySQL configuration for use by the pkg-config
command. This enables pkg-config to be used as an alternative to
mysql_config for obtaining information such as compiler flags or link
libraries required to compile MySQL applications.
    
A new INSTALL_PKGCONFIGDIR CMake option is available to specify the
directory in which to install the mysqlclient.pc file. The default
value is INSTALL_LIBDIR/pkgconfig, unless INSTALL_LIBDIR ends with
/mysql, in which case that is removed first.
[1 Sep 2015 14:39] Paul DuBois
For more information:
http://dev.mysql.com/doc/refman/5.7/en/c-api-building-clients-pkg-config.html