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

Git configure with static curl is failing

From
Paul Smith <paul@mad-scientist.net>
Date
Apr 26, 2020, 19:01 UTC
Message-ID
<9d9fe8376e47a9f5330cd644c76d96987fc67c57.camel@mad-scientist.net>
Hi all;

I'm trying to build Git with my own static curl, not the system curl, and this isn't working due to an issue in configure.ac's curl locating code.

I invoke configure with --with-curl=/other/curl where /other/curl/include/curl and /other/curl/lib/libcurl.a and /other/curl/bin/curl-config all exist and work correctly.

When configure.ac attempts to local curl, it fails; config.log shows:
  configure:5387: my-gcc -o conftest -O2 \
   -I/other/curl/include -L/other/curl/lib conftest.c -lcurl >&5
  /other/curl/lib/libcurl.a(libcurl_la-content_encoding.o):content_encoding.c:function gzip_init_writer: error: undefined reference to 'zlibVersion'

and many other errors, because the link line is missing needed libraries. If curl as a .so this wouldn't matter since libcurl.so would contain references to the libraries it needs and ld.so would handle this, but a static library obviously doesn't have that.

The problem appears to be that configure.ac is not using curl-config to obtain the correct options to link with curl. If I run /other/curl/bin/curl-config --lib I get the proper flags:

  $ /other/curl/bin/curl-config --libs
  -L/other/curl/lib -lcurl -lssl -lz -lcrypto -ldl -lpthread

If configure.ac tried to use $CURLDIR/bin/curl-config --libs to obtain the right linker options, then the link test for curl would work.

Next: brian m. carlson
Message 1 of 4 in “Git configure with static curl is failing”
  1. Paul SmithApr 26, 2020
  2. brian m. carlsonApr 26, 2020
  3. Jeff KingApr 26, 2020
  4. Paul SmithApr 29, 2020

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.