xref: /php-src/ext/session/config.m4 (revision 80d78461)
1PHP_ARG_ENABLE([session],
2  [whether to enable PHP sessions],
3  [AS_HELP_STRING([--disable-session],
4    [Disable session support])],
5  [yes])
6
7PHP_ARG_WITH([mm],
8  [for mm support],
9  [AS_HELP_STRING([[--with-mm[=DIR]]],
10    [SESSION: Include mm support for session storage])],
11  [no],
12  [no])
13
14if test "$PHP_SESSION" != "no"; then
15  PHP_PWRITE_TEST
16  PHP_PREAD_TEST
17  PHP_NEW_EXTENSION([session],
18    [mod_user_class.c session.c mod_files.c mod_mm.c mod_user.c],
19    [$ext_shared],,
20    [-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1])
21
22  PHP_ADD_EXTENSION_DEP(session, date)
23  dnl https://bugs.php.net/53141
24  PHP_ADD_EXTENSION_DEP(session, spl, true)
25
26  PHP_SUBST([SESSION_SHARED_LIBADD])
27  PHP_INSTALL_HEADERS([ext/session], [php_session.h mod_files.h mod_user.h])
28  AC_DEFINE([HAVE_PHP_SESSION], [1],
29    [Define to 1 if the PHP extension 'session' is available.])
30
31  AS_VAR_IF([PHP_MM], [no],, [
32    for i in $PHP_MM /usr/local /usr; do
33      AS_IF([test -f "$i/include/mm.h"], [MM_DIR=$i; break;])
34    done
35
36    AS_VAR_IF([MM_DIR],,
37      [AC_MSG_ERROR([Cannot find the 'mm' library, <mm.h> header file not found.])])
38
39    AS_VAR_IF([PHP_THREAD_SAFETY], [yes], [AC_MSG_ERROR(m4_text_wrap([
40      The configure option '--with-mm' cannot be combined with '--enable-zts'.
41      The mm library is not thread-safe, and mod_mm.c refuses to compile. Either
42      remove the '--with-mm' option, or build without thread safety (remove the
43      '--enable-zts' option).
44    ]))])
45
46    PHP_ADD_LIBRARY_WITH_PATH([mm],
47      [$MM_DIR/$PHP_LIBDIR],
48      [SESSION_SHARED_LIBADD])
49    PHP_ADD_INCLUDE([$MM_DIR/include])
50    PHP_INSTALL_HEADERS([ext/session], [mod_mm.h])
51    AC_DEFINE([HAVE_LIBMM], [1],
52      [Define to 1 if the system has the 'mm' library.])
53  ])
54fi
55