Vala: Fix build when using per-target VALAFLAGS.
authorJürg Billeter <j@bitron.ch>
Sun, 17 May 2009 08:14:13 +0000 (10:14 +0200)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sun, 17 May 2009 08:18:16 +0000 (10:18 +0200)
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 <j@bitron.ch>
Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
ChangeLog
automake.in
doc/automake.texi
tests/Makefile.am
tests/Makefile.in

index 329879c..a8589d3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2009-05-17  Jürg Billeter  <j@bitron.ch>
+           Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       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  <Ralf.Wildenhues@gmx.de>
 
        For PR automake/540:
index 20ef3bd..be52505 100755 (executable)
@@ -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);
 
index e877942..8241d7b 100644 (file)
@@ -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
index afcfda8..d700608 100644 (file)
@@ -4,8 +4,7 @@ XFAIL_TESTS =                                   \
 all.test                                       \
 auxdir2.test                                   \
 cond17.test                                    \
-txinfo5.test                                   \
-vala5.test
+txinfo5.test
 
 include $(srcdir)/parallel-tests.am
 
index ce8e779..bc77d23 100644 (file)
@@ -229,8 +229,7 @@ XFAIL_TESTS = \
 all.test                                       \
 auxdir2.test                                   \
 cond17.test                                    \
-txinfo5.test                                   \
-vala5.test
+txinfo5.test
 
 parallel_tests = \
 check-p.test \