Skip to content

Commit f891587

Browse files
repkgitster
authored andcommitted
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 <[email protected]> Reviewed-by: Jonathan Nieder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9eaa78b commit f891587

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ all::
3939
# Define CURLDIR=/foo/bar if your curl header and library files are in
4040
# /foo/bar/include and /foo/bar/lib directories.
4141
#
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+
#
4245
# Define NO_EXPAT if you do not have expat installed. git-http-push is
4346
# not built, and you cannot push using http:// and https:// transports (dumb).
4447
#
@@ -425,6 +428,7 @@ TCL_PATH = tclsh
425428
TCLTK_PATH = wish
426429
XGETTEXT = xgettext
427430
MSGFMT = msgfmt
431+
CURL_CONFIG = curl-config
428432
PTHREAD_LIBS = -lpthread
429433
PTHREAD_CFLAGS =
430434
GCOV = gcov
@@ -1059,13 +1063,13 @@ else
10591063
REMOTE_CURL_NAMES = $(REMOTE_CURL_PRIMARY) $(REMOTE_CURL_ALIASES)
10601064
PROGRAM_OBJS += http-fetch.o
10611065
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)
10631067
ifeq "$(curl_check)" "070908"
10641068
ifndef NO_EXPAT
10651069
PROGRAM_OBJS += http-push.o
10661070
endif
10671071
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)
10691073
ifeq "$(curl_check)" "072200"
10701074
USE_CURL_FOR_IMAP_SEND = YesPlease
10711075
endif

configure.ac

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,19 @@ GIT_UNSTASH_FLAGS($CURLDIR)
525525

526526
GIT_CONF_SUBST([NO_CURL])
527527

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+
528541
#
529542
# Define NO_EXPAT if you do not have expat installed. git-http-push is
530543
# not built, and you cannot push using http:// and https:// transports.

0 commit comments

Comments
 (0)