From 6009e2c6c42fd80cb1e43c6c290b877aa59d39a6 Mon Sep 17 00:00:00 2001 From: Drew Crawford Date: Mon, 10 Mar 2014 13:59:33 -0500 Subject: [PATCH] Libsodium is now required if and only if --with-libsodium is used This patch is proposed for https://github.com/zeromq/libzmq/issues/912. If a user specifies that they want libzmq built with libsodium, and the requirement cannot be satisfied, we should error at the user so they can either A) install libsodium to a reasonable location or B) relax their requirement for libsodium support. Previously a warning was issued in this case, causing users who wanted libsodium support not to get it, which may be discovered at a much later time when their programs didn't work as expected. I release this patch under the LGPL v3 or any later version. --- AUTHORS | 1 + configure.ac | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index e429b931..ccbc56d1 100644 --- a/AUTHORS +++ b/AUTHORS @@ -37,6 +37,7 @@ Dhammika Pathirana Dhruva Krishnamurthy Dirk O. Kaar Douglas Creager +Drew Crawford Erich Heine Erik Hugne Erik Rigtorp diff --git a/configure.ac b/configure.ac index a258bf09..963a6ead 100644 --- a/configure.ac +++ b/configure.ac @@ -299,7 +299,12 @@ esac # Checks for libraries AC_CHECK_LIB([pthread], [pthread_create]) AC_CHECK_LIB([rt], [clock_gettime]) -AC_CHECK_LIB([sodium], [sodium_init],,AC_MSG_WARN(libsodium is needed for CURVE security)) +if test "x$zmq_search_libsodium" = "xyes"; then + AC_CHECK_LIB([sodium], [sodium_init],,AC_MSG_ERROR(libsodium is not installed. Install it or don't pass --with-libsodium to configure script)) +else + AC_CHECK_LIB([sodium], [sodium_init],,AC_MSG_WARN(libsodium is needed for CURVE security)) +fi + # # Check if the compiler supports -fvisibility=hidden flag. MinGW32 uses __declspec