[cairo] Compiling for Cairo development BUGS?

M Joonas Pihlaja jpihlaja at cc.helsinki.fi
Sun Jun 13 12:13:04 PDT 2010


On Sun, 13 Jun 2010, Bill Spitzak wrote:

> Can somebody please tell me if the "libcairo.la" in cairo-unsupported.pc is an
> error that should be fixed?

I'm pretty sure that's a bug.  Why should any pkg-config file have 
libtool cruft in it?

> I have the absolute newest gcc and it does not think a ".la" file is something
> that should be on on the link line.

Exactly.  Libtool files have no business being in a pkg-config file.

> Also an explanation of the "PKG_CONFIG_TOP_BUILD_DIR" would help. Am I
> supposed to set this or is the text in the .pc file in error that causes that
> to matter?

The pkg-config manual has an explanation of this variable, but it is 
pretty unenlightening:

<quote>
A value to set for the magic variable pc_top_builddir which may appear 
in .pc files. If the environment variable is not set, the default 
value '$(top_builddir)' will be used. This variable should refer to 
the top builddir of the Makefile where the compile/link flags reported 
by pkg-config will be used. This only matters when compiling/linking 
against a package that hasn't yet been installed.
</quote>

Based on the mention of $(top_builddir), it seems like it expects to 
be called from within an autotooled up build system.  If someone could 
explain how the -uninstalled.pc files are actually supposed to work 
that would be wonderful.  To me they look broken as well.

My setup for developing cairo is a directory structure like this:

cairo/
	... cairo sources ...
pixman/
	... pixman sources ...

prefixes/
	cairo -> cairo-HEAD		(symlink)
	pixman -> pixman-HEAD		(symlink)
	pixman-HEAD/
	cairo-HEAD/
	cairo-1.8.8/
	pixman-1.17.5/

The two symlinks in prefixes/ let me always use the same 
--prefix=<...>/prefixes/{cairo,pixman} when configuring, yet let me 
change at runtime the version of cairo being actually used by pointing 
the symlink somewhere else.  Additionally it helps to deal with with 
libtool since its .la files brand in exact paths to libraries.

A setup script sets the following environment variables:

	LD_LIBRARY_PATH=<...>/prefixes/cairo/lib:<...>/prefixes/pixman/lib

	PKG_CONFIG_PATH=<...>/prefixes/cairo/lib/pkgconfig:<...>/prefixes/pixman/lib/pkgconfig

When building I first build pixman and then cairo like so:

	$ (cd pixman; sh autogen.sh --prefix=<...>/prefixes/pixman; make install)

	$ (cd cairo; sh autogen.sh --prefix=<...>/prefixes/cairo; make install)

Hope that helps!

Joonas


More information about the cairo mailing list