]> granicus.if.org Git - php/commitdiff
- Use myslqnd by default when MySQL extensions are activated but no path given
authorJohannes Schlüter <johannes@php.net>
Wed, 7 Sep 2011 13:33:56 +0000 (13:33 +0000)
committerJohannes Schlüter <johannes@php.net>
Wed, 7 Sep 2011 13:33:56 +0000 (13:33 +0000)
ext/mysql/config.m4
ext/mysqli/config.m4
ext/pdo_mysql/config.m4

index 2babcee827dd0bf61baf1f4f25b9efe59a69c32e..fa7a46f8532f7e54465e690c02ff21114370a93f 100644 (file)
@@ -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
index 12df1fa3f07c0fd7b0727f0a702c3d158b4d9c93..6ec93346397179c9ec5c4848d5f02c7483c379ca 100644 (file)
@@ -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
index 88742d2c8c3796b2fa4dfcf61ab7600c2162ed41..a2ba2fdbdd5834061f7d101293831ee3bb2f0454 100755 (executable)
@@ -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])