ID: 39122
User updated by: zaphod at tdl dot com
Reported By: zaphod at tdl dot com
Status: Open
Bug Type: *Compile Issues
Operating System: linux
PHP Version: 5.1.6
New Comment:

Description:
------------
configure fails on modern linux systems with binary distributions of
mysql that use gcc. On such systems, all programs that link against
mysql librares also need to link against libmygcc when built under
gcc.

Reproduce code:
---------------
configure --with-mysql=/usr/local/mysql

yup that's it.

Expected result:
----------------
Expected result is for configure to complete.

Actual result:
--------------
Actual result is the following checks fail

checking for mysql_close in -l$MYSQL_LIBNAME
Checking for mysql_error in -l$MYSQL_LIBNAME

They fail because configure won't link against libmygcc when linking
against libmysqlclient in this cirstance.

To get past this, i need to do the following

Replace the line in both of those checks

LIBS="-l$MYSQL_LIBNAME $LIBS "

with

LIBS="-l$MYSQL_LIBNAME $LIBS -lmygcc"

Additionally i then have to append -lmygcc to MYSQL_LIBS and EXTRA_LIBS
in the makefile AFTER configure completes to get a working build.

Knowing this, you should be able to make configure check for libmygcc,
and link against that after testing to see if it's required.


Previous Comments:
------------------------------------------------------------------------

[2006-10-10 23:29:04] zaphod at tdl dot com

Description:
------------
configure fails on modern linux systems with binary distributions of
mysql. On such systems, all programs that linka gainst mysql librares
also need to link aainst libmygcc, when built under gcc.



Reproduce code:
---------------
configure --with-mysql=/usr/local/mysql

yup that's it.

Expected result:
----------------
Expected result is for configure to complete.



Actual result:
--------------
Actual result is the following checks fail

checking for mysql_close in -l$MYSQL_LIBNAME
checking for mysql_error in -l$MYSQL_LIBNAME

They fail because configure won't link against libmygcc when linking
against libmysqlclient

TO get past this, i need to do the following

Replace the line in both of those checks

LIBS="-l$MYSQL_LIBNAME $LIBS "

with

LIBS="-l$MYSQL_LIBNAME $LIBS -lmygcc"

Additionally i then have to append -lmygcc to MYSQL_LIBS and EXTRA_LIBS
in the makefile AFTER configure completes to get a working build.

Knowing this, you should be able to make configure check for libmygcc,
and link against that after testing to see if it's required.


------------------------------------------------------------------------


--
Edit this bug report at [url]http://bugs.php.net/?id=39122&edit=1[/url]