[Spice-devel] build-sys: fix make distcheck

Submitted by Alon Levy on July 16, 2012, 3 p.m.

Details

Message ID 20120716150045.GB3252@garlic.tlv.redhat.com
State New
Headers show

Not browsing as part of any series.

Commit Message

Alon Levy July 16, 2012, 3 p.m.
On Mon, Jul 16, 2012 at 04:16:54PM +0200, Marc-André Lureau wrote:
> - don't try to overwrite read-only enums.h

I thought you were speaking about fixing non related enums.h problem.
For enums.h I have a fix already that changed $(top_srcdir) to ../ like
Christophe suggested, so it changes _build files and not source. For
intree build this is the same, for out of tree build make dist will
break (have the wrong enums.h) but only if spice.proto has changed (or
any of the build machinary). I don't personally do make dist in an
out-of-tree build, so I'm not sure that's a problem.

> - DIST_SUBDIRS is no longer needed
> ---
>  Makefile.am        |    1 -
>  common/Makefile.am |    5 ++++-
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/Makefile.am b/Makefile.am
> index 79f7903..30c4f37 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -2,7 +2,6 @@ NULL =
>  ACLOCAL_AMFLAGS = -I m4
>  
>  SUBDIRS = python_modules common spice-protocol
> -DIST_SUBDIRS = spice-protocol $(SUBDIRS)

This is fine.

