|
2 | 2 | dnl $Id$
|
3 | 3 | dnl
|
4 | 4 |
|
5 |
| -AC_DEFUN([PHP_JSON_ADD_SOURCES], [ |
6 |
| - PHP_JSON_SOURCES="$PHP_JSON_SOURCES $1" |
7 |
| -]) |
8 |
| - |
9 |
| -AC_DEFUN([PHP_JSON_ADD_BASE_SOURCES], [ |
10 |
| - PHP_JSON_BASE_SOURCES="$PHP_JSON_BASE_SOURCES $1" |
11 |
| -]) |
12 |
| - |
13 |
| -AC_DEFUN([PHP_JSON_ADD_BUILD_DIR], [ |
14 |
| - PHP_JSON_EXTRA_BUILD_DIRS="$PHP_JSON_EXTRA_BUILD_DIRS $1" |
15 |
| -]) |
16 |
| - |
17 |
| -AC_DEFUN([PHP_JSON_ADD_INCLUDE], [ |
18 |
| - PHP_JSON_EXTRA_INCLUDES="$PHP_JSON_EXTRA_INCLUDES $1" |
19 |
| -]) |
20 |
| - |
21 |
| -AC_DEFUN([PHP_JSON_ADD_CONFIG_HEADER], [ |
22 |
| - PHP_JSON_EXTRA_CONFIG_HEADERS="$PHP_JSON_EXTRA_CONFIG_HEADERS $1" |
23 |
| -]) |
24 |
| - |
25 |
| -AC_DEFUN([PHP_JSON_ADD_CFLAG], [ |
26 |
| - PHP_JSON_CFLAGS="$PHP_JSON_CFLAGS $1" |
27 |
| -]) |
28 |
| - |
29 |
| -AC_DEFUN([PHP_JSON_EXTENSION], [ |
30 |
| - PHP_NEW_EXTENSION(json, $PHP_JSON_SOURCES, $ext_shared,, $PHP_JSON_CFLAGS) |
31 |
| - PHP_SUBST(JSON_SHARED_LIBADD) |
32 |
| -
|
33 |
| - for dir in $PHP_JSON_EXTRA_BUILD_DIRS; do |
34 |
| - PHP_ADD_BUILD_DIR([$ext_builddir/$dir], 1) |
35 |
| - done |
36 |
| - |
37 |
| - for dir in $PHP_JSON_EXTRA_INCLUDES; do |
38 |
| - PHP_ADD_INCLUDE([$ext_srcdir/$dir]) |
39 |
| - PHP_ADD_INCLUDE([$ext_builddir/$dir]) |
40 |
| - done |
41 |
| -
|
42 |
| - if test "$ext_shared" = "no"; then |
43 |
| - PHP_ADD_SOURCES(PHP_EXT_DIR(json), $PHP_JSON_BASE_SOURCES,$PHP_JSON_CFLAGS) |
44 |
| - out="php_config.h" |
45 |
| - else |
46 |
| - PHP_ADD_SOURCES_X(PHP_EXT_DIR(json),$PHP_JSON_BASE_SOURCES,$PHP_JSON_CFLAGS,shared_objects_json,yes) |
47 |
| - if test -f "$ext_builddir/config.h.in"; then |
48 |
| - out="$abs_builddir/config.h" |
49 |
| - else |
50 |
| - out="php_config.h" |
51 |
| - fi |
52 |
| - fi |
53 |
| - |
54 |
| - for cfg in $PHP_JSON_EXTRA_CONFIG_HEADERS; do |
55 |
| - cat > $ext_builddir/$cfg <<EOF |
56 |
| -#include "$out" |
57 |
| -EOF |
58 |
| - done |
59 |
| -]) |
60 |
| - |
61 |
| -AC_DEFUN([PHP_JSON_SETUP_JSON_CHECKER], [ |
62 |
| - PHP_JSON_ADD_SOURCES([ |
63 |
| - utf8_to_utf16.c |
64 |
| - utf8_decode.c |
65 |
| - JSON_parser.c |
66 |
| - ]) |
67 |
| -]) |
68 |
| - |
69 |
| -dnl |
70 |
| -dnl Main config |
71 |
| -dnl |
72 |
| - |
73 | 5 | PHP_ARG_ENABLE(json, whether to enable JavaScript Object Serialization support,
|
74 | 6 | [ --disable-json Disable JavaScript Object Serialization support], yes)
|
75 | 7 |
|
76 |
| -if test "$PHP_JSON" != "no"; then |
77 |
| - AC_DEFINE([HAVE_JSON],1,[whether to have JavaScript Object Serialization support]) |
| 8 | +if test "$PHP_JSON" != "no"; then |
| 9 | + AC_DEFINE([HAVE_JSON],1 ,[whether to have JavaScript Object Serialization support]) |
78 | 10 | AC_HEADER_STDC
|
79 | 11 |
|
80 |
| - PHP_JSON_ADD_BASE_SOURCES([json.c]) |
81 |
| - |
82 |
| - dnl json_c is required |
83 |
| - PHP_JSON_SETUP_JSON_CHECKER |
84 |
| - PHP_JSON_EXTENSION |
85 |
| - dnl PHP_INSTALL_HEADERS([ext/json], [json_c]) |
| 12 | + PHP_NEW_EXTENSION(json, json.c utf8_to_utf16.c utf8_decode.c JSON_parser.c, $ext_shared) |
| 13 | + PHP_SUBST(JSON_SHARED_LIBADD) |
86 | 14 | fi
|
87 | 15 |
|
88 | 16 | # vim600: sts=2 sw=2 et
|
0 commit comments