Pages: Welcome | Projects

libcurl's autoconf macros in dist tarballs

2021/4/2
Tags: [ C & C++ ] [ Crossbow ] [ Personal Projects ] [ Today I learned ]

As mentioned on yesterday's post, I'm currently fixing crossbow so that the XML download phase is handled directly, and not delegated to libnxml. Besides fixing the redirection problem, this will enable a future removal of libmrss/libnxml (spoiler: in favour of Mini-XML).

Under the hood, libnxml uses libcurl, which is what I plan to use for the XML retrieval. The set of crossbow's dependencies is therefore not going to change. Nevertheless, it is necessary to re-wire crossbow's configure script so that libcurl is required as a direct dependency.

Crossbow uses GNU Autoconf, and I happily found that libcurl provides some handy autoconf macros, although I initially wondered how should I use it. Basically, I would like to use the LIBCURL_CHECK_CONF macro, which is provided by libcurl.m4. This in turn must be available to autoconf, but who tells me that it is going to be installed in the operating system of the user who builds crossbow?

Bundling the file in my source tree would obviously work, but it would also be as bad in the same way as any bundling (that is, having a copy of the file, keeping it up to date, etc). Well, as it turns out this is not needed at all.

In short, the libcurl.m4 file is provided by the development package of the distribution, which makes it available to the host involved in the creation of the distribution tarball ('make dist'). The distribution tarball will contain a configure script which will not be dependent on libcurl.m4, in the same way as it will not be dependent on GNU Autoconf.

Although it might seem obvious to some, it is important to keep in mind that: