cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Porting libcurl on embedded system with proprietary OS

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Thu, 24 Jul 2014 22:31:00 +0200

On Thu, Jul 24, 2014 at 09:39:00AM -0400, Jon Torrey wrote:
> I am currently attempting to port over libcurl to an ARM-based embedded system
> with a proprietary operating system.  After practicing building on both Linux

Sounds like fun!

> and Windows and capturing the output of the process in text files and reading
> over them, I have what might be an easy question to answer : 
>
> Say I am using Linux to create a build with all of the features I want/don't
> want.  What is the process/order in which these files are made as I am to
> configure the build myself.  My main goal is to be able to make HTTP/HTTPS
> request.  I do have a ported version of the openssl library on the system and I
> need to use that. 
>
> I guess the real question is, how is curl_config.h obtained?  I am going to

Using autoconf is the easiest on a new system, when the build chain will run on
a POSIX system. It will probe the system for the correct settings and generate
curl_config.h for you. Cmake will do something similar.

> assume it is generated using the configure script and if the system does not
> support configure, you must use a configure-*.h file for whatever system you
> have.  

Correct. You'll see those conf files for systems with non-POSIX build chains.

> I would also like to know all of the key files that are involved in building
> libcurl.  Key files meaning configure files and files with pre-processor
> defines.

Every file is in the curl distribution for a good reason, and each one is
therefore key! However, each one isn't necessarily needed in every environment
and in every build configuration. Asking for the key files isn't really going
to help much, because they are so complex and hang together so tightly.
configure is pretty key for an autoconf build, and that one file is over 42K
lines.

Your best bet when porting to a new system is to look at an existing
configuration that's similar to your OS' and tweak it to your needs. That means
either starting with a prebuilt config file (such as lib/config-win32.h) or
configuring curl using autoconf targetting an OS similar to the one you're
using (e.g. configure for an ARM Linux cross-compile). Then modify the
curl_config.h file to match your target and go! You'll probably want to start
with a bare-bones configuration to get started (i.e. use as many --disable-*
and --without* options as you can to create an HTTP-only libcurl), then add
more options and check the differences once the base system is operation.

You can also build for an e.g. ARM Linux target and use nm -D on the shared
library to see the kinds of external symbols that libcurl needs before you even
get started. Not all of those will be absolutely necessary as libcurl will to a
large extent work with what the OS provides, but it will give you an idea of
what you'll be dealing with. Good luck!

>>> Dan
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-07-24