# HG changeset patch
# User Chris Cannam
# Date 1496826347 -3600
# Node ID 41a64dc57066e80eddd59055c41d0e11a181e353
# Parent  975dee07ff5c1fbabe9124cc1daebb887c7473f1
Update Vext logic

diff -r 975dee07ff5c -r 41a64dc57066 configure
--- a/configure	Wed Jun 07 09:56:57 2017 +0100
+++ b/configure	Wed Jun 07 10:05:47 2017 +0100
@@ -8521,11 +8521,28 @@
 fi
 
 
-if test -d .hg ; then
-   if ! ./vext install; then
-      as_fn_error $? "Vext failed; please fix any reported errors and try again" "$LINENO" 5
+if test -x vext ; then
+   if test -d .hg -o -d .git ; then
+      if ! ./vext install; then
+         as_fn_error $? "Vext failed; please fix any reported errors and try again" "$LINENO" 5
+      fi
+   else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Vext executable found but not in an Hg or Git working-copy: not running it" >&5
+$as_echo "$as_me: Vext executable found but not in an Hg or Git working-copy: not running it" >&6;}
+      if ! test -d vamp-plugin-sdk ; then
+          { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: No vamp-plugin-sdk directory present, so external libraries might not have been updated" >&5
+$as_echo "$as_me: WARNING: No vamp-plugin-sdk directory present, so external libraries might not have been updated" >&2;}
+      fi
    fi
-fi
+else
+   { $as_echo "$as_me:${as_lineno-$LINENO}: No Vext executable found: assuming external libraries are already here" >&5
+$as_echo "$as_me: No Vext executable found: assuming external libraries are already here" >&6;}
+   if ! test -d vamp-plugin-sdk ; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: No vamp-plugin-sdk directory present, so external libraries might not have been updated" >&5
+$as_echo "$as_me: WARNING: No vamp-plugin-sdk directory present, so external libraries might not have been updated" >&2;}
+   fi
+fi
+
 if ! $QMAKE -r sonic-visualiser.pro; then
    as_fn_error $? "qmake failed: Command was \"$QMAKE -r\"" "$LINENO" 5
 fi
diff -r 975dee07ff5c -r 41a64dc57066 configure.ac
--- a/configure.ac	Wed Jun 07 09:56:57 2017 +0100
+++ b/configure.ac	Wed Jun 07 10:05:47 2017 +0100
@@ -139,11 +139,24 @@
 
 AC_OUTPUT
 
-if test -d .hg ; then 
-   if ! ./vext install; then
-      AC_MSG_ERROR([Vext failed; please fix any reported errors and try again])
+if test -x vext ; then
+   if test -d .hg -o -d .git ; then 
+      if ! ./vext install; then
+         AC_MSG_ERROR([Vext failed; please fix any reported errors and try again])
+      fi
+   else
+      AC_MSG_NOTICE([Vext executable found but not in an Hg or Git working-copy: not running it])
+      if ! test -d vamp-plugin-sdk ; then
+          AC_MSG_WARN([No vamp-plugin-sdk directory present, so external libraries might not have been updated])
+      fi
+   fi
+else
+   AC_MSG_NOTICE([No Vext executable found: assuming external libraries are already here])
+   if ! test -d vamp-plugin-sdk ; then
+      AC_MSG_WARN([No vamp-plugin-sdk directory present, so external libraries might not have been updated])
    fi
 fi
+
 if ! $QMAKE -r sonic-visualiser.pro; then
    AC_MSG_ERROR([qmake failed: Command was "$QMAKE -r"])
 fi