curl / Mailing Lists / curl-users / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: Static binary of curl including libssh2 for sftp/scp support

From: toby via curl-users <curl-users_at_cool.haxx.se>
Date: Thu, 15 Aug 2019 06:25:21 -0600

i don't think you can build a real static curl - you can do it for external libs but still needs glibc at runtime for nsswitch ?

On Thu, 15 Aug 2019 08:33:33 +0200
Malte Schmidt via curl-users <curl-users_at_cool.haxx.se> wrote:

> Hello,
>
> I am currently trying to build a static curl binary on alpine using musl
> like this:
>
> apk add gcc make musl-dev openssl-dev libssh2-dev
> wget https://curl.haxx.se/download/curl-7.63.0.tar.xz
> tar xvfJ curl-7.63.0.tar.xz
> cd curl-7.63
> ./configure --disable-shared
> make curl_LDFLAGS=-all-static
>
> This results in a static binary but without sftp/scp support, so:
>
> apk add gcc make musl-dev openssl-dev libssh2-dev
> wget https://curl.haxx.se/download/curl-7.63.0.tar.xz
> tar xvfJ curl-7.63.0.tar.xz
> cd curl-7.63
> ./configure --disable-shared --with-libssh2
> make curl_LDFLAGS=-all-static
>
> This automatically compiles a curl binary, which is dynamically linked.
>
> Now, what is the most clean and elegant way of creating a static curl
> binary which includes libssh2 and therefore sftp/scp support?
>
> Thanks in advance and best regards!
>
>

-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2019-08-15