@@ -17,13 +17,11 @@ AC_DEFUN([PHP_MYSQL_SOCKET_SEARCH], [
17
17
fi
18
18
done
19
19
20
- if test -n "$ MYSQL_SOCK"; then
20
+ AS_VAR_IF ( [ MYSQL_SOCK] ,, [ AC_MSG_RESULT ( [ no ] ) ] , [
21
21
AC_DEFINE_UNQUOTED ( [ PHP_MYSQL_UNIX_SOCK_ADDR] , [ "$MYSQL_SOCK"] ,
22
22
[ The MySQL Unix socket location.] )
23
23
AC_MSG_RESULT ( [ $MYSQL_SOCK] )
24
- else
25
- AC_MSG_RESULT ( [ no] )
26
- fi
24
+ ] )
27
25
] )
28
26
29
27
PHP_ARG_WITH([ mysqli] ,
@@ -33,39 +31,42 @@ PHP_ARG_WITH([mysqli],
33
31
34
32
dnl ext/pdo_mysql/config.m4 also depends on this configure option.
35
33
PHP_ARG_WITH([ mysql-sock] ,
36
- [ for specified location of the MySQL UNIX socket] ,
34
+ [ for specified location of the MySQL Unix socket] ,
37
35
[ AS_HELP_STRING ( [ [ --with-mysql-sock[ =SOCKPATH] ] ] ,
38
- [ MySQLi/PDO_MYSQL: Location of the MySQL unix socket pointer. If unspecified,
39
- the default locations are searched] ) ] ,
36
+ [ MySQLi/PDO_MYSQL: Location of the MySQL Unix socket pointer. If
37
+ unspecified, the default locations are searched] ) ] ,
40
38
[ no] ,
41
39
[ no] )
42
40
43
- if test "$PHP_MYSQLI" = "yes" || test "$PHP_MYSQLI" = "mysqlnd"; then
44
- dnl This needs to be set in any extension which wishes to use mysqlnd
45
- PHP_MYSQLND_ENABLED=yes
46
-
47
- elif test "$PHP_MYSQLI" != "no"; then
48
- AC_MSG_ERROR ( [ Linking mysqli against external library is no longer supported] )
49
- fi
50
-
51
- dnl Build extension
52
41
if test "$PHP_MYSQLI" != "no"; then
53
- AC_MSG_CHECKING ( [ for MySQL UNIX socket location] )
54
- if test "$PHP_MYSQL_SOCK" != "no" && test "$PHP_MYSQL_SOCK" != "yes"; then
55
- MYSQL_SOCK=$PHP_MYSQL_SOCK
56
- AC_DEFINE_UNQUOTED ( [ PHP_MYSQL_UNIX_SOCK_ADDR] , [ "$MYSQL_SOCK"] )
57
- AC_MSG_RESULT ( [ $MYSQL_SOCK] )
58
- elif test "$PHP_MYSQL_SOCK" = "yes"; then
59
- PHP_MYSQL_SOCKET_SEARCH
60
- else
61
- AC_MSG_RESULT ( [ no] )
62
- fi
42
+ dnl The PHP_MYSQLND_ENABLED variable enables the mysqlnd extension.
43
+ AS_CASE ( [ $PHP_MYSQLI] ,
44
+ [ yes|mysqlnd] , [ PHP_MYSQLND_ENABLED=yes] ,
45
+ [ AC_MSG_ERROR ( m4_text_wrap ( [
46
+ Linking mysqli against external library is no longer supported. Replace
47
+ '--with-mysqli=$PHP_MYSQLI' with '--with-mysqli'.
48
+ ] ) ) ] )
49
+
50
+ AC_MSG_CHECKING ( [ for MySQL Unix socket location] )
51
+ AS_CASE ( [ $PHP_MYSQL_SOCK] ,
52
+ [ yes] , [ PHP_MYSQL_SOCKET_SEARCH] ,
53
+ [ no] , [ AC_MSG_RESULT ( [ no] ) ] ,
54
+ [
55
+ AC_DEFINE_UNQUOTED ( [ PHP_MYSQL_UNIX_SOCK_ADDR] , [ "$PHP_MYSQL_SOCK"] )
56
+ AC_MSG_RESULT ( [ $PHP_MYSQL_SOCK] )
57
+ ] )
63
58
64
- mysqli_sources="mysqli.c mysqli_api.c mysqli_prop.c mysqli_nonapi.c \
65
- mysqli_report.c mysqli_driver.c mysqli_warning.c \
66
- mysqli_exception.c mysqli_result_iterator.c"
67
- PHP_NEW_EXTENSION([ mysqli] ,
68
- [ $mysqli_sources] ,
59
+ PHP_NEW_EXTENSION([ mysqli] , m4_normalize ( [
60
+ mysqli_api.c
61
+ mysqli_driver.c
62
+ mysqli_exception.c
63
+ mysqli_nonapi.c
64
+ mysqli_prop.c
65
+ mysqli_report.c
66
+ mysqli_result_iterator.c
67
+ mysqli_warning.c
68
+ mysqli.c
69
+ ] ) ,
69
70
[ $ext_shared] ,,
70
71
[ -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1] )
71
72
PHP_INSTALL_HEADERS([ ext/mysqli] , [ php_mysqli_structs.h mysqli_mysqlnd.h] )
0 commit comments