gbm: fail symbol check if lib is missing
authorEric Engestrom <eric.engestrom@imgtec.com>
Mon, 30 Oct 2017 15:27:25 +0000 (15:27 +0000)
committerEric Engestrom <eric.engestrom@imgtec.com>
Tue, 31 Oct 2017 17:59:29 +0000 (17:59 +0000)
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
src/gbm/gbm-symbols-check

index 2444131e990228513d8fa7756cc8493e92c08715..cf57a08d5728cfff480c05033e0f5b9fc72920d8 100755 (executable)
@@ -1,6 +1,15 @@
 #!/bin/sh
+set -eu
 
-FUNCS=$(nm -D --defined-only ${1-.libs/libgbm.so} | grep -o "T .*" | cut -c 3- | while read func; do
+LIB=${1-.libs/libgbm.so}
+
+if ! [ -f "$LIB" ]
+then
+  exit 1
+fi
+
+
+FUNCS=$(nm -D --defined-only $LIB | grep -o "T .*" | cut -c 3- | while read func; do
 ( grep -q "^$func$" || echo $func )  <<EOF
 gbm_device_get_fd
 gbm_device_get_backend_name