[cairo] Making configure error message more clear

Carl Worth cworth at cworth.org
Thu Mar 18 12:28:59 PDT 2010


I think it would be awfully nice if cairo's configure output gave a
kinder message if pkg-config fails to find something required, (such as
pixman).

Currently, one gets:

	checking whether cairo's image surface backend feature could be
	enabled... no (requires pixman-1 >= 0.12.0
	http://cairographics.org/releases/)
	configure: error: mandatory image surface backend feature could not be enabled

Below is an exchange I recently had with a new user trying to use cairo
who got this error and followed its advice, (browsed to the URL, found
pixman, downloaded it, installed it to the default /usr/local/). But the
user still got the same message, and never knew to adjust the
PKG_CONFIG_PATH environment variable.

Perhaps we could also add something like:

	If you have already installed pixman, then you may need to set
	the PKG_CONFIG_PATH variable to indicate the directory into
	which the pixman-1.pc file was installed. For example:

		export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

Though I do wish that even this step weren't necessary. It seems to me
that with all of our software configuring itself for /usr/local by
default, that pkg-config should *also* be looking there by default. (And
then, I'd like the dynamic loader to look there by default as well.)

We just make things so hard on users just getting started with compiling
software manually, and there's no good reason for that.

-Carl

A new user recently said (and I replied):
> First time I tried ./configure for Cairo, it gave me this
> 
> requires pixman-1 >= 0.12.0 http://cairographics.org/releases/
> 
> So I downloaded and installed the latest from cairographics.org/ 
> releases (into the default /usr/local/lib),

Good. You did all that correctly.

> and then I redid the cairo configure -- but no luck; same error message.
> 
> checking for pixman... no

The problem here is that cairo is trying to use pkg-config to find
pixman, and even though most packages install themselves into
/usr/local/lib by default, pkg-config does not look into /usr/local/lib
by default.

So you need to tell pkg-config about that by setting the following
environment variable before you call configure:

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

This is an annoying hurdle, but only needs to be jumped over once, the
first time you try to compile a package that uses pkg-config to find
another package.

We have some notes in cairo's INSTALL file about this, (written for the
case of someone having just installed cairo to /usr/local/lib and then
wanting to compile other code to find it). Those instructions pre-date
pixman being in a separate package, so perhaps they should be updated to
inform users they may need to set this variable even before compiling
cairo.

> Just in case it might be useful, here's the entire output from  
> configure:

That configure output has a very unhelpful error message. It really
should be fixed to let the user know that the failed attempt to find
pixman was via pkg-config and that the user may need to set
PKG_CONFIG_PATH to fix the problem.

Would you mind if I copied the cairo mailing list on this mail to
encourage someone to fix the configure script to give a more helpful
error message in this case?

-Carl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.cairographics.org/archives/cairo/attachments/20100318/2b03d0b1/attachment.pgp>


More information about the cairo mailing list