git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/2] Makefile: allow static linking against libcurl

From
Dave Borowitz <dborowitz@google.com>
Date
Apr 12, 2014, 23:15 UTC
Message-ID
<1397344502-23459-2-git-send-email-dborowitz@google.com>
In-Reply-To
<1397344502-23459-1-git-send-email-dborowitz@google.com>
Signed-off-by: Dave Borowitz <dborowitz@google.com>
---
 Makefile | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index d6330bc..3c151d3 100644
--- a/Makefile
+++ b/Makefile
@@ -37,6 +37,9 @@ all::
 # Define CURL_CONFIG to the path to a curl-config binary other than the
 # default 'curl-config'.
 #
+# Define CURL_STATIC to statically link libcurl.  Only applies if
+# CURL_CONFIG is used.
+#
 # Define CURLDIR=/foo/bar if your curl header and library files are in
 # /foo/bar/include and /foo/bar/lib directories.  This overrides CURL_CONFIG,
 # but is less robust.
@@ -1139,7 +1142,11 @@ else
 	else
 		CURL_CONFIG ?= curl-config
 		BASIC_CFLAGS += $(shell $(CURL_CONFIG) --cflags)
-		CURL_LIBCURL = $(shell $(CURL_CONFIG) --libs)
+		ifdef CURL_STATIC
+			CURL_LIBCURL = $(shell $(CURL_CONFIG) --static-libs)
+		else
+			CURL_LIBCURL = $(shell $(CURL_CONFIG) --libs)
+		endif
 		ifeq "$(CURL_LIBCURL)" ""
 			$(error curl not detected; try setting CURLDIR)
 		endif
-- 
1.9.1.423.g4596e3a
Previous: Dave BorowitzNext: Junio C Hamano
Message 2 of 5 in “Makefile: use curl-config to determine curl flags”
  1. 1/2 Makefile: use curl-config to determine curl flagsDave Borowitz, Apr 12, 2014
  2. 2/2 Makefile: allow static linking against libcurlDave Borowitz, Apr 12, 2014
  3. Junio C HamanoApr 14, 2014
  4. Dave BorowitzApr 15, 2014
  5. Junio C HamanoApr 15, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.