MFB: #37630 MySQL extensions should link against thread safe client libs if built with ZTS

This commit is contained in:
Michael Wallner 2006-06-01 19:15:31 +00:00
parent 8c04c51f9b
commit 1ba7a6812c
3 changed files with 11 additions and 16 deletions

View File

@ -86,7 +86,11 @@ if test "$PHP_MYSQL" != "no"; then
Note that the MySQL client library is not bundled anymore!])
fi
MYSQL_LIBNAME=mysqlclient
if test "$enable_maintainer_zts" = "yes"; then
MYSQL_LIBNAME=mysqlclient_r
else
MYSQL_LIBNAME=mysqlclient
fi
case $host_alias in
*netware*[)]
MYSQL_LIBNAME=mysql

View File

@ -385,13 +385,6 @@ ZEND_MODULE_STARTUP_D(mysql)
REGISTER_LONG_CONSTANT("MYSQL_CLIENT_INTERACTIVE", CLIENT_INTERACTIVE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("MYSQL_CLIENT_IGNORE_SPACE", CLIENT_IGNORE_SPACE, CONST_CS | CONST_PERSISTENT);
#ifdef ZTS
# if MYSQL_VERSION_ID >= 40000
mysql_thread_init();
# endif
#endif
return SUCCESS;
}
/* }}} */
@ -400,12 +393,6 @@ ZEND_MODULE_STARTUP_D(mysql)
*/
PHP_MSHUTDOWN_FUNCTION(mysql)
{
#ifdef ZTS
# if MYSQL_VERSION_ID >= 40000
mysql_thread_end();
# endif
#endif
UNREGISTER_INI_ENTRIES();
return SUCCESS;
}

View File

@ -22,9 +22,13 @@ dnl fi
MYSQL_CONFIG=$PHP_MYSQLI
fi
MYSQL_LIB_NAME='mysqlclient'
if test "$PHP_EMBEDDED_MYSQLI" = "yes"; then
AC_DEFINE(HAVE_EMBEDDED_MYSQLI, 1, [embedded MySQL support enabled])
MYSQL_LIB_CFG='--libmysqld-libs'
elif test "$enable_maintainer_zts" = "yes"; then
MYSQL_LIB_CFG='--libs_r'
MYSQL_LIB_NAME='mysqlclient_r'
else
MYSQL_LIB_CFG='--libs'
fi
@ -40,12 +44,12 @@ dnl fi
dnl
dnl Check the library
dnl
PHP_CHECK_LIBRARY(mysqlclient, mysql_set_server_option,
PHP_CHECK_LIBRARY($MYSQL_LIB_NAME, mysql_set_server_option,
[
PHP_EVAL_INCLINE($MYSQLI_INCLINE)
PHP_EVAL_LIBLINE($MYSQLI_LIBLINE, MYSQLI_SHARED_LIBADD)
AC_DEFINE(HAVE_MYSQLILIB,1,[ ])
PHP_CHECK_LIBRARY(mysqlclient, mysql_stmt_field_count,
PHP_CHECK_LIBRARY($MYSQL_LIB_NAME, mysql_stmt_field_count,
[ ],[
AC_MSG_ERROR([MySQLI doesn't support versions < 4.1.3 (for MySQL 4.1.x) and < 5.0.1 for (MySQL 5.0.x) anymore. Please update your libraries.])
],[$MYSQLI_LIBLINE])