{"thread":{"id":"9031","subject":"[PATCH] fall back to mozilla's sha.h if openssl/sha.h is not available","startedAt":"2007-07-14T09:25:18Z","lastAt":"2007-07-14T09:25:18Z","messageCount":1,"participants":["martin f. krafft"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"47335","messageId":"11844051182286-git-send-email-madduck@madduck.net","threadId":"9031","inReplyTo":null,"subject":"[PATCH] fall back to mozilla's sha.h if openssl/sha.h is not available","fromName":"martin f. krafft","fromEmail":"madduck@madduck.net","sentAt":"2007-07-14T09:25:18Z","receivedAt":"2007-07-14T09:25:18Z","isPatch":true,"sender":{"key":"madduck@madduck.net","avatar":null},"body":"Uses $(CPP) to attempt to preprocess an include <openssl/sha.h> directive. If\nthat fails, NO_OPENSSL is defined, causing the Makefile to fall back to using\nmozilla's SHA implementation.\n\nThis should possibly go to configure.ac, but maybe *also* to Makefile to make\nfrom-source compilations easier. git HEAD already comes with a Makefile (rather\nthan a Makefile.in), so I just ran it while testing out patches. I introduced\nthe test because I thought the computer could find out about libssl for me,\nrather than myself having to forget to specify NO_OPENSSL every time.\n\nSigned-off-by: martin f. krafft <madduck@madduck.net>\n---\n Makefile |    6 ++++++\n 1 files changed, 6 insertions(+), 0 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex d7541b4..1676343 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -532,6 +532,12 @@ ifndef NO_CURL\n \tendif\n endif\n \n+HAS_OPENSSL := $(shell echo \"\\#include <openssl/sha.h>\" \\\n+\t\t\t| $(CPP) -o/dev/null - 2>/dev/null || echo no)\n+ifeq \"$(HAS_OPENSSL)\" \"no\"\n+\tNO_OPENSSL = \"openssl_sha.h_not_found\"\n+endif\n+\n ifndef NO_OPENSSL\n \tOPENSSL_LIBSSL = -lssl\n \tifdef OPENSSLDIR\n-- \n1.5.3.rc1.9.gf029\n"}]}