git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fall back to mozilla's sha.h if openssl/sha.h is not available
@ 2007-07-14  9:24 martin f. krafft
  2007-07-14 14:23 ` Alex Riesen
  0 siblings, 1 reply; 5+ messages in thread
From: martin f. krafft @ 2007-07-14  9:24 UTC (permalink / raw)
  To: git; +Cc: martin f. krafft

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 <madduck@madduck.net>
---
 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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH] fall back to mozilla's sha.h if openssl/sha.h is not available
@ 2007-07-14  9:25 martin f. krafft
  0 siblings, 0 replies; 5+ messages in thread
From: martin f. krafft @ 2007-07-14  9:25 UTC (permalink / raw)
  To: git

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 <madduck@madduck.net>
---
 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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] fall back to mozilla's sha.h if openssl/sha.h is not available
  2007-07-14  9:24 martin f. krafft
@ 2007-07-14 14:23 ` Alex Riesen
  2007-07-14 14:50   ` martin f krafft
  0 siblings, 1 reply; 5+ messages in thread
From: Alex Riesen @ 2007-07-14 14:23 UTC (permalink / raw)
  To: martin f. krafft; +Cc: git

martin f. krafft, Sat, Jul 14, 2007 11:24:37 +0200:
> This should possibly go to configure.ac, but maybe *also* to Makefile to make

Definitely. It should it least skip the test if NO_OPENSSL is already
defined.

> 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.

You can simply create a config.mak and put NO_OPENSSL=Yes in it.
It gets included from Makefile.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] fall back to mozilla's sha.h if openssl/sha.h is not available
  2007-07-14 14:23 ` Alex Riesen
@ 2007-07-14 14:50   ` martin f krafft
  2007-07-14 15:12     ` Alex Riesen
  0 siblings, 1 reply; 5+ messages in thread
From: martin f krafft @ 2007-07-14 14:50 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 1834 bytes --]

also sprach Alex Riesen <raa.lkml@gmail.com> [2007.07.14.1623 +0200]:
> > This should possibly go to configure.ac, but maybe *also* to Makefile to make
> 
> Definitely. It should it least skip the test if NO_OPENSSL is already
> defined.

Reading this as a yes, here is the patch adding this. I'll wait for
a few days before submitting a squashed patch to Junio then. If you
oppose, please speak up.

My autotools knowledge is limited, but I might then look at adding
the fall back to configure.ac too.

Btw: I've done a lot of things wrong on this mailing list already,
for which I'd like to apologise. Thanks to those who told me
privately off my faux pas. I hope those won't be necessary anymore.



commit c8cbe9e5a44174baabe17152d575b3ee46b82c36
Author: martin f. krafft <madduck@madduck.net>
Date:   Sat Jul 14 16:44:46 2007 +0200

    skip the openssl/sha.h test if NO_OPENSSL is already defined

diff --git a/Makefile b/Makefile
index 1676343..b0ce7f0 100644
--- a/Makefile
+++ b/Makefile
@@ -532,10 +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"
+ifndef NO_OPENSSL
+	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
 endif
 
 ifndef NO_OPENSSL

-- 
martin;              (greetings from the heart of the sun.)
  \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck
 
spamtraps: madduck.bogus@madduck.net
 
"one should never do anything that
 one cannot talk about after dinner."
                                                        -- oscar wilde

[-- Attachment #2: Digital signature (GPG/PGP) --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] fall back to mozilla's sha.h if openssl/sha.h is not available
  2007-07-14 14:50   ` martin f krafft
@ 2007-07-14 15:12     ` Alex Riesen
  0 siblings, 0 replies; 5+ messages in thread
From: Alex Riesen @ 2007-07-14 15:12 UTC (permalink / raw)
  To: git

martin f krafft, Sat, Jul 14, 2007 16:50:13 +0200:
> also sprach Alex Riesen <raa.lkml@gmail.com> [2007.07.14.1623 +0200]:
> > > This should possibly go to configure.ac, but maybe *also* to Makefile to make
> > 
> > Definitely. It should it least skip the test if NO_OPENSSL is already
> > defined.
> 
> Reading this as a yes, here is the patch adding this. ...

I was not clear. Read it as NO.

> My autotools knowledge is limited, but I might then look at adding
> the fall back to configure.ac too.

Some (me, for one) will consider it the only place where it should be

> Btw: I've done a lot of things wrong on this mailing list already,
> for which I'd like to apologise. Thanks to those who told me
> privately off my faux pas. I hope those won't be necessary anymore.

If I were you, I would have considered CPPFLAGS and CFLAGS and added a
check if HAS_OPENSSL already set.

And BTW doesn't it strike you as a little bit odd that noone has done
that in Makefile before you? Could that be because configure is
considered the _right_ place for this kind of stuff?

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-07-14 15:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-14  9:25 [PATCH] fall back to mozilla's sha.h if openssl/sha.h is not available martin f. krafft
  -- strict thread matches above, loose matches on Subject: below --
2007-07-14  9:24 martin f. krafft
2007-07-14 14:23 ` Alex Riesen
2007-07-14 14:50   ` martin f krafft
2007-07-14 15:12     ` Alex Riesen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).