diff options
-rw-r--r-- | acinclude.m4 | 24 | ||||
-rw-r--r-- | ext/mysql/config.m4 | 9 | ||||
-rw-r--r-- | ext/mysql/config.w32 | 20 | ||||
-rw-r--r-- | ext/mysql/mysql_mysqlnd.h | 2 | ||||
-rw-r--r-- | ext/mysql/package.xml | 2 | ||||
-rw-r--r-- | ext/mysql/php_mysql.h | 11 | ||||
-rw-r--r-- | ext/mysqli/config.m4 (renamed from ext/mysqli/config9.m4) | 50 | ||||
-rw-r--r-- | ext/mysqli/config.w32 | 26 | ||||
-rw-r--r-- | ext/mysqli/mysqli_mysqlnd.h | 2 | ||||
-rw-r--r-- | ext/mysqli/php_mysqli.h | 3 | ||||
-rw-r--r-- | ext/mysqli/php_mysqli_structs.h | 8 | ||||
-rw-r--r-- | ext/mysqlnd/CREDITS | 2 | ||||
-rw-r--r-- | ext/mysqlnd/config-win.h (renamed from ext/mysqli/mysqlnd/config-win.h) | 0 | ||||
-rw-r--r-- | ext/mysqlnd/config.w32 | 64 | ||||
-rw-r--r-- | ext/mysqlnd/config9.m4 | 29 | ||||
-rw-r--r-- | ext/mysqlnd/mysqlnd.c (renamed from ext/mysqli/mysqlnd/mysqlnd.c) | 1 | ||||
-rw-r--r-- | ext/mysqlnd/mysqlnd.h (renamed from ext/mysqli/mysqlnd/mysqlnd.h) | 2 | ||||
-rw-r--r-- | ext/mysqlnd/mysqlnd_charset.c (renamed from ext/mysqli/mysqlnd/mysqlnd_charset.c) | 0 | ||||
-rw-r--r-- | ext/mysqlnd/mysqlnd_charset.h (renamed from ext/mysqli/mysqlnd/mysqlnd_charset.h) | 0 | ||||
-rw-r--r-- | ext/mysqlnd/mysqlnd_enum_n_def.h (renamed from ext/mysqli/mysqlnd/mysqlnd_enum_n_def.h) | 0 | ||||
-rw-r--r-- | ext/mysqlnd/mysqlnd_libmysql_compat.h (renamed from ext/mysqli/mysqlnd/mysqlnd_libmysql_compat.h) | 0 | ||||
-rw-r--r-- | ext/mysqlnd/mysqlnd_loaddata.c (renamed from ext/mysqli/mysqlnd/mysqlnd_loaddata.c) | 0 | ||||
-rw-r--r-- | ext/mysqlnd/mysqlnd_palloc.c (renamed from ext/mysqli/mysqlnd/mysqlnd_palloc.c) | 0 | ||||
-rw-r--r-- | ext/mysqlnd/mysqlnd_palloc.h (renamed from ext/mysqli/mysqlnd/mysqlnd_palloc.h) | 0 | ||||
-rw-r--r-- | ext/mysqlnd/mysqlnd_portability.h (renamed from ext/mysqli/mysqlnd/portability.h) | 43 | ||||
-rw-r--r-- | ext/mysqlnd/mysqlnd_priv.h (renamed from ext/mysqli/mysqlnd/mysqlnd_priv.h) | 0 | ||||
-rw-r--r-- | ext/mysqlnd/mysqlnd_ps.c (renamed from ext/mysqli/mysqlnd/mysqlnd_ps.c) | 0 | ||||
-rw-r--r-- | ext/mysqlnd/mysqlnd_ps_codec.c (renamed from ext/mysqli/mysqlnd/mysqlnd_ps_codec.c) | 0 | ||||
-rw-r--r-- | ext/mysqlnd/mysqlnd_qcache.c (renamed from ext/mysqli/mysqlnd/mysqlnd_qcache.c) | 0 | ||||
-rw-r--r-- | ext/mysqlnd/mysqlnd_result.c (renamed from ext/mysqli/mysqlnd/mysqlnd_result.c) | 0 | ||||
-rw-r--r-- | ext/mysqlnd/mysqlnd_result.h (renamed from ext/mysqli/mysqlnd/mysqlnd_result.h) | 0 | ||||
-rw-r--r-- | ext/mysqlnd/mysqlnd_result_meta.c (renamed from ext/mysqli/mysqlnd/mysqlnd_result_meta.c) | 0 | ||||
-rw-r--r-- | ext/mysqlnd/mysqlnd_result_meta.h (renamed from ext/mysqli/mysqlnd/mysqlnd_result_meta.h) | 0 | ||||
-rw-r--r-- | ext/mysqlnd/mysqlnd_statistics.c (renamed from ext/mysqli/mysqlnd/mysqlnd_statistics.c) | 0 | ||||
-rw-r--r-- | ext/mysqlnd/mysqlnd_statistics.h (renamed from ext/mysqli/mysqlnd/mysqlnd_statistics.h) | 0 | ||||
-rw-r--r-- | ext/mysqlnd/mysqlnd_wireprotocol.c (renamed from ext/mysqli/mysqlnd/mysqlnd_wireprotocol.c) | 0 | ||||
-rw-r--r-- | ext/mysqlnd/mysqlnd_wireprotocol.h (renamed from ext/mysqli/mysqlnd/mysqlnd_wireprotocol.h) | 0 | ||||
-rw-r--r-- | ext/mysqlnd/php_mysqlnd.h (renamed from ext/mysqli/mysqlnd/php_mysqlnd.h) | 0 |
38 files changed, 170 insertions, 128 deletions
diff --git a/acinclude.m4 b/acinclude.m4 index 37f1fd9830..439b3de980 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1026,7 +1026,14 @@ dnl ------------------------------------------------------------------------- dnl Checks for structures, typedefs, broken functions, etc. dnl ------------------------------------------------------------------------- -dnl Internal helper macro +dnl Internal helper macros +dnl +dnl _PHP_DEF_HAVE_FILE(what, filename) +AC_DEFUN([_PHP_DEF_HAVE_FILE], [ + php_def_have_what=HAVE_[]`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz-' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_' ` + echo "#define $php_def_have_what 1" >> $2 +]) +dnl dnl _PHP_CHECK_SIZEOF(type, cross-value, extra-headers [, found-action [, not-found-action]]) dnl AC_DEFUN([_PHP_CHECK_SIZEOF], [ @@ -1085,6 +1092,21 @@ AC_DEFUN(PHP_CHECK_SIZEOF, [ ]) dnl +dnl PHP_CHECK_TYPES(type-list, include-file [, extra-headers]) +dnl +AC_DEFUN([PHP_CHECK_TYPES], [ + for php_typename in $1; do + AC_MSG_CHECKING([whether $php_typename exists]) + _PHP_CHECK_SIZEOF($php_typename, 0, $3, [ + _PHP_DEF_HAVE_FILE($php_typename, $2) + AC_MSG_RESULT([yes]) + ], [ + AC_MSG_RESULT([no]) + ]) + done +]) + +dnl dnl PHP_CHECK_IN_ADDR_T dnl AC_DEFUN([PHP_CHECK_IN_ADDR_T], [ diff --git a/ext/mysql/config.m4 b/ext/mysql/config.m4 index 3653cfab55..f5ed71c6c5 100644 --- a/ext/mysql/config.m4 +++ b/ext/mysql/config.m4 @@ -140,7 +140,6 @@ Note that the MySQL client library is not bundled anymore!]) PHP_ADD_LIBRARY_WITH_PATH($MYSQL_LIBNAME, $MYSQL_LIB_DIR, MYSQL_SHARED_LIBADD) PHP_ADD_INCLUDE($MYSQL_INC_DIR) - MYSQL_MODULE_TYPE=external MYSQL_LIBS="-L$MYSQL_LIB_DIR -l$MYSQL_LIBNAME $MYSQL_LIBS" MYSQL_INCLUDE=-I$MYSQL_INC_DIR @@ -156,9 +155,7 @@ if test "$PHP_MYSQL" != "no"; then 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]) + if test "$PHP_MYSQLI" = "mysqlnd"; then + PHP_ADD_EXTENSION_DEP(mysqli, mysqlnd) + fi fi diff --git a/ext/mysql/config.w32 b/ext/mysql/config.w32 index 95f689e1d6..452a46a577 100644 --- a/ext/mysql/config.w32 +++ b/ext/mysql/config.w32 @@ -4,12 +4,16 @@ ARG_WITH("mysql", "MySQL support", "no"); if (PHP_MYSQL != "no") { - if (CHECK_LIB("libmysql.lib", "mysql", PHP_MYSQL) && - CHECK_HEADER_ADD_INCLUDE("mysql.h", "CFLAGS_MYSQL", - PHP_MYSQL + "\\include;" + PHP_PHP_BUILD + "\\include\\mysql;" + PHP_MYSQL)) { - EXTENSION("mysql", "php_mysql.c"); - AC_DEFINE('HAVE_MYSQL', 1, 'Have MySQL library'); - } else { - WARNING("mysql not enabled; libraries and headers not found"); - } + if (PHP_MYSQLI != "mysqlnd") { + if (CHECK_LIB("libmysql.lib", "mysql", PHP_MYSQL) && + CHECK_HEADER_ADD_INCLUDE("mysql.h", "CFLAGS_MYSQL", + PHP_MYSQL + "\\include;" + PHP_PHP_BUILD + "\\include\\mysql;" + PHP_MYSQL)) { + } else { + WARNING("mysql not enabled; libraries and headers not found"); + } + } else { + ADD_EXTENSION_DEP('mysql', 'mysqlnd', true); + } + EXTENSION("mysql", "php_mysql.c"); + AC_DEFINE('HAVE_MYSQL', 1, 'Have MySQL library'); } diff --git a/ext/mysql/mysql_mysqlnd.h b/ext/mysql/mysql_mysqlnd.h index de62529a89..e5cd4a14ea 100644 --- a/ext/mysql/mysql_mysqlnd.h +++ b/ext/mysql/mysql_mysqlnd.h @@ -22,7 +22,7 @@ #ifndef MYSQL_MYSQLND_H #define MYSQL_MYSQLND_H -#include "ext/mysqli/mysqlnd/mysqlnd_libmysql_compat.h" +#include "ext/mysqlnd/mysqlnd_libmysql_compat.h" /* Here comes non-libmysql API to have less ifdefs in mysqli*/ #define MYSQLI_CLOSE_EXPLICIT MYSQLND_CLOSE_EXPLICIT diff --git a/ext/mysql/package.xml b/ext/mysql/package.xml index 98db8cac6c..455349a970 100644 --- a/ext/mysql/package.xml +++ b/ext/mysql/package.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="ISO-8859-1" ?> <!DOCTYPE package SYSTEM "../pear/package.dtd"> <package> - <name>mysqli</name> + <name>mysql</name> <summary>MySQL database access functions</summary> <maintainers> <maintainer> diff --git a/ext/mysql/php_mysql.h b/ext/mysql/php_mysql.h index 5f1123474f..ba906af333 100644 --- a/ext/mysql/php_mysql.h +++ b/ext/mysql/php_mysql.h @@ -16,7 +16,6 @@ +----------------------------------------------------------------------+ */ - /* $Id$ */ #ifndef PHP_MYSQL_H @@ -42,12 +41,8 @@ #define FALSE 0 #endif -#ifdef PHP_ATOM_INC -#include "ext/mysql/php_have_mysqlnd.h" /* HAVE_MYSQLND is defined here if enabled */ -#endif - #if defined(HAVE_MYSQLND) -#include "ext/mysqli/mysqlnd/mysqlnd.h" +#include "ext/mysqlnd/mysqlnd.h" #include "ext/mysql/mysql_mysqlnd.h" #else #include <mysql.h> @@ -152,8 +147,4 @@ ZEND_END_MODULE_GLOBALS(mysql) #define phpext_mysql_ptr mysql_module_ptr - -#include "ext/mysqli/mysqlnd/php_mysqlnd.h" - - #endif /* PHP_MYSQL_H */ diff --git a/ext/mysqli/config9.m4 b/ext/mysqli/config.m4 index 9c62188fcf..7302e66c42 100644 --- a/ext/mysqli/config9.m4 +++ b/ext/mysqli/config.m4 @@ -64,56 +64,14 @@ elif test "$PHP_MYSQLI" != "no"; then fi dnl Build extension -if test -n "$mysqli_extra_sources" || test "$PHP_MYSQLI" != "no"; then +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) - 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 -dnl AC_CHECK_TYPES([int8, uint8, int16, uint16, int32, uint32, uchar],[],[], [ -dnl #include <sys/types.h> -dnl ]) -dnl AC_CHECK_TYPES([int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t],[],[], [ -dnl #include <stdint.h> -dnl ]) - PHP_CHECK_SIZEOF(int8, 0) - PHP_CHECK_SIZEOF(uint8, 0) - PHP_CHECK_SIZEOF(int16, 0) - PHP_CHECK_SIZEOF(uint16, 0) - PHP_CHECK_SIZEOF(int32, 0) - PHP_CHECK_SIZEOF(uint32, 0) - PHP_CHECK_SIZEOF(int64, 0) - PHP_CHECK_SIZEOF(uint64, 0) - PHP_CHECK_SIZEOF(int8_t, 0) - PHP_CHECK_SIZEOF(uint8_t, 0) - PHP_CHECK_SIZEOF(int16_t, 0) - PHP_CHECK_SIZEOF(uint16_t, 0) - PHP_CHECK_SIZEOF(int32_t, 0) - PHP_CHECK_SIZEOF(uint32_t, 0) - PHP_CHECK_SIZEOF(int64_t, 0) - PHP_CHECK_SIZEOF(uint64_t, 0) - PHP_CHECK_SIZEOF(ulong, 0) - - 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]) - EXT_STATIC="$EXT_STATIC mysqlnd" - EXT_CLI_STATIC="$EXT_CLI_STATIC mysqlnd" - PHP_INSTALL_HEADERS([ext/mysqli/mysqlnd]) + if test "$PHP_MYSQLI" = "mysqlnd"; then + PHP_ADD_EXTENSION_DEP(mysqli, mysqlnd) + fi fi - diff --git a/ext/mysqli/config.w32 b/ext/mysqli/config.w32 index 876eb9ca54..03d28b1990 100644 --- a/ext/mysqli/config.w32 +++ b/ext/mysqli/config.w32 @@ -2,12 +2,11 @@ // vim:ft=javascript // Note: The extension name is "mysqli", you enable it with "--with-mysqli". -// The "--enable-mysqlnd" tells to use "mysqli", if enabled, with the bundled +// Passing value "mysqlnd" to it enables the bundled // client library to connect to the MySQL server, i.e. no external MySQL // client library is needed to perform the build. ARG_WITH("mysqli", "MySQLi support", "no"); -ARG_ENABLE("mysqlnd", "MySQLi with mysqlnd support", "no"); if (PHP_MYSQLI != "no") { @@ -23,7 +22,7 @@ if (PHP_MYSQLI != "no") { "mysqli_report.c " + "mysqli_warning.c"; - if (PHP_MYSQLND == "no") { + if (PHP_MYSQLI != "mysqlnd") { if (CHECK_LIB("libmysql.lib", "mysqli", PHP_MYSQLI) && CHECK_HEADER_ADD_INCLUDE("mysql.h", "CFLAGS_MYSQLI", PHP_MYSQLI + "\\include;" + PHP_PHP_BUILD + @@ -38,27 +37,8 @@ if (PHP_MYSQLI != "no") { } else { - mysqlnd_source = - "mysqlnd.c " + -// "mysqlnd_alloc.c " + - "mysqlnd_charset.c " + - "mysqlnd_loaddata.c " + - "mysqlnd_palloc.c " + - "mysqlnd_ps.c " + - "mysqlnd_ps_codec.c " + - "mysqlnd_qcache.c " + - "mysqlnd_result.c " + - "mysqlnd_result_meta.c " + - "mysqlnd_statistics.c " + - "mysqlnd_wireprotocol.c"; - EXTENSION("mysqli", mysqli_source); - // Specify that add "mysqlnd" sources, but use same object file - // directory as the "mysqli" sources - // FIXME the hard coded "ext/mysqli/mysqlnd" prevents pointing - // out sources in another directory? Like above: PHP_MYSQLI + "\\include;" - ADD_SOURCES("ext/mysqli/mysqlnd", mysqlnd_source, "mysqli"); AC_DEFINE('HAVE_MYSQLILIB', 1, 'Have MySQLi library'); - AC_DEFINE('HAVE_MYSQLND' , 1, 'MySQL native driver support enabled'); + ADD_EXTENSION_DEP('mysqli', 'mysqlnd', true); } } diff --git a/ext/mysqli/mysqli_mysqlnd.h b/ext/mysqli/mysqli_mysqlnd.h index de62529a89..e5cd4a14ea 100644 --- a/ext/mysqli/mysqli_mysqlnd.h +++ b/ext/mysqli/mysqli_mysqlnd.h @@ -22,7 +22,7 @@ #ifndef MYSQL_MYSQLND_H #define MYSQL_MYSQLND_H -#include "ext/mysqli/mysqlnd/mysqlnd_libmysql_compat.h" +#include "ext/mysqlnd/mysqlnd_libmysql_compat.h" /* Here comes non-libmysql API to have less ifdefs in mysqli*/ #define MYSQLI_CLOSE_EXPLICIT MYSQLND_CLOSE_EXPLICIT diff --git a/ext/mysqli/php_mysqli.h b/ext/mysqli/php_mysqli.h index 334792e835..0a732c7333 100644 --- a/ext/mysqli/php_mysqli.h +++ b/ext/mysqli/php_mysqli.h @@ -144,14 +144,11 @@ ZEND_FUNCTION(mysqli_result_construct); ZEND_FUNCTION(mysqli_driver_construct); ZEND_METHOD(mysqli_warning,__construct); - #define phpext_mysqli_ptr &mysqli_module_entry extern zend_module_entry mysqli_module_entry; #endif /* PHP_MYSQLI.H */ -#include "ext/mysqli/mysqlnd/php_mysqlnd.h" - /* * Local variables: * tab-width: 4 diff --git a/ext/mysqli/php_mysqli_structs.h b/ext/mysqli/php_mysqli_structs.h index 30dec64506..447b124b4f 100644 --- a/ext/mysqli/php_mysqli_structs.h +++ b/ext/mysqli/php_mysqli_structs.h @@ -36,12 +36,8 @@ #define FALSE 0 #endif -#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" +#ifdef HAVE_MYSQLND +#include "ext/mysqlnd/mysqlnd.h" #include "ext/mysqli/mysqli_mysqlnd.h" #else #include <mysql.h> diff --git a/ext/mysqlnd/CREDITS b/ext/mysqlnd/CREDITS new file mode 100644 index 0000000000..bac8d1a4a2 --- /dev/null +++ b/ext/mysqlnd/CREDITS @@ -0,0 +1,2 @@ +MySQLnd +Georg Richter, Andrey Hristov, Ulf Wendel diff --git a/ext/mysqli/mysqlnd/config-win.h b/ext/mysqlnd/config-win.h index 86018221a6..86018221a6 100644 --- a/ext/mysqli/mysqlnd/config-win.h +++ b/ext/mysqlnd/config-win.h diff --git a/ext/mysqlnd/config.w32 b/ext/mysqlnd/config.w32 new file mode 100644 index 0000000000..876eb9ca54 --- /dev/null +++ b/ext/mysqlnd/config.w32 @@ -0,0 +1,64 @@ +// $Id$ +// vim:ft=javascript + +// Note: The extension name is "mysqli", you enable it with "--with-mysqli". +// The "--enable-mysqlnd" tells to use "mysqli", if enabled, with the bundled +// client library to connect to the MySQL server, i.e. no external MySQL +// client library is needed to perform the build. + +ARG_WITH("mysqli", "MySQLi support", "no"); +ARG_ENABLE("mysqlnd", "MySQLi with mysqlnd support", "no"); + +if (PHP_MYSQLI != "no") { + + mysqli_source = + "mysqli.c " + + "mysqli_api.c " + + "mysqli_driver.c " + + "mysqli_embedded.c " + + "mysqli_exception.c " + + "mysqli_fe.c " + + "mysqli_nonapi.c " + + "mysqli_prop.c " + + "mysqli_report.c " + + "mysqli_warning.c"; + + if (PHP_MYSQLND == "no") { + if (CHECK_LIB("libmysql.lib", "mysqli", PHP_MYSQLI) && + CHECK_HEADER_ADD_INCLUDE("mysql.h", "CFLAGS_MYSQLI", PHP_MYSQLI + + "\\include;" + PHP_PHP_BUILD + + "\\include\\mysql;" + PHP_MYSQLI)) { + // No "mysqli_repl.c" when using "mysqlnd" + mysqli_extra_sources = "mysqli_repl.c"; + EXTENSION("mysqli", mysqli_source + " " + mysqli_extra_sources); + AC_DEFINE('HAVE_MYSQLILIB', 1, 'Have MySQLi library'); + } else { + WARNING("mysqli not enabled; libraries and headers not found"); + } + + } else { + + mysqlnd_source = + "mysqlnd.c " + +// "mysqlnd_alloc.c " + + "mysqlnd_charset.c " + + "mysqlnd_loaddata.c " + + "mysqlnd_palloc.c " + + "mysqlnd_ps.c " + + "mysqlnd_ps_codec.c " + + "mysqlnd_qcache.c " + + "mysqlnd_result.c " + + "mysqlnd_result_meta.c " + + "mysqlnd_statistics.c " + + "mysqlnd_wireprotocol.c"; + + EXTENSION("mysqli", mysqli_source); + // Specify that add "mysqlnd" sources, but use same object file + // directory as the "mysqli" sources + // FIXME the hard coded "ext/mysqli/mysqlnd" prevents pointing + // out sources in another directory? Like above: PHP_MYSQLI + "\\include;" + ADD_SOURCES("ext/mysqli/mysqlnd", mysqlnd_source, "mysqli"); + AC_DEFINE('HAVE_MYSQLILIB', 1, 'Have MySQLi library'); + AC_DEFINE('HAVE_MYSQLND' , 1, 'MySQL native driver support enabled'); + } +} diff --git a/ext/mysqlnd/config9.m4 b/ext/mysqlnd/config9.m4 new file mode 100644 index 0000000000..3f9310f81b --- /dev/null +++ b/ext/mysqlnd/config9.m4 @@ -0,0 +1,29 @@ +dnl +dnl $Id$ +dnl config.m4 for mysqlnd driver + +dnl If some extension uses mysqlnd it will get compiled in PHP core +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_NEW_EXTENSION(mysqlnd, $mysqlnd_sources, no) + PHP_ADD_BUILD_DIR([ext/mysqlnd], 1) + PHP_INSTALL_HEADERS([ext/mysqlnd]) + PHP_INSTALL_HEADERS([$ext_builddir/php_mysqlnd_config.h]) + AC_DEFINE([HAVE_MYSQLND], 1, [Whether mysqlnd is enabled]) + + dnl This creates a file so it has to be after above macros + PHP_CHECK_TYPES([int8 uint8 int16 uint16 int32 uint32 uchar int8_t uint8_t int16_t uint16_t int32_t uint32_t int64_t uint64_t], [ + $ext_builddir/php_mysqlnd_config.h + ],[ +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif +#ifdef HAVE_STDINT_H +#include <stdint.h> +#endif + ]) +fi diff --git a/ext/mysqli/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c index 3331c9a79a..b776339219 100644 --- a/ext/mysqli/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@ -19,6 +19,7 @@ */ /* $Id$ */ + #include "php.h" #include "mysqlnd.h" #include "mysqlnd_wireprotocol.h" diff --git a/ext/mysqli/mysqlnd/mysqlnd.h b/ext/mysqlnd/mysqlnd.h index d8f00bd211..df75c62190 100644 --- a/ext/mysqli/mysqlnd/mysqlnd.h +++ b/ext/mysqlnd/mysqlnd.h @@ -47,7 +47,7 @@ extern zend_module_entry mysqlnd_module_entry; */ #define MYSQLND_DO_WIRE_CHECK_BEFORE_COMMAND 1 -#include "portability.h" +#include "mysqlnd_portability.h" #ifdef ZTS #include "TSRM.h" diff --git a/ext/mysqli/mysqlnd/mysqlnd_charset.c b/ext/mysqlnd/mysqlnd_charset.c index 9208e7f256..9208e7f256 100644 --- a/ext/mysqli/mysqlnd/mysqlnd_charset.c +++ b/ext/mysqlnd/mysqlnd_charset.c diff --git a/ext/mysqli/mysqlnd/mysqlnd_charset.h b/ext/mysqlnd/mysqlnd_charset.h index 85b0cd51a8..85b0cd51a8 100644 --- a/ext/mysqli/mysqlnd/mysqlnd_charset.h +++ b/ext/mysqlnd/mysqlnd_charset.h diff --git a/ext/mysqli/mysqlnd/mysqlnd_enum_n_def.h b/ext/mysqlnd/mysqlnd_enum_n_def.h index 53d5f7d8d7..53d5f7d8d7 100644 --- a/ext/mysqli/mysqlnd/mysqlnd_enum_n_def.h +++ b/ext/mysqlnd/mysqlnd_enum_n_def.h diff --git a/ext/mysqli/mysqlnd/mysqlnd_libmysql_compat.h b/ext/mysqlnd/mysqlnd_libmysql_compat.h index 8f8e0e69bc..8f8e0e69bc 100644 --- a/ext/mysqli/mysqlnd/mysqlnd_libmysql_compat.h +++ b/ext/mysqlnd/mysqlnd_libmysql_compat.h diff --git a/ext/mysqli/mysqlnd/mysqlnd_loaddata.c b/ext/mysqlnd/mysqlnd_loaddata.c index ce7a27bcf4..ce7a27bcf4 100644 --- a/ext/mysqli/mysqlnd/mysqlnd_loaddata.c +++ b/ext/mysqlnd/mysqlnd_loaddata.c diff --git a/ext/mysqli/mysqlnd/mysqlnd_palloc.c b/ext/mysqlnd/mysqlnd_palloc.c index a5df45c82e..a5df45c82e 100644 --- a/ext/mysqli/mysqlnd/mysqlnd_palloc.c +++ b/ext/mysqlnd/mysqlnd_palloc.c diff --git a/ext/mysqli/mysqlnd/mysqlnd_palloc.h b/ext/mysqlnd/mysqlnd_palloc.h index 434df01730..434df01730 100644 --- a/ext/mysqli/mysqlnd/mysqlnd_palloc.h +++ b/ext/mysqlnd/mysqlnd_palloc.h diff --git a/ext/mysqli/mysqlnd/portability.h b/ext/mysqlnd/mysqlnd_portability.h index aea3e9eae1..cbb629be1a 100644 --- a/ext/mysqli/mysqlnd/portability.h +++ b/ext/mysqlnd/mysqlnd_portability.h @@ -30,17 +30,19 @@ This file is public domain and comes with NO WARRANTY of any kind */ #endif /* __CYGWIN__ */ #if defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) || defined(WIN32) -# include <ext/mysqli/mysqlnd/config-win.h> -#elif PHP_MAJOR_VERSION < 6 -# include <main/php_config.h> +# include <ext/mysqlnd/config-win.h> +#else +# include "ext/mysqlnd/php_mysqlnd_config.h" #endif /* _WIN32... */ +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif #ifdef HAVE_STDINT_H #include <stdint.h> #endif - #if SIZEOF_LONG_LONG > 4 && !defined(_LONG_LONG) #define _LONG_LONG 1 /* For AIX string library */ #endif @@ -59,62 +61,62 @@ This file is public domain and comes with NO WARRANTY of any kind */ /* Typdefs for easyier portability */ -#if (SIZEOF_INT8 == 0) -#if (SIZEOF_INT8_T == 0) +#ifndef HAVE_INT8 +#ifndef HAVE_INT8_T == 0) typedef signed char int8; /* Signed integer >= 8 bits */ #else typedef int8_t int8; /* Signed integer >= 8 bits */ #endif #endif -#if (SIZEOF_UINT8 == 0) -#if (SIZEOF_UINT8_T == 0) +#ifndef HAVE_UINT8 +#ifndef HAVE_UINT8_T typedef unsigned char uint8; /* Unsigned integer >= 8 bits */ #else typedef uint8_t uint8; /* Signed integer >= 8 bits */ #endif #endif -#if (SIZEOF_INT16 == 0) -#if (SIZEOF_INT16_T == 0) +#ifndef HAVE_INT16 +#ifndef HAVE_INT16_T typedef signed short int16; /* Signed integer >= 16 bits */ #else typedef int16_t int16; /* Signed integer >= 16 bits */ #endif #endif -#if (SIZEOF_UINT16 == 0) -#if (SIZEOF_UINT16_T == 0) +#ifndef HAVE_UINT16 +#ifndef HAVE_UINT16_T typedef unsigned short uint16; /* Signed integer >= 16 bits */ #else typedef uint16_t uint16; /* Signed integer >= 16 bits */ #endif #endif -#if (SIZEOF_UCHAR == 0) +#ifndef HAVE_UCHAR typedef unsigned char uchar; /* Short for unsigned char */ #endif -#if (SIZEOF_INT32_T != 0) && (SIZEOF_UINT32_T != 0) +#if defined(HAVE_INT32_T) && defined(HAVE_UINT32_T) typedef int32_t int32; typedef uint32_t uint32; #elif SIZEOF_INT == 4 -#if (SIZEOF_INT32 == 0) +#ifndef HAVE_INT32 typedef signed int int32; #endif -#if (SIZEOF_UINT32 == 0) +#ifndef HAVE_UINT32 typedef unsigned int uint32; #endif #elif SIZEOF_LONG == 4 -#if (SIZEOF_INT32 == 0) +#ifndef HAVE_INT32 typedef signed long int32; #endif -#if (SIZEOF_UINT32 == 0) +#ifndef HAVE_UINT32 typedef unsigned long uint32; #endif @@ -487,14 +489,14 @@ typedef __int64 mynd_longlong; #ifndef L64 #define L64(x) x##LL #endif -#if (SIZEOF_UINT64_T == 0) +#ifndef HAVE_UINT64_T typedef unsigned long long my_uint64; typedef unsigned long long mynd_ulonglong; #else typedef uint64_t my_uint64; typedef uint64_t mynd_ulonglong; #endif -#if (SIZEOF_INT64_T == 0) +#ifndef HAVE_INT64_T == 0) typedef long long my_int64; typedef long long mynd_longlong; #else @@ -503,7 +505,6 @@ typedef int64_t mynd_longlong; #endif #endif - /* * Local variables: * tab-width: 4 diff --git a/ext/mysqli/mysqlnd/mysqlnd_priv.h b/ext/mysqlnd/mysqlnd_priv.h index cea3887796..cea3887796 100644 --- a/ext/mysqli/mysqlnd/mysqlnd_priv.h +++ b/ext/mysqlnd/mysqlnd_priv.h diff --git a/ext/mysqli/mysqlnd/mysqlnd_ps.c b/ext/mysqlnd/mysqlnd_ps.c index 46d2435831..46d2435831 100644 --- a/ext/mysqli/mysqlnd/mysqlnd_ps.c +++ b/ext/mysqlnd/mysqlnd_ps.c diff --git a/ext/mysqli/mysqlnd/mysqlnd_ps_codec.c b/ext/mysqlnd/mysqlnd_ps_codec.c index 85676adbd5..85676adbd5 100644 --- a/ext/mysqli/mysqlnd/mysqlnd_ps_codec.c +++ b/ext/mysqlnd/mysqlnd_ps_codec.c diff --git a/ext/mysqli/mysqlnd/mysqlnd_qcache.c b/ext/mysqlnd/mysqlnd_qcache.c index a08c7d488d..a08c7d488d 100644 --- a/ext/mysqli/mysqlnd/mysqlnd_qcache.c +++ b/ext/mysqlnd/mysqlnd_qcache.c diff --git a/ext/mysqli/mysqlnd/mysqlnd_result.c b/ext/mysqlnd/mysqlnd_result.c index e1027e7ae8..e1027e7ae8 100644 --- a/ext/mysqli/mysqlnd/mysqlnd_result.c +++ b/ext/mysqlnd/mysqlnd_result.c diff --git a/ext/mysqli/mysqlnd/mysqlnd_result.h b/ext/mysqlnd/mysqlnd_result.h index dd07097b52..dd07097b52 100644 --- a/ext/mysqli/mysqlnd/mysqlnd_result.h +++ b/ext/mysqlnd/mysqlnd_result.h diff --git a/ext/mysqli/mysqlnd/mysqlnd_result_meta.c b/ext/mysqlnd/mysqlnd_result_meta.c index ba0b55a5a3..ba0b55a5a3 100644 --- a/ext/mysqli/mysqlnd/mysqlnd_result_meta.c +++ b/ext/mysqlnd/mysqlnd_result_meta.c diff --git a/ext/mysqli/mysqlnd/mysqlnd_result_meta.h b/ext/mysqlnd/mysqlnd_result_meta.h index 1a7c308b29..1a7c308b29 100644 --- a/ext/mysqli/mysqlnd/mysqlnd_result_meta.h +++ b/ext/mysqlnd/mysqlnd_result_meta.h diff --git a/ext/mysqli/mysqlnd/mysqlnd_statistics.c b/ext/mysqlnd/mysqlnd_statistics.c index 4c93e0f79e..4c93e0f79e 100644 --- a/ext/mysqli/mysqlnd/mysqlnd_statistics.c +++ b/ext/mysqlnd/mysqlnd_statistics.c diff --git a/ext/mysqli/mysqlnd/mysqlnd_statistics.h b/ext/mysqlnd/mysqlnd_statistics.h index 08b28f36ed..08b28f36ed 100644 --- a/ext/mysqli/mysqlnd/mysqlnd_statistics.h +++ b/ext/mysqlnd/mysqlnd_statistics.h diff --git a/ext/mysqli/mysqlnd/mysqlnd_wireprotocol.c b/ext/mysqlnd/mysqlnd_wireprotocol.c index 77f757e6c9..77f757e6c9 100644 --- a/ext/mysqli/mysqlnd/mysqlnd_wireprotocol.c +++ b/ext/mysqlnd/mysqlnd_wireprotocol.c diff --git a/ext/mysqli/mysqlnd/mysqlnd_wireprotocol.h b/ext/mysqlnd/mysqlnd_wireprotocol.h index 4c3f80caaa..4c3f80caaa 100644 --- a/ext/mysqli/mysqlnd/mysqlnd_wireprotocol.h +++ b/ext/mysqlnd/mysqlnd_wireprotocol.h diff --git a/ext/mysqli/mysqlnd/php_mysqlnd.h b/ext/mysqlnd/php_mysqlnd.h index 0958fcae1f..0958fcae1f 100644 --- a/ext/mysqli/mysqlnd/php_mysqlnd.h +++ b/ext/mysqlnd/php_mysqlnd.h |