Annotation of embedaddon/php/ext/mysql/config.m4, revision 1.1.1.1
1.1 misho 1: dnl
2: dnl $Id: config.m4 291501 2009-11-30 15:11:29Z jani $
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
44: directory. If mysqlnd is passed as DIR,
45: the MySQL native driver will be used [/usr/local]])
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:
56: if test "$PHP_MYSQL" = "mysqlnd"; then
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:
64: for i in $PHP_MYSQL /usr/local /usr; do
65: if test -r $i/include/mysql/mysql.h; then
66: MYSQL_DIR=$i
67: MYSQL_INC_DIR=$i/include/mysql
68: break
69: elif test -r $i/include/mysql.h; then
70: MYSQL_DIR=$i
71: MYSQL_INC_DIR=$i/include
72: break
73: fi
74: done
75:
76: if test -z "$MYSQL_DIR"; then
77: AC_MSG_ERROR([Cannot find MySQL header files under $PHP_MYSQL.
78: Note that the MySQL client library is not bundled anymore!])
79: fi
80:
81: if test "$enable_maintainer_zts" = "yes"; then
82: MYSQL_LIBNAME=mysqlclient_r
83: else
84: MYSQL_LIBNAME=mysqlclient
85: fi
86: case $host_alias in
87: *netware*[)]
88: MYSQL_LIBNAME=mysql
89: ;;
90: esac
91:
92: dnl for compat with PHP 4 build system
93: if test -z "$PHP_LIBDIR"; then
94: PHP_LIBDIR=lib
95: fi
96:
97: for i in $PHP_LIBDIR $PHP_LIBDIR/mysql; do
98: MYSQL_LIB_CHK($i)
99: done
100:
101: if test -z "$MYSQL_LIB_DIR"; then
102: AC_MSG_ERROR([Cannot find lib$MYSQL_LIBNAME under $MYSQL_DIR.
103: Note that the MySQL client library is not bundled anymore!])
104: fi
105:
106: PHP_CHECK_LIBRARY($MYSQL_LIBNAME, mysql_close, [ ],
107: [
108: if test "$PHP_ZLIB_DIR" != "no"; then
109: PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR, MYSQL_SHARED_LIBADD)
110: PHP_CHECK_LIBRARY($MYSQL_LIBNAME, mysql_error, [], [
111: AC_MSG_ERROR([mysql configure failed. Please check config.log for more information.])
112: ], [
113: -L$PHP_ZLIB_DIR/$PHP_LIBDIR -L$MYSQL_LIB_DIR
114: ])
115: MYSQL_LIBS="-L$PHP_ZLIB_DIR/$PHP_LIBDIR -lz"
116: else
117: PHP_ADD_LIBRARY(z,, MYSQL_SHARED_LIBADD)
118: PHP_CHECK_LIBRARY($MYSQL_LIBNAME, mysql_errno, [], [
119: AC_MSG_ERROR([Try adding --with-zlib-dir=<DIR>. Please check config.log for more information.])
120: ], [
121: -L$MYSQL_LIB_DIR
122: ])
123: MYSQL_LIBS="-lz"
124: fi
125: ], [
126: -L$MYSQL_LIB_DIR
127: ])
128:
129: PHP_ADD_LIBRARY_WITH_PATH($MYSQL_LIBNAME, $MYSQL_LIB_DIR, MYSQL_SHARED_LIBADD)
130: PHP_ADD_INCLUDE($MYSQL_INC_DIR)
131:
132: MYSQL_MODULE_TYPE=external
133: MYSQL_LIBS="-L$MYSQL_LIB_DIR -l$MYSQL_LIBNAME $MYSQL_LIBS"
134: MYSQL_INCLUDE=-I$MYSQL_INC_DIR
135:
136: PHP_SUBST_OLD(MYSQL_MODULE_TYPE)
137: PHP_SUBST_OLD(MYSQL_LIBS)
138: PHP_SUBST_OLD(MYSQL_INCLUDE)
139: fi
140:
141: dnl Enable extension
142: if test "$PHP_MYSQL" != "no"; then
143: AC_MSG_CHECKING([for MySQL UNIX socket location])
144: if test "$PHP_MYSQL_SOCK" != "no" && test "$PHP_MYSQL_SOCK" != "yes"; then
145: MYSQL_SOCK=$PHP_MYSQL_SOCK
146: AC_DEFINE_UNQUOTED(PHP_MYSQL_UNIX_SOCK_ADDR, "$MYSQL_SOCK", [ ])
147: AC_MSG_RESULT([$MYSQL_SOCK])
148: elif test "$PHP_MYSQL" = "yes" || test "$PHP_MYSQL_SOCK" = "yes"; then
149: PHP_MYSQL_SOCKET_SEARCH
150: else
151: AC_MSG_RESULT([no])
152: fi
153:
154: AC_DEFINE(HAVE_MYSQL, 1, [Whether you have MySQL])
155: PHP_NEW_EXTENSION(mysql, php_mysql.c, $ext_shared)
156: PHP_SUBST(MYSQL_SHARED_LIBADD)
157:
158: if test "$PHP_MYSQL" = "mysqlnd"; then
159: PHP_ADD_EXTENSION_DEP(mysql, mysqlnd)
160: AC_DEFINE([MYSQL_USE_MYSQLND], 1, [Whether mysqlnd is enabled])
161: fi
162: fi
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>