{"thread":{"id":"40610","subject":"[PATCH v4 1/1] Makefile: make curl-config path configurable","startedAt":"2015-10-21T17:10:46Z","lastAt":"2015-10-21T19:36:39Z","messageCount":2,"participants":["Remi Pommarel","Jonathan Nieder"],"isPatch":true,"patchVersion":4,"patchTotal":1},"messages":[{"id":"272043","messageId":"1445447446-21748-1-git-send-email-repk@triplefau.lt","threadId":"40610","inReplyTo":null,"subject":"[PATCH v4 1/1] Makefile: make curl-config path configurable","fromName":"Remi Pommarel","fromEmail":"repk@triplefau.lt","sentAt":"2015-10-21T17:10:46Z","receivedAt":"2015-10-21T17:10:46Z","isPatch":true,"sender":{"key":"repk@triplefau.lt","avatar":"https://avatars.githubusercontent.com/u/6833759?v=4"},"body":"There are situations, e.g. during cross compilation, where curl-config\nprogram is 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>\nReviewed-by: Jonathan Nieder <jrnieder@gmail.com>\n---\nChanges to v3:\n\t- Add Jonathan Nieder's modifications\n\n Makefile     |  8 ++++++--\n configure.ac | 13 +++++++++++++\n 2 files changed, 19 insertions(+), 2 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 04c2231..7574c26 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -39,6 +39,9 @@ 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 prints information\n+# about the library (e.g., its version number).  The default is '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@@ -428,6 +431,7 @@ TCL_PATH = tclsh\n TCLTK_PATH = wish\n XGETTEXT = xgettext\n MSGFMT = msgfmt\n+CURL_CONFIG = curl-config\n PTHREAD_LIBS = -lpthread\n PTHREAD_CFLAGS =\n GCOV = gcov\n@@ -1066,13 +1070,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":"272052","messageId":"20151021193639.GC7881@google.com","threadId":"40610","inReplyTo":"1445447446-21748-1-git-send-email-repk@triplefau.lt","subject":"Re: [PATCH v4 1/1] Makefile: make curl-config path configurable","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2015-10-21T19:36:39Z","receivedAt":"2015-10-21T19:36:39Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Remi Pommarel wrote:\n\n> Signed-off-by: Remi Pommarel <repk@triplefau.lt>\n> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>\n\nYep. ;)\n\nThanks.\n"}]}