Skip to content

Commit a5c2940

Browse files
committed
Merge branch 'master' of git.php.net:php-src
2 parents bb89f75 + 1305fda commit a5c2940

9 files changed

+406
-53
lines changed

ext/standard/config.m4

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,38 @@ dnl Check for getrandom on newer Linux kernels
550550
dnl
551551
AC_CHECK_DECLS([getrandom])
552552

553+
dnl
554+
dnl Check for argon2
555+
dnl
556+
PHP_ARG_WITH(password-argon2, for Argon2 support,
557+
[ --with-password-argon2[=DIR] Include Argon2 support in password_*. DIR is the Argon2 shared library path]])
558+
559+
if test "$PHP_PASSWORD_ARGON2" != "no"; then
560+
AC_MSG_CHECKING([for Argon2 library])
561+
for i in $PHP_PASSWORD_ARGON2 /usr /usr/local ; do
562+
if test -r $i/include/argon2.h; then
563+
ARGON2_DIR=$i;
564+
AC_MSG_RESULT(found in $i)
565+
break
566+
fi
567+
done
568+
569+
if test -z "$ARGON2_DIR"; then
570+
AC_MSG_RESULT([not found])
571+
AC_MSG_ERROR([Please ensure the argon2 header and library are installed])
572+
fi
573+
574+
PHP_ADD_LIBRARY_WITH_PATH(argon2, $ARGON2_DIR/$PHP_LIBDIR)
575+
PHP_ADD_INCLUDE($ARGON2_DIR/include)
576+
577+
AC_CHECK_LIB(argon2, argon2_hash, [
578+
LIBS="$LIBS -largon2"
579+
AC_DEFINE(HAVE_ARGON2LIB, 1, [ Define to 1 if you have the <argon2.h> header file ])
580+
], [
581+
AC_MSG_ERROR([Problem with libargon2.(a|so). Please verify that Argon2 header and libaries are installed])
582+
])
583+
fi
584+
553585
dnl
554586
dnl Setup extension sources
555587
dnl

ext/standard/config.w32

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
// vim:ft=javascript
22
// $Id$
33

4+
ARG_WITH("password-argon2", "Argon2 support", "no");
5+
6+
if (PHP_PASSWORD_ARGON2 != "no") {
7+
if (CHECK_LIB("Argon2Ref.lib", null, PHP_PASSWORD_ARGON2)
8+
&& CHECK_HEADER_ADD_INCLUDE("argon2.h", "CFLAGS")) {
9+
AC_DEFINE('HAVE_ARGON2LIB', 1);
10+
} else {
11+
WARNING("Argon2 not enabled; libaries and headers not found");
12+
}
13+
}
14+
415
ARG_WITH("config-file-scan-dir", "Dir to check for additional php ini files", "");
516

617
AC_DEFINE("PHP_CONFIG_FILE_SCAN_DIR", PHP_CONFIG_FILE_SCAN_DIR);

0 commit comments

Comments
 (0)