[darcs-users] darcs patch: Use `curl-config --static-libs` when building with sta...

Dmitry Kurochkin dmitry.kurochkin at gmail.com
Sat May 3 21:09:18 UTC 2008


Hi.

I was able to build statically linked darcs on debian.

1. Build a custom static libcurl without GSSAPI. AFAIK it does not
support static library, so you can not build working static libcurl
with GSSAPI. That is why libcurl from debian, ubuntu (maybe others)
distros do not work. I used the following configure parameters for
libcurl:

./configure --enable-ares --without-libidn --disable-ldap

This builds static libcurl with openssl and c-ares (at least on my system).

2. Then use the new libcurl to build darcs. Do not forget to copy
curl-config somewhere darcs can find it. Unfortunately `curl-config
--static-libs` was not able to detect all required flags, so the final
darcs configure command line looks like:

LDFLAGS=-pthread LIBS=-ldl ./configure --with-static-libs --with-curl-pipelining

-ldl is required for openssl. If you build curl without openssl it
should not be needed.

Not sure why -pthread is required, but linking darcs fails without it.

After that make produces statically linked darcs! On other systems
there can be other tricks required.

Also I have found that check for curl_multi_timeout always fails on
static builds. That happens because AC_CHECK_LIB adds only -lcurl
option, and for static linking that is not enough. Will send a short
patch soon.

Regards,
  Dmitry


More information about the darcs-users mailing list