>From c12161817a71b7ab5410896294ac44254e002d3b Mon Sep 17 00:00:00 2001 Message-Id: From: Marc-Antoine Perennou Date: Thu, 12 Apr 2012 13:32:58 +0200 Subject: [PATCH] vala: fix distcheck with c/vala mixed projects 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 Signed-off-by: Stefano Lattarini --- automake.in | 3 +++ tests/vala-mix.test | 11 ++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/automake.in b/automake.in index 08b3300..836680a 100644 --- a/automake.in +++ b/automake.in @@ -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/; diff --git a/tests/vala-mix.test b/tests/vala-mix.test index 012b36a..fe48f26 100755 --- a/tests/vala-mix.test +++ b/tests/vala-mix.test @@ -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 -- 1.7.9.5