From: foobar Date: Mon, 8 Jul 2002 15:31:01 +0000 (+0000) Subject: Fix shared build and made the logic of finding the socket location better. X-Git-Tag: dev~388 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=df9fc2bb51e7b910646ccdc8e922b1be638871ce;p=php Fix shared build and made the logic of finding the socket location better. --- diff --git a/ext/mysql/config.m4 b/ext/mysql/config.m4 index 9b9d5430d6..ea88ee1a5a 100644 --- a/ext/mysql/config.m4 +++ b/ext/mysql/config.m4 @@ -33,31 +33,36 @@ AC_DEFUN(PHP_MYSQL_SOCKET_SEARCH, [ break 2 fi done - - AC_DEFINE_UNQUOTED(MYSQL_UNIX_ADDR, "$MYSQL_SOCK", [ ]) - AC_MSG_RESULT([$MYSQL_SOCK]) + + if test -n "$MYSQL_SOCK"; then + AC_DEFINE_UNQUOTED(MYSQL_UNIX_ADDR, "$MYSQL_SOCK", [ ]) + AC_MSG_RESULT([$MYSQL_SOCK]) + else + AC_MSG_RESULT([no]) + fi ]) -PHP_ARG_WITH(mysql, for MySQL support, -[ --with-mysql[=DIR] Include MySQL support. DIR is the MySQL base directory. - If unspecified, the bundled MySQL library will be used.], yes) - PHP_ARG_WITH(mysql-sock, for specified location of the MySQL UNIX socket, [ --with-mysql-sock[=DIR] Location of the MySQL unix socket pointer. If unspecified, the default locations are searched.]) +PHP_ARG_WITH(mysql, for MySQL support, +[ --with-mysql[=DIR] Include MySQL support. DIR is the MySQL base directory. + If unspecified, the bundled MySQL library will be used.], yes) if test "$PHP_MYSQL" != "no"; then AC_DEFINE(HAVE_MYSQL, 1, [Whether you have MySQL]) AC_MSG_CHECKING(for MySQL UNIX socket location) - if test "$PHP_MYSQL_SOCK" != "no"; then - MYSQL_SOCK=$PHP_MYSQL_SOCK - AC_DEFINE_UNQUOTED(MYSQL_UNIX_ADDR, "$MYSQL_SOCK", [ ]) - AC_MSG_RESULT([$MYSQL_SOCK]) - else + if test "$PHP_MYSQL_SOCK" != "no" && test "$PHP_MYSQL_SOCK" != "yes"; then + MYSQL_SOCK=$PHP_MYSQL_SOCK + AC_DEFINE_UNQUOTED(MYSQL_UNIX_ADDR, "$MYSQL_SOCK", [ ]) + AC_MSG_RESULT([$MYSQL_SOCK]) + elif test "$PHP_MYSQL" = "yes" || test "$PHP_MYSQL_SOCK" = "yes"; then PHP_MYSQL_SOCKET_SEARCH + else + AC_MSG_RESULT([no]) fi fi