Annotation of embedaddon/php/ext/mysql/config.m4, revision 1.1.1.2
1.1 misho 1: dnl
1.1.1.2 ! misho 2: dnl $Id$
1.1 misho 3: dnl
4:
5: AC_DEFUN([MYSQL_LIB_CHK], [
6: str="$MYSQL_DIR/$1/lib$MYSQL_LIBNAME.*"
7: for j in `echo $str`; do
8: if test -r $j; then
9: MYSQL_LIB_DIR=$MYSQL_DIR/$1
10: break 2
11: fi
12: done
13: ])
14:
15: AC_DEFUN([PHP_MYSQL_SOCKET_SEARCH], [
16: for i in \
17: /var/run/mysqld/mysqld.sock \
18: /var/tmp/mysql.sock \
19: /var/run/mysql/mysql.sock \
20: /var/lib/mysql/mysql.sock \
21: /var/mysql/mysql.sock \
22: /usr/local/mysql/var/mysql.sock \
23: /Private/tmp/mysql.sock \
24: /private/tmp/mysql.sock \
25: /tmp/mysql.sock \
26: ; do
27: if test -r $i; then
28: MYSQL_SOCK=$i
29: break 2
30: fi
31: done
32:
33: if test -n "$MYSQL_SOCK"; then
34: AC_DEFINE_UNQUOTED(PHP_MYSQL_UNIX_SOCK_ADDR, "$MYSQL_SOCK", [ ])
35: AC_MSG_RESULT([$MYSQL_SOCK])
36: else
37: AC_MSG_RESULT([no])
38: fi
39: ])
40:
41:
42: PHP_ARG_WITH(mysql, for MySQL support,
43: [ --with-mysql[=DIR] Include MySQL support. DIR is the MySQL base
1.1.1.2 ! misho 44: directory, if no DIR is passed or the value is
! 45: mysqlnd the MySQL native driver will be used])
1.1 misho 46:
47: PHP_ARG_WITH(mysql-sock, for specified location of the MySQL UNIX socket,
48: [ --with-mysql-sock[=DIR] MySQL/MySQLi/PDO_MYSQL: Location of the MySQL unix socket pointer.
49: If unspecified, the default locations are searched], no, no)
50:
51: if test -z "$PHP_ZLIB_DIR"; then
52: PHP_ARG_WITH(zlib-dir, for the location of libz,
53: [ --with-zlib-dir[=DIR] MySQL: Set the path to libz install prefix], no, no)
54: fi
55:
1.1.1.2 ! misho 56: if test "$PHP_MYSQL" = "yes" || test "$PHP_MYSQL" = "mysqlnd"; then
1.1 misho 57: dnl enables build of mysqnd library
58: PHP_MYSQLND_ENABLED=yes
59:
60: elif test "$PHP_MYSQL" != "no"; then
61: MYSQL_DIR=
62: MYSQL_INC_DIR=
63:
1.1.1.2 ! misho 64: if test -r $PHP_MYSQL/include/mysql/mysql.h; then
! 65: MYSQL_DIR=$PHP_MYSQL
! 66: MYSQL_INC_DIR=$PHP_MYSQL/include/mysql
! 67: break
! 68: elif test -r $PHP_MYSQL/include/mysql.h; then
! 69: MYSQL_DIR=$PHP_MYSQL
! 70: MYSQL_INC_DIR=$PHP_MYSQL/include
! 71: break
! 72: fi
1.1 misho 73:
74: if test -z "$MYSQL_DIR"; then
75: AC_MSG_ERROR([Cannot find MySQL header files under $PHP_MYSQL.
76: Note that the MySQL client library is not bundled anymore!])
77: fi
78:
79: if test "$enable_maintainer_zts" = "yes"; then
80: MYSQL_LIBNAME=mysqlclient_r
81: else
82: MYSQL_LIBNAME=mysqlclient
83: fi
84: case $host_alias in
85: *netware*[)]
86: MYSQL_LIBNAME=mysql
87: ;;
88: esac
89:
90: dnl for compat with PHP 4 build system
91: if test -z "$PHP_LIBDIR"; then
92: PHP_LIBDIR=lib
93: fi
94:
95: for i in $PHP_LIBDIR $PHP_LIBDIR/mysql; do
96: MYSQL_LIB_CHK($i)
97: done
98:
99: if test -z "$MYSQL_LIB_DIR"; then
100: AC_MSG_ERROR([Cannot find lib$MYSQL_LIBNAME under $MYSQL_DIR.
101: Note that the MySQL client library is not bundled anymore!])
102: fi
103:
104: PHP_CHECK_LIBRARY($MYSQL_LIBNAME, mysql_close, [ ],
105: [
106: if test "$PHP_ZLIB_DIR" != "no"; then
107: PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR, MYSQL_SHARED_LIBADD)
108: PHP_CHECK_LIBRARY($MYSQL_LIBNAME, mysql_error, [], [
109: AC_MSG_ERROR([mysql configure failed. Please check config.log for more information.])
110: ], [
111: -L$PHP_ZLIB_DIR/$PHP_LIBDIR -L$MYSQL_LIB_DIR
112: ])
113: MYSQL_LIBS="-L$PHP_ZLIB_DIR/$PHP_LIBDIR -lz"
114: else
115: PHP_ADD_LIBRARY(z,, MYSQL_SHARED_LIBADD)
116: PHP_CHECK_LIBRARY($MYSQL_LIBNAME, mysql_errno, [], [
117: AC_MSG_ERROR([Try adding --with-zlib-dir=<DIR>. Please check config.log for more information.])
118: ], [
119: -L$MYSQL_LIB_DIR
120: ])
121: MYSQL_LIBS="-lz"
122: fi
123: ], [
124: -L$MYSQL_LIB_DIR
125: ])
126:
127: PHP_ADD_LIBRARY_WITH_PATH($MYSQL_LIBNAME, $MYSQL_LIB_DIR, MYSQL_SHARED_LIBADD)
128: PHP_ADD_INCLUDE($MYSQL_INC_DIR)
129:
130: MYSQL_MODULE_TYPE=external
131: MYSQL_LIBS="-L$MYSQL_LIB_DIR -l$MYSQL_LIBNAME $MYSQL_LIBS"
132: MYSQL_INCLUDE=-I$MYSQL_INC_DIR
133:
134: PHP_SUBST_OLD(MYSQL_MODULE_TYPE)
135: PHP_SUBST_OLD(MYSQL_LIBS)
136: PHP_SUBST_OLD(MYSQL_INCLUDE)
137: fi
138:
139: dnl Enable extension
140: if test "$PHP_MYSQL" != "no"; then
141: AC_MSG_CHECKING([for MySQL UNIX socket location])
142: if test "$PHP_MYSQL_SOCK" != "no" && test "$PHP_MYSQL_SOCK" != "yes"; then
143: MYSQL_SOCK=$PHP_MYSQL_SOCK
144: AC_DEFINE_UNQUOTED(PHP_MYSQL_UNIX_SOCK_ADDR, "$MYSQL_SOCK", [ ])
145: AC_MSG_RESULT([$MYSQL_SOCK])
146: elif test "$PHP_MYSQL" = "yes" || test "$PHP_MYSQL_SOCK" = "yes"; then
147: PHP_MYSQL_SOCKET_SEARCH
148: else
149: AC_MSG_RESULT([no])
150: fi
151:
152: AC_DEFINE(HAVE_MYSQL, 1, [Whether you have MySQL])
153: PHP_NEW_EXTENSION(mysql, php_mysql.c, $ext_shared)
154: PHP_SUBST(MYSQL_SHARED_LIBADD)
155:
1.1.1.2 ! misho 156: if test "$PHP_MYSQL" = "yes" || test "$PHP_MYSQL" = "mysqlnd"; then
1.1 misho 157: PHP_ADD_EXTENSION_DEP(mysql, mysqlnd)
158: AC_DEFINE([MYSQL_USE_MYSQLND], 1, [Whether mysqlnd is enabled])
159: fi
160: fi
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>