cURL / Mailing Lists / curl-library / Single Mail

curl-library

[PATCH] adding curl/config.h

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 11 Dec 2006 13:22:30 +0100 (CET)

Hi friends,

Explanation coming up. I'm interested in your thoughts, objections or other
feedback on the idea, concept and implementation!

I've decided to finally take a stab at fixing several problems we've had over
the years with the public headers, that have been troublesome to address since
they are public and thus haven't been able to use or depend on any configure
results. Like knowing if sys/select.h can be included, or knowing how large
the curl_off_t variable type is/should be etc. It should allow us to do less
#if [this-os or that-compiler] checks in the public headers, and rather depend
on actual features and therefore possibly easier remain more portable with
less required work.

My initial patch is attached to this mail. It will produce a public
curl/config.h header when configure runs, which will have all the defines
created by configure prefixed with CURLCONF_. All public curl headers should
be able to include that and behave according to what the defines specify. I
selected a prefix like this to reduce the risk of name collisions.

Systems that don't have a working configure will get the default config.h file
(which is named config.h.dist in this patch and in CVS) as it will be renamed
to curl/config.h only when we build a distribution archive.

All source archives will then have a default curl/config.h file, and if you
run configure you'll get a generated one in the build dir (which may or may
not be the same dir as the source dir) and by setting up the include path
properly we'll make sure libcurl gets built and told to use the build-dir one
rather than the source dir one.

Another bonus is that we can in fact rely on such config info for both the
curl code and the libcurl code, as with this such info will be "public
knowledge". src/config.h and lib/config.h might not even be necessary in the
future.

The downside is that we will have to move some (most?) of the hard-coded logic
from lib/config-*.h to the public header(s) so that this concept will work
fine even for non-configure platforms (VMS, Netware, Windows, Amiga, etc).

Any comments?

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html

Received on 2006-12-11