From: Charles R. Portwood II Date: Tue, 12 Jul 2016 04:13:07 +0000 (-0500) Subject: Fixing linker issue on linux when DIR is specified on --with-argon2 X-Git-Tag: php-7.2.0alpha1~1316^2^2~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f4aa3a465b248f0e0db970f882e6cd39968a2057;p=php Fixing linker issue on linux when DIR is specified on --with-argon2 --- diff --git a/ext/standard/config.m4 b/ext/standard/config.m4 index f0dc00512c..8cf64a5550 100644 --- a/ext/standard/config.m4 +++ b/ext/standard/config.m4 @@ -558,28 +558,24 @@ PHP_ARG_WITH(argon2, for Argon2 support, if test "$PHP_ARGON2" != "no"; then AC_MSG_CHECKING([for Argon2 library]) - if test "$PHP_ARGON2" = "yes"; then - SEARCH_PATH="/usr /usr/lib /usr/local /usr/local/share /usr/share" - else - SEARCH_PATH="$PHP_ARGON2" - fi - for i in $SEARCH_PATH ; do - if test -r $i/libargon2.so; then + for i in $PHP_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 headers and static library are installed]) + AC_MSG_ERROR([Please ensure the argon2 header and library are installed]) fi - + + PHP_ADD_LIBRARY_WITH_PATH(argon2, $ARGON2_DIR) PHP_ADD_INCLUDE($ARGON2_DIR/include) - AC_CHECK_HEADERS([argon2.h]) AC_CHECK_LIB(argon2, argon2_hash, [ - LIBS="-largon2 $LIBS -largon2" + LIBS="$LIBS -largon2" AC_DEFINE(HAVE_ARGON2LIB, 1, [ Define to 1 if you have the header file ]) ], [ AC_MSG_ERROR([Problem with libargon2.(a|so). Please verify that Argon2 header and libaries are installed])