@@ -406,36 +406,18 @@ AC_CHECK_DECLS([arc4random_buf])
406
406
dnl
407
407
dnl Check for argon2
408
408
dnl
409
- PHP_ARG_WITH([ password-argon2] ,
410
- [ for Argon2 support] ,
411
- [ AS_HELP_STRING ( [ [ --with-password-argon2[ =DIR] ] ] ,
412
- [ Include Argon2 support in password_*. DIR is the Argon2 shared library
413
- path] ) ] )
414
-
415
- if test "$PHP_PASSWORD_ARGON2" != "no"; then
416
- AC_MSG_CHECKING ( [ for Argon2 library] )
417
- for i in $PHP_PASSWORD_ARGON2 /usr /usr/local ; do
418
- if test -r $i/include/argon2.h; then
419
- ARGON2_DIR=$i;
420
- AC_MSG_RESULT ( found in $i )
421
- break
422
- fi
423
- done
424
-
425
- if test -z "$ARGON2_DIR"; then
426
- AC_MSG_RESULT ( [ not found] )
427
- AC_MSG_ERROR ( [ Please ensure the argon2 header and library are installed] )
428
- fi
409
+ PHP_ARG_WITH([ argon2] ,
410
+ [ whether to build with Argon2 support] ,
411
+ [ AS_HELP_STRING ( [ --with-argon2] ,
412
+ [ Build with Argon2 support] ) ] )
429
413
430
- PHP_ADD_LIBRARY_WITH_PATH(argon2, $ARGON2_DIR/$PHP_LIBDIR)
431
- PHP_ADD_INCLUDE($ARGON2_DIR/include )
414
+ if test "$PHP_ARGON2" != "no"; then
415
+ PKG_CHECK_MODULES( [ ARGON2 ] , [ libargon2 ] )
432
416
433
- AC_CHECK_LIB ( argon2 , argon2id_hash_raw , [
434
- LIBS="$LIBS -largon2"
435
- AC_DEFINE ( HAVE_ARGON2LIB , 1 , [ Define to 1 if you have the <argon2.h> header file ] )
436
- ] , [
437
- AC_MSG_ERROR ( [ Problem with libargon2.(a|so). Please verify that Argon2 header and libraries >= 20161029 are installed] )
438
- ] )
417
+ PHP_EVAL_INCLINE($ARGON2_CFLAGS)
418
+ PHP_EVAL_LIBLINE($ARGON2_LIBS, ARGON2_SHARED_LIBADD)
419
+
420
+ AC_DEFINE ( HAVE_ARGON2LIB , 1 , [ ] )
439
421
fi
440
422
441
423
dnl
0 commit comments