On 09/01/2011 09:35 PM, Stefano Lattarini wrote:
Hi Zbigniew, sorry for the shameful delay.
No problem. Autotools are great anyway :)

I'm quite ignorant about vala and also its support in automake,
I think that the support is in general adequate -- systemd uses vala and in general things get build like they are supposed too.

but I do
think that VPATH builds are not really supported for vala.
So it seems.

Anyway, it would be nice to at least expose the problem in the Automake
testsuite, even if only as an XFAIL; do you have a minimal use case
exposing the issue?
I've taken the hello world example from vala tutorial and wrapped it with
Makefile.am and configure.ac.

It builds fine locally, and fails when build from an external directory:

/tmp/build % ~/src/vala_autotools_test/configure
...
/tmp/build % make
make: *** No rule to make target `/home/zbyszek/src/vala_autotools_test/hello_vala.stamp', needed by `/home/zbyszek/src/vala_autotools_test/src/hello.c'. Stop.

The example is attached. Three files: configure.ac and Makefile.am go in the root directory of the source tree, hello.vala goes into src/.

Zbyszek
AC_INIT([hello],[0],[m...@example.com])
AC_CONFIG_SRCDIR([src/hello.vala])

AM_INIT_AUTOMAKE([foreign])
AM_SILENT_RULES([yes])

AC_PROG_CC
AM_PROG_VALAC([0.10])
AC_SUBST(VAPIDIR)
AC_CONFIG_FILES([Makefile])

AC_USE_SYSTEM_EXTENSIONS
PKG_CHECK_MODULES(GTK, [ gtk+-2.0 glib-2.0 gio-unix-2.0 ])
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)

AC_OUTPUT
bin_PROGRAMS = hello
hello_SOURCES = src/hello.vala

hello_CFLAGS = $(AM_CFLAGS) $(GTK_CFLAGS)
hello_VALAFLAGS = --pkg=posix --pkg=gtk+-2.0 -g
hello_LDADD = $(GTK_LIBS)
class Demo.HelloWorld : GLib.Object {

    public static int main(string[] args) {

        stdout.printf("Hello, World\n");

        return 0;
    }
}

Reply via email to