configure: Check for AM_PATH_LIBGCRYPT macro explicitly, so autogen is possible without libgcrypt

This commit is contained in:
Luke Dashjr
2014-08-29 01:32:05 +00:00
parent 2b70e26f47
commit 619e4e15e3

View File

@@ -26,20 +26,24 @@ AC_CONFIG_FILES([Makefile
AC_CHECK_LIB([ws2_32], [strchr])
AC_ARG_ENABLE([tool],
[AC_HELP_STRING([--disable-tool],[Compile command line base58 tool (default enabled)])],
[use_tool=$enableval],
[use_tool=auto])
if test x$use_tool != xno; then
AM_PATH_LIBGCRYPT([],[
use_tool=yes
],[
if test x$use_tool = xyes; then
AC_MSG_ERROR([libgcrypt not found; use --disable-tool])
fi
use_tool=no
])
fi
m4_ifdef([AM_PATH_LIBGCRYPT], [
AC_ARG_ENABLE([tool],
[AC_HELP_STRING([--disable-tool],[Compile command line base58 tool (default enabled)])],
[use_tool=$enableval],
[use_tool=auto])
if test x$use_tool != xno; then
AM_PATH_LIBGCRYPT([],[
use_tool=yes
],[
if test x$use_tool = xyes; then
AC_MSG_ERROR([libgcrypt not found; use --disable-tool])
fi
use_tool=no
])
fi
],[
m4_warn([syntax], [AM_PATH_LIBGCRYPT missing; CLI tool will not be available])
])
AM_CONDITIONAL([USE_TOOL], [test x$use_tool = xyes])
AC_OUTPUT