diff --git a/src/util/Makefile b/src/util/Makefile index 00fb2cf7..9c3f47a8 100644 --- a/src/util/Makefile +++ b/src/util/Makefile @@ -1,6 +1,8 @@ top_builddir=../.. include $(top_builddir)/Makefile.config +INCLUDES += $(GNUTLS_CFLAGS) $(OPENSSL_CFLAGS) + # Reverse a CONFIG_* string # Usage $(call not,$(CONFIG_FOO)) not = $(if $(findstring yes,$(1)),no,yes) @@ -9,7 +11,6 @@ OBJS-$(call not,$(CONFIG_SMALL)) += fastfind.o OBJS-$(CONFIG_CSS) += scanner.o OBJS-$(CONFIG_DEBUG) += memdebug.o OBJS-$(CONFIG_DOM) += scanner.o -OBJS-$(CONFIG_MD5) += md5.o # Use own MD5 implementation if testing libc or there's no OpenSSL # (either the real thing or GNUTLS compat wrappers). diff --git a/src/util/md5.h b/src/util/md5.h index 7c29c927..f4f7f4c4 100644 --- a/src/util/md5.h +++ b/src/util/md5.h @@ -3,12 +3,14 @@ /* Optionally MD5 support can depend on external implementation when linking * against a SSL library that supports it. */ -#ifndef CONFIG_MD5 -#if defined(CONFIG_OPENSSL) +#if defined(CONFIG_OWN_LIBC) +#define CONFIG_MD5 1 +#elif defined(CONFIG_OPENSSL) #include #elif defined(CONFIG_GNUTLS_OPENSSL_COMPAT) #include -#endif +#else +#define CONFIG_MD5 1 #endif /* GNU TLS doesn't define this */ diff --git a/src/util/sha1.h b/src/util/sha1.h index c344c255..9948a3a7 100644 --- a/src/util/sha1.h +++ b/src/util/sha1.h @@ -36,10 +36,12 @@ /* Optionally SHA1 support can depend on external implementation when linking * against a SSL library that supports it. */ -#ifndef CONFIG_SHA1 -#if defined(CONFIG_OPENSSL) +#if defined(CONFIG_OWN_LIBC) +#define CONFIG_SHA1 1 +#elif defined(CONFIG_OPENSSL) #include -#endif +#else +#define CONFIG_SHA1 1 #endif #ifndef SHA_DIGEST_LENGTH