[Cairo] Re: Patch for cairo --without-x

Sasha Vasko sasha at aftercode.net
Fri Nov 28 15:04:41 PST 2003


James Henstridge wrote:
> If we decide to require automake >= 1.7 to build Cairo from CVS (which I 
> highly recommend), then it should be pretty easy to conditionally 
> install the cairo-xlib.h with syntax like this:
> 
<snip>
> This is easy to read, and should work okay.  I would think absense of a 
> header is a better indication that the feature isn't available, compared 
> to having a present but effectively empty header installed on the system

Conditional installation of headers is evil, as it requires apps to 
check not only for cairo, but also for its individual headers, while 
configuring self. Also it makes impossible explicit include of it in 
main header cairo.h.

> (would we install a cairo-win32.h header on unix systems in the future?)

Well yeah, from this perspective better solution would be to rename 
header to something like  cairo-interfaces.h, and have all the optional 
stuff in this single header.

> 
> For conditional compilation of the actual Cairo code, it would be better 
> to do it the normal way.  That is, just use an AC_DEFINE() statement in 
> the configure script to define CAIRO_HAS_X_BACKEND.  If config.h is 

That was the way I did it at first, but as Carl noted that forces 
compilation of effectively empty file, which makes conditional 
compilation a preffered method.

> included before cairoint.h everywhere, you wouldn't need the unnecessary 
> "#include <cairo-xlib.h>" directive in cairoint.h.
> 
> James.
> 


Sasha





More information about the cairo mailing list