forked from crazyxman/simdjson_php
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.m4
36 lines (27 loc) · 1.03 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
dnl config.m4 for extension simdjson
PHP_ARG_ENABLE(simdjson, whether to enable simdjson, [ --enable-simdjson Enable simdjson])
if test "$PHP_SIMDJSON" != "no"; then
PHP_REQUIRE_CXX()
AC_MSG_CHECKING([PHP version])
if test -z "$PHP_CONFIG"; then
AC_MSG_ERROR([php-config not found])
fi
php_version=`$PHP_CONFIG --vernum`
if test -z "$php_version"; then
AC_MSG_ERROR([failed to detect PHP version, please report])
fi
if test "$php_version" -lt "70000"; then
AC_MSG_ERROR([You need at least PHP 7.0.0 to be able to use this version of simdjson. PHP $php_version found])
else
AC_MSG_RESULT([$php_version, ok])
fi
AC_DEFINE(HAVE_SIMDJSON, 1, [whether simdjson is enabled])
PHP_NEW_EXTENSION(simdjson, [
php_simdjson.cpp \
src/bindings.cpp \
src/simdjson.cpp],
$ext_shared,, "-std=c++17 -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1", cxx)
PHP_INSTALL_HEADERS([ext/simdjson], [php_simdjson.h])
PHP_ADD_MAKEFILE_FRAGMENT
PHP_ADD_BUILD_DIR(src, 1)
fi