summaryrefslogtreecommitdiff
path: root/ext/mysqli/config.m4
diff options
context:
space:
mode:
Diffstat (limited to 'ext/mysqli/config.m4')
-rw-r--r--ext/mysqli/config.m437
1 files changed, 25 insertions, 12 deletions
diff --git a/ext/mysqli/config.m4 b/ext/mysqli/config.m4
index 19bc252bb0..7302e66c42 100644
--- a/ext/mysqli/config.m4
+++ b/ext/mysqli/config.m4
@@ -3,18 +3,17 @@ dnl $Id$
dnl config.m4 for extension mysqli
PHP_ARG_WITH(mysqli, for MySQLi support,
-[ --with-mysqli[=FILE] Include MySQLi support. FILE is the optional pathname
- to mysql_config [mysql_config]])
+[ --with-mysqli[=FILE] Include MySQLi support. FILE is the optional pathname to mysql_config [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 "$PHP_MYSQLI" != "no"; then
+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 there are no mysql libs currently bundled with PHP.. --Jani
-dnl if test "$PHP_MYSQL" = "yes"; then
-dnl AC_MSG_ERROR([--with-mysql (using bundled libs) can not be used together with --with-mysqli.])
-dnl fi
+elif test "$PHP_MYSQLI" != "no"; then
if test "$PHP_MYSQLI" = "yes"; then
MYSQL_CONFIG=`$php_shtool path mysql_config`
@@ -26,6 +25,8 @@ dnl fi
if test "$PHP_EMBEDDED_MYSQLI" = "yes"; then
AC_DEFINE(HAVE_EMBEDDED_MYSQLI, 1, [embedded MySQL support enabled])
MYSQL_LIB_CFG='--libmysqld-libs'
+ dnl mysqlnd doesn't support embedded, so we have to add some extra stuff
+ mysqli_extra_sources="mysqli_embedded.c"
elif test "$enable_maintainer_zts" = "yes"; then
MYSQL_LIB_CFG='--libs_r'
MYSQL_LIB_NAME='mysqlclient_r'
@@ -48,17 +49,29 @@ dnl fi
[
PHP_EVAL_INCLINE($MYSQLI_INCLINE)
PHP_EVAL_LIBLINE($MYSQLI_LIBLINE, MYSQLI_SHARED_LIBADD)
- AC_DEFINE(HAVE_MYSQLILIB,1,[ ])
- PHP_CHECK_LIBRARY($MYSQL_LIB_NAME, mysql_stmt_field_count,
+ AC_DEFINE(HAVE_MYSQLILIB, 1, [ ])
+ PHP_CHECK_LIBRARY($MYSQL_LIB_NAME, mysql_set_character_set,
[ ],[
- 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])
+ AC_MSG_ERROR([MySQLI doesn't support versions < 4.1.13 (for MySQL 4.1.x) and < 5.0.7 for (MySQL 5.0.x) anymore. Please update your libraries.])
+ ],[$MYSQLI_LIBLINE])
],[
AC_MSG_ERROR([wrong mysql library version or lib not found. Check config.log for more information.])
],[
$MYSQLI_LIBLINE
])
- PHP_NEW_EXTENSION(mysqli, mysqli.c mysqli_api.c mysqli_prop.c mysqli_nonapi.c mysqli_fe.c mysqli_report.c mysqli_repl.c mysqli_driver.c mysqli_warning.c mysqli_exception.c mysqli_embedded.c, $ext_shared)
+ mysqli_extra_sources="$mysqli_extra_sources mysqli_repl.c"
+fi
+
+dnl Build extension
+if test "$PHP_MYSQLI" != "no"; then
+ mysqli_sources="mysqli.c mysqli_api.c mysqli_prop.c mysqli_nonapi.c \
+ mysqli_fe.c mysqli_report.c mysqli_driver.c mysqli_warning.c \
+ mysqli_exception.c $mysqli_extra_sources"
+ PHP_NEW_EXTENSION(mysqli, $mysqli_sources, $ext_shared)
PHP_SUBST(MYSQLI_SHARED_LIBADD)
+
+ if test "$PHP_MYSQLI" = "mysqlnd"; then
+ PHP_ADD_EXTENSION_DEP(mysqli, mysqlnd)
+ fi
fi