0
0
mirror of https://github.com/zeromq/libzmq.git synced 2025-01-15 02:07:59 +08:00

Support both --with-* and --without-* options for libsodium and pgm

This commit is contained in:
J.T. Conklin 2014-10-18 16:48:40 -07:00
parent 1251d06dcc
commit 663781fbd4

View File

@ -383,18 +383,16 @@ have_sodium_library="no"
AC_ARG_WITH([libsodium], [AS_HELP_STRING([--with-libsodium], AC_ARG_WITH([libsodium], [AS_HELP_STRING([--with-libsodium],
[require libzmq build with libsodium. Requires pkg-config [default=no]])], [require libzmq build with libsodium. Requires pkg-config [default=no]])],
[require_libsodium_ext=yes], [require_libsodium_ext=no]) [require_libsodium_ext=$withval],
[require_libsodium_ext=no])
#conditionally require libsodium package #conditionally require libsodium package
if test "x$require_libsodium_ext" != "xno"; then if test "x$require_libsodium_ext" != "xno"; then
PKG_CHECK_MODULES([sodium], [libsodium], [have_sodium_library="yes"]) PKG_CHECK_MODULES([sodium], [libsodium], [have_sodium_library="yes"])
else
PKG_CHECK_MODULES([sodium], [libsodium], [have_sodium_library="yes"],
[AC_MSG_WARN(libsodium is needed for CURVE security)])
fi fi
if test "x$have_sodium_library" != "xno"; then if test "x$have_sodium_library" != "xno"; then
AC_DEFINE(HAVE_LIBSODIUM, 1, [The libsodium library is to be used.]) AC_DEFINE(HAVE_LIBSODIUM, 1, [The libsodium library is to be used.])
fi fi
AM_CONDITIONAL(HAVE_SODIUM, test "x$have_sodium_library" != "xno") AM_CONDITIONAL(HAVE_SODIUM, test "x$have_sodium_library" != "xno")
@ -404,7 +402,8 @@ have_pgm_library="no"
AC_ARG_WITH([pgm], [AS_HELP_STRING([--with-pgm], AC_ARG_WITH([pgm], [AS_HELP_STRING([--with-pgm],
[build libzmq with PGM extension. Requires pkg-config [default=no]])], [build libzmq with PGM extension. Requires pkg-config [default=no]])],
[with_pgm_ext=yes], [with_pgm_ext=no]) [with_pgm_ext=$withval],
[with_pgm_ext=no])
# conditionally require pgm package # conditionally require pgm package
if test "x$with_pgm_ext" != "xno"; then if test "x$with_pgm_ext" != "xno"; then