<div dir="ltr">aren't the #include "header" looked up in current file directory?<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Mar 19, 2014 at 4:30 PM, Christophe Fergeau <span dir="ltr"><<a href="mailto:cfergeau@redhat.com" target="_blank">cfergeau@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Now that they are created in $builddir, their includes will need to refer<br>
to files in $srcdir, which can be different. It's cleaner to add<br>
-I $(top_srcdir)/spice-common/ to modules using spice-common rather than<br>
having -I $(top_srcdir)/spice-common/common which would could create header<br>
collisions.<br>
---<br>
 common/Makefile.am          | 15 ++++++++-------<br>
 python_modules/demarshal.py |  2 +-<br>
 python_modules/marshal.py   |  4 ++--<br>
 3 files changed, 11 insertions(+), 10 deletions(-)<br>
<br>
diff --git a/common/Makefile.am b/common/Makefile.am<br>
index f985057..435d448 100644<br>
--- a/common/Makefile.am<br>
+++ b/common/Makefile.am<br>
@@ -81,6 +81,7 @@ libspice_common_la_SOURCES +=         \<br>
 endif<br>
<br>
 AM_CPPFLAGS =                          \<br>
+       -I$(top_srcdir)                 \<br>
        $(GL_CFLAGS)                    \<br>
        $(PIXMAN_CFLAGS)                \<br>
        $(CELT051_CFLAGS)               \<br>
@@ -109,26 +110,26 @@ MARSHALLERS_DEPS =                                        \<br>
 # Note despite being autogenerated these are not part of CLEANFILES, they are<br>
 # actually a part of EXTRA_DIST, to avoid the need for pyparser by end users<br>
 generated_client_demarshallers.c: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)<br>
-       $(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-demarshallers --client --include messages.h $< $@ >/dev/null<br>
+       $(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-demarshallers --client --include common/messages.h $< $@ >/dev/null<br>
<br>
 generated_client_demarshallers1.c: $(top_srcdir)/spice1.proto $(MARSHALLERS_DEPS)<br>
-       $(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-demarshallers --client --include messages.h --prefix 1 --ptrsize 8 $< $@ >/dev/null<br>
+       $(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-demarshallers --client --include common/messages.h --prefix 1 --ptrsize 8 $< $@ >/dev/null<br>
<br>
 generated_client_marshallers.c: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)<br>
-       $(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-marshallers -P --include messages.h --include client_marshallers.h --client $< $@ >/dev/null<br>
+       $(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-marshallers -P --include common/messages.h --include client_marshallers.h --client $< $@ >/dev/null<br>
<br>
 generated_client_marshallers1.c: $(top_srcdir)/spice1.proto $(MARSHALLERS_DEPS)<br>
-       $(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-marshallers -P --include messages.h --include client_marshallers.h --client --prefix 1 --ptrsize 8 $< $@ >/dev/null<br>
+       $(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-marshallers -P --include common/messages.h --include client_marshallers.h --client --prefix 1 --ptrsize 8 $< $@ >/dev/null<br>
<br>
 generated_server_demarshallers.c: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)<br>
-       $(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-demarshallers --server --include messages.h $< $@ >/dev/null<br>
+       $(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-demarshallers --server --include common/messages.h $< $@ >/dev/null<br>
<br>
 STRUCTS = -M String -M Rect -M Point -M DisplayBase -M Fill -M Opaque -M Copy -M Blend -M Blackness -M Whiteness -M Invers -M Rop3 -M Stroke -M Text -M Transparent -M AlphaBlend -M Composite<br>
 generated_server_marshallers.c: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)<br>
-       $(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-marshallers $(STRUCTS) --server --include messages.h $< $@ >/dev/null<br>
+       $(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-marshallers $(STRUCTS) --server --include common/messages.h $< $@ >/dev/null<br>
<br>
 generated_server_marshallers.h: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)<br>
-       $(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-marshallers $(STRUCTS) --server --include messages.h -H $< $@ >/dev/null<br>
+       $(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-marshallers $(STRUCTS) --server --include common/messages.h -H $< $@ >/dev/null<br>
<br>
 # this is going to upset automake distcheck, since we try to write to<br>
 # readonly srcdir. To limit the fail chances, rebuild automatically<br>
diff --git a/python_modules/demarshal.py b/python_modules/demarshal.py<br>
index cf48d74..794cd25 100644<br>
--- a/python_modules/demarshal.py<br>
+++ b/python_modules/demarshal.py<br>
@@ -1250,7 +1250,7 @@ def write_includes(writer):<br>
     writer.writeln("#include <stdio.h>")<br>
     writer.writeln("#include <spice/protocol.h>")<br>
     writer.writeln("#include <spice/macros.h>")<br>
-    writer.writeln('#include "mem.h"')<br>
+    writer.writeln('#include "common/mem.h"')<br>
     writer.newline()<br>
     writer.writeln("#ifdef _MSC_VER")<br>
     writer.writeln("#pragma warning(disable:4101)")<br>
diff --git a/python_modules/marshal.py b/python_modules/marshal.py<br>
index 4020799..ae5fe31 100644<br>
--- a/python_modules/marshal.py<br>
+++ b/python_modules/marshal.py<br>
@@ -4,7 +4,7 @@ import codegen<br>
<br>
 def write_includes(writer):<br>
     writer.header.writeln("#include <spice/protocol.h>")<br>
-    writer.header.writeln('#include "marshaller.h"')<br>
+    writer.header.writeln('#include "common/marshaller.h"')<br>
     writer.header.newline()<br>
     writer.header.writeln("#ifndef _GENERATED_HEADERS_H")<br>
     writer.header.writeln("#define _GENERATED_HEADERS_H")<br>
@@ -15,7 +15,7 @@ def write_includes(writer):<br>
     writer.writeln("#include <stdio.h>")<br>
     writer.writeln("#include <spice/protocol.h>")<br>
     writer.writeln("#include <spice/macros.h>")<br>
-    writer.writeln('#include "marshaller.h"')<br>
+    writer.writeln('#include "common/marshaller.h"')<br>
     writer.newline()<br>
     writer.writeln("#ifdef _MSC_VER")<br>
     writer.writeln("#pragma warning(disable:4101)")<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.8.5.3<br>
<br>
_______________________________________________<br>
Spice-devel mailing list<br>
<a href="mailto:Spice-devel@lists.freedesktop.org">Spice-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/spice-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/spice-devel</a><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br>Marc-André Lureau
</div>