Subject: bug#8753: unable to build VALA project out-of-tree

From: Ryan Lortie <[email-masked]>
Date: Sat, 07 Jan 2012 01:21:52 -0500

hi,

Here are a pair of patches that should fix this issue.

Cheers
>From 2debb991917a9f213423962fd4b4c4d4ba478d39 Mon Sep 17 00:00:00 2001
From: Ryan Lortie <[email-masked]>
Date: Sat, 7 Jan 2012 01:06:37 -0500
Subject: [PATCH 1/2] tests: fix some bugs in the vala-vpath test

There are (trivial) problems in this testcase that would cause the build
to fail even if the core issue were resolved.  Fix those.
---
 tests/vala-vpath.test |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/tests/vala-vpath.test b/tests/vala-vpath.test
index 9db9de0..5d5d8d7 100755
--- a/tests/vala-vpath.test
+++ b/tests/vala-vpath.test
@@ -20,8 +20,6 @@
 required="valac"
 . ./defs || Exit 1
 
-mkdir src
-
 cat >> configure.in << 'END'
 AC_CONFIG_SRCDIR([hello.vala])
 AC_PROG_CC
@@ -32,6 +30,7 @@ END
 
 cat > Makefile.am <<'END'
 bin_PROGRAMS = foo
+foo_VALAFLAGS = --profile=posix
 foo_SOURCES = hello.vala
 END
 
@@ -39,7 +38,6 @@ cat > hello.vala <<'END'
 void main ()
 {
   stdout.printf ("foo\n");
-  return 0;
 }
 END
 
-- 
1.7.7.5

>From cbab9dcb685d2ddb0649c14a16b8a2e54b8528cc Mon Sep 17 00:00:00 2001
From: Ryan Lortie <[email-masked]>
Date: Sat, 7 Jan 2012 01:08:11 -0500
Subject: [PATCH 2/2] automake: fix VPATH builds for Vala

and remove the testcase from XFAIL_TESTS
---
 automake.in       |    4 ++--
 tests/Makefile.am |    1 -
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/automake.in b/automake.in
index aa65e56..39876f9 100644
--- a/automake.in
+++ b/automake.in
@@ -5900,8 +5900,8 @@ sub lang_vala_finish_target ($$)
   my $silent = silent_flag ();
 
   $output_rules .=
-    "${derived}_vala.stamp: \$(${derived}_SOURCES)\n".
-    "\t${verbose}${compile} \$(${derived}_SOURCES)\n".
+    "\$(srcdir)/${derived}_vala.stamp: \$(${derived}_SOURCES)\n".
+    "\tcd \$(srcdir); ${verbose}${compile} \$(${derived}_SOURCES)\n".
     "\t${silent}touch \$@\n";
 
   push_dist_common ("${derived}_vala.stamp");
diff --git a/tests/Makefile.am b/tests/Makefile.am
index bfd4337..5d5c254 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -52,7 +52,6 @@ pr8365-remake-timing.test \
 lex-subobj-nodep.test \
 remake-am-pr10111.test \
 remake-m4-pr10111.test \
-vala-vpath.test \
 txinfo5.test
 
 # Some testsuite-influential variables should be overridable from the
-- 
1.7.7.5