-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconfig.m4
57 lines (46 loc) · 1.51 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
PHP_ARG_ENABLE(khttp, whether to enable khttp, [ --enable-khttp Enable Khttp])
if test "$PHP_KHTTP" = "yes"; then
if ! test "x" = "x"; then
PHP_EVAL_LIBLINE(, KHTTP_SHARED_LIBADD)
fi
AC_DEFINE(HAVE_KHTTP, 1, [Whether you have Khttp])
khttp_sources="khttp.c kernel/main.c kernel/memory.c kernel/exception.c kernel/hash.c kernel/debug.c kernel/backtrace.c kernel/object.c kernel/array.c kernel/extended/array.c kernel/string.c kernel/fcall.c kernel/extended/fcall.c kernel/require.c kernel/file.c kernel/operators.c kernel/math.c kernel/concat.c kernel/variables.c kernel/filter.c kernel/iterator.c kernel/time.c kernel/exit.c khttp/request.zep.c "
PHP_NEW_EXTENSION(khttp, $khttp_sources, $ext_shared,, )
PHP_SUBST(KHTTP_SHARED_LIBADD)
old_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $INCLUDES"
AC_CHECK_DECL(
[HAVE_BUNDLED_PCRE],
[
AC_CHECK_HEADERS(
[ext/pcre/php_pcre.h],
[
PHP_ADD_EXTENSION_DEP([khttp], [pcre])
AC_DEFINE([ZEPHIR_USE_PHP_PCRE], [1], [Whether PHP pcre extension is present at compile time])
],
,
[[#include "main/php.h"]]
)
],
,
[[#include "php_config.h"]]
)
AC_CHECK_DECL(
[HAVE_JSON],
[
AC_CHECK_HEADERS(
[ext/json/php_json.h],
[
PHP_ADD_EXTENSION_DEP([khttp], [json])
AC_DEFINE([ZEPHIR_USE_PHP_JSON], [1], [Whether PHP json extension is present at compile time])
],
,
[[#include "main/php.h"]]
)
],
,
[[#include "php_config.h"]]
)
CPPFLAGS=$old_CPPFLAGS
PHP_INSTALL_HEADERS([ext/khttp], [php_KHTTP.h])
fi