From: Wouter Wijngaards Date: Fri, 11 Jul 2014 16:44:26 +0000 (+0000) Subject: Fixup SHA512 definitions from compat not appearing when not needed. X-Git-Tag: release-1.5.0rc1~85 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eeb39524f2827deb93c426af70b0dbe6634673b3;p=thirdparty%2Funbound.git Fixup SHA512 definitions from compat not appearing when not needed. git-svn-id: file:///svn/unbound/trunk@3175 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/config.h.in b/config.h.in index 486f76448..53902ee21 100644 --- a/config.h.in +++ b/config.h.in @@ -3,6 +3,9 @@ /* Directory to chroot to */ #undef CHROOT_DIR +/* Do sha512 definitions in config.h */ +#undef COMPAT_SHA512 + /* Pathname to the Unbound configuration file */ #undef CONFIGFILE @@ -907,7 +910,7 @@ void _ARC4_UNLOCK(void); #ifndef HAVE_ARC4RANDOM_UNIFORM uint32_t arc4random_uniform(uint32_t upper_bound); #endif -#ifndef HAVE_SHA512_UPDATE +#ifdef COMPAT_SHA512 #ifndef SHA512_DIGEST_LENGTH #define SHA512_BLOCK_LENGTH 128 #define SHA512_DIGEST_LENGTH 64 @@ -922,7 +925,7 @@ void SHA512_Init(SHA512_CTX*); void SHA512_Update(SHA512_CTX*, void*, size_t); void SHA512_Final(uint8_t[SHA512_DIGEST_LENGTH], SHA512_CTX*); unsigned char *SHA512(void* data, unsigned int data_len, unsigned char *digest); -#endif /* HAVE_SHA512_UPDATE */ +#endif /* COMPAT_SHA512 */ diff --git a/configure b/configure index 007b89ee2..b42d5c834 100755 --- a/configure +++ b/configure @@ -18248,6 +18248,9 @@ _ACEOF else + +$as_echo "#define COMPAT_SHA512 1" >>confdefs.h +; case " $LIBOBJS " in *" sha512.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS sha512.$ac_objext" diff --git a/configure.ac b/configure.ac index c5d83a9aa..bd912e92d 100644 --- a/configure.ac +++ b/configure.ac @@ -998,6 +998,7 @@ if test "$USE_NSS" = "no"; then Linux|*) AC_LIBOBJ(getentropy_linux) AC_CHECK_FUNCS([SHA512_Update],,[ + AC_DEFINE([COMPAT_SHA512], [1], [Do sha512 definitions in config.h]); AC_LIBOBJ(sha512) ]) AC_SEARCH_LIBS([clock_gettime], [rt]) @@ -1213,7 +1214,7 @@ void _ARC4_UNLOCK(void); #ifndef HAVE_ARC4RANDOM_UNIFORM uint32_t arc4random_uniform(uint32_t upper_bound); #endif -#ifndef HAVE_SHA512_UPDATE +#ifdef COMPAT_SHA512 #ifndef SHA512_DIGEST_LENGTH #define SHA512_BLOCK_LENGTH 128 #define SHA512_DIGEST_LENGTH 64 @@ -1228,7 +1229,7 @@ void SHA512_Init(SHA512_CTX*); void SHA512_Update(SHA512_CTX*, void*, size_t); void SHA512_Final(uint8_t[SHA512_DIGEST_LENGTH], SHA512_CTX*); unsigned char *SHA512(void* data, unsigned int data_len, unsigned char *digest); -#endif /* HAVE_SHA512_UPDATE */ +#endif /* COMPAT_SHA512 */