forked from easy-swoole/compiler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.m4
26 lines (22 loc) · 1.11 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
dnl Tell PHP about the argument to enable the compiler extension
dnl Check PHP version:
AC_MSG_CHECKING(PHP version)
if test ! -z "$phpincludedir"; then
PHP_VERSION=`grep 'PHP_VERSION ' $phpincludedir/main/php_version.h | sed -e 's/.*"\([[0-9\.]]*\)".*/\1/g' 2>/dev/null`
elif test ! -z "$PHP_CONFIG"; then
PHP_VERSION=`$PHP_CONFIG --version 2>/dev/null`
fi
if test x"$PHP_VERSION" = "x"; then
AC_MSG_WARN([none])
else
PHP_MAJOR_VERSION=`echo $PHP_VERSION | sed -e 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/g' 2>/dev/null`
PHP_MINOR_VERSION=`echo $PHP_VERSION | sed -e 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/g' 2>/dev/null`
PHP_RELEASE_VERSION=`echo $PHP_VERSION | sed -e 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/g' 2>/dev/null`
AC_MSG_RESULT([$PHP_VERSION])
fi
if test $PHP_MAJOR_VERSION -lt 7; then
AC_MSG_ERROR([need at least PHP 7.1 or newer])
fi
PHP_ARG_ENABLE(easy_compiler, enable the easy_compiler extension,NULL)
//src/Zend/$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION/zend_language_scanner.c
PHP_NEW_EXTENSION(easy_compiler, src/compiler.c src/pkcs7.c src/aes.c , $ext_shared)