Fixes automake bug#11229.
* automake.in (lang_vala_finish_target): Return early if the
current '_SOURCES' variable does not contain any '.vala' nor
'.vapi' source. Otherwise, the vala compiler will be called
without arguments, causing an error.
* tests/vala-mix.test: Enhance to catch the fixed bug.
Copyright-paperwork-exempt: yes
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
my @vala_sources = grep { /\.vala$/ } ($var->value_as_list_recursive);
+ # For automake bug#11229.
+ return unless @vala_sources;
+
foreach my $vala_file (@vala_sources)
{
(my $c_file = $vala_file) =~ s/(.*)\.vala$/$1.c/;
END
cat > Makefile.am <<'END'
-bin_PROGRAMS = zardoz mu
+bin_PROGRAMS = zardoz mu baz
AM_VALAFLAGS = --profile=posix
zardoz_SOURCES = foo.vala bar.c
mu_SOURCES = 1.vala 2.c
mu_VALAFLAGS = $(AM_VALAFLAGS) --main=run
mu_CFLAGS = -DHAVE_MU
+baz_SOURCES = baz.c
END
if cross_compiling; then :; else
#endif
END
+# For automake bug#11229.
+cat > baz.c <<'END'
+int main (void)
+{
+ return 0;
+}
+END
+
$ACLOCAL
$AUTOMAKE -a
$AUTOCONF