git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nick Hengeveld <nickh@reactrix.com>
To: git@vger.kernel.org
Subject: [PATCH] Decide whether to build http-push in the Makefile
Date: Fri, 18 Nov 2005 17:08:36 -0800	[thread overview]
Message-ID: <20051119010836.GL3968@reactrix.com> (raw)

The decision about whether to build http-push or not belongs in the
Makefile.  This follows Junio's suggestion to determine whether curl
is new enough to support http-push.

Signed-off-by: Nick Hengeveld <nickh@reactrix.com>


---

I should have thought this through better before I posted the HTTP
refactoring patch set.  Apologies.

I've confirmed that http-push will not build unless
- curl-config is executable from the current PATH
- the --vernum flag is a valid option
- --vernum returns a value at least as recent as 070908


 Makefile    |    9 ++++++---
 http-push.c |    9 ---------
 2 files changed, 6 insertions(+), 12 deletions(-)

applies-to: 769e3c5498df32db6fc5ee764cd999608c6f1d9a
6d56bf9f18c029e15fcfd59fdd65f652961913af
diff --git a/Makefile b/Makefile
index 285b3ed..0efb0b6 100644
--- a/Makefile
+++ b/Makefile
@@ -242,9 +242,12 @@ ifndef NO_CURL
 		CURL_LIBCURL = -lcurl
 	endif
 	PROGRAMS += git-http-fetch$X
-	ifndef NO_EXPAT
-		EXPAT_LIBEXPAT = -lexpat
-		PROGRAMS += git-http-push$X
+	curl_check := $(shell (echo 070908; curl-config --vernum) | sort -r | sed -ne 2p)
+	ifeq "$(curl_check)" "070908"
+		ifndef NO_EXPAT
+			EXPAT_LIBEXPAT = -lexpat
+			PROGRAMS += git-http-push$X
+		endif
 	endif
 endif
 
diff --git a/http-push.c b/http-push.c
index f3c92c9..76c7886 100644
--- a/http-push.c
+++ b/http-push.c
@@ -6,8 +6,6 @@
 #include "blob.h"
 #include "http.h"
 
-#ifdef USE_CURL_MULTI
-
 #include <expat.h>
 
 static const char http_push_usage[] =
@@ -1426,10 +1424,3 @@ int main(int argc, char **argv)
 
 	return rc;
 }
-#else /* ifdef USE_CURL_MULTI */
-int main(int argc, char **argv)
-{
-	fprintf(stderr, "http-push requires curl 7.9.8 or higher.\n");
-	return 1;
-}
-#endif
---
0.99.9.GIT

                 reply	other threads:[~2005-11-19  1:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20051119010836.GL3968@reactrix.com \
    --to=nickh@reactrix.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).