{"thread":{"id":"40485","subject":"[PATCH v2 1/1] Makefile: make curl-config path configurable","startedAt":"2015-10-05T19:20:58Z","lastAt":"2015-10-05T20:25:08Z","messageCount":3,"participants":["Remi Pommarel","Jonathan Nieder"],"isPatch":true,"patchVersion":2,"patchTotal":1},"messages":[{"id":"271152","messageId":"1444072858-24399-1-git-send-email-repk@triplefau.lt","threadId":"40485","inReplyTo":null,"subject":"[PATCH v2 1/1] Makefile: make curl-config path configurable","fromName":"Remi Pommarel","fromEmail":"repk@triplefau.lt","sentAt":"2015-10-05T19:20:58Z","receivedAt":"2015-10-05T19:20:58Z","isPatch":true,"sender":{"key":"repk@triplefau.lt","avatar":"https://avatars.githubusercontent.com/u/6833759?v=4"},"body":"There are situations, ie during cross compilation, where curl-config program\nis not present in the PATH.\n\nMake the makefile use a configurable curl-config program passed through\nCURL_CONFIG variable which can be set through config.mak.\n\nAlso make this variable tunable through use of autoconf/configure. Configure\nwill set CURL_CONFIG variable in config.mak.autogen to whatever value has been\npassed to ac_cv_prog_CURL_CONFIG.\n\nSigned-off-by: Remi Pommarel <repk@triplefau.lt>\n---\n Makefile     |  9 +++++++--\n configure.ac | 13 +++++++++++++\n 2 files changed, 20 insertions(+), 2 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex ce0cfe2..59528b4 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -39,6 +39,10 @@ all::\n # Define CURLDIR=/foo/bar if your curl header and library files are in\n # /foo/bar/include and /foo/bar/lib directories.\n #\n+# Define CURL_CONFIG to curl's configuration program that gives informations\n+# about the library (ie curl's version, cflags, ...) . If not set it defaults\n+# to 'curl-config'.\n+#\n # Define NO_EXPAT if you do not have expat installed.  git-http-push is\n # not built, and you cannot push using http:// and https:// transports (dumb).\n #\n@@ -374,6 +378,7 @@ LDFLAGS =\n ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS)\n ALL_LDFLAGS = $(LDFLAGS)\n STRIP ?= strip\n+CURL_CONFIG = curl-config\n \n # Among the variables below, these:\n #   gitexecdir\n@@ -1059,13 +1064,13 @@ else\n \tREMOTE_CURL_NAMES = $(REMOTE_CURL_PRIMARY) $(REMOTE_CURL_ALIASES)\n \tPROGRAM_OBJS += http-fetch.o\n \tPROGRAMS += $(REMOTE_CURL_NAMES)\n-\tcurl_check := $(shell (echo 070908; curl-config --vernum | sed -e '/^70[BC]/s/^/0/') 2>/dev/null | sort -r | sed -ne 2p)\n+\tcurl_check := $(shell (echo 070908; $(CURL_CONFIG) --vernum | sed -e '/^70[BC]/s/^/0/') 2>/dev/null | sort -r | sed -ne 2p)\n \tifeq \"$(curl_check)\" \"070908\"\n \t\tifndef NO_EXPAT\n \t\t\tPROGRAM_OBJS += http-push.o\n \t\tendif\n \tendif\n-\tcurl_check := $(shell (echo 072200; curl-config --vernum | sed -e '/^70[BC]/s/^/0/') 2>/dev/null | sort -r | sed -ne 2p)\n+\tcurl_check := $(shell (echo 072200; $(CURL_CONFIG) --vernum | sed -e '/^70[BC]/s/^/0/') 2>/dev/null | sort -r | sed -ne 2p)\n \tifeq \"$(curl_check)\" \"072200\"\n \t\tUSE_CURL_FOR_IMAP_SEND = YesPlease\n \tendif\ndiff --git a/configure.ac b/configure.ac\nindex 14012fa..01b07ad 100644\n--- a/configure.ac\n+++ b/configure.ac\n@@ -525,6 +525,19 @@ GIT_UNSTASH_FLAGS($CURLDIR)\n \n GIT_CONF_SUBST([NO_CURL])\n \n+if test -z \"$NO_CURL\"; then\n+\n+AC_CHECK_PROG([CURL_CONFIG], [curl-config],\n+[curl-config],\n+[no])\n+\n+if test $CURL_CONFIG != no; then\n+    GIT_CONF_SUBST([CURL_CONFIG])\n+fi\n+\n+fi\n+\n+\n #\n # Define NO_EXPAT if you do not have expat installed.  git-http-push is\n # not built, and you cannot push using http:// and https:// transports.\n-- \n2.0.1\n"},{"id":"271154","messageId":"20151005193127.GC11993@google.com","threadId":"40485","inReplyTo":"1444072858-24399-1-git-send-email-repk@triplefau.lt","subject":"Re: [PATCH v2 1/1] Makefile: make curl-config path configurable","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2015-10-05T19:31:27Z","receivedAt":"2015-10-05T19:31:27Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Remi Pommarel wrote:\n\n> There are situations, ie during cross compilation, where curl-config program\n> is not present in the PATH.\n\ns/ie/e.g.,/\n\n[...]\n> @@ -374,6 +378,7 @@ LDFLAGS =\n>  ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS)\n>  ALL_LDFLAGS = $(LDFLAGS)\n>  STRIP ?= strip\n> +CURL_CONFIG = curl-config\n\nCould this go down with the other programs (CC, AR, FIND, et al)?\n\nThe rest looks good.\n\nJonathan\n"},{"id":"271162","messageId":"20151005202508.GB386@cruxbox","threadId":"40485","inReplyTo":"20151005193127.GC11993@google.com","subject":"Re: [PATCH v2 1/1] Makefile: make curl-config path configurable","fromName":"Remi Pommarel","fromEmail":"repk@triplefau.lt","sentAt":"2015-10-05T20:25:08Z","receivedAt":"2015-10-05T20:25:08Z","isPatch":true,"sender":{"key":"repk@triplefau.lt","avatar":"https://avatars.githubusercontent.com/u/6833759?v=4"},"body":"On Mon, Oct 05, 2015 at 12:31:27PM -0700, Jonathan Nieder wrote:\n> Remi Pommarel wrote:\n> \n> > There are situations, ie during cross compilation, where curl-config program\n> > is not present in the PATH.\n> \n> s/ie/e.g.,/\n\nOups sorry about that.\n\n> \n> [...]\n> > @@ -374,6 +378,7 @@ LDFLAGS =\n> >  ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS)\n> >  ALL_LDFLAGS = $(LDFLAGS)\n> >  STRIP ?= strip\n> > +CURL_CONFIG = curl-config\n> \n> Could this go down with the other programs (CC, AR, FIND, et al)?\n\nYes sure that makes sense. I'll resend a modified patch, thanks\n\n-- \nRémi\n"}]}