]> granicus.if.org Git - php/commitdiff
Fixing linker issue on linux when DIR is specified on --with-argon2
authorCharles R. Portwood II <charlesportwoodii@erianna.com>
Tue, 12 Jul 2016 04:13:07 +0000 (23:13 -0500)
committerCharles R. Portwood II <charlesportwoodii@erianna.com>
Tue, 12 Jul 2016 04:13:07 +0000 (23:13 -0500)
ext/standard/config.m4

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