[Spice-devel] [RFC PATCH 1/1] separate and encapsulate the agent business code

Christophe Fergeau cfergeau at redhat.com
Mon Feb 19 13:05:05 UTC 2018


On Wed, Feb 14, 2018 at 10:13:41PM +0100, Christophe de Dinechin wrote:
> >> I’d write “config.h”. No reason to ever look config.h in system headers.
> > 
> > The reason for the <> is described in [1], 4th paragraph. I've
> > mentioned it during the previous discussion and didn't get any comment
> > on it IIRC. Either is fine by me, I don't plan to introduce another
> > file named 'config.h' anywhere in the source tree.
> > 
> > [1] https://www.gnu.org/software/autoconf/manual/autoconf-2.66/html_node/Configuration-Headers.html
> 
> That rationale is remarkably inconsistent with the generated makefiles, which build for example with:
> 
> -I. -I..  -I.. -I.. -I/usr/include/pixman-1  -I/usr/include/cacard -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/nss3 -I/usr/include/nspr4   -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -pthread  -I/usr/include/opus   -DG_LOG_DOMAIN=\"Spice\" -I/usr/local/include/spice-1  
> 
> or for the streaming agent:
> 
> -I. -I..  -DSPICE_STREAMING_AGENT_PROGRAM -I../include -DPLUGINSDIR=\"/usr/local/lib/spice-streaming-agent/plugins\" -I/usr/local/include/spice-1  
> 
> So you -I. first anyway, and you would prefer the local config.h in any case. “config.h” just lets compiler find it without looking up at the command-line options.

As far as I can tell, this -I. -I.. corresponds to -I$(builddir) -I$(srcdir)

#include "config.h" would look into $(srcdir) first regardless of these
-I flags, #include <config.h> will look into -I$(builddir) first, which
is what is documented in the link given by Lukas.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20180219/cf0decd7/attachment-0001.sig>


More information about the Spice-devel mailing list