How to build from source code


Where can I find the source code and instructions for building

I’m working on a project that needs I am required to build it from source code – I am not allowed to simply install it with "apt-get install libcurl". Unfortunately, my google-fu is failing me and I can’t find a source code repository or instructions to build anywhere.

Here’s what I have found:

Linux-from-scratch has well-documented instructions for building, here: That lets me build with gnutls, but not

The curl website (, has detailed instructions on its various options here: Those show me how to build libcurl with gnutls, but the end product is still, not

When I run ldd -r on my project, it identifies the functions it needs (curl_easy_init, curl_easy_setopt, curl_easy_perform, and curl_easy_cleanup). I can find those symbols in both and a pre-built This leads me to suspect that is, published under a different name. However, renaming to is not sufficient to meet the dependency requirements. I could try altering the libcurl project to set its name and version to libcurl-gnutls (not that I know how to do it – I would poke around until I figure it out), but I don’t know how appropriate that would be.

I found one other question on Stack Overflow about libcurl-gnutls (How to create lib, but the answers to that are to install a pre-built version via apt-get install, which I am not allowed to do.


Here’s a complete answer cobbled together from everyone’s input (Thanks especially to Knud Larsen and Wassim Dhif): is just built with gnutls support. Archives for the project are here:

  1. Change the SONAME that is built with by editing to change:

     if test -n "$soname_spec";
     then eval soname=\"$soname_spec\"


    if test -n "$soname_spec"; then

I’m sure there’s a more elegant way to do it, but this works and I need to move on.

Alternatively, you can modify the the SONAME after is built with:

    patchelf –set-soname
  1. Check your client (the program or shared library that requires as a dependency), to see if it requires version information.
    For instance, when I run objdump -p myprogram, I get this:

     Version References:
     required from
     0x0b103d23 0x00 14 CURL_GNUTLS_3

To build with this version information:

2a. Set the version information to version 3:
In lib/ change:




2b. Use --enable-versioned-symbols when configuring the libcurl project. This adds the required version information.

./configure --with-gnutls --enable-versioned-symbols [other arguments as needed]

The final product may be named, but can be renamed. It will have its SONAME set to and will have the required version information.

Answered By – user3149991

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published