VPATHs and Vala

View: New views
2 Messages — Rating Filter:   Alert me  

VPATHs and Vala

by Bahjat Salem :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Added support for VPATH builds when compiling Vala sources.
* automake.in (lang_vala_finish_target): Rewrote the .stamp file
target commands, and simplified .c and .h target commands.


Please ignore my previous (failed) patch :
http://www.mail-archive.com/bug-automake@.../msg01597.html

[0001-VPATH-builds-with-Vala.patch]

From 668c22b2f132893daa125a586faed3cb958ef1c9 Mon Sep 17 00:00:00 2001
From: Bahjat SALEM <bahjat.salem@...>
Date: Sun, 25 Oct 2009 14:34:19 +0100
Subject: [PATCH] VPATH builds with Vala

Problem solved:
Build failure on a VPATH build.

How the problem was solved:
Made automake put the .stamp file and the .c sources in the source tree.

Typical usage scenarii tested:
1. C sources have not yet been generated by $(VALAC). VPATH build.
mkdir build && cd build && autoreconf -vfi .. && ../configure && make
2. C sources have not yet been generated by $(VALAC). Normal build.
autoreconf -vfi && ./configure && make
3. C sources have already been generated by the package maintainer's
$(VALAC). The sources are included in the package and do not need to
be generated again.
./configure && make
4. Same as 3.
mkdir build && cd build && ../configure && make

Please ignore my previous (failed) patch.
http://www.mail-archive.com/bug-automake@.../msg01597.html
---
 automake.in |   17 ++++-------------
 1 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/automake.in b/automake.in
index 2af2897..16d9a42 100755
--- a/automake.in
+++ b/automake.in
@@ -5979,11 +5979,7 @@ sub lang_vala_finish_target ($$)
     {
       foreach my $file ($var->value_as_list_recursive)
         {
-          $output_rules .= "\$(srcdir)/$file: \$(srcdir)/${derived}_vala.stamp\n".
-            "\t\@if test -f \$@; then :; else \\\n".
-            "\t  rm -f \$(srcdir)/${derived}_vala.stamp; \\\n".
-            "\t  \$(am__cd) \$(srcdir) && \$(MAKE) \$(AM_MAKEFLAGS) ${derived}_vala.stamp; \\\n".
-            "\tfi\n"
+          $output_rules .= "\$(srcdir)/$file: \$(srcdir)/${derived}_vala.stamp\n"
             if $file =~ s/(.*)\.vala$/$1.c/;
         }
     }
