Bug #26953 mysql should distribute pkg-config .pc files
Submitted: 8 Mar 2007 7:45 Modified: 1 Dec 2016 13:20
Reporter: Monty Taylor Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Packaging Severity:S4 (Feature request)
Version:5.0, 5.1 OS:Linux (linux)
Assigned to: Kent Boortz CPU Architecture:Any

[8 Mar 2007 7:45] Monty Taylor
Description:
MySQL should distribute pkg-config .pc files on platforms that support pkg-config. Whereas mysql_config exists, there are several different sets of values it tries to support, and adding support for new sets of flags that users might want to query is problematic at best. 

By distributing one or more .pc files, MySQL can provide information in an sensible manner about such different things as building against libmysqlclient, libmysqlclient_r, libmysqld. The format of the file is simple to produce using the existing autoconf macros, and the existence of the files should not harm people who do not use them. 

Additionally, they give access to the use by developers of the PKG_CHECK_MODULES() macros in their configure scripts, to check for the existence of MySQL and to get the appropriate flags for building against it. 

How to repeat:
run mysql_config --help and then run pkg-config --help and check out the differences in features.

Suggested fix:
Distribute .pc files. Probably a mysql.pc, a mysql-threaded.pc, a mysql-ndb.pc and a mysql-embedded.pc.
[8 Mar 2007 17:50] Sergei Golubchik
I've tried to create mysql.pc when I was writing mysql.m4.

But the problem is that pkg-config approach doesn't seem to allow to install many versions of the same thing. At least, all I was able to find in the manual was "if you need to install .pc for different versions - use different filenames". Which would mean in our case mysql-5.0.27.pc, mysql-5.0.28.pc and so on, as it's not uncommon to have more than one MySQL installed that differ only in the minor version.

mysql.m4 doesn't have this problem, it's the same for all versions.
[13 Mar 2007 13:16] Monty Taylor
I think the intention here is to handle the simple case very nicely. There are non-autotools build environments that might want the information. (Like python setuptools) And the m4 macros could check for the existence of pkg-config data and use it if there.

But you are right, having multiple versioned pkg-config files would quickly get ridiculous. 

Most of the multi-version setups are done through binary tarballs though, so the existence of a pkg-config file shouln't hurt anything. right?
[13 Mar 2007 13:26] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/21811

ChangeSet@1.2472, 2007-03-13 06:25:59-07:00, mtaylor@qualinost.(none) +7 -0
  BUG#26953: mysql should distribute pkg-config .pc files
  
  Added code to generate .pc files for pkg-config. Currently doing the work at the configure step, although it could be argued that this should be done at Make time like it is for the .sh files in support-files.
[1 Dec 2016 13:19] Terje Røsten
Posted by developer:
 
Fixed by commit:

commit eb46d86131bcafd309e03d27c62e3ec84a26022c
Author: Tor Didriksen <tor.didriksen@oracle.com>
Date:   Thu Aug 27 16:35:50 2015 +0200

    Bug#20637746 ADD SUPPORT FOR PKG-CONFIG
    
    Add mysqlclient.pc.in and INSTALL it if appropriate for the install layout.
    
    Also: cleanup library settings in mysql_config (perl and sh variants).