vala: fix distcheck with c/vala mixed projects
authorMarc-Antoine Perennou <Marc-Antoine@Perennou.com>
Thu, 12 Apr 2012 11:32:58 +0000 (13:32 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 12 Apr 2012 12:08:57 +0000 (14:08 +0200)
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>
automake.in
tests/vala-mix.test

index 08b3300..836680a 100644 (file)
@@ -6041,6 +6041,9 @@ sub lang_vala_finish_target ($$)
 
   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/;
index 012b36a..fe48f26 100755 (executable)
@@ -29,12 +29,13 @@ AC_OUTPUT
 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
@@ -74,6 +75,14 @@ chocke me
 #endif
 END
 
+# For automake bug#11229.
+cat > baz.c <<'END'
+int main (void)
+{
+  return 0;
+}
+END
+
 $ACLOCAL
 $AUTOMAKE -a
 $AUTOCONF