[cairo] config.h ?

Emmanuele Bassi ebassi at gmail.com
Wed May 19 16:20:31 UTC 2021


On Wed, 19 May 2021 at 16:24, John Emmas <john at creativepost.co.uk> wrote:

> On 19/05/2021 15:50, Emmanuele Bassi wrote:
>
>
> Yes, it's generated by the `configure` script in Autotools, just like
> Meson.
>
>
> Ah... in my case I'm building with (my own) Visual C++ build projects.  At
> one time, some libraries could generate VC project files either using Meson
> or CMake but I never really found them satisfactory.  Could you maybe
> attach a copy of config.h so I can at least see what kinda stuff it needs
> to contain?  Thanks,
>

The `config.h` file is just a list of `#define FOO` symbols that are
discovered at configuration time depending on your platform, like:

```
/* Define to 1 if the PS backend can be tested (needs ghostscript) */
#define CAIRO_CAN_TEST_PS_SURFACE 1

/* Define to 1 if the SVG backend can be tested */
#define CAIRO_CAN_TEST_SVG_SURFACE 1

/* Define to 1 if the Win32 Printing backend can be tested (needs
ghostscript)
   */
/* #undef CAIRO_CAN_TEST_WIN32_PRINTING_SURFACE */

/* Define to 1 if dlsym is available */
#define CAIRO_HAS_DLSYM 1

/* Define to 1 to enable cairo's cairo-script-interpreter feature */
#define CAIRO_HAS_INTERPRETER 1

/* Define to 1 to enable cairo's pthread feature */
#define CAIRO_HAS_PTHREAD 1

/* Define to 1 if we have full pthread support */
#define CAIRO_HAS_REAL_PTHREAD 1
```

If you're using your own build system, unsanctioned by the Cairo project,
then I'm afraid you're on your own. The reason why `HAVE_CONFIG_H` was
removed was because all the build systems supported by Cairo—i.e. the in
tree ones—generated a `config.h`, so there's literally no point in defining
`HAVE_CONFIG_H` to guard the `config.h` inclusion.

Incidentally, if you relied on that to build Cairo, you probably have been
building a fairly broken version of it—unless, of course, you've also been
injecting symbols like `CAIRO_HAS_DLSYM` or `HAVE_OS_ATOMIC_OPS` or
`HAVE_UINT64_T` in your build environment.

Personally, I'd ask you to use the build system provided by the project
you're building, instead of going at it in your own way.

Ciao,
 Emmanuele.

-- 
https://www.bassi.io
[@] ebassi [@gmail.com]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cairographics.org/archives/cairo/attachments/20210519/0010f6f9/attachment-0001.htm>


More information about the cairo mailing list