*-symbol-check: use correct `nm` path when cross-compiling
authorEric Engestrom <eric.engestrom@imgtec.com>
Fri, 23 Feb 2018 17:02:08 +0000 (17:02 +0000)
committerEric Engestrom <eric.engestrom@imgtec.com>
Mon, 26 Feb 2018 13:50:59 +0000 (13:50 +0000)
Inspired-by: a similar patch for libdrm by Heiko Becker
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
12 files changed:
configure.ac
meson.build
src/egl/egl-symbols-check
src/egl/meson.build
src/egl/wayland/wayland-egl/meson.build
src/egl/wayland/wayland-egl/wayland-egl-symbols-check
src/gbm/gbm-symbols-check
src/gbm/meson.build
src/mapi/es1api/ABI-check
src/mapi/es1api/meson.build
src/mapi/es2api/ABI-check
src/mapi/es2api/meson.build

index 346c813..d809359 100644 (file)
@@ -116,6 +116,7 @@ dnl other CC/CXX flags related help
 AC_ARG_VAR([CXX11_CXXFLAGS], [Compiler flag to enable C++11 support (only needed if not
                               enabled by default and different  from -std=c++11)])
 AM_PROG_CC_C_O
+AC_PROG_NM
 AM_PROG_AS
 AX_CHECK_GNU_MAKE
 AC_CHECK_PROGS([PYTHON2], [python2.7 python2 python])
index 8cf67b8..6f2615f 100644 (file)
@@ -1256,6 +1256,9 @@ endif
 
 pkg = import('pkgconfig')
 
+env_test = environment()
+env_test.set('NM', find_program('nm').path())
+
 subdir('include')
 subdir('bin')
 subdir('src')
index ae867d0..460e61a 100755 (executable)
@@ -8,7 +8,7 @@ then
   exit 1
 fi
 
-FUNCS=$(nm -D --defined-only $LIB | grep -o "T .*" | cut -c 3- | while read func; do
+FUNCS=$($NM -D --defined-only $LIB | grep -o "T .*" | cut -c 3- | while read func; do
 ( grep -q "^$func$" || echo $func )  <<EOF
 eglBindAPI
 eglBindTexImage
index abf6085..36cd33a 100644 (file)
@@ -204,6 +204,7 @@ if with_tests
   else
     test('egl-symbols-check',
       find_program('egl-symbols-check'),
+      env : env_test,
       args : libegl
     )
   endif
index c95d4c1..d0a7521 100644 (file)
@@ -40,6 +40,7 @@ pkg.generate(
 if with_tests
   test('wayland-egl-symbols-check',
     find_program('wayland-egl-symbols-check'),
+    env : env_test,
     args : libwayland_egl
   )
   test(
index 04b2dbf..a5fab77 100755 (executable)
@@ -8,7 +8,7 @@ then
   exit 1
 fi
 
-FUNCS=$(nm -D --defined-only $LIB | grep -o "T .*" | cut -c 3- | while read func; do
+FUNCS=$($NM -D --defined-only $LIB | grep -o "T .*" | cut -c 3- | while read func; do
 ( grep -q "^$func$" || echo $func )  <<EOF
 wl_egl_window_resize
 wl_egl_window_create
index cf57a08..5adeada 100755 (executable)
@@ -8,8 +8,7 @@ then
   exit 1
 fi
 
-
-FUNCS=$(nm -D --defined-only $LIB | grep -o "T .*" | cut -c 3- | while read func; do
+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
index 2f5d1c6..13fa3a1 100644 (file)
@@ -74,6 +74,7 @@ if with_tests
   test(
     'gbm-symbols-check',
     find_program('gbm-symbols-check'),
+    env : env_test,
     args : libgbm
   )
 endif
index b9ae5ef..11b4923 100755 (executable)
@@ -26,7 +26,7 @@ then
   exit 1
 fi
 
-FUNCS=$(nm -D --defined-only $LIB | grep -o 'T gl.*' | cut -c 3- | while read func; do
+FUNCS=$($NM -D --defined-only $LIB | grep -o 'T gl.*' | cut -c 3- | while read func; do
 ( grep -q "^$func$" || echo $func )  <<EOF
 glActiveTexture
 glAlphaFunc
index 38a5747..657dc2d 100644 (file)
@@ -55,6 +55,7 @@ if with_tests
   test(
     'es1-ABI-check',
     find_program('ABI-check'),
+    env : env_test,
     args : libglesv1_cm
   )
 endif
index 7bc7848..a04b03d 100755 (executable)
@@ -23,7 +23,7 @@ then
   exit 1
 fi
 
-FUNCS=$(nm -D --defined-only $LIB | grep -o 'T gl.*' | cut -c 3- | while read func; do
+FUNCS=$($NM -D --defined-only $LIB | grep -o 'T gl.*' | cut -c 3- | while read func; do
 ( grep -q "^$func$" || echo $func )  <<EOF
 glActiveShaderProgram
 glActiveTexture
index 9f4770a..da5198e 100644 (file)
@@ -55,6 +55,7 @@ if with_tests
   test(
     'es2-ABI-check',
     find_program('ABI-check'),
+    env : env_test,
     args : libgles2
   )
 endif