-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfig.m4
62 lines (51 loc) · 2.09 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
dnl
dnl $ Id: $
dnl vim:se ts=2 sw=2 et:
PHP_ARG_ENABLE(distlock, whether to enable distlock support,
[ --enable-distlock Enable distlock support])
PHP_ARG_WITH(libzookeeper-dir, for libzookeeper,
[ --with-libzookeeper-dir[=DIR] Set the path to libzookeeper install prefix.], yes)
if test -z "$PHP_DEBUG"; then
AC_ARG_ENABLE(debug,
[ --enable-debug compile with debugging symbols],[
PHP_DEBUG=$enableval
],[ PHP_DEBUG=no
])
fi
if test "$PHP_DISTLOCK" != "no"; then
if test "$PHP_LIBZOOKEEPER_DIR" != "no" && test "$PHP_LIBZOOKEEPER_DIR" != "yes"; then
if test -r "$PHP_LIBZOOKEEPER_DIR/include/c-client-src/zookeeper.h"; then
PHP_LIBZOOKEEPER_DIR="$PHP_LIBZOOKEEPER_DIR"
elif test -r "$PHP_LIBZOOKEEPER_DIR/include/zookeeper/zookeeper.h"; then
PHP_LIBZOOKEEPER_DIR="$PHP_LIBZOOKEEPER_DIR"
else
AC_MSG_ERROR([Can't find zookeeper headers under "$PHP_LIBZOOKEEPER_DIR"])
fi
else
PHP_LIBZOOKEEPER_DIR="no"
for i in /usr /usr/local; do
if test -r "$i/include/c-client-src/zookeeper.h"; then
PHP_LIBZOOKEEPER_DIR=$i
break
elif test -r "$i/include/zookeeper/zookeeper.h"; then
PHP_LIBZOOKEEPER_DIR=$i
break
fi
done
fi
AC_MSG_CHECKING([for libzookeeper location])
if test "$PHP_LIBZOOKEEPER_DIR" = "no"; then
AC_MSG_ERROR([zookeeper support requires libzookeeper. Use --with-libzookeeper-dir=<DIR> to specify the prefix where libzookeeper headers and library are located])
else
AC_MSG_RESULT([$PHP_LIBZOOKEEPER_DIR])
if test -r "$PHP_LIBZOOKEEPER_DIR/include/c-client-src/zookeeper.h"; then
PHP_LIBZOOKEEPER_INCDIR="$PHP_LIBZOOKEEPER_DIR/include/c-client-src"
elif test -r "$PHP_LIBZOOKEEPER_DIR/include/zookeeper/zookeeper.h"; then
PHP_LIBZOOKEEPER_INCDIR="$PHP_LIBZOOKEEPER_DIR/include/zookeeper"
fi
PHP_ADD_INCLUDE($PHP_LIBZOOKEEPER_INCDIR)
PHP_ADD_LIBRARY_WITH_PATH(zookeeper_mt, $PHP_LIBZOOKEEPER_DIR/lib, DISTLOCK_SHARED_LIBADD)
PHP_SUBST(DISTLOCK_SHARED_LIBADD)
PHP_NEW_EXTENSION(distlock, zoo_lock.c php_distlock.c, $ext_shared)
fi
fi