[PATCH] Catch when requested SHA1 implementation is missing

Yaakov (Cygwin/X) yselkowitz at users.sourceforge.net
Wed Apr 14 11:24:58 PDT 2010


From: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>

The other SHA1 implementation detections already error out if
specifically requested but were not found.

Signed-off-by: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
---
Note that the order of the hunks of this patch depends on my 
previously-sent "Prefer libsha1 over libgcrypt" patch.

 configure.ac |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/configure.ac b/configure.ac
index 4d62618..26caa8f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1412,6 +1412,9 @@ AC_CHECK_LIB([sha1], [sha1_begin], [HAVE_LIBSHA1=yes])
 if test "x$with_sha1" = x && test "x$HAVE_LIBSHA1" = xyes; then
    with_sha1=libsha1
 fi
+if test "x$with_sha1" = xlibsha1 && test "x$HAVE_LIBSHA1" != xyes; then
+	AC_MSG_ERROR([libsha1 requested but not found])
+fi
 if test "x$with_sha1" = xlibsha1; then
 	AC_DEFINE([HAVE_SHA1_IN_LIBSHA1], [1],
 	          [Use libsha1 for SHA1])
@@ -1421,6 +1424,9 @@ AC_CHECK_LIB([gcrypt], [gcry_md_open], [HAVE_LIBGCRYPT=yes])
 if test "x$with_sha1" = x && test "x$HAVE_LIBGCRYPT" = xyes; then
 	with_sha1=libgcrypt
 fi
+if test "x$with_sha1" = xlibgcrypt && test "x$HAVE_LIBGCRYPT" != xyes; then
+	AC_MSG_ERROR([libgcrypt requested but not found])
+fi
 if test "x$with_sha1" = xlibgcrypt; then
 	AC_DEFINE([HAVE_SHA1_IN_LIBGCRYPT], [1],
 	          [Use libgcrypt SHA1 functions])
-- 
1.6.6.1



More information about the xorg-devel mailing list