@@ -106,49 +106,29 @@ if test "$PHP_MEMCACHED" != "no"; then
106
106
AC_MSG_RESULT ( [ $session_inc_path] )
107
107
fi
108
108
fi
109
-
109
+
110
110
if test "$PHP_MEMCACHED_JSON" != "no"; then
111
111
AC_MSG_CHECKING ( [ for json includes] )
112
112
json_inc_path=""
113
-
114
- tmp_version=$PHP_VERSION
115
- if test -z "$tmp_version"; then
116
- if test -z "$PHP_CONFIG"; then
117
- AC_MSG_ERROR ( [ php-config not found] )
118
- fi
119
- PHP_MEMCACHED_VERSION_ORIG=`$PHP_CONFIG --version`;
120
- else
121
- PHP_MEMCACHED_VERSION_ORIG=$tmp_version
122
- fi
123
113
124
- if test -z $PHP_MEMCACHED_VERSION_ORIG; then
125
- AC_MSG_ERROR ( [ failed to detect PHP version, please report] )
114
+ if test -f "$abs_srcdir/include/php/ext/json/php_json.h"; then
115
+ json_inc_path="$abs_srcdir/include/php"
116
+ elif test -f "$abs_srcdir/ext/json/php_json.h"; then
117
+ json_inc_path="$abs_srcdir"
118
+ elif test -f "$phpincludedir/ext/json/php_json.h"; then
119
+ json_inc_path="$phpincludedir"
120
+ else
121
+ for i in php php4 php5 php6; do
122
+ if test -f "$prefix/include/$i/ext/json/php_json.h"; then
123
+ json_inc_path="$prefix/include/$i"
124
+ fi
125
+ done
126
126
fi
127
-
128
- PHP_MEMCACHED_VERSION_MASK=`echo ${PHP_MEMCACHED_VERSION_ORIG} | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
129
-
130
- if test $PHP_MEMCACHED_VERSION_MASK -ge 7000000; then
131
- if test -f "$abs_srcdir/include/php/ext/json/php_json.h"; then
132
- json_inc_path="$abs_srcdir/include/php"
133
- elif test -f "$abs_srcdir/ext/json/php_json.h"; then
134
- json_inc_path="$abs_srcdir"
135
- elif test -f "$phpincludedir/ext/json/php_json.h"; then
136
- json_inc_path="$phpincludedir"
137
- else
138
- for i in php php4 php5 php6; do
139
- if test -f "$prefix/include/$i/ext/json/php_json.h"; then
140
- json_inc_path="$prefix/include/$i"
141
- fi
142
- done
143
- fi
144
- if test "$json_inc_path" = ""; then
145
- AC_MSG_ERROR ( [ Cannot find php_json.h] )
146
- else
147
- AC_DEFINE ( HAVE_JSON_API ,1 ,[ Whether JSON API is available] )
148
- AC_MSG_RESULT ( [ $json_inc_path] )
149
- fi
127
+ if test "$json_inc_path" = ""; then
128
+ AC_MSG_ERROR ( [ Cannot find php_json.h] )
150
129
else
151
- AC_MSG_RESULT ( [ this version of memcached is only suitable for PHP7+] )
130
+ AC_DEFINE ( HAVE_JSON_API ,1 ,[ Whether JSON API is available] )
131
+ AC_MSG_RESULT ( [ $json_inc_path] )
152
132
fi
153
133
fi
154
134
0 commit comments