{"thread":{"id":"40423","subject":"[PATCH 1/1] configure: make curl-config path configurable","startedAt":"2015-09-24T19:50:43Z","lastAt":"2015-09-25T00:21:48Z","messageCount":2,"participants":["Remi Pommarel","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":1},"messages":[{"id":"270648","messageId":"1443124243-15134-1-git-send-email-repk@triplefau.lt","threadId":"40423","inReplyTo":null,"subject":"[PATCH 1/1] configure: make curl-config path configurable","fromName":"Remi Pommarel","fromEmail":"repk@triplefau.lt","sentAt":"2015-09-24T19:50:43Z","receivedAt":"2015-09-24T19:50:43Z","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 configure check that a custom curl-config program is passed by the user\nthrough ac_cv_prog_CURL_CONFIG then set CURL_CONFIG variable accordingly in\nconfig.mak.autogen. Makefile uses this variable to get the target's curl\nconfiguration program.\n\nSigned-off-by: Remi Pommarel <repk@triplefau.lt>\n---\n Makefile     |  5 +++--\n configure.ac | 10 ++++++++++\n 2 files changed, 13 insertions(+), 2 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex ce0cfe2..81ac5bb 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -374,6 +374,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 +1060,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..acc23fb 100644\n--- a/configure.ac\n+++ b/configure.ac\n@@ -525,6 +525,16 @@ 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], [curl-config], [no])\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":"270729","messageId":"xmqqio6zuz4z.fsf@gitster.mtv.corp.google.com","threadId":"40423","inReplyTo":"1443124243-15134-1-git-send-email-repk@triplefau.lt","subject":"Re: [PATCH 1/1] configure: make curl-config path configurable","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-09-25T00:21:48Z","receivedAt":"2015-09-25T00:21:48Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Remi Pommarel <repk@triplefau.lt> writes:\n\n> There are situations, ie during cross compilation, where curl-config program\n> is not present in the PATH.\n>\n> Make configure check that a custom curl-config program is passed by the user\n> through ac_cv_prog_CURL_CONFIG then set CURL_CONFIG variable accordingly in\n> config.mak.autogen. Makefile uses this variable to get the target's curl\n> configuration program.\n>\n> Signed-off-by: Remi Pommarel <repk@triplefau.lt>\n> ---\n>  Makefile     |  5 +++--\n>  configure.ac | 10 ++++++++++\n>  2 files changed, 13 insertions(+), 2 deletions(-)\n>\n> diff --git a/Makefile b/Makefile\n> index ce0cfe2..81ac5bb 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -374,6 +374,7 @@ LDFLAGS =\n>  ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS)\n>  ALL_LDFLAGS = $(LDFLAGS)\n>  STRIP ?= strip\n> +CURL_CONFIG=curl-config\n\ns/.*/CURL_CONFIG = curl-config/;\n\nPlease also add description in the early part of Makefile, perhaps\nright after it explains CURLDIR=/foo/bar.\n\nThe officially supported way to tweak the build is to define these\nvariables by whatever means, and use of autoconf/configure is merely\none optional way of doing so.  Other people need to know what can be\ntweaked and how, and even those who chose to use autoconf/configure\nwould need to know when autoconf/configure did not work correctly.\n\nThanks.\n\n>  # Among the variables below, these:\n>  #   gitexecdir\n> @@ -1059,13 +1060,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\n> diff --git a/configure.ac b/configure.ac\n> index 14012fa..acc23fb 100644\n> --- a/configure.ac\n> +++ b/configure.ac\n> @@ -525,6 +525,16 @@ 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], [curl-config], [no])\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"}]}