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.

Static binary of curl including libssh2 for sftp/scp support

From: Malte Schmidt <m_at_maltris.org>
Date: Thu, 15 Aug 2019 08:33:33 +0200

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