[PATCH][1/1] - Xserver - XTrap prep sources for config.h
inclusion
Kevin E Martin
kem at freedesktop.org
Tue Apr 19 07:15:21 PDT 2005
On Tue, Apr 19, 2005 at 04:20:09PM +1000, Daniel Stone wrote:
> On Mon, Apr 18, 2005 at 11:11:53PM -0700, John Davidorff Pell wrote:
> > Wow! You're really putting in some great effort here. :-D
> >
> > A couple comments for you:
> >
> > I noticed that you have included config.h in a few header files. I
> > assume that this was just a mistake, so I thought I'd just make sure
> > you realised it. :-)
>
> ... why would it be a mistake? Given that config.h, in autotools,
> defines everything.
There are two ways to handle the defines from the autotools. You can
specify AM_CONFIG_HEADER([config.h]) in your configure.ac file and the
config.h file will be automatically be created. Or, you can leave that
macro out, and no config.h file is created but rather the #defines are
turned into -D command line arguments. This latter solution has the
upside of not having to add #include <config.h> everywhere, but has the
downside of much longer command lines. I lean a tiny bit toward the
latter solution only because we would have to modify fewer files, but I
really don't have any strong preference here.
Something that I saw in the several of the autotooled libraries in xlibs
is to use put "-include config.h" in AM_CFLAGS, which accomplishes the
same result as adding #include <config.h> everywhere. Is "-include" a
portable compiler option?
Kevin
More information about the xorg-modular
mailing list