Mathias Hasselmann

Automake support for Vala

Using Vala together with automake was quite painful so far. When looking into libvala's Makefile.am for instance you'll see alot of duplication.

So I hacked a little script generating the automake rules needed for vala code. After adding the vala-support script to your autogen.sh script your Makefile.am can look as simple as this:

lib_LTLIBRARIES = libtest.la

libtest_la_CFLAGS = $(AM_CFLAGS) $(GTK_CFLAGS)
libtest_la_VALAFLAGS = --library=test --pkg=gtk+-2.0
libtest_la_LIBADD = $(GTK_LIBS)

libtest_la_SOURCES = \
    test-first.vala \
    test-second.vala \
    test-extra.c

include Makefile.vm

Unfortunatly this is not integrated into upstream automake yet - simply because I am not very skilled in reading other people's Perl code - but the vala-support script itself is written in Perl already, so it should be easy for some skilled Perl hacker to merge that code into automake.

So anyone there to take that task?

Comments

off-topic :/ commented on September 11, 2007 at 4:38 p.m.

SCons has support for building vala projects now:

http://scons.org/wiki/ValaBuilder

When the tool is in place you simply do:

env = Environment()
env.Program(['test1.vala', 'test2.vala', 'test3.c'])