]> granicus.if.org Git - php/commitdiff
@ added support for --with-mysql-sock so people can specify it (eg, NFS compiles...
authorJames Cox <imajes@php.net>
Sat, 8 Jun 2002 11:37:20 +0000 (11:37 +0000)
committerJames Cox <imajes@php.net>
Sat, 8 Jun 2002 11:37:20 +0000 (11:37 +0000)
  changed the default mysql.sock location to use the one from the RPM. Added /usr/local
  locations to the search list. (imajes)

ext/mysql/config.m4

index 882e492e676c7c209f135cffe0956bb2ca031641..0c1c8d13fb96852e25dab0f6e399402ab056b6a6 100644 (file)
@@ -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