Fix shared build and made the logic of finding the socket location better.

This commit is contained in:
foobar 2002-07-08 15:31:01 +00:00
parent 728f2de442
commit df9fc2bb51

View File

@ -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