config.m4 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. PHP_ARG_ENABLE([embed],,
  2. [AS_HELP_STRING([[--enable-embed[=TYPE]]],
  3. [EXPERIMENTAL: Enable building of embedded SAPI library TYPE is either
  4. 'shared' or 'static'. [TYPE=shared]])],
  5. [no],
  6. [no])
  7. AC_MSG_CHECKING([for embedded SAPI library support])
  8. if test "$PHP_EMBED" != "no"; then
  9. case "$PHP_EMBED" in
  10. yes|shared)
  11. LIBPHP_CFLAGS="-shared"
  12. PHP_EMBED_TYPE=shared
  13. INSTALL_IT="\$(mkinstalldirs) \$(INSTALL_ROOT)\$(prefix)/lib; \$(INSTALL) -m 0755 $SAPI_SHARED \$(INSTALL_ROOT)\$(prefix)/lib"
  14. ;;
  15. static)
  16. LIBPHP_CFLAGS="-static"
  17. PHP_EMBED_TYPE=static
  18. INSTALL_IT="\$(mkinstalldirs) \$(INSTALL_ROOT)\$(prefix)/lib; \$(INSTALL) -m 0644 $SAPI_STATIC \$(INSTALL_ROOT)\$(prefix)/lib"
  19. ;;
  20. *)
  21. PHP_EMBED_TYPE=no
  22. ;;
  23. esac
  24. if test "$PHP_EMBED_TYPE" != "no"; then
  25. PHP_SUBST(LIBPHP_CFLAGS)
  26. PHP_SELECT_SAPI(embed, $PHP_EMBED_TYPE, php_embed.c, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
  27. PHP_INSTALL_HEADERS([sapi/embed/php_embed.h])
  28. fi
  29. AC_MSG_RESULT([$PHP_EMBED_TYPE])
  30. else
  31. AC_MSG_RESULT(no)
  32. fi