-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconfig.m4
72 lines (59 loc) · 1.74 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
62
63
64
65
66
67
68
69
70
71
72
dnl config.m4 for couchdb
PHP_ARG_ENABLE(couchdb, whether to enable couchdb support,
[ --enable-couchdb Enable couchdb support], no)
PHP_ARG_WITH(curl, add curl library path,
[ --with-curl=[=DIR] Ignore CURL path check])
if test "$PHP_COUCHDB" != "no"; then
ASYNCH_LOCATIONS="/usr/local/include /usr/include /usr/local/opt/include"
ASYNCH_HEADER="async.h"
ASYNCH_SEM_HEADER="async-sem.h"
HAVE_ASYNCH=0
dnl check if libcurl is installed
PKG_CHECK_MODULES([CURL], [libcurl >= 7.29.0])
PKG_CHECK_VAR([CURL_FEATURES], [libcurl], [supported_features])
PHP_EVAL_LIBLINE($CURL_LIBS, CURL_SHARED_LIBADD)
PHP_EVAL_INCLINE($CURL_CFLAGS)
CURL_SSL=0
AC_MSG_CHECKING([for SSL support in libcurl])
case "$CURL_FEATURES" in
*SSL*)
CURL_SSL=1
AC_MSG_RESULT([yes])
;;
*)
AC_MSG_RESULT([no])
;;
esac
if test $CURL_SSL == "1"; then
sava_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $CURL_LIBS"
else
AC_MSG_ERROR([Please install libcurl with SSL support])
fi
PHP_CHECK_LIBRARY(curl, curl_easy_perform,
[
AC_DEFINE(HAVE_CURL, 1, [ ])
], [
AC_MSG_ERROR([Please check your libcurl installation])
], [
$CURL_LIBS
])
dnl check if async.h is installed
AC_MSG_CHECKING([for async.h])
for iter in $ASYNCH_LOCATIONS; do
if test -s $iter/$ASYNCH_HEADER; then
if test -s $iter/$ASYNCH_SEM_HEADER; then
AC_MSG_RESULT([yes])
HAVE_ASYNCH=1
else
AC_MSG_RESULT([no])
fi
fi
done
if test $HAVE_ASYNCH == "0"; then
AC_MSG_ERROR([Please check your async.h installation])
fi
PHP_ADD_EXTENSION_DEP(couchdb, json)
AC_DEFINE(HAVE_COUCHDB, 1, [ Have couchdb support ])
PHP_NEW_EXTENSION(couchdb, couchdb.c, $ext_shared)
fi