Thread (4 messages) flat view 4 messages, 2 authors, 2016-06-15
DORMANTno replies

[PATCH] fall back to mozilla's sha.h if openssl/sha.h is not available

From: martin f. krafft <hidden>
Date: 2016-06-15 22:43:21
Subsystem: kernel build + files below scripts/ (unless maintained elsewhere), the rest · Maintainers: Nathan Chancellor, Nicolas Schier, Linus Torvalds

Uses $(CPP) to attempt to preprocess an include <openssl/sha.h> directive. If
that fails, NO_OPENSSL is defined, causing the Makefile to fall back to using
mozilla's SHA implementation.

This should possibly go to configure.ac, but maybe *also* to Makefile to make
from-source compilations easier. git HEAD already comes with a Makefile (rather
than a Makefile.in), so I just ran it while testing out patches. I introduced
the test because I thought the computer could find out about libssl for me,
rather than myself having to forget to specify NO_OPENSSL every time.

Signed-off-by: martin f. krafft <redacted>
---
 Makefile |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/Makefile b/Makefile
index d7541b4..1676343 100644
--- a/Makefile
+++ b/Makefile
@@ -532,6 +532,12 @@ ifndef NO_CURL
 	endif
 endif
 
+HAS_OPENSSL := $(shell echo "\#include <openssl/sha.h>" \
+			| $(CPP) -o/dev/null - 2>/dev/null || echo no)
+ifeq "$(HAS_OPENSSL)" "no"
+	NO_OPENSSL = "openssl_sha.h_not_found"
+endif
+
 ifndef NO_OPENSSL
 	OPENSSL_LIBSSL = -lssl
 	ifdef OPENSSLDIR
-- 
1.5.3.rc1.9.gf029
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help