|
| 1 | +PHP_ARG_ENABLE(yaf, whether to enable yaf support, |
| 2 | +[ --enable-yaf Enable yaf support]) |
| 3 | + |
| 4 | +AC_ARG_ENABLE(yaf-debug, |
| 5 | +[ --enable-yaf-debug Enable yaf debug mode default=no], |
| 6 | +[PHP_YAF_DEBUG=$enableval], |
| 7 | +[PHP_YAF_DEBUG="no"]) |
| 8 | + |
| 9 | +if test "$PHP_YAF" != "no"; then |
| 10 | + |
| 11 | + if test "$PHP_YAF_DEBUG" = "yes"; then |
| 12 | + AC_DEFINE(PHP_YAF_DEBUG,1,[define to 1 if you want to change the POST/GET by php script]) |
| 13 | + else |
| 14 | + AC_DEFINE(PHP_YAF_DEBUG,0,[define to 1 if you want to change the POST/GET by php script]) |
| 15 | + fi |
| 16 | + |
| 17 | + AC_MSG_CHECKING([PHP version]) |
| 18 | + |
| 19 | + tmp_version=$PHP_VERSION |
| 20 | + if test -z "$tmp_version"; then |
| 21 | + if test -z "$PHP_CONFIG"; then |
| 22 | + AC_MSG_ERROR([php-config not found]) |
| 23 | + fi |
| 24 | + php_version=`$PHP_CONFIG --version 2>/dev/null|head -n 1|sed -e 's#\([0-9]\.[0-9]*\.[0-9]*\)\(.*\)#\1#'` |
| 25 | + else |
| 26 | + php_version=`echo "$tmp_version"|sed -e 's#\([0-9]\.[0-9]*\.[0-9]*\)\(.*\)#\1#'` |
| 27 | + fi |
| 28 | + |
| 29 | + if test -z "$php_version"; then |
| 30 | + AC_MSG_ERROR([failed to detect PHP version, please report]) |
| 31 | + fi |
| 32 | + |
| 33 | + ac_IFS=$IFS |
| 34 | + IFS="." |
| 35 | + set $php_version |
| 36 | + IFS=$ac_IFS |
| 37 | + yaf_php_version=`expr [$]1 \* 1000000 + [$]2 \* 1000 + [$]3` |
| 38 | + |
| 39 | + if test "$yaf_php_version" -le "5002000"; then |
| 40 | + AC_MSG_ERROR([You need at least PHP 5.2.0 to be able to use this version of Yaf. PHP $php_version found]) |
| 41 | + else |
| 42 | + AC_MSG_RESULT([$php_version, ok]) |
| 43 | + fi |
| 44 | + PHP_NEW_EXTENSION(yaf, yaf.c yaf_application.c yaf_bootstrap.c yaf_dispatcher.c yaf_exception.c yaf_config.c yaf_request.c yaf_response.c yaf_view.c yaf_controller.c yaf_action.c yaf_router.c yaf_loader.c yaf_registry.c yaf_plugin.c yaf_session.c, $ext_shared) |
| 45 | +fi |
0 commit comments