summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJames Knight <james.d.knight@live.com>2018-11-03 05:12:11 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-11-05 01:19:25 (GMT)
commit23c4bbe28e61974577164db09cbd1d1c7e568ca4 (patch)
tree9669d56595c17501d83735e1b9043c88b12e7053 /Makefile
parentd582ea202b626dcc6c3b01e1e11a296d9badd730 (diff)
downloadgit-23c4bbe28e61974577164db09cbd1d1c7e568ca4.zip
git-23c4bbe28e61974577164db09cbd1d1c7e568ca4.tar.gz
git-23c4bbe28e61974577164db09cbd1d1c7e568ca4.tar.bz2
build: link with curl-defined linker flags
Adjusting the build process to rely more on curl-config to populate linker flags instead of manually populating flags based off detected features. Originally, a configure-invoked build would check for SSL-support in the target curl library. If enabled, NEEDS_SSL_WITH_CURL would be set and used in the Makefile to append additional libraries to link against. As for systems building solely with make, the defines NEEDS_IDN_WITH_CURL and NEEDS_SSL_WITH_CURL could be set to indirectly enable respective linker flags. Since both configure.ac and Makefile already rely on curl-config utility to provide curl-related build information, adjusting the respective assets to populate required linker flags using the utility (unless explicitly configured). Signed-off-by: James Knight <james.d.knight@live.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile30
1 files changed, 15 insertions, 15 deletions
diff --git a/Makefile b/Makefile
index bbfbb42..ad005af 100644
--- a/Makefile
+++ b/Makefile
@@ -59,6 +59,13 @@ all::
# Define CURL_CONFIG to curl's configuration program that prints information
# about the library (e.g., its version number). The default is 'curl-config'.
#
+# Define CURL_LDFLAGS to specify flags that you need to link when using libcurl,
+# if you do not want to rely on the libraries provided by CURL_CONFIG. The
+# default value is a result of `curl-config --libs`. An example value for
+# CURL_LDFLAGS is as follows:
+#
+# CURL_LDFLAGS=-lcurl
+#
# 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).
#
@@ -183,10 +190,6 @@ all::
#
# Define NEEDS_SSL_WITH_CRYPTO if you need -lssl when using -lcrypto (Darwin).
#
-# Define NEEDS_SSL_WITH_CURL if you need -lssl with -lcurl (Minix).
-#
-# Define NEEDS_IDN_WITH_CURL if you need -lidn when using -lcurl (Minix).
-#
# Define NEEDS_LIBICONV if linking with libc is not enough (Darwin).
#
# Define NEEDS_LIBINTL_BEFORE_LIBICONV if you need libintl before libiconv.
@@ -1307,20 +1310,17 @@ else
ifdef CURLDIR
# Try "-Wl,-rpath=$(CURLDIR)/$(lib)" in such a case.
BASIC_CFLAGS += -I$(CURLDIR)/include
- CURL_LIBCURL = -L$(CURLDIR)/$(lib) $(CC_LD_DYNPATH)$(CURLDIR)/$(lib) -lcurl
+ CURL_LIBCURL = -L$(CURLDIR)/$(lib) $(CC_LD_DYNPATH)$(CURLDIR)/$(lib)
else
- CURL_LIBCURL = -lcurl
- endif
- ifdef NEEDS_SSL_WITH_CURL
- CURL_LIBCURL += -lssl
- ifdef NEEDS_CRYPTO_WITH_SSL
- CURL_LIBCURL += -lcrypto
- endif
- endif
- ifdef NEEDS_IDN_WITH_CURL
- CURL_LIBCURL += -lidn
+ CURL_LIBCURL =
endif
+ifdef CURL_LDFLAGS
+ CURL_LIBCURL += $(CURL_LDFLAGS)
+else
+ CURL_LIBCURL += $(shell $(CURL_CONFIG) --libs)
+endif
+
REMOTE_CURL_PRIMARY = git-remote-http$X
REMOTE_CURL_ALIASES = git-remote-https$X git-remote-ftp$X git-remote-ftps$X
REMOTE_CURL_NAMES = $(REMOTE_CURL_PRIMARY) $(REMOTE_CURL_ALIASES)