>  
>  EXTRA_DIST =				\
>  	spice_codegen.py		\
> diff --git a/common/Makefile.am b/common/Makefile.am
> index 3210fc8..5f2c6e5 100644
> --- a/common/Makefile.am
> +++ b/common/Makefile.am
> @@ -122,7 +122,10 @@ generated_server_marshallers.c: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
>  generated_server_marshallers.h: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
>  	$(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-marshallers $(STRUCTS) --server --include messages.h -H $< $@ >/dev/null
>  
> -$(top_srcdir)/spice-protocol/spice/enums.h: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
> +# this is going to upset automake distcheck, since we try to write to
> +# readonly srcdir. To limit the fail chances, rebuild automatically
> +# enums.h only if the spice.proto has changed.
> +$(top_srcdir)/spice-protocol/spice/enums.h: $(top_srcdir)/spice.proto # $(MARSHALLERS_DEPS)
>  	$(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-enums $< $@ >/dev/null

Drop this, instead use the following:


commit d0cbc0518fcb0ad5f441387a4530c63ff377ba48
Author: Alon Levy <alevy@redhat.com>
Date:   Mon Jul 16 12:04:34 2012 +0300

    enums.h: generate in build directory, passes distcheck



>  
>  EXTRA_DIST =				\
> -- 
> 1.7.10.4
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel

Patch hide | download patch | download mbox

diff --git a/common/Makefile.am b/common/Makefile.am
index 3210fc8..3ae2a6b 100644
--- a/common/Makefile.am
+++ b/common/Makefile.am
@@ -14,7 +14,7 @@  SERVER_MARSHALLERS =					\
 	$(srcdir)/generated_server_marshallers.h	\
 	$(NULL)
 
-BUILT_SOURCES = $(CLIENT_MARSHALLERS) $(SERVER_MARSHALLERS) $(top_srcdir)/spice-protocol/spice/enums.h
+BUILT_SOURCES = $(CLIENT_MARSHALLERS) $(SERVER_MARSHALLERS) ../spice-protocol/spice/enums.h
 
 noinst_LTLIBRARIES = libspice-common.la libspice-common-server.la libspice-common-client.la
 libspice_common_la_SOURCES =		\
@@ -122,7 +122,7 @@  generated_server_marshallers.c: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
 generated_server_marshallers.h: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
 	$(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-marshallers $(STRUCTS) --server --include messages.h -H $< $@ >/dev/null
 
-$(top_srcdir)/spice-protocol/spice/enums.h: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
+../spice-protocol/spice/enums.h: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
 	$(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-enums $< $@ >/dev/null
 
 EXTRA_DIST =				\

Comments

On Mon, Jul 16, 2012 at 06:00:45PM +0300, Alon Levy wrote:
> On Mon, Jul 16, 2012 at 04:16:54PM +0200, Marc-André Lureau wrote:
> > - don't try to overwrite read-only enums.h
> 
> I thought you were speaking about fixing non related enums.h problem.
> For enums.h I have a fix already that changed $(top_srcdir) to ../ like
> Christophe suggested, so it changes _build files and not source. For
> intree build this is the same, for out of tree build make dist will
> break (have the wrong enums.h) but only if spice.proto has changed (or
> any of the build machinary). I don't personally do make dist in an
> out-of-tree build, so I'm not sure that's a problem.
> 
> > - DIST_SUBDIRS is no longer needed
> > ---
> >  Makefile.am        |    1 -
> >  common/Makefile.am |    5 ++++-
> >  2 files changed, 4 insertions(+), 2 deletions(-)
> > 
> > diff --git a/Makefile.am b/Makefile.am
> > index 79f7903..30c4f37 100644
> > --- a/Makefile.am
> > +++ b/Makefile.am
> > @@ -2,7 +2,6 @@ NULL =
> >  ACLOCAL_AMFLAGS = -I m4
> >  
> >  SUBDIRS = python_modules common spice-protocol
> > -DIST_SUBDIRS = spice-protocol $(SUBDIRS)
> 
> This is fine.
> 
> >  
> >  EXTRA_DIST =				\
> >  	spice_codegen.py		\
> > diff --git a/common/Makefile.am b/common/Makefile.am
> > index 3210fc8..5f2c6e5 100644
> > --- a/common/Makefile.am
> > +++ b/common/Makefile.am
> > @@ -122,7 +122,10 @@ generated_server_marshallers.c: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
> >  generated_server_marshallers.h: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
> >  	$(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-marshallers $(STRUCTS) --server --include messages.h -H $< $@ >/dev/null
> >  
> > -$(top_srcdir)/spice-protocol/spice/enums.h: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
> > +# this is going to upset automake distcheck, since we try to write to
> > +# readonly srcdir. To limit the fail chances, rebuild automatically
> > +# enums.h only if the spice.proto has changed.
> > +$(top_srcdir)/spice-protocol/spice/enums.h: $(top_srcdir)/spice.proto # $(MARSHALLERS_DEPS)
> >  	$(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-enums $< $@ >/dev/null
> 
> Drop this, instead use the following:
> 
> 
> commit d0cbc0518fcb0ad5f441387a4530c63ff377ba48
> Author: Alon Levy <alevy@redhat.com>
> Date:   Mon Jul 16 12:04:34 2012 +0300
> 
>     enums.h: generate in build directory, passes distcheck
> 
> diff --git a/common/Makefile.am b/common/Makefile.am
> index 3210fc8..3ae2a6b 100644
> --- a/common/Makefile.am
> +++ b/common/Makefile.am
> @@ -14,7 +14,7 @@ SERVER_MARSHALLERS =					\
>  	$(srcdir)/generated_server_marshallers.h	\
>  	$(NULL)
>  
> -BUILT_SOURCES = $(CLIENT_MARSHALLERS) $(SERVER_MARSHALLERS) $(top_srcdir)/spice-protocol/spice/enums.h
> +BUILT_SOURCES = $(CLIENT_MARSHALLERS) $(SERVER_MARSHALLERS) ../spice-protocol/spice/enums.h

Have you tried $(top_builddir) instead of ../ ?

Christophe

>  
>  noinst_LTLIBRARIES = libspice-common.la libspice-common-server.la libspice-common-client.la
>  libspice_common_la_SOURCES =		\
> @@ -122,7 +122,7 @@ generated_server_marshallers.c: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
>  generated_server_marshallers.h: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
>  	$(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-marshallers $(STRUCTS) --server --include messages.h -H $< $@ >/dev/null
>  
> -$(top_srcdir)/spice-protocol/spice/enums.h: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
> +../spice-protocol/spice/enums.h: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
>  	$(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-enums $< $@ >/dev/null
>  
>  EXTRA_DIST =				\
> 
> 
> >  
> >  EXTRA_DIST =				\
> > -- 
> > 1.7.10.4
> > 
> > _______________________________________________
> > Spice-devel mailing list
> > Spice-devel@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/spice-devel
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
Hi

On Mon, Jul 16, 2012 at 5:00 PM, Alon Levy <alevy@redhat.com> wrote:
> Drop this, instead use the following:
>
>
> commit d0cbc0518fcb0ad5f441387a4530c63ff377ba48
> Author: Alon Levy <alevy@redhat.com>
> Date:   Mon Jul 16 12:04:34 2012 +0300
>
>     enums.h: generate in build directory, passes distcheck
>
> diff --git a/common/Makefile.am b/common/Makefile.am
> index 3210fc8..3ae2a6b 100644
> --- a/common/Makefile.am
> +++ b/common/Makefile.am
> @@ -14,7 +14,7 @@ SERVER_MARSHALLERS =                                  \
>         $(srcdir)/generated_server_marshallers.h        \
>         $(NULL)
>
> -BUILT_SOURCES = $(CLIENT_MARSHALLERS) $(SERVER_MARSHALLERS) $(top_srcdir)/spice-protocol/spice/enums.h
> +BUILT_SOURCES = $(CLIENT_MARSHALLERS) $(SERVER_MARSHALLERS) ../spice-protocol/spice/enums.h

But then you have 2 enums.h in srcdir and builddir.

>  noinst_LTLIBRARIES = libspice-common.la libspice-common-server.la libspice-common-client.la
>  libspice_common_la_SOURCES =           \
> @@ -122,7 +122,7 @@ generated_server_marshallers.c: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
>  generated_server_marshallers.h: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
>         $(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-marshallers $(STRUCTS) --server --include messages.h -H >lt; $@ >/dev/null
>
> -$(top_srcdir)/spice-protocol/spice/enums.h: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
> +../spice-protocol/spice/enums.h: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
>         $(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-enums >lt; $@ >/dev/null

This will probably still "fail" if builddir == srcdir and src files
are made read only (which is a good thing).
On Mon, Jul 16, 2012 at 05:06:06PM +0200, Christophe Fergeau wrote:
> On Mon, Jul 16, 2012 at 06:00:45PM +0300, Alon Levy wrote:
> > On Mon, Jul 16, 2012 at 04:16:54PM +0200, Marc-André Lureau wrote:
> > > - don't try to overwrite read-only enums.h
> > 
> > I thought you were speaking about fixing non related enums.h problem.
> > For enums.h I have a fix already that changed $(top_srcdir) to ../ like
> > Christophe suggested, so it changes _build files and not source. For
> > intree build this is the same, for out of tree build make dist will
> > break (have the wrong enums.h) but only if spice.proto has changed (or
> > any of the build machinary). I don't personally do make dist in an
> > out-of-tree build, so I'm not sure that's a problem.
> > 
> > > - DIST_SUBDIRS is no longer needed
> > > ---
> > >  Makefile.am        |    1 -
> > >  common/Makefile.am |    5 ++++-
> > >  2 files changed, 4 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/Makefile.am b/Makefile.am
> > > index 79f7903..30c4f37 100644
> > > --- a/Makefile.am
> > > +++ b/Makefile.am
> > > @@ -2,7 +2,6 @@ NULL =
> > >  ACLOCAL_AMFLAGS = -I m4
> > >  
> > >  SUBDIRS = python_modules common spice-protocol
> > > -DIST_SUBDIRS = spice-protocol $(SUBDIRS)
> > 
> > This is fine.
> > 
> > >  
> > >  EXTRA_DIST =				\
> > >  	spice_codegen.py		\
> > > diff --git a/common/Makefile.am b/common/Makefile.am
> > > index 3210fc8..5f2c6e5 100644
> > > --- a/common/Makefile.am
> > > +++ b/common/Makefile.am
> > > @@ -122,7 +122,10 @@ generated_server_marshallers.c: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
> > >  generated_server_marshallers.h: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
> > >  	$(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-marshallers $(STRUCTS) --server --include messages.h -H $< $@ >/dev/null
> > >  
> > > -$(top_srcdir)/spice-protocol/spice/enums.h: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
> > > +# this is going to upset automake distcheck, since we try to write to
> > > +# readonly srcdir. To limit the fail chances, rebuild automatically
> > > +# enums.h only if the spice.proto has changed.
> > > +$(top_srcdir)/spice-protocol/spice/enums.h: $(top_srcdir)/spice.proto # $(MARSHALLERS_DEPS)
> > >  	$(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-enums $< $@ >/dev/null
> > 
> > Drop this, instead use the following:
> > 
> > 
> > commit d0cbc0518fcb0ad5f441387a4530c63ff377ba48
> > Author: Alon Levy <alevy@redhat.com>
> > Date:   Mon Jul 16 12:04:34 2012 +0300
> > 
> >     enums.h: generate in build directory, passes distcheck
> > 
> > diff --git a/common/Makefile.am b/common/Makefile.am
> > index 3210fc8..3ae2a6b 100644
> > --- a/common/Makefile.am
> > +++ b/common/Makefile.am
> > @@ -14,7 +14,7 @@ SERVER_MARSHALLERS =					\
> >  	$(srcdir)/generated_server_marshallers.h	\
> >  	$(NULL)
> >  
> > -BUILT_SOURCES = $(CLIENT_MARSHALLERS) $(SERVER_MARSHALLERS) $(top_srcdir)/spice-protocol/spice/enums.h
> > +BUILT_SOURCES = $(CLIENT_MARSHALLERS) $(SERVER_MARSHALLERS) ../spice-protocol/spice/enums.h
> 
> Have you tried $(top_builddir) instead of ../ ?

No. Where do I find out about those variables?

> 
> Christophe
> 
> >  
> >  noinst_LTLIBRARIES = libspice-common.la libspice-common-server.la libspice-common-client.la
> >  libspice_common_la_SOURCES =		\
> > @@ -122,7 +122,7 @@ generated_server_marshallers.c: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
> >  generated_server_marshallers.h: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
> >  	$(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-marshallers $(STRUCTS) --server --include messages.h -H $< $@ >/dev/null
> >  
> > -$(top_srcdir)/spice-protocol/spice/enums.h: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
> > +../spice-protocol/spice/enums.h: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
> >  	$(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-enums $< $@ >/dev/null
> >  
> >  EXTRA_DIST =				\
> > 
> > 
> > >  
> > >  EXTRA_DIST =				\
> > > -- 
> > > 1.7.10.4
> > > 
> > > _______________________________________________
> > > Spice-devel mailing list
> > > Spice-devel@lists.freedesktop.org
> > > http://lists.freedesktop.org/mailman/listinfo/spice-devel
> > _______________________________________________
> > Spice-devel mailing list
> > Spice-devel@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/spice-devel
On Mon, Jul 16, 2012 at 05:06:42PM +0200, Marc-André Lureau wrote:
> Hi
> 
> On Mon, Jul 16, 2012 at 5:00 PM, Alon Levy <alevy@redhat.com> wrote:
> > Drop this, instead use the following:
> >
> >
> > commit d0cbc0518fcb0ad5f441387a4530c63ff377ba48
> > Author: Alon Levy <alevy@redhat.com>
> > Date:   Mon Jul 16 12:04:34 2012 +0300
> >
> >     enums.h: generate in build directory, passes distcheck
> >
> > diff --git a/common/Makefile.am b/common/Makefile.am
> > index 3210fc8..3ae2a6b 100644
> > --- a/common/Makefile.am
> > +++ b/common/Makefile.am
> > @@ -14,7 +14,7 @@ SERVER_MARSHALLERS =                                  \
> >         $(srcdir)/generated_server_marshallers.h        \
> >         $(NULL)
> >
> > -BUILT_SOURCES = $(CLIENT_MARSHALLERS) $(SERVER_MARSHALLERS) $(top_srcdir)/spice-protocol/spice/enums.h
> > +BUILT_SOURCES = $(CLIENT_MARSHALLERS) $(SERVER_MARSHALLERS) ../spice-protocol/spice/enums.h
> 
> But then you have 2 enums.h in srcdir and builddir.
> 
> >  noinst_LTLIBRARIES = libspice-common.la libspice-common-server.la libspice-common-client.la
> >  libspice_common_la_SOURCES =           \
> > @@ -122,7 +122,7 @@ generated_server_marshallers.c: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
> >  generated_server_marshallers.h: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
> >         $(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-marshallers $(STRUCTS) --server --include messages.h -H >lt; $@ >/dev/null
> >
> > -$(top_srcdir)/spice-protocol/spice/enums.h: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
> > +../spice-protocol/spice/enums.h: $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
> >         $(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py --generate-enums >lt; $@ >/dev/null
> 
> This will probably still "fail" if builddir == srcdir and src files
> are made read only (which is a good thing).
> 

distcheck doesn't use that, so what's the big deal? and make dist will
work.

> -- 
> Marc-André Lureau
----- Mensaje original -----
> On Mon, Jul 16, 2012 at 05:06:42PM +0200, Marc-André Lureau wrote:
> > Hi
> > 
> > On Mon, Jul 16, 2012 at 5:00 PM, Alon Levy <alevy@redhat.com>
> > wrote:
> > > Drop this, instead use the following:
> > >
> > >
> > > commit d0cbc0518fcb0ad5f441387a4530c63ff377ba48
> > > Author: Alon Levy <alevy@redhat.com>
> > > Date:   Mon Jul 16 12:04:34 2012 +0300
> > >
> > >     enums.h: generate in build directory, passes distcheck
> > >
> > > diff --git a/common/Makefile.am b/common/Makefile.am
> > > index 3210fc8..3ae2a6b 100644
> > > --- a/common/Makefile.am
> > > +++ b/common/Makefile.am
> > > @@ -14,7 +14,7 @@ SERVER_MARSHALLERS =
> > >                                  \
> > >         $(srcdir)/generated_server_marshallers.h        \
> > >         $(NULL)
> > >
> > > -BUILT_SOURCES = $(CLIENT_MARSHALLERS) $(SERVER_MARSHALLERS)
> > > $(top_srcdir)/spice-protocol/spice/enums.h
> > > +BUILT_SOURCES = $(CLIENT_MARSHALLERS) $(SERVER_MARSHALLERS)
> > > ../spice-protocol/spice/enums.h
> > 
> > But then you have 2 enums.h in srcdir and builddir.
> > 
> > >  noinst_LTLIBRARIES = libspice-common.la
> > >  libspice-common-server.la libspice-common-client.la
> > >  libspice_common_la_SOURCES =           \
> > > @@ -122,7 +122,7 @@ generated_server_marshallers.c:
> > > $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
> > >  generated_server_marshallers.h: $(top_srcdir)/spice.proto
> > >  $(MARSHALLERS_DEPS)
> > >         $(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py
> > >         --generate-marshallers $(STRUCTS) --server --include
> > >         messages.h -H >lt; $@ >/dev/null
> > >
> > > -$(top_srcdir)/spice-protocol/spice/enums.h:
> > > $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
> > > +../spice-protocol/spice/enums.h: $(top_srcdir)/spice.proto
> > > $(MARSHALLERS_DEPS)
> > >         $(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py
> > >         --generate-enums >lt; $@ >/dev/null
> > 
> > This will probably still "fail" if builddir == srcdir and src files
> > are made read only (which is a good thing).
> > 
> 
> distcheck doesn't use that, so what's the big deal? and make dist
> will
> work.

Well, having 2 enums.h is already a good reason to avoid this approach. Either it is in srcdir or builddir, but not in both.

Otherwise, I would really prefer we keep the current manually generated and committed approach.
On Mon, Jul 16, 2012 at 11:26:28AM -0400, Marc-André Lureau wrote:
> 
> 
> ----- Mensaje original -----
> > On Mon, Jul 16, 2012 at 05:06:42PM +0200, Marc-André Lureau wrote:
> > > Hi
> > >
> > > On Mon, Jul 16, 2012 at 5:00 PM, Alon Levy <alevy@redhat.com>
> > > wrote:
> > > > Drop this, instead use the following:
> > > >
> > > >
> > > > commit d0cbc0518fcb0ad5f441387a4530c63ff377ba48
> > > > Author: Alon Levy <alevy@redhat.com>
> > > > Date:   Mon Jul 16 12:04:34 2012 +0300
> > > >
> > > >     enums.h: generate in build directory, passes distcheck
> > > >
> > > > diff --git a/common/Makefile.am b/common/Makefile.am
> > > > index 3210fc8..3ae2a6b 100644
> > > > --- a/common/Makefile.am
> > > > +++ b/common/Makefile.am
> > > > @@ -14,7 +14,7 @@ SERVER_MARSHALLERS =
> > > >                                  \
> > > >         $(srcdir)/generated_server_marshallers.h        \
> > > >         $(NULL)
> > > >
> > > > -BUILT_SOURCES = $(CLIENT_MARSHALLERS) $(SERVER_MARSHALLERS)
> > > > $(top_srcdir)/spice-protocol/spice/enums.h
> > > > +BUILT_SOURCES = $(CLIENT_MARSHALLERS) $(SERVER_MARSHALLERS)
> > > > ../spice-protocol/spice/enums.h
> > >
> > > But then you have 2 enums.h in srcdir and builddir.
> > >
> > > >  noinst_LTLIBRARIES = libspice-common.la
> > > >  libspice-common-server.la libspice-common-client.la
> > > >  libspice_common_la_SOURCES =           \
> > > > @@ -122,7 +122,7 @@ generated_server_marshallers.c:
> > > > $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
> > > >  generated_server_marshallers.h: $(top_srcdir)/spice.proto
> > > >  $(MARSHALLERS_DEPS)
> > > >         $(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py
> > > >         --generate-marshallers $(STRUCTS) --server --include
> > > >         messages.h -H >lt; $@ >/dev/null
> > > >
> > > > -$(top_srcdir)/spice-protocol/spice/enums.h:
> > > > $(top_srcdir)/spice.proto $(MARSHALLERS_DEPS)
> > > > +../spice-protocol/spice/enums.h: $(top_srcdir)/spice.proto
> > > > $(MARSHALLERS_DEPS)
> > > >         $(AM_V_GEN)$(PYTHON) $(top_srcdir)/spice_codegen.py
> > > >         --generate-enums >lt; $@ >/dev/null
> > >
> > > This will probably still "fail" if builddir == srcdir and src files
> > > are made read only (which is a good thing).
> > >
> >
> > distcheck doesn't use that, so what's the big deal? and make dist
> > will
> > work.
> 
> Well, having 2 enums.h is already a good reason to avoid this approach. Either it is in srcdir or builddir, but not in both.
> 
> Otherwise, I would really prefer we keep the current manually generated and committed approach.

Fine, push your solution then.
On Mon, Jul 16, 2012 at 06:19:20PM +0300, Alon Levy wrote:
> On Mon, Jul 16, 2012 at 05:06:06PM +0200, Christophe Fergeau wrote:
> > Have you tried $(top_builddir) instead of ../ ?
> 
> No. Where do I find out about those variables?

Somewhere in autoconf documentation I guess ;)
http://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Preset-Output-Variables.html

Christophe