Re: [Vala] automake 1.11.1: unable to build vala project out-of-tree



On Sat, Nov 6, 2010 at 10:23 PM, Abderrahim Kitouni <a kitouni gmail com> wrote:
Hi,
               في س، 06-11-2010 عند 18:46 +0300 ، كتب Andrey Borzenkov:
I'm trying to rebuild systemd
(http://www.freedesktop.org/wiki/Software/systemd) from GIT. It is
using several programs built using vala; in-tree build is OK,
out-of-tree build fails:
Automake assumes the .c files generated by vala are distributed with the
source, and this isn't true when building from git. A solution is to do
an in-tree build, make distclean, and re-run your out-of-tree build. The
problem is you have to do this dance every time a vala file changes, so
in practice, out-of-tree build isn't supported for development, only for
release tarballs.


I am afraid it does not answer my question. Yes, .c generated from
.vala are disributed, but why automake deliberately emits code that
cannot built .c files from .vala in *source* directory?

The following crude change to final Makefile builds files in (srcdir)
when started from build directory:

$(srcdir)/src/systemadm.c: $(srcdir)/systemadm_vala.stamp
        @if test -f $@; then :; else \
          rm -f $(srcdir)/systemadm_vala.stamp; \
          $(am__cd) $(srcdir) && $(MAKE) $(AM_MAKEFLAGS)
$(srcdir)/systemadm_vala.stamp; \
        fi
$(srcdir)/src/systemd-interfaces.c: $(srcdir)/systemadm_vala.stamp
        @if test -f $@; then :; else \
          rm -f $(srcdir)/systemadm_vala.stamp; \
          $(am__cd) $(srcdir) && $(MAKE) $(AM_MAKEFLAGS)
$(srcdir)/systemadm_vala.stamp; \
        fi
$(srcdir)/systemadm_vala.stamp: $(systemadm_SOURCES)
        $(am__cd) $(srcdir) && \
        $(AM_V_VALAC)$(VALAC) $(systemadm_VALAFLAGS) $(VALAFLAGS) -C
$(systemadm_SOURCES)
        $(AM_V_at)touch $@

Do you see any immediate problem with this change? Could automake
generate similar code by default?

<wishlist>
A possible solution is to have automake (optionally) not distribute the
generated .c files (so they end up in the build dir rather than the
source dir) and that could be used in development if out-of-tree builds
are needed.
</wishlist>


While this is nice wishlist, it is rather orthogonal to discussed problem :)

Thank you!

-andrey



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]