From b629ff7b3ed15c44147ebe87e1afb554f22e83a9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrg=20Billeter?= Date: Sun, 17 May 2009 10:14:13 +0200 Subject: [PATCH] Vala: Fix build when using per-target VALAFLAGS. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This does not yet implement full per-target support for VALAFLAGS, however, this change at least fixes building when there is only one target per source file, which is the most common situation. * automake.in: Remove `VALAFLAGS' from `flags' in language struct. (lang_vala_finish_target): Handle `*_VALAFLAGS rewriting' manually here; check `VALAFLAGS' user variables. * tests/Makefile.am (XFAIL_TESTS): Remove vala5.test. * doc/automake.texi (Vala Support): Document per-target flag limitations. Signed-off-by: Jürg Billeter Signed-off-by: Ralf Wildenhues --- ChangeLog | 14 ++++++++++++++ automake.in | 19 ++++++++++--------- doc/automake.texi | 4 ++++ tests/Makefile.am | 3 +-- tests/Makefile.in | 3 +-- 5 files changed, 30 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 329879c26..a8589d354 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2009-05-17 Jürg Billeter + Ralf Wildenhues + + Vala: Fix build when using per-target VALAFLAGS. + This does not yet implement full per-target support for VALAFLAGS, + however, this change at least fixes building when there is only one + target per source file, which is the most common situation. + * automake.in: Remove `VALAFLAGS' from `flags' in language struct. + (lang_vala_finish_target): Handle `*_VALAFLAGS rewriting' manually + here; check `VALAFLAGS' user variables. + * tests/Makefile.am (XFAIL_TESTS): Remove vala5.test. + * doc/automake.texi (Vala Support): Document per-target flag + limitations. + 2009-05-11 Ralf Wildenhues For PR automake/540: diff --git a/automake.in b/automake.in index 20ef3bd2e..be525053b 100755 --- a/automake.in +++ b/automake.in @@ -815,7 +815,7 @@ register_language ('name' => 'header', register_language ('name' => 'vala', 'Name' => 'Vala', 'config_vars' => ['VALAC'], - 'flags' => ['VALAFLAGS'], + 'flags' => [], 'compile' => '$(VALAC) $(AM_VALAFLAGS) $(VALAFLAGS)', 'ccer' => 'VALAC', 'compiler' => 'VALACOMPILE', @@ -5953,14 +5953,15 @@ sub lang_vala_finish_target ($$) my $compile = $self->compile; - # Rewrite each occurrence of `AM_$flag' in the compile - # rule into `${derived}_$flag' if it exists. - for my $flag (@{$self->flags}) - { - my $val = "${derived}_$flag"; - $compile =~ s/\(AM_$flag\)/\($val\)/ - if set_seen ($val); - } + # Rewrite each occurrence of `AM_VALAFLAGS' in the compile + # rule into `${derived}_VALAFLAGS' if it exists. + my $val = "${derived}_VALAFLAGS"; + $compile =~ s/\(AM_VALAFLAGS\)/\($val\)/ + if set_seen ($val); + + # VALAFLAGS is a user variable (per GNU Standards), + # it should not be overridden in the Makefile... + check_user_variables ['VALAFLAGS']; my $dirname = dirname ($name); diff --git a/doc/automake.texi b/doc/automake.texi index e8779422a..8241d7bf1 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -6653,6 +6653,10 @@ libfoo_la_SOURCES = foo.vala @end example @end vtable +Note that currently, you cannot use per-target @code{*_VALAFLAGS} +(@pxref{Renamed Objects}) to produce different C files from one Vala +source file. + @node Support for Other Languages @comment node-name, next, previous, up diff --git a/tests/Makefile.am b/tests/Makefile.am index afcfda8ae..d70060846 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -4,8 +4,7 @@ XFAIL_TESTS = \ all.test \ auxdir2.test \ cond17.test \ -txinfo5.test \ -vala5.test +txinfo5.test include $(srcdir)/parallel-tests.am diff --git a/tests/Makefile.in b/tests/Makefile.in index ce8e779e8..bc77d2341 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -229,8 +229,7 @@ XFAIL_TESTS = \ all.test \ auxdir2.test \ cond17.test \ -txinfo5.test \ -vala5.test +txinfo5.test parallel_tests = \ check-p.test \ -- 2.47.2