forked from kajidai/php-libmemcached
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.m4
44 lines (39 loc) · 1.75 KB
/
config.m4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
dnl $Id$
dnl config.m4 for extension libmemcached
PHP_ARG_ENABLE(libmemcached, whether to enable libmemcached support,
Make sure that the comment is aligned:
[ --enable-libmemcached Enable libmemcached support])
if test -z "$PHP_LIBMEMCACHED_DIR"; then
PHP_ARG_WITH(libmemcached-dir, for the location of libmemcached (--with specified),
[ --with-libmemcached-dir[=DIR] Set the path to libmemcached install prefix.], no, no)
fi
if test "$PHP_LIBMEMCACHED" != "no"; then
if test "$PHP_LIBMEMCACHED_DIR" != "no" && test "$PHP_LIBMEMCACHED_DIR" != "yes"; then
if test -f "$PHP_LIBMEMCACHED_DIR/include/libmemcached/memcached.h"; then
PHP_LIBMEMCACHED_DIR="$PHP_LIBMEMCACHED_DIR"
PHP_LIBMEMCACHED_INCDIR="$PHP_LIBMEMCACHED_DIR/include"
else
AC_MSG_ERROR([Can't find libmemcached headers under "$PHP_LIBMEMCACHED_DIR"])
fi
else
for i in /usr/local /usr; do
if test -f "$i/include/libmemcached/memcached.h"; then
PHP_LIBMEMCACHED_DIR="$i"
PHP_LIBMEMCACHED_INCDIR="$i/include"
fi
done
fi
dnl # libmemcached
AC_MSG_CHECKING([for the location of libmemcached])
if test "$PHP_LIBMEMCACHED_DIR" = "no"; then
AC_MSG_ERROR([libmemcached support requires libmemcached installation. use --with-libmemcached-dir=<DIR> to specify prefix where libmemcached include and library are located])
else
AC_MSG_RESULT([$PHP_LIBMEMCACHED_DIR])
PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_LIBMEMCACHED_DIR/$PHP_LIBDIR, ZIP_SHARED_LIBADD)
PHP_ADD_INCLUDE($PHP_LIBMEMCACHED_INCDIR)
fi
PHP_ADD_LIBRARY_WITH_PATH(memcached, $PHP_LIBMEMCACHED_DIR/lib, LIBMEMCACHED_SHARED_LIBADD)
export CFLAGS=$CFLAGS" -Werror"
PHP_NEW_EXTENSION(libmemcached, libmemcached.c, $ext_shared)
PHP_SUBST(LIBMEMCACHED_SHARED_LIBADD)
fi