@@ -5999,11 +5995,7 @@ sub lang_vala_finish_target ($$)
                           '--vapi', '--internal-vapi', '--gir')))
     {
       my $headerfile = $flag;
-      $output_rules .= "\$(srcdir)/$headerfile: \$(srcdir)/${derived}_vala.stamp\n".
- "\t\@if test -f \$@; then :; else \\\n".
- "\t  rm -f \$(srcdir)/${derived}_vala.stamp; \\\n".
- "\t  \$(am__cd) \$(srcdir) && \$(MAKE) \$(AM_MAKEFLAGS) ${derived}_vala.stamp; \\\n".
- "\tfi\n";
+      $output_rules .= "\$(srcdir)/$headerfile: \$(srcdir)/${derived}_vala.stamp\n";
 
       # valac is not used when building from dist tarballs
       # distribute the generated files
@@ -6035,9 +6027,8 @@ sub lang_vala_finish_target ($$)
   my $silent = silent_flag ();
 
   $output_rules .=
-    "${derived}_vala.stamp: \$(${derived}_SOURCES)\n".
-    "\t${verbose}${compile} \$(${derived}_SOURCES)\n".
-    "\t${silent}touch \$@\n";
+    "\$(srcdir)/${derived}_vala.stamp: \$(${derived}_SOURCES)\n".
+    "\t${verbose}\$(am__cd) \$(srcdir) && ${compile} \$(${derived}_SOURCES) && touch \$(abs_srcdir)/${derived}_vala.stamp\n";
 
   push_dist_common ("${derived}_vala.stamp");
 
--
1.6.0.4




signature.asc (204 bytes) Download Attachment

Re: VPATHs and Vala

by Ralf Wildenhues :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

<http://thread.gmane.org/gmane.comp.sysutils.automake.patches/3721>

Hello Bahjat,

* Bahjat Salem wrote on Sun, Oct 25, 2009 at 03:17:43PM CET:
> Added support for VPATH builds when compiling Vala sources.
> * automake.in (lang_vala_finish_target): Rewrote the .stamp file
> target commands, and simplified .c and .h target commands.
>
> Please ignore my previous (failed) patch :
> http://www.mail-archive.com/bug-automake@.../msg01597.html

Thanks for your patch.  In order to be able to judge its impact, I
would like to see an example that is broken without the patch and
works with the patch, and I'd like to add a test to this extent to
the Automake test suite, to ensure it isn't broken again later.

Please also note that nontrivial patches need copyright assignment
(details off-list).  The patch you posted so far is small enough not
to need it, but with a testcase it won't be.  So if you do not assign
or disclaim then please don't post a patch for a test case but only
describe it in words, so we can write an unencumbered one.

Thanks,
Ralf

> From 668c22b2f132893daa125a586faed3cb958ef1c9 Mon Sep 17 00:00:00 2001
> From: Bahjat SALEM <bahjat.salem@...>
> Date: Sun, 25 Oct 2009 14:34:19 +0100
> Subject: [PATCH] VPATH builds with Vala
>
> Problem solved:
> Build failure on a VPATH build.
>
> How the problem was solved:
> Made automake put the .stamp file and the .c sources in the source tree.
>
> Typical usage scenarii tested:
> 1. C sources have not yet been generated by $(VALAC). VPATH build.
> mkdir build && cd build && autoreconf -vfi .. && ../configure && make
> 2. C sources have not yet been generated by $(VALAC). Normal build.
> autoreconf -vfi && ./configure && make
> 3. C sources have already been generated by the package maintainer's
> $(VALAC). The sources are included in the package and do not need to
> be generated again.
> ./configure && make
> 4. Same as 3.
> mkdir build && cd build && ../configure && make
>
> Please ignore my previous (failed) patch.
> http://www.mail-archive.com/bug-automake@.../msg01597.html

> --- a/automake.in
> +++ b/automake.in
> @@ -5979,11 +5979,7 @@ sub lang_vala_finish_target ($$)
>      {
>        foreach my $file ($var->value_as_list_recursive)
>          {
> -          $output_rules .= "\$(srcdir)/$file: \$(srcdir)/${derived}_vala.stamp\n".
> -            "\t\@if test -f \$@; then :; else \\\n".
> -            "\t  rm -f \$(srcdir)/${derived}_vala.stamp; \\\n".
> -            "\t  \$(am__cd) \$(srcdir) && \$(MAKE) \$(AM_MAKEFLAGS) ${derived}_vala.stamp; \\\n".
> -            "\tfi\n"
> +          $output_rules .= "\$(srcdir)/$file: \$(srcdir)/${derived}_vala.stamp\n"
>              if $file =~ s/(.*)\.vala$/$1.c/;
>          }
>      }
> @@ -5999,11 +5995,7 @@ sub lang_vala_finish_target ($$)
>                            '--vapi', '--internal-vapi', '--gir')))
>      {
>        my $headerfile = $flag;
> -      $output_rules .= "\$(srcdir)/$headerfile: \$(srcdir)/${derived}_vala.stamp\n".
> - "\t\@if test -f \$@; then :; else \\\n".
> - "\t  rm -f \$(srcdir)/${derived}_vala.stamp; \\\n".
> - "\t  \$(am__cd) \$(srcdir) && \$(MAKE) \$(AM_MAKEFLAGS) ${derived}_vala.stamp; \\\n".
> - "\tfi\n";
> +      $output_rules .= "\$(srcdir)/$headerfile: \$(srcdir)/${derived}_vala.stamp\n";
>  
>        # valac is not used when building from dist tarballs
>        # distribute the generated files
> @@ -6035,9 +6027,8 @@ sub lang_vala_finish_target ($$)
>    my $silent = silent_flag ();
>  
>    $output_rules .=
> -    "${derived}_vala.stamp: \$(${derived}_SOURCES)\n".
> -    "\t${verbose}${compile} \$(${derived}_SOURCES)\n".
> -    "\t${silent}touch \$@\n";
> +    "\$(srcdir)/${derived}_vala.stamp: \$(${derived}_SOURCES)\n".
> +    "\t${verbose}\$(am__cd) \$(srcdir) && ${compile} \$(${derived}_SOURCES) && touch \$(abs_srcdir)/${derived}_vala.stamp\n";
>  
>    push_dist_common ("${derived}_vala.stamp");
>