diff --git a/CMakeLists.txt b/CMakeLists.txt index 0e653a692..efdec314c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,7 +33,10 @@ endif () if (NOT OPENDHT_ARGON2) find_package(PkgConfig) pkg_search_module(argon2 libargon2) - if (NOT argon2_FOUND) + if (argon2_FOUND) + message("Argon2 found " ${argon2_req}) + set(argon2_lib ", libargon2") + else () message("Argon2 not found, using included version.") set(OPENDHT_ARGON2 ON) endif() diff --git a/configure.ac b/configure.ac index e5eec72b5..336dd4863 100644 --- a/configure.ac +++ b/configure.ac @@ -104,7 +104,10 @@ AC_ARG_WITH([argon2], AS_HELP_STRING([--without-argon2], [Use included Argon2])) AS_IF([test "x$with_argon2" != "xno"], [PKG_CHECK_MODULES([Argon2], [libargon2], [have_argon2=yes], [have_argon2=no])], [have_argon2=no]) -AS_IF([test "x$have_argon2" = "xyes"], [], [ +AS_IF([test "x$have_argon2" = "xyes"], [ + AC_MSG_NOTICE([Using system Argon2]) + AC_SUBST(argon2_lib, [", libargon2"]) +], [ AS_IF([test "x$with_argon2" = "xyes"], [ AC_MSG_ERROR([Argon2 requested but not found]) ],[ diff --git a/opendht.pc.in b/opendht.pc.in index ee7506ab9..0aae92c65 100644 --- a/opendht.pc.in +++ b/opendht.pc.in @@ -7,5 +7,5 @@ Description: C++ Distributed Hash Table library Version: @VERSION@ Libs: -L${libdir} -lopendht Libs.private: -lpthread -Requires.private: gnutls >= 3.1 +Requires.private: gnutls >= 3.1@argon2_lib@ Cflags: -I${includedir}