{"thread":{"id":"9032","subject":"[PATCH] fall back to mozilla's sha.h if openssl/sha.h is not available","startedAt":"2007-07-14T09:24:37Z","lastAt":"2007-07-14T15:12:31Z","messageCount":4,"participants":["martin f. krafft","Alex Riesen","martin f krafft"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"47337","messageId":"11844050771857-git-send-email-madduck@madduck.net","threadId":"9032","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:24:37Z","receivedAt":"2007-07-14T09:24:37Z","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"},{"id":"47355","messageId":"20070714142350.GB2544@steel.home","threadId":"9032","inReplyTo":"11844050771857-git-send-email-madduck@madduck.net","subject":"Re: [PATCH] fall back to mozilla's sha.h if openssl/sha.h is not available","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2007-07-14T14:23:50Z","receivedAt":"2007-07-14T14:23:50Z","isPatch":true,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"martin f. krafft, Sat, Jul 14, 2007 11:24:37 +0200:\n> This should possibly go to configure.ac, but maybe *also* to Makefile to make\n\nDefinitely. It should it least skip the test if NO_OPENSSL is already\ndefined.\n\n> from-source compilations easier. git HEAD already comes with a Makefile (rather\n> than a Makefile.in), so I just ran it while testing out patches. I introduced\n> the test because I thought the computer could find out about libssl for me,\n> rather than myself having to forget to specify NO_OPENSSL every time.\n\nYou can simply create a config.mak and put NO_OPENSSL=Yes in it.\nIt gets included from Makefile.\n"},{"id":"47357","messageId":"20070714145013.GA14488@piper.oerlikon.madduck.net","threadId":"9032","inReplyTo":"20070714142350.GB2544@steel.home","subject":"Re: [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-14T14:50:13Z","receivedAt":"2007-07-14T14:50:13Z","isPatch":true,"sender":{"key":"madduck@madduck.net","avatar":null},"body":"also sprach Alex Riesen <raa.lkml@gmail.com> [2007.07.14.1623 +0200]:\n> > This should possibly go to configure.ac, but maybe *also* to Makefile to make\n> \n> Definitely. It should it least skip the test if NO_OPENSSL is already\n> defined.\n\nReading this as a yes, here is the patch adding this. I'll wait for\na few days before submitting a squashed patch to Junio then. If you\noppose, please speak up.\n\nMy autotools knowledge is limited, but I might then look at adding\nthe fall back to configure.ac too.\n\nBtw: I've done a lot of things wrong on this mailing list already,\nfor which I'd like to apologise. Thanks to those who told me\nprivately off my faux pas. I hope those won't be necessary anymore.\n\n\n\ncommit c8cbe9e5a44174baabe17152d575b3ee46b82c36\nAuthor: martin f. krafft <madduck@madduck.net>\nDate:   Sat Jul 14 16:44:46 2007 +0200\n\n    skip the openssl/sha.h test if NO_OPENSSL is already defined\n\ndiff --git a/Makefile b/Makefile\nindex 1676343..b0ce7f0 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -532,10 +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+ifndef NO_OPENSSL\n+\tHAS_OPENSSL := $(shell echo \"\\#include <openssl/sha.h>\" \\\n+\t\t\t\t| $(CPP) -o/dev/null - 2>/dev/null || echo no)\n+\tifeq \"$(HAS_OPENSSL)\" \"no\"\n+\t\tNO_OPENSSL = \"openssl_sha.h_not_found\"\n+\tendif\n endif\n \n ifndef NO_OPENSSL\n\n-- \nmartin;              (greetings from the heart of the sun.)\n  \\____ echo mailto: !#^.\"<*>\"|tr \"<*> mailto:\" net@madduck\n \nspamtraps: madduck.bogus@madduck.net\n \n\"one should never do anything that\n one cannot talk about after dinner.\"\n                                                        -- oscar wilde\n"},{"id":"47358","messageId":"20070714151231.GD2544@steel.home","threadId":"9032","inReplyTo":"20070714145013.GA14488@piper.oerlikon.madduck.net","subject":"Re: [PATCH] fall back to mozilla's sha.h if openssl/sha.h is not available","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2007-07-14T15:12:31Z","receivedAt":"2007-07-14T15:12:31Z","isPatch":true,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"martin f krafft, Sat, Jul 14, 2007 16:50:13 +0200:\n> also sprach Alex Riesen <raa.lkml@gmail.com> [2007.07.14.1623 +0200]:\n> > > This should possibly go to configure.ac, but maybe *also* to Makefile to make\n> > \n> > Definitely. It should it least skip the test if NO_OPENSSL is already\n> > defined.\n> \n> Reading this as a yes, here is the patch adding this. ...\n\nI was not clear. Read it as NO.\n\n> My autotools knowledge is limited, but I might then look at adding\n> the fall back to configure.ac too.\n\nSome (me, for one) will consider it the only place where it should be\n\n> Btw: I've done a lot of things wrong on this mailing list already,\n> for which I'd like to apologise. Thanks to those who told me\n> privately off my faux pas. I hope those won't be necessary anymore.\n\nIf I were you, I would have considered CPPFLAGS and CFLAGS and added a\ncheck if HAS_OPENSSL already set.\n\nAnd BTW doesn't it strike you as a little bit odd that noone has done\nthat in Makefile before you? Could that be because configure is\nconsidered the _right_ place for this kind of stuff?\n"}]}