com php-src: ext/standard: Use PKG_CHECK_MODULES to det ect the Argon2 library: azure/apt.yml azure/job .yml ext/standard/config.m4
| From: | Joe Watkins | Date: | Wed, 12 Jun 2019 04:54:54 +0000 |
| Subject: | com php-src: ext/standard: Use PKG_CHECK_MODULES to det ect the Argon2 library: azure/apt.yml azure/job .yml ext/standard/config.m4 | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-106686@lists.php.net to get a copy of this message | ||
Commit: bdcef51bcb367323f2eea4808f34a1b3e58bd3d8
Author: Hugh McMaster <hugh.mcmaster@outlook.com> Fri, 7 Jun 2019 19:44:22 +1000
Committer: Joe Watkins <krakjoe@php.net> Wed, 12 Jun 2019 06:54:54 +0200
Parents: 9d6103665162f29b7621493b0c5c4a613731a1c9
Branches: PHP-7.4 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=bdcef51bcb367323f2eea4808f34a1b3e58bd3d8
Log:
ext/standard: Use PKG_CHECK_MODULES to detect the Argon2 library
Changed paths:
M azure/apt.yml
M azure/job.yml
M ext/standard/config.m4
Diff:
diff --git a/azure/apt.yml b/azure/apt.yml
index 4ce769c..843ae1d 100644
--- a/azure/apt.yml
+++ b/azure/apt.yml
@@ -31,6 +31,7 @@ steps:
libreadline-dev \
libldap2-dev \
libsasl2-dev \
+ libargon2-0-dev \
postgresql \
postgresql-contrib \
${{ parameters.packages }}
diff --git a/azure/job.yml b/azure/job.yml
index 2b6960c..003a6d2 100644
--- a/azure/job.yml
+++ b/azure/job.yml
@@ -58,6 +58,7 @@ jobs:
--enable-zend-test \
--with-ldap \
--with-ldap-sasl \
+ --with-password-argon2 \
--enable-werror \
--with-config-file-path=/etc \
--with-config-file-scan-dir=/etc/php.d
diff --git a/ext/standard/config.m4 b/ext/standard/config.m4
index 891fca2..20ff3d5 100644
--- a/ext/standard/config.m4
+++ b/ext/standard/config.m4
@@ -406,36 +406,18 @@ AC_CHECK_DECLS([arc4random_buf])
dnl
dnl Check for argon2
dnl
-PHP_ARG_WITH([password-argon2],
- [for Argon2 support],
- [AS_HELP_STRING([[--with-password-argon2[=DIR]]],
- [Include Argon2 support in password_*. DIR is the Argon2 shared library
- path])])
-
-if test "$PHP_PASSWORD_ARGON2" != "no"; then
- AC_MSG_CHECKING([for Argon2 library])
- for i in $PHP_PASSWORD_ARGON2 /usr /usr/local ; do
- if test -r $i/include/argon2.h; then
- ARGON2_DIR=$i;
- AC_MSG_RESULT(found in $i)
- break
- fi
- done
-
- if test -z "$ARGON2_DIR"; then
- AC_MSG_RESULT([not found])
- AC_MSG_ERROR([Please ensure the argon2 header and library are installed])
- fi
+PHP_ARG_WITH([argon2],
+ [whether to build with Argon2 support],
+ [AS_HELP_STRING([--with-argon2],
+ [Build with Argon2 support])])
- PHP_ADD_LIBRARY_WITH_PATH(argon2, $ARGON2_DIR/$PHP_LIBDIR)
- PHP_ADD_INCLUDE($ARGON2_DIR/include)
+if test "$PHP_ARGON2" != "no"; then
+ PKG_CHECK_MODULES([ARGON2], [libargon2])
- AC_CHECK_LIB(argon2, argon2id_hash_raw, [
- LIBS="$LIBS -largon2"
- AC_DEFINE(HAVE_ARGON2LIB, 1, [ Define to 1 if you have the <argon2.h> header file ])
- ], [
- AC_MSG_ERROR([Problem with libargon2.(a|so). Please verify that Argon2 header and libraries
>= 20161029 are installed])
- ])
+ PHP_EVAL_INCLINE($ARGON2_CFLAGS)
+ PHP_EVAL_LIBLINE($ARGON2_LIBS, ARGON2_SHARED_LIBADD)
+
+ AC_DEFINE(HAVE_ARGON2LIB, 1, [ ])
fi
dnl