summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorMikhail Gusarov <dottedmag@dottedmag.net>2009-10-29 01:54:00 +0600
committerKeith Packard <keithp@keithp.com>2009-10-28 15:49:38 -0700
commitccf4a69db747b000aee09072aac0a2891bde139a (patch)
tree8d30f6c94d8fd37bb5288ca933e56101de87913f /configure.ac
parent8613e4b0eb04150b1e377871f02b164be5d001e9 (diff)
os: Add libsha1 as a choice of SHA1 implementation
There are small systems which don't need OpenSSL or gcrypt. Add libsha1 (http://github.com/dottedmag/libsha1) as an alternative small SHA1 implementation. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac11
1 files changed, 10 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index e7c050446..02e9146bb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1286,7 +1286,7 @@ CORE_INCS='-I$(top_srcdir)/include -I$(top_builddir)/include'
# SHA1 hashing
AC_ARG_WITH([sha1],
- [AS_HELP_STRING([--with-sha1=libmd|libgcrypt|libcrypto],
+ [AS_HELP_STRING([--with-sha1=libmd|libgcrypt|libcrypto|libsha1],
[choose SHA1 implementation])])
AC_CHECK_LIB([md], [SHA1Init], [HAVE_LIBMD=yes])
if test "x$with_sha1" = x && test "x$HAVE_LIBMD" = xyes; then
@@ -1309,6 +1309,15 @@ if test "x$with_sha1" = xlibgcrypt; then
[Use libgcrypt SHA1 functions])
SHA1_LIBS=-lgcrypt
fi
+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; then
+ AC_DEFINE([HAVE_SHA1_IN_LIBSHA1], [1],
+ [Use libsha1 for SHA1])
+ SHA1_LIBS=-lsha1
+fi
# We don't need all of the OpenSSL libraries, just libcrypto
AC_CHECK_LIB([crypto], [SHA1_Init], [HAVE_LIBCRYPTO=yes])
PKG_CHECK_MODULES([OPENSSL], [openssl], [HAVE_OPENSSL_PKC=yes],