xref: /php-src/ext/openssl/config0.m4 (revision 45ebe475)
1PHP_ARG_WITH([openssl],
2  [for OpenSSL support],
3  [AS_HELP_STRING([--with-openssl],
4    [Include OpenSSL support (requires OpenSSL >= 1.1.1)])])
5
6PHP_ARG_WITH([system-ciphers],
7  [whether to use system default cipher list instead of hardcoded value],
8  [AS_HELP_STRING([--with-system-ciphers],
9    [OPENSSL: Use system default cipher list instead of hardcoded value])],
10  [no],
11  [no])
12
13PHP_ARG_WITH([openssl-legacy-provider],
14  [whether to load legacy algorithm provider],
15  [AS_HELP_STRING([--with-openssl-legacy-provider],
16    [OPENSSL: Load legacy algorithm provider in addition to default provider])],
17  [no],
18  [no])
19
20PHP_ARG_WITH([openssl-argon2],
21  [whether to enable argon2 password hashing (requires OpenSSL >= 3.2)],
22  [AS_HELP_STRING([--with-openssl-argon2],
23    [OPENSSL: Enable argon2 password hashing])],
24  [no],
25  [no])
26
27if test "$PHP_OPENSSL" != "no"; then
28  PHP_NEW_EXTENSION([openssl],
29    [openssl.c openssl_pwhash.c xp_ssl.c],
30    [$ext_shared])
31  PHP_SUBST([OPENSSL_SHARED_LIBADD])
32  PHP_SETUP_OPENSSL([OPENSSL_SHARED_LIBADD],
33    [AC_DEFINE([HAVE_OPENSSL_EXT], [1],
34      [Define to 1 if the PHP extension 'openssl' is available.])])
35
36  PHP_CHECK_LIBRARY([crypto], [RAND_egd],
37    [AC_DEFINE([HAVE_RAND_EGD], [1],
38      [Define to 1 if OpenSSL crypto library has the 'RAND_egd' function.])],,
39    [$OPENSSL_LIBS])
40
41  AS_VAR_IF([PHP_SYSTEM_CIPHERS], [no],,
42    [AC_DEFINE([USE_OPENSSL_SYSTEM_CIPHERS], [1],
43      [Define to 1 to use system default cipher list instead of the hardcoded
44      value in OpenSSL.])])
45
46  AS_VAR_IF([PHP_OPENSSL_LEGACY_PROVIDER], [no],,
47    [AC_DEFINE([LOAD_OPENSSL_LEGACY_PROVIDER], [1],
48      [Define to 1 to load the OpenSSL legacy algorithm provider in addition to
49      the default provider.])])
50
51  AS_VAR_IF([PHP_OPENSSL_ARGON2], [no],, [
52    AS_VAR_IF([PHP_THREAD_SAFETY], [yes],
53      [AC_MSG_ERROR([Not supported in ZTS mode for now])])
54
55    PHP_CHECK_LIBRARY([crypto], [OSSL_set_max_threads],
56      [AC_DEFINE([HAVE_OPENSSL_ARGON2], [1],
57        [Define to 1 to enable OpenSSL argon2 password hashing.])],
58      [AC_MSG_ERROR([argon2 hashing requires OpenSSL 3.2])],
59      [$OPENSSL_LIBS])
60  ])
61fi
62