* [PATCH v2 1/1] Makefile: make curl-config path configurable
@ 2015-10-05 19:20 Remi Pommarel
2015-10-05 19:31 ` Jonathan Nieder
0 siblings, 1 reply; 3+ messages in thread
From: Remi Pommarel @ 2015-10-05 19:20 UTC (permalink / raw)
To: git
Cc: Junio C Hamano, Brandon Casey, Jeff King, Jonathan Nieder,
Remi Pommarel
There are situations, ie 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>
---
Makefile | 9 +++++++--
configure.ac | 13 +++++++++++++
2 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index ce0cfe2..59528b4 100644
--- a/Makefile
+++ b/Makefile
@@ -39,6 +39,10 @@ all::
# Define CURLDIR=/foo/bar if your curl header and library files are in
# /foo/bar/include and /foo/bar/lib directories.
#
+# Define CURL_CONFIG to curl's configuration program that gives informations
+# about the library (ie curl's version, cflags, ...) . If not set it defaults
+# to 'curl-config'.
+#
# Define NO_EXPAT if you do not have expat installed. git-http-push is
# not built, and you cannot push using http:// and https:// transports (dumb).
#
@@ -374,6 +378,7 @@ LDFLAGS =
ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS)
ALL_LDFLAGS = $(LDFLAGS)
STRIP ?= strip
+CURL_CONFIG = curl-config
# Among the variables below, these:
# gitexecdir
@@ -1059,13 +1064,13 @@ else
REMOTE_CURL_NAMES = $(REMOTE_CURL_PRIMARY) $(REMOTE_CURL_ALIASES)
PROGRAM_OBJS += http-fetch.o
PROGRAMS += $(REMOTE_CURL_NAMES)
- curl_check := $(shell (echo 070908; curl-config --vernum | sed -e '/^70[BC]/s/^/0/') 2>/dev/null | sort -r | sed -ne 2p)
+ curl_check := $(shell (echo 070908; $(CURL_CONFIG) --vernum | sed -e '/^70[BC]/s/^/0/') 2>/dev/null | sort -r | sed -ne 2p)
ifeq "$(curl_check)" "070908"
ifndef NO_EXPAT
PROGRAM_OBJS += http-push.o
endif
endif
- curl_check := $(shell (echo 072200; curl-config --vernum | sed -e '/^70[BC]/s/^/0/') 2>/dev/null | sort -r | sed -ne 2p)
+ curl_check := $(shell (echo 072200; $(CURL_CONFIG) --vernum | sed -e '/^70[BC]/s/^/0/') 2>/dev/null | sort -r | sed -ne 2p)
ifeq "$(curl_check)" "072200"
USE_CURL_FOR_IMAP_SEND = YesPlease
endif
diff --git a/configure.ac b/configure.ac
index 14012fa..01b07ad 100644
--- a/configure.ac
+++ b/configure.ac
@@ -525,6 +525,19 @@ GIT_UNSTASH_FLAGS($CURLDIR)
GIT_CONF_SUBST([NO_CURL])
+if test -z "$NO_CURL"; then
+
+AC_CHECK_PROG([CURL_CONFIG], [curl-config],
+[curl-config],
+[no])
+
+if test $CURL_CONFIG != no; then
+ GIT_CONF_SUBST([CURL_CONFIG])
+fi
+
+fi
+
+
#
# Define NO_EXPAT if you do not have expat installed. git-http-push is
# not built, and you cannot push using http:// and https:// transports.
--
2.0.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2 1/1] Makefile: make curl-config path configurable
2015-10-05 19:20 [PATCH v2 1/1] Makefile: make curl-config path configurable Remi Pommarel
@ 2015-10-05 19:31 ` Jonathan Nieder
2015-10-05 20:25 ` Remi Pommarel
0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Nieder @ 2015-10-05 19:31 UTC (permalink / raw)
To: Remi Pommarel; +Cc: git, Junio C Hamano, Brandon Casey, Jeff King
Remi Pommarel wrote:
> There are situations, ie during cross compilation, where curl-config program
> is not present in the PATH.
s/ie/e.g.,/
[...]
> @@ -374,6 +378,7 @@ LDFLAGS =
> ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS)
> ALL_LDFLAGS = $(LDFLAGS)
> STRIP ?= strip
> +CURL_CONFIG = curl-config
Could this go down with the other programs (CC, AR, FIND, et al)?
The rest looks good.
Jonathan
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2 1/1] Makefile: make curl-config path configurable
2015-10-05 19:31 ` Jonathan Nieder
@ 2015-10-05 20:25 ` Remi Pommarel
0 siblings, 0 replies; 3+ messages in thread
From: Remi Pommarel @ 2015-10-05 20:25 UTC (permalink / raw)
To: Jonathan Nieder; +Cc: git, Junio C Hamano, Brandon Casey, Jeff King
On Mon, Oct 05, 2015 at 12:31:27PM -0700, Jonathan Nieder wrote:
> Remi Pommarel wrote:
>
> > There are situations, ie during cross compilation, where curl-config program
> > is not present in the PATH.
>
> s/ie/e.g.,/
Oups sorry about that.
>
> [...]
> > @@ -374,6 +378,7 @@ LDFLAGS =
> > ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS)
> > ALL_LDFLAGS = $(LDFLAGS)
> > STRIP ?= strip
> > +CURL_CONFIG = curl-config
>
> Could this go down with the other programs (CC, AR, FIND, et al)?
Yes sure that makes sense. I'll resend a modified patch, thanks
--
Rémi
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-10-05 20:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-05 19:20 [PATCH v2 1/1] Makefile: make curl-config path configurable Remi Pommarel
2015-10-05 19:31 ` Jonathan Nieder
2015-10-05 20:25 ` Remi Pommarel
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).