@matheusbsbs / matheus-bagliano / commits / 0890098780
Fork 0

Decide whether to build http-push in the Makefile

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> Signed-off-by: Junio C Hamano <junkio@cox.net>

Nick Hengeveld committed Nov 18, 2005 at 17:08 UTC 0890098780f295f2a58658d1f6b6627e40426c72
2 files changed +6 -12
Makefile
+6 -3
@@ -242,9 +242,12 @@ ifndef NO_CURL
242 CURL_LIBCURL = -lcurl
243 endif
244 PROGRAMS += git-http-fetch$X
245 - ifndef NO_EXPAT
246 - EXPAT_LIBEXPAT = -lexpat
247 - PROGRAMS += git-http-push$X
245 + curl_check := $(shell (echo 070908; curl-config --vernum) | sort -r | sed -ne 2p)
246 + ifeq "$(curl_check)" "070908"
247 + ifndef NO_EXPAT
248 + EXPAT_LIBEXPAT = -lexpat
249 + PROGRAMS += git-http-push$X
250 + endif
251 endif
252 endif
253
http-push.c
-9
@@ -6,8 +6,6 @@
6 #include "blob.h"
7 #include "http.h"
8
9 -#ifdef USE_CURL_MULTI
10 -
9 #include <expat.h>
10
11 static const char http_push_usage[] =
@@ -1426,10 +1424,3 @@ int main(int argc, char **argv)
1424
1425 return rc;
1426 }
1429 -#else /* ifdef USE_CURL_MULTI */
1430 -int main(int argc, char **argv)
1431 -{
1432 - fprintf(stderr, "http-push requires curl 7.9.8 or higher.\n");
1433 - return 1;
1434 -}
1435 -#endif