Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ext/json/Makefile.frag
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$(srcdir)/json_scanner.c: $(srcdir)/json_scanner.re
$(RE2C) -t $(srcdir)/php_json_scanner_defs.h --no-generation-date -bci -o $@ $(srcdir)/json_scanner.re
$(RE2C_FOR_JSON) -t $(srcdir)/php_json_scanner_defs.h --no-generation-date -bci -o $@ $(srcdir)/json_scanner.re

$(srcdir)/json_parser.tab.c: $(srcdir)/json_parser.y
$(YACC) --defines -l $(srcdir)/json_parser.y -o $@
26 changes: 21 additions & 5 deletions ext/json/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,36 @@ dnl
dnl $Id$
dnl

PHP_ARG_ENABLE(json, whether to enable JavaScript Object Serialization support,
[ --disable-json Disable JavaScript Object Serialization support], yes)
PHP_ARG_ENABLE(json,
whether to enable JavaScript Object Serialization support,
[AS_HELP_STRING([--disable-json], [Disable JavaScript Object Serialization support])],
yes)

AC_ARG_ENABLE(json-filegen,
[AS_HELP_STRING([--enable-json-filegen], [Enable new Json file generation])],
[PHP_JSON_FILEGEN=yes], [PHP_JSON_FILEGEN=no])

if test "$PHP_JSON" != "no"; then
AC_DEFINE([HAVE_JSON],1 ,[whether to enable JavaScript Object Serialization support])
AC_HEADER_STDC

PHP_NEW_EXTENSION(json,
PHP_NEW_EXTENSION(json,
json.c \
json_encoder.c \
json_parser.tab.c \
json_scanner.c,
$ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_INSTALL_HEADERS([ext/json], [php_json.h])
PHP_ADD_MAKEFILE_FRAGMENT()
PHP_INSTALL_HEADERS([ext/json], [php_json.h])

if test "$PHP_JSON_FILEGEN" != "no"; then
if test -z "$re2c_vernum" || test "$re2c_vernum" -lt "1306"; then
AC_MSG_WARN([You will need re2c 0.13.6 or later if you want to regenerate JSON scanner.])
RE2C_FOR_JSON="exit 0;"
else
RE2C_FOR_JSON="$RE2C"
fi
PHP_SUBST(RE2C_FOR_JSON)
PHP_ADD_MAKEFILE_FRAGMENT()
fi
PHP_SUBST(JSON_SHARED_LIBADD)
fi
Loading