From: Johannes Schlüter Date: Wed, 7 Sep 2011 13:33:56 +0000 (+0000) Subject: - Use myslqnd by default when MySQL extensions are activated but no path given X-Git-Tag: php-5.5.0alpha1~1233 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bea25b5e553147b39d9372be2d95c6a240b3dd6d;p=php - Use myslqnd by default when MySQL extensions are activated but no path given --- diff --git a/ext/mysql/config.m4 b/ext/mysql/config.m4 index 2babcee827..fa7a46f853 100644 --- a/ext/mysql/config.m4 +++ b/ext/mysql/config.m4 @@ -41,8 +41,8 @@ AC_DEFUN([PHP_MYSQL_SOCKET_SEARCH], [ PHP_ARG_WITH(mysql, for MySQL support, [ --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 [/usr/local]]) + directory, if no DIR is passed or the value is + mysqlnd 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/MySQLi/PDO_MYSQL: Location of the MySQL unix socket pointer. @@ -53,7 +53,7 @@ if test -z "$PHP_ZLIB_DIR"; then [ --with-zlib-dir[=DIR] MySQL: Set the path to libz install prefix], no, no) fi -if test "$PHP_MYSQL" = "mysqlnd"; then +if test "$PHP_MYSQL" = "yes" || test "$PHP_MYSQL" = "mysqlnd"; then dnl enables build of mysqnd library PHP_MYSQLND_ENABLED=yes @@ -61,17 +61,15 @@ elif test "$PHP_MYSQL" != "no"; then MYSQL_DIR= MYSQL_INC_DIR= - for i in $PHP_MYSQL /usr/local /usr; do - if test -r $i/include/mysql/mysql.h; then - MYSQL_DIR=$i - MYSQL_INC_DIR=$i/include/mysql - break - elif test -r $i/include/mysql.h; then - MYSQL_DIR=$i - MYSQL_INC_DIR=$i/include - break - fi - done + if test -r $PHP_MYSQL/include/mysql/mysql.h; then + MYSQL_DIR=$PHP_MYSQL + MYSQL_INC_DIR=$PHP_MYSQL/include/mysql + break + elif test -r $PHP_MYSQL/include/mysql.h; then + MYSQL_DIR=$PHP_MYSQL + MYSQL_INC_DIR=$PHP_MYSQL/include + break + fi if test -z "$MYSQL_DIR"; then AC_MSG_ERROR([Cannot find MySQL header files under $PHP_MYSQL. @@ -155,7 +153,7 @@ if test "$PHP_MYSQL" != "no"; then PHP_NEW_EXTENSION(mysql, php_mysql.c, $ext_shared) PHP_SUBST(MYSQL_SHARED_LIBADD) - if test "$PHP_MYSQL" = "mysqlnd"; then + if test "$PHP_MYSQL" = "yes" || test "$PHP_MYSQL" = "mysqlnd"; then PHP_ADD_EXTENSION_DEP(mysql, mysqlnd) AC_DEFINE([MYSQL_USE_MYSQLND], 1, [Whether mysqlnd is enabled]) fi diff --git a/ext/mysqli/config.m4 b/ext/mysqli/config.m4 index 12df1fa3f0..6ec9334639 100644 --- a/ext/mysqli/config.m4 +++ b/ext/mysqli/config.m4 @@ -4,24 +4,20 @@ dnl config.m4 for extension mysqli PHP_ARG_WITH(mysqli, for MySQLi support, [ --with-mysqli[=FILE] Include MySQLi support. FILE is the path - to mysql_config. If mysqlnd is passed as FILE, - the MySQL native driver will be used [mysql_config]]) + to mysql_config. If no value or 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 Note: Does not work with MySQL native driver!], no, no) -if test "$PHP_MYSQLI" = "mysqlnd"; then +if test "$PHP_MYSQLI" = "yes" || test "$PHP_MYSQLI" = "mysqlnd"; then dnl This needs to be set in any extension which wishes to use mysqlnd PHP_MYSQLND_ENABLED=yes elif test "$PHP_MYSQLI" != "no"; then - if test "$PHP_MYSQLI" = "yes"; then - MYSQL_CONFIG=`$php_shtool path mysql_config` - else - MYSQL_CONFIG=$PHP_MYSQLI - fi + MYSQL_CONFIG=$PHP_MYSQLI MYSQL_LIB_NAME='mysqlclient' if test "$PHP_EMBEDDED_MYSQLI" = "yes"; then @@ -82,7 +78,7 @@ if test "$PHP_MYSQLI" != "no"; then PHP_SUBST(MYSQLI_SHARED_LIBADD) PHP_INSTALL_HEADERS([ext/mysqli/php_mysqli_structs.h]) - if test "$PHP_MYSQLI" = "mysqlnd"; then + if test "$PHP_MYSQLI" = "yes" || test "$PHP_MYSQLI" = "mysqlnd"; then PHP_ADD_EXTENSION_DEP(mysqli, mysqlnd) AC_DEFINE([MYSQLI_USE_MYSQLND], 1, [Whether mysqlnd is enabled]) fi diff --git a/ext/pdo_mysql/config.m4 b/ext/pdo_mysql/config.m4 index 88742d2c8c..a2ba2fdbdd 100755 --- a/ext/pdo_mysql/config.m4 +++ b/ext/pdo_mysql/config.m4 @@ -4,8 +4,8 @@ dnl vim: se ts=2 sw=2 et: PHP_ARG_WITH(pdo-mysql, for MySQL support for PDO, [ --with-pdo-mysql[=DIR] PDO: MySQL support. DIR is the MySQL base directory - If mysqlnd is passed as DIR, the MySQL native - native driver will be used [/usr/local]]) + If no value or mysqlnd is passed as DIR, the + MySQL native driver will be used]) if test -z "$PHP_ZLIB_DIR"; then PHP_ARG_WITH(zlib-dir, for the location of libz, @@ -28,30 +28,21 @@ if test "$PHP_PDO_MYSQL" != "no"; then done ]) - if test -f $PHP_PDO_MYSQL && test -x $PHP_PDO_MYSQL ; then - PDO_MYSQL_CONFIG=$PHP_PDO_MYSQL - elif test "$PHP_PDO_MYSQL" != "yes"; then - if test -d "$PHP_PDO_MYSQL" ; then - if test -x "$PHP_PDO_MYSQL/bin/mysql_config" ; then - PDO_MYSQL_CONFIG="$PHP_PDO_MYSQL/bin/mysql_config" - else - PDO_MYSQL_DIR="$PHP_PDO_MYSQL" + if test "$PHP_PDO_MYSQL" != "yes" && test "$PHP_PDO_MYSQL" != "mysqlnd"; then + if test -f $PHP_PDO_MYSQL && test -x $PHP_PDO_MYSQL ; then + PDO_MYSQL_CONFIG=$PHP_PDO_MYSQL + else + if test -d "$PHP_PDO_MYSQL" ; then + if test -x "$PHP_PDO_MYSQL/bin/mysql_config" ; then + PDO_MYSQL_CONFIG="$PHP_PDO_MYSQL/bin/mysql_config" + else + PDO_MYSQL_DIR="$PHP_PDO_MYSQL" + fi fi fi - else - for i in /usr/local /usr ; do - if test -x "$i/bin/mysql_config" ; then - PDO_MYSQL_CONFIG="$i/bin/mysql_config" - break; - fi - if test -r $i/include/mysql/mysql.h || test -r $i/include/mysql.h ; then - PDO_MYSQL_DIR="$i" - break; - fi - done fi - - if test "$PHP_PDO_MYSQL" = "mysqlnd"; then + + if test "$PHP_PDO_MYSQL" = "yes" || test "$PHP_PDO_MYSQL" = "mysqlnd"; then dnl enables build of mysqnd library PHP_MYSQLND_ENABLED=yes AC_DEFINE([PDO_USE_MYSQLND], 1, [Whether pdo_mysql uses mysqlnd])