xref: /PHP-8.1/sapi/embed/config.m4 (revision 46e38a19)
1PHP_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
8AC_MSG_CHECKING([for embedded SAPI library support])
9
10if test "$PHP_EMBED" != "no"; then
11  case "$PHP_EMBED" in
12    yes|shared)
13      LIBPHP_CFLAGS="-shared"
14      PHP_EMBED_TYPE=shared
15      INSTALL_IT="\$(mkinstalldirs) \$(INSTALL_ROOT)\$(prefix)/lib; \$(INSTALL) -m 0755 $SAPI_SHARED \$(INSTALL_ROOT)\$(prefix)/lib"
16      ;;
17    static)
18      LIBPHP_CFLAGS="-static"
19      PHP_EMBED_TYPE=static
20      INSTALL_IT="\$(mkinstalldirs) \$(INSTALL_ROOT)\$(prefix)/lib; \$(INSTALL) -m 0644 $SAPI_STATIC \$(INSTALL_ROOT)\$(prefix)/lib"
21      ;;
22    *)
23      PHP_EMBED_TYPE=no
24      ;;
25  esac
26  if test "$PHP_EMBED_TYPE" != "no"; then
27    PHP_SUBST(LIBPHP_CFLAGS)
28    PHP_SELECT_SAPI(embed, $PHP_EMBED_TYPE, php_embed.c, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
29    PHP_INSTALL_HEADERS([sapi/embed/php_embed.h])
30  fi
31  AC_MSG_RESULT([$PHP_EMBED_TYPE])
32else
33  AC_MSG_RESULT(no)
34fi
35