[Cairo] Re: Patch for cairo --without-x
james at daa.com.au
Thu Nov 27 00:00:14 PST 2003
On 27/11/2003 3:02 PM, Sasha V. wrote:
> Ok, here is new version of the patch.
> It does remove _xlib.c from compilation entirely,
> but I had to keep cairo-xlib.h, but not just keep it, but rename it
> into cairo-xlib.h.in, so that configure could insert proper macro
> directly into it.
> It might be a good idea to forcibly include cairo-xlib.h
> in cairo.h.
> I had to do diff -Nur to get the patch as cvs diff would not pick
> renamed file.
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:
include_HEADERS = cairo.h
libcairo_la_SOURCES = ...
include_HEADERS += cairo-xlib.h
libcairo_la_SOURCES += cairo_xlib_surface.c
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
(would we install a cairo-win32.h header on unix systems in the future?)
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
included before cairoint.h everywhere, you wouldn't need the unnecessary
"#include <cairo-xlib.h>" directive in cairoint.h.
Email: james at daa.com.au
More information about the cairo