summaryrefslogtreecommitdiff
path: root/ext/pdo_mysql
diff options
context:
space:
mode:
authorJani Taskinen <jani@php.net>2009-11-30 15:11:29 +0000
committerJani Taskinen <jani@php.net>2009-11-30 15:11:29 +0000
commitc1aa547b18c48861a20f222604ac65d28bcc6248 (patch)
treeab679fefc8d959c48b2819eef67aad89278f3ddd /ext/pdo_mysql
parentb26c9d400dd5e08173daa7a72edbeb979fe58b15 (diff)
downloadphp-git-c1aa547b18c48861a20f222604ac65d28bcc6248.tar.gz
- Fixed bug #50231 (Socket path passed using --with-mysql-sock is ignored when mysqlnd is enabled)
Diffstat (limited to 'ext/pdo_mysql')
-rwxr-xr-xext/pdo_mysql/config.m469
1 files changed, 33 insertions, 36 deletions
diff --git a/ext/pdo_mysql/config.m4 b/ext/pdo_mysql/config.m4
index fc5fc8102a..b1ae1eec3a 100755
--- a/ext/pdo_mysql/config.m4
+++ b/ext/pdo_mysql/config.m4
@@ -28,46 +28,42 @@ 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"
+ 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
dnl enables build of mysqnd library
PHP_MYSQLND_ENABLED=yes
AC_DEFINE([PDO_USE_MYSQLND], 1, [Whether pdo_mysql uses mysqlnd])
else
AC_DEFINE(HAVE_MYSQL, 1, [Whether you have MySQL])
- AC_MSG_CHECKING([for mysql_config])
- 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"
- fi
- else
- AC_MSG_RESULT([$PHP_PDO_MYSQL is not a directory])
- AC_MSG_ERROR([can not find mysql under the "$PHP_PDO_MYSQL" that you specified])
- 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 -n "$PDO_MYSQL_CONFIG" && test -x "$PDO_MYSQL_CONFIG" ; then
+ AC_MSG_CHECKING([for mysql_config])
+ if test -n "$PDO_MYSQL_CONFIG"; then
AC_MSG_RESULT($PDO_MYSQL_CONFIG)
if test "x$SED" = "x"; then
AC_PATH_PROG(SED, sed)
fi
-
if test "$enable_maintainer_zts" = "yes"; then
PDO_MYSQL_LIBNAME=mysqlclient_r
PDO_MYSQL_LIBS=`$PDO_MYSQL_CONFIG --libs_r | $SED -e "s/'//g"`
@@ -76,11 +72,7 @@ if test "$PHP_PDO_MYSQL" != "no"; then
PDO_MYSQL_LIBS=`$PDO_MYSQL_CONFIG --libs | $SED -e "s/'//g"`
fi
PDO_MYSQL_INCLUDE=`$PDO_MYSQL_CONFIG --cflags | $SED -e "s/'//g"`
- PDO_MYSQL_SOCKET=`$PDO_MYSQL_CONFIG --socket`
- elif test -z "$PDO_MYSQL_DIR"; then
- AC_MSG_RESULT([not found])
- AC_MSG_ERROR([Cannot find MySQL header files under $PDO_MYSQL_DIR])
- else
+ elif test -n "$PDO_MYSQL_DIR"; then
AC_MSG_RESULT([not found])
AC_MSG_CHECKING([for mysql install under $PDO_MYSQL_DIR])
if test -r $PDO_MYSQL_DIR/include/mysql; then
@@ -103,10 +95,11 @@ if test "$PHP_PDO_MYSQL" != "no"; then
PHP_ADD_INCLUDE($PDO_MYSQL_INC_DIR)
PDO_MYSQL_INCLUDE=-I$PDO_MYSQL_INC_DIR
+ else
+ AC_MSG_RESULT([not found])
+ AC_MSG_ERROR([Unable to find your mysql installation])
fi
- AC_DEFINE_UNQUOTED(PDO_MYSQL_UNIX_ADDR, "$PDO_MYSQL_SOCKET", [ ])
-
PHP_CHECK_LIBRARY($PDO_MYSQL_LIBNAME, mysql_query,
[
PHP_EVAL_INCLINE($PDO_MYSQL_INCLUDE)
@@ -159,6 +152,10 @@ if test "$PHP_PDO_MYSQL" != "no"; then
AC_MSG_RESULT($pdo_inc_path)
])
+ if test -n "$PDO_MYSQL_CONFIG"; then
+ PDO_MYSQL_SOCKET=`$PDO_MYSQL_CONFIG --socket`
+ AC_DEFINE_UNQUOTED(PDO_MYSQL_UNIX_ADDR, "$PDO_MYSQL_SOCKET", [ ])
+ fi
dnl fix after renaming to pdo_mysql
PHP_NEW_EXTENSION(pdo_mysql, pdo_mysql.c mysql_driver.c mysql_statement.c, $ext_shared,,-I$pdo_inc_path -I)