0002-Makefile-make-curl-config-path-configurable.patch 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. From f89158760d5f02ba59f644799abd921e6be22f13 Mon Sep 17 00:00:00 2001
  2. From: Remi Pommarel <repk@triplefau.lt>
  3. Date: Wed, 21 Oct 2015 19:10:46 +0200
  4. Subject: [PATCH 2/3] Makefile: make curl-config path configurable
  5. There are situations, e.g. during cross compilation, where curl-config
  6. program is not present in the PATH.
  7. Make the makefile use a configurable curl-config program passed through
  8. CURL_CONFIG variable which can be set through config.mak.
  9. Also make this variable tunable through use of autoconf/configure. Configure
  10. will set CURL_CONFIG variable in config.mak.autogen to whatever value has been
  11. passed to ac_cv_prog_CURL_CONFIG.
  12. Signed-off-by: Remi Pommarel <repk@triplefau.lt>
  13. Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
  14. Signed-off-by: Junio C Hamano <gitster@pobox.com>
  15. ---
  16. Makefile | 8 ++++++--
  17. configure.ac | 13 +++++++++++++
  18. 2 files changed, 19 insertions(+), 2 deletions(-)
  19. diff --git a/Makefile b/Makefile
  20. index 9787385..64d17d0 100644
  21. --- a/Makefile
  22. +++ b/Makefile
  23. @@ -39,6 +39,9 @@ all::
  24. # Define CURLDIR=/foo/bar if your curl header and library files are in
  25. # /foo/bar/include and /foo/bar/lib directories.
  26. #
  27. +# Define CURL_CONFIG to curl's configuration program that prints information
  28. +# about the library (e.g., its version number). The default is 'curl-config'.
  29. +#
  30. # Define NO_EXPAT if you do not have expat installed. git-http-push is
  31. # not built, and you cannot push using http:// and https:// transports (dumb).
  32. #
  33. @@ -425,6 +428,7 @@ TCL_PATH = tclsh
  34. TCLTK_PATH = wish
  35. XGETTEXT = xgettext
  36. MSGFMT = msgfmt
  37. +CURL_CONFIG = curl-config
  38. PTHREAD_LIBS = -lpthread
  39. PTHREAD_CFLAGS =
  40. GCOV = gcov
  41. @@ -1059,13 +1063,13 @@ else
  42. REMOTE_CURL_NAMES = $(REMOTE_CURL_PRIMARY) $(REMOTE_CURL_ALIASES)
  43. PROGRAM_OBJS += http-fetch.o
  44. PROGRAMS += $(REMOTE_CURL_NAMES)
  45. - curl_check := $(shell (echo 070908; curl-config --vernum | sed -e '/^70[BC]/s/^/0/') 2>/dev/null | sort -r | sed -ne 2p)
  46. + curl_check := $(shell (echo 070908; $(CURL_CONFIG) --vernum | sed -e '/^70[BC]/s/^/0/') 2>/dev/null | sort -r | sed -ne 2p)
  47. ifeq "$(curl_check)" "070908"
  48. ifndef NO_EXPAT
  49. PROGRAM_OBJS += http-push.o
  50. endif
  51. endif
  52. - curl_check := $(shell (echo 072200; curl-config --vernum | sed -e '/^70[BC]/s/^/0/') 2>/dev/null | sort -r | sed -ne 2p)
  53. + curl_check := $(shell (echo 072200; $(CURL_CONFIG) --vernum | sed -e '/^70[BC]/s/^/0/') 2>/dev/null | sort -r | sed -ne 2p)
  54. ifeq "$(curl_check)" "072200"
  55. USE_CURL_FOR_IMAP_SEND = YesPlease
  56. endif
  57. diff --git a/configure.ac b/configure.ac
  58. index 14012fa..01b07ad 100644
  59. --- a/configure.ac
  60. +++ b/configure.ac
  61. @@ -525,6 +525,19 @@ GIT_UNSTASH_FLAGS($CURLDIR)
  62. GIT_CONF_SUBST([NO_CURL])
  63. +if test -z "$NO_CURL"; then
  64. +
  65. +AC_CHECK_PROG([CURL_CONFIG], [curl-config],
  66. +[curl-config],
  67. +[no])
  68. +
  69. +if test $CURL_CONFIG != no; then
  70. + GIT_CONF_SUBST([CURL_CONFIG])
  71. +fi
  72. +
  73. +fi
  74. +
  75. +
  76. #
  77. # Define NO_EXPAT if you do not have expat installed. git-http-push is
  78. # not built, and you cannot push using http:// and https:// transports.
  79. --
  80. 2.0.1