Next: , Previous: , Up: Building Programs and Libraries   [Contents][Index]


8.17 Vala Support

Automake provides initial support for Vala (http://www.vala-project.org/). This requires valac version 0.7.0 or later, and currently requires the user to use GNU make.

foo_SOURCES = foo.vala bar.vala zardoc.c

Any .vala file listed in a _SOURCES variable will be compiled into C code by the Vala compiler. The generated .c files are distributed. The end user does not need to have a Vala compiler installed.

Automake ships with an Autoconf macro called AM_PROG_VALAC that will locate the Vala compiler and optionally check its version number.

Macro: AM_PROG_VALAC ([minimum-version])

Try to find a Vala compiler in PATH. If it is found, the variable VALAC is set. Optionally a minimum release number of the compiler can be requested:

AM_PROG_VALAC([0.7.0])

There are a few variables that are used when compiling Vala sources:

VALAC

Path to the Vala compiler.

VALAFLAGS

Additional arguments for the Vala compiler.

AM_VALAFLAGS

The maintainer’s variant of VALAFLAGS.

lib_LTLIBRARIES = libfoo.la
libfoo_la_SOURCES = foo.vala

Note that currently, you cannot use per-target *_VALAFLAGS (see Why are object files sometimes renamed?) to produce different C files from one Vala source file.