diff options
author | James Cox <imajes@php.net> | 2002-06-08 11:37:20 +0000 |
---|---|---|
committer | James Cox <imajes@php.net> | 2002-06-08 11:37:20 +0000 |
commit | 00779e5fa37a8d2cff59eb2aef9835d97e096b85 (patch) | |
tree | bb812c75db83f7fae66d15c493cc1a62f6d700fe | |
parent | 0cd40c2808da10f4dd0f86596af51646475067b4 (diff) | |
download | php-git-00779e5fa37a8d2cff59eb2aef9835d97e096b85.tar.gz |
@ added support for --with-mysql-sock so people can specify it (eg, NFS compiles, etc)
changed the default mysql.sock location to use the one from the RPM. Added /usr/local
locations to the search list. (imajes)
-rw-r--r-- | ext/mysql/config.m4 | 51 |
1 files changed, 35 insertions, 16 deletions
diff --git a/ext/mysql/config.m4 b/ext/mysql/config.m4 index 882e492e67..0c1c8d13fb 100644 --- a/ext/mysql/config.m4 +++ b/ext/mysql/config.m4 @@ -16,22 +16,38 @@ AC_DEFUN(MYSQL_LIB_CHK,[ fi done ]) - -AC_DEFUN(PHP_MYSQL_SOCK,[ - AC_MSG_CHECKING(for MySQL UNIX socket) - MYSQL_SOCK=/tmp/mysql.sock - for i in \ - /var/run/mysqld/mysqld.sock \ - /var/tmp/mysql.sock \ - /var/run/mysql/mysql.sock \ - /var/lib/mysql/mysql.sock \ - /var/mysql/mysql.sock \ - /Private/tmp/mysql.sock \ - ; do - if test -r $i; then - MYSQL_SOCK=$i - fi - done + +PHP_ARG_WITH(mysql-sock, Location of the MySQL Socket pointer, +[ --with-mysql-sock[=DIR] Optionally reference the pointer to the MySQL Socket. + If unspecified, it will search default locations for the socket.], no) + +if test "$PHP_MYSQL_SOCK" != "no"; then + AC_MSG_CHECKING($PHP_MYSQL_SOCK) + MYSQL_SOCK=$PHP_MYSQL_SOCK + AC_MSG_CHECKING(for specified MySQL UNIX socket) + AC_DEFINE_UNQUOTED(MYSQL_UNIX_ADDR, "$MYSQL_SOCK", [ ]) + AC_MSG_RESULT($MYSQL_SOCK) +fi + + AC_DEFUN(PHP_MYSQL_SOCK,[ + AC_MSG_CHECKING(for MySQL UNIX socket) + for i in \ + /var/run/mysqld/mysqld.sock \ + /var/tmp/mysql.sock \ + /var/run/mysql/mysql.sock \ + /var/lib/mysql/mysql.sock \ + /var/mysql/mysql.sock \ + /usr/local/mysql/var/mysql.sock \ + /Private/tmp/mysql.sock \ + /tmp/mysql.sock \ + ; do + if test -r $i; then + MYSQL_SOCK=$i + else + MYSQL_SOCK=/var/lib/mysql/mysql.sock + fi + done + AC_DEFINE_UNQUOTED(MYSQL_UNIX_ADDR, "$MYSQL_SOCK", [ ]) AC_MSG_RESULT($MYSQL_SOCK) ]) @@ -41,7 +57,10 @@ PHP_ARG_WITH(mysql, for MySQL support, If unspecified, the bundled MySQL library will be used.], yes) if test "$PHP_MYSQL" != "no"; then + $PHP_MYSQL_SOCK + if test "$PHP_MYSQL_SOCK" = "no"; then PHP_MYSQL_SOCK + fi AC_DEFINE(HAVE_MYSQL, 1, [Whether you have MySQL]) fi |