-
Notifications
You must be signed in to change notification settings - Fork 67
/
config.m4
38 lines (33 loc) · 1.3 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
PHP_ARG_ENABLE(phpiredis, whether to enable phpiredis support,
[ --enable-phpiredis Enable phpiredis support])
PHP_ARG_WITH(hiredis-dir, for hiredis library,
[ --with-hiredis-dir[=DIR] Set the path to hiredis install prefix.], yes)
if test "$PHP_PHPIREDIS" = "yes"; then
AC_DEFINE(HAVE_PHPIREDIS, 1, [Whether you have phpiredis])
PKG_CONFIG=`which pkg-config`
if test "$PHP_HIREDIS_DIR" != "no" && test "$PHP_HIREDIS_DIR" != "yes"; then
for i in $PHP_HIREDIS_DIR /usr /usr/local; do
if test -r $i/include/$SEARCH_FOR; then
HIREDIS_DIR=$i
break
fi
done
if test -z $HIREDIS_DIR; then
AC_MSG_RESULT(not found)
AC_MSG_ERROR(Could not find hiredis in search paths)
fi
AC_MSG_RESULT(Found hiredis in $HIREDIS_DIR)
PHP_EVAL_LIBLINE(-lhiredis)
PHP_EVAL_INCLINE(-I$HIREDIS_DIR/include)
elif $PKG_CONFIG --exists hiredis; then
HIREDIS_VERSION=`$PKG_CONFIG --modversion hiredis`
AC_MSG_RESULT([Found hiredis $HIREDIS_VERSION])
PHP_EVAL_INCLINE(`$PKG_CONFIG --cflags-only-I hiredis`)
PHP_EVAL_LIBLINE(`$PKG_CONFIG --libs hiredis`, PHPIREDIS_SHARED_LIBADD)
else
AC_MSG_RESULT(not found)
AC_MSG_ERROR(Ooops ! hiredis not found)
fi
PHP_SUBST(PHPIREDIS_SHARED_LIBADD)
PHP_NEW_EXTENSION(phpiredis, phpiredis.c, $ext_shared)
fi