vala: fix name of temporary file used in vala rules
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sun, 22 Jan 2012 09:44:42 +0000 (10:44 +0100)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sun, 22 Jan 2012 09:45:39 +0000 (10:45 +0100)
Unquoted `@' characters in a "..." string in the automake script
were causing slightly wrong rules to be emitted in the generated
Makefile.in; i.e., rules like:

  rm -f $@ && echo stamp > $10t

instead of the expected:

  rm -f $@ && echo stamp > $@-t

* automake.in (lang_vala_finish_target): Fix that.
* tests/vala.test: Enhance.

automake.in
tests/vala.test

index 3c70b38..abca23d 100644 (file)
@@ -6083,9 +6083,9 @@ sub lang_vala_finish_target ($$)
 # especially important on systems with sub-second timestamp resolution).
 # Thus we need to create the stamp file *before* invoking valac, and to
 # move it to its final location only after valac has been invoked.
-    "\t${silent}rm -f \$@ && echo stamp > \$@-t\n".
+    "\t${silent}rm -f \$\@ && echo stamp > \$\@-t\n".
     "\t${verbose}\$(am__cd) \$(srcdir) && ${compile} \$(${derived}_SOURCES)\n".
-    "\t${silent}mv -f \$@-t \$@\n";
+    "\t${silent}mv -f \$\@-t \$\@\n";
 
   push_dist_common ("${derived}_vala.stamp");
 
index 442661d..70122c3 100755 (executable)
@@ -84,4 +84,9 @@ $FGREP 'baz.c' sub/Makefile.in
 $FGREP 'foo_vala.stamp:' sub/Makefile.in
 test `$FGREP -c '.stamp:' sub/Makefile.in` -eq 1
 
+# Check against regression for weird bug due to unescaped '@'
+# characters used in a "..." perl string when writing the vala
+# rules from automake.in.
+grep '\$[0-9][0-9]*t' Makefile.in sub/Makefile.in && Exit 1
+
 :