[Mesa-dev] [PATCH mesa 2/5] gles: use new symbols checking script

Eric Engestrom eric.engestrom at imgtec.com
Wed Mar 28 17:07:47 UTC 2018


Signed-off-by: Eric Engestrom <eric.engestrom at imgtec.com>
---
This will fail unless [1] lands first.

[1] https://patchwork.freedesktop.org/patch/213409/
---
 meson.build               |  1 +
 src/mapi/Makefile.am      |  1 +
 src/mapi/es1api/ABI-check | 22 ++++++++--------------
 src/mapi/es2api/ABI-check | 22 ++++++++--------------
 4 files changed, 18 insertions(+), 28 deletions(-)

diff --git a/meson.build b/meson.build
index acc6688921e5ad06f651..31907b06fe5d32782da5 100644
--- a/meson.build
+++ b/meson.build
@@ -1321,6 +1321,7 @@ pkg = import('pkgconfig')
 
 env_test = environment()
 env_test.set('NM', find_program('nm').path())
+env_test.set('top_srcdir', meson.source_root())
 
 subdir('include')
 subdir('bin')
diff --git a/src/mapi/Makefile.am b/src/mapi/Makefile.am
index 3da1a193d284a68af528..22ede2ce4a206e1d17fb 100644
--- a/src/mapi/Makefile.am
+++ b/src/mapi/Makefile.am
@@ -21,6 +21,7 @@
 
 SUBDIRS =
 TESTS =
+AM_TESTS_ENVIRONMENT = top_srcdir='$(top_srcdir)'
 
 BUILT_SOURCES =
 CLEANFILES = $(BUILT_SOURCES)
diff --git a/src/mapi/es1api/ABI-check b/src/mapi/es1api/ABI-check
index d8501e5d8c5c2fdd1ca1..d8616840b1329a8394cd 100755
--- a/src/mapi/es1api/ABI-check
+++ b/src/mapi/es1api/ABI-check
@@ -10,23 +10,18 @@ set -eu
 
 case "$(uname)" in
 Darwin)
-  LIB=${1-es1api/.libs/libGLESv1_CM.dylib}
+  LIB=es1api/.libs/libGLESv1_CM.dylib
   ;;
 CYGWIN*)
-  LIB=${1-es1api/.libs/cygGLESv1_CM-1.dll}
+  LIB=es1api/.libs/cygGLESv1_CM-1.dll
   ;;
 *)
-  LIB=${1-es1api/.libs/libGLESv1_CM.so.1}
+  LIB=es1api/.libs/libGLESv1_CM.so.1
   ;;
 esac
 
-if ! [ -f "$LIB" ]
-then
-  exit 1
-fi
-
-FUNCS=$($NM -D --defined-only $LIB | grep -o 'T gl.*' | cut -c 3- | while read func; do
-( grep -q "^$func$" || echo $func )  <<EOF
+# Official ABI, taken from the header.
+REQ_FUNCS="
 glActiveTexture
 glAlphaFunc
 glAlphaFuncx
@@ -174,8 +169,7 @@ glTranslatef
 glTranslatex
 glVertexPointer
 glViewport
-EOF
-done)
+"
 
-test ! -n "$FUNCS" || echo $FUNCS
-test ! -n "$FUNCS"
+# Run the checks
+source "$top_srcdir"/scripts/symbols-check
diff --git a/src/mapi/es2api/ABI-check b/src/mapi/es2api/ABI-check
index 2d92d1c0028697f1439e..df6dfeabfacc491d400b 100755
--- a/src/mapi/es2api/ABI-check
+++ b/src/mapi/es2api/ABI-check
@@ -7,23 +7,18 @@ set -eu
 
 case "$(uname)" in
 Darwin)
-  LIB=${1-es2api/.libs/libGLESv2.dylib}
+  LIB=es2api/.libs/libGLESv2.dylib
   ;;
 CYGWIN*)
-  LIB=${1-es2api/.libs/cygGLESv2-2.dll}
+  LIB=es2api/.libs/cygGLESv2-2.dll
   ;;
 *)
-  LIB=${1-es2api/.libs/libGLESv2.so.2}
+  LIB=es2api/.libs/libGLESv2.so.2
   ;;
 esac
 
-if ! [ -f "$LIB" ]
-then
-  exit 1
-fi
-
-FUNCS=$($NM -D --defined-only $LIB | grep -o 'T gl.*' | cut -c 3- | while read func; do
-( grep -q "^$func$" || echo $func )  <<EOF
+# Official ABI, taken from the header.
+REQ_FUNCS="
 glActiveShaderProgram
 glActiveTexture
 glAttachShader
@@ -389,8 +384,7 @@ glVertexAttribPointer
 glVertexBindingDivisor
 glViewport
 glWaitSync
-EOF
-done)
+"
 
-test ! -n "$FUNCS" || echo $FUNCS
-test ! -n "$FUNCS"
+# Run the checks
+source "$top_srcdir"/scripts/symbols-check
-- 
Cheers,
  Eric



More information about the mesa-dev mailing list