Bug #28544 Incorrect shared library install name
Submitted: 20 May 2007 19:56 Modified: 31 Oct 2007 11:32
Reporter: Peter Gerdes Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Packaging Severity:S2 (Serious)
Version:5.0.41, 5.1.22-RC OS:Mac OS X (10.4.9)
Assigned to: Kent Boortz CPU Architecture:Any

[20 May 2007 19:56] Peter Gerdes
Description:
Installing MySQL 5.0.41 for 10.4 on OS X places the shared libraries (such as libmysqlclient.15.0.0.dylib ) in /usr/local/mysql/lib .  However, running otool -D on these libraries reveals that their install path is set to /usr/local/mysql/lib/mysql .  This causes an error when trying to configure php5 with pear enabled and I saw some posts around the internet suggesting other bugs (ruby mysql gem).  

See below for quick and dirty fix.

How to repeat:
Install the 5.0.41 mysql package on OS X 10.4.9 (probably on any 10.4).  My install was actually an upgrade so this might be necessary but I doubt it.

Suggested fix:
A quick fix can be had by executing "sudo ln -s /usr/local/mysql/lib/mysql /usr/local/mysql/lib".  Likely a more robust fix would be to use install_name_tool -id to change the library install location but I'm not sure if that is correct and I didn't want to mess with it.  Looking at apple docs it appears that one has to set this information after you build the library with the install_name_tool and can't count on the build process to set it for you but I could be wrong.

The correct solution is to have the package distributed with correct install locations in the libraries.
[21 May 2007 9:07] Sveta Smirnova
Thank you for the report.

Verified as described.
[29 May 2007 3:41] Andreas Fink
same goes for include files. Used to be under /usr/local/mysql/include/mysql and are now on /usr/local/mysql/include.

Possible name conflict can evolve. For example I used:

#include <mysql/errmsg.h>

with the new "stripped mysql subdir" way of doing things, this has to be

#include <errmsg.h>

which might easily clash with current or future system headers with the same name.
[21 Jul 2007 1:33] Michael Malone
Problem still exists with the 5.0.45 release on OS X 10.4.10.  Reverting back to 5.0.37 until this gets fixed.
[30 Jul 2007 19:22] Kent Boortz
Will be in 4.1.24, 5.0.48 and 5.1.21

Made the install path "/usr/local/mysql/lib" and
the path compiled into the shared libraries
match.
[30 Jul 2007 19:45] Paul Dubois
Noted in 4.1.24, 5.0.48, 5.1.21 changelogs.

On Mac OS X, shared-library installation pathnames were incorrect.
[1 Aug 2007 11:06] Sveta Smirnova
Bug #30160 was marked as duplicate of this one.
[4 Aug 2007 5:13] Valeriy Kravchuk
Bug #30220 was marked as a duplcate of this one.
[19 Oct 2007 9:37] Sveta Smirnova
Bug #31448 was marked as duplicate of this one.
[20 Oct 2007 11:14] MC Brown
The problem still exists in the 5.1.22 build, which was the test platform I used when reporting #31448.
[20 Oct 2007 11:25] MC Brown
Opening; bug still exists in 5.1.22.
[29 Oct 2007 9:58] Sveta Smirnova
I can not repeat the problem using mysql-5.1.22-rc-osx10.4-i686.tar.gz too:

$otool -D lib/libmysqlclient.16.0.0.dylib
lib/libmysqlclient.16.0.0.dylib:
/usr/local/mysql/lib/libmysqlclient.16.dylib
[31 Oct 2007 11:32] MC Brown
Confirmed fixed in the 5.1.22 and 5.0.50 releases.