cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: vms_show hack explained

From: Yang Tse <yangsita_at_gmail.com>
Date: Sat, 16 Mar 2013 05:38:14 +0100

On Sat, Mar 16, 2013, John E. Malmberg wrote:

> The daily tarball that I used earlier did not have a curlbuild.h file in it,
> so I had to generate it.

You might have been unfortunate back then fetching a badly broken
daily snapshot. I've just verified that curl-7.30.0-20130314.tar
certainly has curlbuild.h in it.

$ find . -name curlbuild.h
./curl-7.30.0-20130314/include/curl/curlbuild.h

> In reading the curlbuild.h.in file several of the values in the file
> depended on what had previously been generated in the curl_config.h file and
> I did not see any cases where curlbuild.h was used with out curl_config.h
> being include prior to it.

./curl-7.30.0-20130314/include/curl/curl.h (line 34) #include "curlbuild.h"

Included also by external API when no curl_config.h exists once the
library is built and installed.

> As it is, the values for VMS in curlbuild.h in the March 14 daily tarball
> are incorrect for some !__VAX VMS releases. For !__VAX the size of off_t is
> only 32 bits for older versions of VMS and is only 64 bits on more recent
> versions and requires that support to be requested at compile time.

Even if it sounds funny curl_off_t is not off_t. Read
./curl-7.30.0-20130314/lib/README.curl_off_t and 'Note 2' at the
beginning of ./curl-7.30.0-20130314/include/curl/curlbuild.h

> I had changed the VMS build procedure to default to asking for that support
> on non-VAX, but just because it asked for it, does not guarantee that it
> will get it.
>
> The procedure to generate the curl_config.h does set the off_t size based on
> what the platform it is run on actually supports.

If you base or set curl_off_t on off_t you will get a wrongly built libcurl.

>> 2) Generated or hand-crafted config.h does not include a single header
>> file.
>
>
> The config_h.com is a generic procedure shared by multiple projects. While
> it knows how to generate most of what is in the config.h file, it does not
> know how to get everything correct.

Notice that even when all projects might be using autotools and all
might define certain preprocessor macro such as HAVE_* each project is
free to impose the conditions upon when it is ok to define that macro.
Some might define it doing only some naive checks and others might do
very thorough checks in order to define it.

So, the same macro definition isn't actually shareable among projects.
And not even whether it gets defined or not.

> So it includes a config_vms.h file that is built by a project specific
> command file that knows what config_h.com was not able to calculate for it.
>
> For example, the config_h.com reads the configure script to determine how to
> set some symbols that it did not find in the header files. It takes the
> first assignment it finds, which is not the default that we want for many of
> the settings.
>
> So a command procedure is run first based on the build options selected and
> it generates the config_vms.h that combined with the auto-generated config.h
> is correct. That procedure also renames the config.h file to curl_config.h.

You are going to have lots of fun. But If your priority is being able
to build a proper libcurl it is not going to be a short term target.

>> 3) No change is done to the placement where header files curlbuild.h
>> and setup-vms.h are included.
>
>
> Some things need to be in the order that I set them or the correct wrapper
> will not be used. I will try to check the latest daily build this weekend.

Trust me, concentrate first in achieving an auto contained curlbuild.h
and the rest will fit nicely.

-- 
-=[Yang]=-
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2013-03-16