|
|||||||||||
|
PHP mysqlnd svn commit: r505 - in trunk/php5/ext: mysql mysqli
From: <ahristov(at)mysql.com>
Date: Tue Jun 26 2007 - 15:45:25 EDT
Modified: trunk/php5/ext/mysql/config.m4 trunk/php5/ext/mysql/mysql_mysqlnd.h trunk/php5/ext/mysql/php_mysql.c trunk/php5/ext/mysqli/config9.m4 trunk/php5/ext/mysqli/php_mysqli.h Log: patches by Jani Taskinen to change building and make ext/mysql build together with ext/mysqli . NEW SYNTAX : --with-mysql=mysqlnd|/path/to/mysql --with-mysqli=mysqlnd|/pato/to/mysql_config So one can build only one of the extensions with libmysql, if he wishes. Now we say truth in one of our slides. Modified: trunk/php5/ext/mysql/config.m4
PHP_ARG_WITH(mysql, for MySQL support, -[ --with-mysql[=DIR] Include MySQL support. DIR is the MySQL base directory]) +[ --with-mysql[=DIR] Include MySQL support. DIR is the MySQL base directory. + If mysqlnd is passed as DIR, the MySQL native driver will be used]) PHP_ARG_WITH(mysql-sock, for specified location of the MySQL UNIX socket, [ --with-mysql-sock[=DIR] MySQL: Location of the MySQL unix socket pointer.
If unspecified, the default locations are searched], no, no)
-PHP_ARG_ENABLE(mysqlnd, wheter to enable MySQL native driver support,
-[ --enable-mysqlnd Enable MySQL native driver supprt], no, no)
-
if test -z "$PHP_ZLIB_DIR"; then PHP_ARG_WITH(zlib-dir, for the location of libz, [ --with-zlib-dir[=DIR] MySQL: Set the path to libz install prefix], no, no) fi -if test "$PHP_MYSQL" != "no"; then - AC_DEFINE(HAVE_MYSQL, 1, [Whether you have MySQL]) - sources="php_mysql.c" -fi +if test "$PHP_MYSQL" = "mysqlnd"; then + dnl enables build of mysqnd library + PHP_MYSQLND_ENABLED=yes -if test "$PHP_MYSQLND" = "yes"; then - - AC_DEFINE(HAVE_MYSQLND, 1, "MySQL native driver support enabled") - MYSQLND_DIR="../mysqli/mysqlnd" - extra_sources="php_mysql.c \ - $MYSQLND_DIR/mysqlnd.c \ - $MYSQLND_DIR/mysqlnd_charset.c \ - $MYSQLND_DIR/mysqlnd_wireprotocol.c \ - $MYSQLND_DIR/mysqlnd_ps.c \ - $MYSQLND_DIR/mysqlnd_loaddata.c \ - $MYSQLND_DIR/mysqlnd_palloc.c \ - $MYSQLND_DIR/mysqlnd_ps_codec.c \ - $MYSQLND_DIR/mysqlnd_statistics.c \ - $MYSQLND_DIR/mysqlnd_qcache.c \ - $MYSQLND_DIR/mysqlnd_result.c \ - $MYSQLND_DIR/mysqlnd_result_meta.c" - elif test "$PHP_MYSQL" != "no"; then
AC_MSG_CHECKING([for MySQL UNIX socket location])
PHP_SUBST_OLD(MYSQL_INCLUDE)
-if test -n "$sources"; then
+dnl Enable extension +if test "$PHP_MYSQL" != "no"; then + AC_DEFINE(HAVE_MYSQL, 1, [Whether you have MySQL]) + PHP_NEW_EXTENSION(mysql, php_mysql.c, $ext_shared) PHP_SUBST(MYSQL_SHARED_LIBADD) + + dnl These 3 lines are neeeded to be able to build ext/mysql and/or ext/mysqli with/without mysqlnd. + dnl Need to do this here for the file to be always available. + $php_shtool mkdir -p ext/mysql/ + echo > ext/mysql/php_have_mysqlnd.h + test "$PHP_MYSQL" = "mysqlnd" && PHP_DEFINE(HAVE_MYSQLND, 1, [ext/mysql])fi Modified: trunk/php5/ext/mysql/mysql_mysqlnd.h
*/ +#ifndef MYSQL_MYSQLND_H +#define MYSQL_MYSQLND_H + /* Global types and definitions*/ #define MYSQL_NO_DATA MYSQLND_NO_DATA #define MYSQL_DATA_TRUNCATED MYSQLND_DATA_TRUNCATED +#endif Modified: trunk/php5/ext/mysql/php_mysql.c
#include "php_ini.h"
-
/* True globals, no need for thread safety */ Modified: trunk/php5/ext/mysqli/config9.m4
PHP_ARG_WITH(mysqli, for MySQLi support, -[ --with-mysqli[=FILE] Include MySQLi support. FILE is the optional pathname - to mysql_config]) +[ --with-mysqli[=FILE] Include MySQLi support. FILE is the optional pathname to mysql_config. + If mysqlnd is passed as FILE, the MySQL native driver will be used]) PHP_ARG_ENABLE(embedded_mysqli, whether to enable embedded MySQLi support, [ --enable-embedded-mysqli MYSQLi: Enable embedded support], no, no) -if test -z "$PHP_MYSQLND"; then - PHP_ARG_ENABLE(mysqlnd, whether to enable MySQL native driver support, - [ --enable-mysqlnd MYSQLi: Enable MySQL native driver supprt], no, no) -fi +if test "$PHP_MYSQLI" = "mysqlnd"; then+ dnl This needs to be set in any extension which wishes to use mysqlnd + PHP_MYSQLND_ENABLED=yes -dnl If some extension uses mysqlnd it will get compiled in PHP whether MYSQLi is enabled or not. -if test "$PHP_MYSQLND" = "yes"; then - AC_DEFINE(HAVE_MYSQLND, 1, [MySQL native driver support enabled]) - mysqlnd_sources="mysqlnd.c mysqlnd_charset.c mysqlnd_wireprotocol.c \ - mysqlnd_ps.c mysqlnd_loaddata.c mysqlnd_palloc.c \ - mysqlnd_ps_codec.c mysqlnd_statistics.c mysqlnd_qcache.c\ - mysqlnd_result.c mysqlnd_result_meta.c"+elif test "$PHP_MYSQLI" != "no"; then
+dnl Build extension
mysqli_fe.c mysqli_report.c mysqli_driver.c mysqli_warning.c \
mysqli_exception.c $extra_sources"
PHP_NEW_EXTENSION(mysqli, $mysqli_sources, $ext_shared)
PHP_SUBST(MYSQLI_SHARED_LIBADD)
+ + dnl These 3 lines are neeeded to be able to build ext/mysql and/or ext/mysqli with/without mysqlnd. + dnl Need to do this here for the file to be always available. + $php_shtool mkdir -p ext/mysqli/ + echo > ext/mysqli/php_have_mysqlnd.h + test "$PHP_MYSQLI" = "mysqlnd" && PHP_DEFINE(HAVE_MYSQLND, 1, [ext/mysqli])fi + +dnl MySQLnd build +dnl If some extension uses mysqlnd it will get compiled in PHP whether MYSQLi is enabled or not. +if test "$PHP_MYSQLND_ENABLED" = "yes"; then + mysqlnd_sources="mysqlnd.c mysqlnd_charset.c mysqlnd_wireprotocol.c \ + mysqlnd_ps.c mysqlnd_loaddata.c mysqlnd_palloc.c \ + mysqlnd_ps_codec.c mysqlnd_statistics.c mysqlnd_qcache.c\ + mysqlnd_result.c mysqlnd_result_meta.c" + + PHP_ADD_SOURCES(ext/mysqli/mysqlnd, $mysqlnd_sources) + PHP_ADD_BUILD_DIR([ext/mysqli/mysqlnd]) + PHP_INSTALL_HEADERS([ext/mysqli/mysqlnd]) +fi + Modified: trunk/php5/ext/mysqli/php_mysqli.h
+#ifdef PHP_ATOM_INC +#include "ext/mysqli/php_have_mysqlnd.h" /* HAVE_MYSQLND is defined here if enabled */ +#endif + #if defined(HAVE_MYSQLND) #include "ext/mysqli/mysqlnd/mysqlnd.h" #include "ext/mysqli/mysqli_mysqlnd.h" -- MySQL Code Commits Mailing List For list archives: http://lists.mysql.com/commits To unsubscribe: http://lists.mysql.com/commits?unsub=lists@pantek.comReceived on Tue Jun 26 15:49:08 2007 This archive was generated by hypermail 2.1.8 : Tue Jun 26 2007 - 15:50:04 EDT |
||||||||||
|
|||||||||||