commit - 06dea620797245512753a0381061eed71bd34dc1
commit + 3aa316cbcf696304c13f295e70b40c94ac75d17d
blob - 613855f12d450e8083c23a83e2880abb4c863cc3
blob + 350531801a49a764893df7a418570aefd3bea41f
--- configure.ac
+++ configure.ac
AM_CONDITIONAL([HAVE_SHA2], [test "x$ac_cv_header_sha2_h" = xyes])
# Check for SHA1_DIGEST_LENGTH
-if test "x$ac_cv_header_sha_h" = xyes; then
-AC_CHECK_DECL([SHA_DIGEST_LENGTH],
- [AC_DEFINE(HAVE_SHA_AS_SHA1)],
- [AC_DEFINE(NEEDS_SHA1_DEFS)],
- [#include <sha.h>])
-fi
-
-if test "x$ac_cv_header_sha1_h" = xyes; then
-AC_CHECK_DECL([SHA_DIGEST_LENGTH],
- [AC_DEFINE(HAVE_SHA1_AS_SHA1)],
- [AC_DEFINE(NEEDS_SHA1_DEFS)],
- [#include <sha1.h>])
-fi
-
-if test "x$ac_cv_header_sha_h" = xno || test "x$ac_cv_header_sha1_h" = xno
-then
- AC_DEFINE(NEEDS_SHA1_DEFS)
-fi
+AC_CHECK_DECL([SHA1_DIGEST_LENGTH],
+ [AC_DEFINE(HAVE_SHA1_AS_SHA1)],
+ [
+ dnl maybe sha.h is available
+ AC_CHECK_DECL([SHA_DIGEST_LENGTH],
+ [AC_DEFINE(HAVE_SHA_AS_SHA1)],
+ [],
+ [#include <sha.h>])
+ ],
+ [
+ #include <sys/types.h>
+ #include <sha1.h>
+ ])
# Checks for typ edefs, structures, and compiler characteristics.
AC_CHECK_HEADER_STDBOOL
blob - 1ca8f7f5914a4749826adb88bd25914675fd012a
blob + 847c76958d00a869e71be503e43f000280b06cba
--- include/got_compat.h
+++ include/got_compat.h
#include <openssl/sha.h>
#endif
-#ifdef NEEDS_SHA1_DEFS
+#ifndef SHA1_DIGEST_LENGTH
#define SHA1_DIGEST_LENGTH SHA_DIGEST_LENGTH
#define SHA1_DIGEST_STRING_LENGTH (SHA1_DIGEST_LENGTH * 2 + 1)