From 206037eaa497aa9e369e5594b3a58c3c9b4b7237 Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Thu, 19 Jan 2006 02:08:07 +0100 Subject: [PATCH] Handle the logic for util/{md5,sha1} in the Makefile --- Makefile.config.in | 2 -- configure.in | 23 ----------------------- src/util/Makefile | 25 +++++++++++++++++++------ 3 files changed, 19 insertions(+), 31 deletions(-) diff --git a/Makefile.config.in b/Makefile.config.in index 85386320..4c297dc3 100644 --- a/Makefile.config.in +++ b/Makefile.config.in @@ -131,7 +131,6 @@ CONFIG_LEDS = @CONFIG_LEDS@ CONFIG_MAILCAP = @CONFIG_MAILCAP@ CONFIG_MANUAL = @CONFIG_MANUAL@ CONFIG_MARKS = @CONFIG_MARKS@ -CONFIG_MD5 = @CONFIG_MD5@ CONFIG_MIMETYPES = @CONFIG_MIMETYPES@ CONFIG_MOUSE = @CONFIG_MOUSE@ CONFIG_NNTP = @CONFIG_NNTP@ @@ -151,7 +150,6 @@ CONFIG_SCRIPTING_PERL = @CONFIG_SCRIPTING_PERL@ CONFIG_SCRIPTING_PYTHON = @CONFIG_SCRIPTING_PYTHON@ CONFIG_SCRIPTING_RUBY = @CONFIG_SCRIPTING_RUBY@ CONFIG_SCRIPTING_SPIDERMONKEY = @CONFIG_SCRIPTING_SPIDERMONKEY@ -CONFIG_SHA1 = @CONFIG_SHA1@ CONFIG_SMALL = @CONFIG_SMALL@ CONFIG_SMB = @CONFIG_SMB@ CONFIG_SPIDERMONKEY = @CONFIG_SPIDERMONKEY@ diff --git a/configure.in b/configure.in index 2ef54920..33dca15f 100644 --- a/configure.in +++ b/configure.in @@ -1224,29 +1224,6 @@ EL_ARG_ENABLE(CONFIG_OWN_LIBC, own-libc, [Own libc stubs], EL_ARG_ENABLE(CONFIG_SMALL, small, [Small binary], [ --enable-small reduce binary size as far as possible (but see the bottom of doc/small.txt!)]) -if test "$CONFIG_OPENSSL" != yes && - test "$CONFIG_GNUTLS_OPENSSL_COMPAT" != yes || - test "$CONFIG_OWN_LIBC" = yes; -then - AC_MSG_CHECKING(for built-in MD5 support) - AC_MSG_RESULT(yes) - EL_CONFIG(CONFIG_MD5, [Built-in MD5]) -fi - -AC_SUBST(CONFIG_MD5) - -if test "$CONFIG_BITTORRENT" = yes; then - if test "$CONFIG_OPENSSL" != yes || - test "$CONFIG_OWN_LIBC" = yes; - then - AC_MSG_CHECKING(for built-in SHA1 support) - AC_MSG_RESULT(yes) - EL_CONFIG(CONFIG_SHA1, [Built-in SHA1]) - fi -fi - -AC_SUBST(CONFIG_SHA1) - AC_ARG_ENABLE(weehoofooboomookerchoo, [ Also check out the features.conf file for more information about features! diff --git a/src/util/Makefile b/src/util/Makefile index 727a8a8b..00fb2cf7 100644 --- a/src/util/Makefile +++ b/src/util/Makefile @@ -5,12 +5,25 @@ include $(top_builddir)/Makefile.config # Usage $(call not,$(CONFIG_FOO)) not = $(if $(findstring yes,$(1)),no,yes) -OBJS-$(CONFIG_DEBUG) += memdebug.o -OBJS-$(CONFIG_MD5) += md5.o -OBJS-$(CONFIG_CSS) += scanner.o -OBJS-$(CONFIG_DOM) += scanner.o -OBJS-$(CONFIG_SHA1) += sha1.o -OBJS-$(call not,$(CONFIG_SMALL)) += fastfind.o +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). +OBJS-$(CONFIG_OWN_LIBC) += md5.o +ifeq ($(CONFIG_GNUTLS_OPENSSL_COMPAT),no) +OBJS-$(call not,$(CONFIG_OPENSSL)) += md5.o +endif + +ifeq ($(CONFIG_BITTORRENT),yes) +# BitTorrent is the only user. Compile in SHA1 if testing libc or +# there is no OpenSSL. The GNUTLS OpenSSL wrappers doesn't have it. +OBJS-$(CONFIG_OWN_LIBC) += sha1.o +OBJS-$(call not,$(CONFIG_OPENSSL)) += sha1.o +endif OBJS = \ base64.o \