Makefile: make curl-config path configurable

There are situations, e.g. during cross compilation, where curl-config program is not present in the PATH. Make the makefile use a configurable curl-config program passed through CURL_CONFIG variable which can be set through config.mak. Also make this variable tunable through use of autoconf/configure. Configure will set CURL_CONFIG variable in config.mak.autogen to whatever value has been passed to ac_cv_prog_CURL_CONFIG. Signed-off-by: Remi Pommarel <repk@triplefau.lt> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Remi Pommarel committed Oct 21, 2015 at 19:10 UTC f89158760d5f02ba59f644799abd921e6be22f13
2 files changed +19 -2
Makefile
+6 -2
@@ -39,6 +39,9 @@ all::
39 # Define CURLDIR=/foo/bar if your curl header and library files are in
40 # /foo/bar/include and /foo/bar/lib directories.
41 #
42 +# Define CURL_CONFIG to curl's configuration program that prints information
43 +# about the library (e.g., its version number). The default is 'curl-config'.
44 +#
45 # Define NO_EXPAT if you do not have expat installed. git-http-push is
46 # not built, and you cannot push using http:// and https:// transports (dumb).
47 #
@@ -425,6 +428,7 @@ TCL_PATH = tclsh
428 TCLTK_PATH = wish
429 XGETTEXT = xgettext
430 MSGFMT = msgfmt
431 +CURL_CONFIG = curl-config
432 PTHREAD_LIBS = -lpthread
433 PTHREAD_CFLAGS =
434 GCOV = gcov
@@ -1059,13 +1063,13 @@ else
1063 REMOTE_CURL_NAMES = $(REMOTE_CURL_PRIMARY) $(REMOTE_CURL_ALIASES)
1064 PROGRAM_OBJS += http-fetch.o
1065 PROGRAMS += $(REMOTE_CURL_NAMES)
1062 - curl_check := $(shell (echo 070908; curl-config --vernum | sed -e '/^70[BC]/s/^/0/') 2>/dev/null | sort -r | sed -ne 2p)
1066 + curl_check := $(shell (echo 070908; $(CURL_CONFIG) --vernum | sed -e '/^70[BC]/s/^/0/') 2>/dev/null | sort -r | sed -ne 2p)
1067 ifeq "$(curl_check)" "070908"
1068 ifndef NO_EXPAT
1069 PROGRAM_OBJS += http-push.o
1070 endif
1071 endif
1068 - curl_check := $(shell (echo 072200; curl-config --vernum | sed -e '/^70[BC]/s/^/0/') 2>/dev/null | sort -r | sed -ne 2p)
1072 + curl_check := $(shell (echo 072200; $(CURL_CONFIG) --vernum | sed -e '/^70[BC]/s/^/0/') 2>/dev/null | sort -r | sed -ne 2p)
1073 ifeq "$(curl_check)" "072200"
1074 USE_CURL_FOR_IMAP_SEND = YesPlease
1075 endif
configure.ac
+13
@@ -525,6 +525,19 @@ GIT_UNSTASH_FLAGS($CURLDIR)
525
526 GIT_CONF_SUBST([NO_CURL])
527
528 +if test -z "$NO_CURL"; then
529 +
530 +AC_CHECK_PROG([CURL_CONFIG], [curl-config],
531 +[curl-config],
532 +[no])
533 +
534 +if test $CURL_CONFIG != no; then
535 + GIT_CONF_SUBST([CURL_CONFIG])
536 +fi
537 +
538 +fi
539 +
540 +
541 #
542 # Define NO_EXPAT if you do not have expat installed. git-http-push is
543 # not built, and you cannot push using http:// and https:// transports.