From: Emil Velikov <emil.veli...@collabora.com>

There is no robust way to detect either one, so simply hope for the best
and warn just in case.

Signed-off-by: Emil Velikov <emil.veli...@collabora.com>
---
 src/compiler/glsl/tests/warnings-test.sh | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/src/compiler/glsl/tests/warnings-test.sh 
b/src/compiler/glsl/tests/warnings-test.sh
index 50d760511c0..71e9a8b04d5 100755
--- a/src/compiler/glsl/tests/warnings-test.sh
+++ b/src/compiler/glsl/tests/warnings-test.sh
@@ -1,8 +1,21 @@
 #!/bin/sh
 
+if [ -z "$srcdir" -o -z "$abs_builddir" ]; then
+    echo ""
+    echo "Warning: you're invoking the script manually and things may fail."
+    echo "Attempting to determine/set srcdir and abs_builddir variables."
+    echo ""
+
+    # Variable should point to the Makefile.glsl.am
+    srcdir=./../../
+    cd `dirname "$0"`
+    # Variable should point to glsl_compiler
+    abs_builddir=`pwd`/../../
+fi
+
 # Execute several shaders, and check that the InfoLog outcome is the expected.
 
-compiler=./glsl_compiler
+compiler=$abs_builddir/glsl_compiler
 total=0
 pass=0
 
-- 
2.11.1

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to