[cairo] What the new .pc files are good for
Carl Worth
cworth at cworth.org
Mon Jun 19 16:10:17 PDT 2006
On Sun, 18 Jun 2006 12:43:26 +0800, Steven Chaplin wrote:
> On Wed, 2006-06-14 at 09:01 -0700, Carl Worth wrote:
> > New, backend-specific pkg-config files
> > --------------------------------------
> > In addition to the original cairo.pc file, cairo will also now install
> > a pkg-config files for each configured backend, (for example
> > cairo-pdf.pc, cairo-svg.pc, cairo-xlib.pc, cairo-win32.pc, etc.) this
> > also includes optional font backends (such as cairo-ft.pc) and the
> > optional png functionality (cairo-png.pc).
> >
> > These new pkg-config files should be very convenient for allowing
> > cairo-using code to easily check for the existing of optional
> > functionality in cairo without having to write complex rules to grub
> > through cairo header files or the compiled library looking for
> > symbols.
>
> How do you intend for these .pc files to be used?
> Is the intention for the presence/absence of the cairo-xlib.pc file (for
> example) to indicate that the xlib backend is enabled/disabled, and the
> actual content of cairo-xlib.pc is irrelevant and duplicates the
> cairo.pc file?
The new .pc files do indicate the presence of particular backends, but
the content is significant and does not duplicate the cairo.pc file.
The new .pc files provide the necessary compiler/linker options needed
to use particular backends.
For example, cairo's cairo-xlib.h header file depends on <X11/Xlib.h>
so using cairo-xlib.h requires the user to properly setup include
paths.
Compare the results I get for the "cairo" and "cairo-xlib" packages
below:
$ pkg-config --cflags --libs cairo
-I/opt/fdo/include/cairo -L/opt/fdo/lib -lcairo
$ pkg-config --cflags --libs cairo-xlib
-I/opt/fdo/include/cairo -I/opt/xorg/include -L/opt/fdo/lib -L/opt/xorg/lib -lcairo -lXrender -lX11 -ldl
> What advantage does having multiple pkg-config files have over storing the
> backend information in a single cairo.pc file?
The point is that cairo's configure script can go through a lot of
work to track down the proper include paths for X, etc. and it's nice
to not force the user of cairo to repeat all that same configure
machinery to find them again.
-Carl
PS. It would help a lot if you would edit out irrelevant portions of
quoted messages when replying.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20060619/d9256b97/attachment.pgp
More information about the cairo
mailing list