[Spice-devel] [spice-gtk 1/2] configure.ac: improve vala detection

Christophe Fergeau cfergeau at redhat.com
Mon Apr 2 03:07:53 PDT 2012


Currently, configure doesn't check for vala, nor set vala related
variables unless --enable-vala was passed. autogen.sh automatically
pass --enable-vala if controller.vala.stamp doesn't exist. However,
this is not enough since if controller.vala is newer than
controller.vala.stamp, we will need to regenerate the vala files,
and for that the vala tools are needed.
This commit doesn't fully fix this issue, but it at least autodetect
vala unless --disable-vala is passed, which will help on systems where
vala is installed, but where --enable-vala wasn't explicitly passed.
---
 configure.ac |   16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/configure.ac b/configure.ac
index 45d99dc..f416ede 100644
--- a/configure.ac
+++ b/configure.ac
@@ -511,19 +511,23 @@ GOBJECT_INTROSPECTION_CHECK([0.6.7])
 AM_CONDITIONAL([G_IR_SCANNER_SYMBOL_PREFIX], [test "x$has_symbol_prefix" = "xyes"])
 
 AC_ARG_ENABLE([vala],
-  AS_HELP_STRING([--enable-vala], [Check for vala requirements @<:@default=no@:>@]),
+  AS_HELP_STRING([--enable-vala], [Check for vala requirements @<:@default=check@:>@]),
   [],
-  enable_vala="no")
+  enable_vala="check")
 
 VALA_REQUIRED=0.14
-if test x$enable_vala = xyes ; then
+if test x$enable_vala != xno ; then
     # check for vala
     AM_PROG_VALAC([$VALA_REQUIRED])
     AC_PATH_PROG(VAPIGEN, vapigen, no)
-    if test "x$VAPIGEN" == "xno"; then
-        AC_MSG_ERROR([Cannot find the "vapigen" binary in your PATH])
+    if test "x$VAPIGEN" != "xno"; then
+        enable_vala=yes
+        AC_SUBST(VAPIGEN)
+    else
+        if test "x$enable_vala" == "xyes"; then
+            AC_MSG_ERROR([Cannot find the "vapigen" binary in your PATH])
+        fi
     fi
-    AC_SUBST(VAPIGEN)
 fi
 
 AM_CONDITIONAL(WITH_VALA, [test "x$enable_vala" = "xyes"])
-- 
1.7.9.3



More information about the Spice-devel mailing list