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 <argon2.h> header file ])
], [
AC_MSG_ERROR([Problem with libargon2.(a|so). Please verify that Argon2 header and libaries are installed])