config.m4 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. dnl
  2. dnl $Id$
  3. dnl
  4. PHP_ARG_WITH(roxen,,
  5. [ --with-roxen=DIR Build PHP as a Pike module. DIR is the base Roxen
  6. directory, normally /usr/local/roxen/server], no, no)
  7. PHP_ARG_ENABLE(roxen-zts, whether Roxen module is build using ZTS,
  8. [ --enable-roxen-zts ROXEN: Build the Roxen module using Zend Thread Safety], no, no)
  9. RESULT=
  10. AC_MSG_CHECKING([for Roxen/Pike support])
  11. if test "$PHP_ROXEN" != "no"; then
  12. if test ! -d $PHP_ROXEN ; then
  13. AC_MSG_ERROR([You did not specify a directory])
  14. fi
  15. if test -f $PHP_ROXEN/bin/roxen; then
  16. PIKE=$PHP_ROXEN/bin/roxen
  17. elif test -f $PHP_ROXEN/bin/pike; then
  18. PIKE=$PHP_ROXEN/bin/pike
  19. else
  20. AC_MSG_ERROR([Could not find a pike in $PHP_ROXEN/bin/])
  21. fi
  22. if $PIKE -e 'float v; catch(v = __VERSION__ + (__BUILD__/10000.0)); if(v < 0.7079) exit(1); exit(0);'; then
  23. PIKE_MODULE_DIR=`$PIKE --show-paths 2>&1| grep '^Module' | sed -e 's/.*: //'`
  24. PIKE_INCLUDE_DIR=`echo $PIKE_MODULE_DIR | sed -e 's,lib/pike/modules,include/pike,' -e 's,lib/modules,include/pike,'`
  25. if test -z "$PIKE_INCLUDE_DIR" || test -z "$PIKE_MODULE_DIR"; then
  26. AC_MSG_ERROR([Failed to figure out Pike module and include directories])
  27. fi
  28. else
  29. AC_MSG_ERROR([Roxen/PHP requires Pike 0.7.79 or newer])
  30. fi
  31. PHP_ADD_INCLUDE($PIKE_INCLUDE_DIR)
  32. AC_DEFINE(HAVE_ROXEN, 1, [Whether you use Roxen])
  33. PHP_SELECT_SAPI(roxen, shared, roxen.c)
  34. INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_SHARED $PIKE_MODULE_DIR/PHP5.so"
  35. RESULT="yes
  36. Pike binary used: $PIKE
  37. Pike include dir: $PIKE_INCLUDE_DIR
  38. Pike module directory: $PIKE_MODULE_DIR"
  39. PIKE_INCLUDE_DIR=" -I$PIKE_INCLUDE_DIR "
  40. if test "$PHP_ROXEN_ZTS" != "no"; then
  41. PHP_BUILD_THREAD_SAFE
  42. AC_DEFINE(ROXEN_USE_ZTS, 1, [Whether to use Roxen in ZTS mode])
  43. fi
  44. fi
  45. AC_MSG_RESULT([$RESULT])
  46. dnl ## Local Variables:
  47. dnl ## tab-width: 4
  48. dnl ## End: