[Mesa-dev] [PATCH mesa] *-symbol-check: use correct `nm` path when cross-compiling
Eric Engestrom
eric.engestrom at imgtec.com
Fri Feb 23 17:04:54 UTC 2018
Inspired-by: a similar patch for libdrm by Heiko Becker
Signed-off-by: Eric Engestrom <eric.engestrom at imgtec.com>
---
configure.ac | 1 +
meson.build | 3 +++
src/egl/egl-symbols-check | 2 +-
src/egl/meson.build | 1 +
src/egl/wayland/wayland-egl/meson.build | 1 +
src/egl/wayland/wayland-egl/wayland-egl-symbols-check | 2 +-
src/gbm/gbm-symbols-check | 3 +--
src/gbm/meson.build | 1 +
src/mapi/es1api/ABI-check | 2 +-
src/mapi/es1api/meson.build | 1 +
src/mapi/es2api/ABI-check | 2 +-
src/mapi/es2api/meson.build | 1 +
12 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/configure.ac b/configure.ac
index 8a9172690a87d68714f7..324f28c70170c5830087 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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])
diff --git a/meson.build b/meson.build
index 8eb1e472098d7110d58f..e470e62074da9a46767c 100644
--- a/meson.build
+++ b/meson.build
@@ -1255,6 +1255,9 @@ endif
pkg = import('pkgconfig')
+env_test = environment()
+env_test.set('NM', find_program('nm').path())
+
subdir('include')
subdir('bin')
subdir('src')
diff --git a/src/egl/egl-symbols-check b/src/egl/egl-symbols-check
index ae867d04bca91f22b070..460e61a357c7ab6d02c3 100755
--- a/src/egl/egl-symbols-check
+++ b/src/egl/egl-symbols-check
@@ -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
diff --git a/src/egl/meson.build b/src/egl/meson.build
index abf6085573761f0f55c4..36cd33ac08b24134a61f 100644
--- a/src/egl/meson.build
+++ b/src/egl/meson.build
@@ -204,6 +204,7 @@ if with_tests
else
test('egl-symbols-check',
find_program('egl-symbols-check'),
+ env : env_test,
args : libegl
)
endif
diff --git a/src/egl/wayland/wayland-egl/meson.build b/src/egl/wayland/wayland-egl/meson.build
index c95d4c1d1f4175ce4754..d0a7521da915580a6a7c 100644
--- a/src/egl/wayland/wayland-egl/meson.build
+++ b/src/egl/wayland/wayland-egl/meson.build
@@ -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(
diff --git a/src/egl/wayland/wayland-egl/wayland-egl-symbols-check b/src/egl/wayland/wayland-egl/wayland-egl-symbols-check
index 04b2dbf1d37677031720..a5fab775824e78b3bf32 100755
--- a/src/egl/wayland/wayland-egl/wayland-egl-symbols-check
+++ b/src/egl/wayland/wayland-egl/wayland-egl-symbols-check
@@ -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
diff --git a/src/gbm/gbm-symbols-check b/src/gbm/gbm-symbols-check
index cf57a08d5728cfff480c..5adeadaed07811010d9b 100755
--- a/src/gbm/gbm-symbols-check
+++ b/src/gbm/gbm-symbols-check
@@ -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
diff --git a/src/gbm/meson.build b/src/gbm/meson.build
index 2f5d1c6ddd7cdd4f666f..13fa3a1f84c36b1af1a0 100644
--- a/src/gbm/meson.build
+++ b/src/gbm/meson.build
@@ -74,6 +74,7 @@ if with_tests
test(
'gbm-symbols-check',
find_program('gbm-symbols-check'),
+ env : env_test,
args : libgbm
)
endif
diff --git a/src/mapi/es1api/ABI-check b/src/mapi/es1api/ABI-check
index b9ae5efafd8f4bd863b1..11b4923dea280be2f849 100755
--- a/src/mapi/es1api/ABI-check
+++ b/src/mapi/es1api/ABI-check
@@ -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
diff --git a/src/mapi/es1api/meson.build b/src/mapi/es1api/meson.build
index 38a5747e9a0740270033..657dc2d9eff35ed04ede 100644
--- a/src/mapi/es1api/meson.build
+++ b/src/mapi/es1api/meson.build
@@ -55,6 +55,7 @@ if with_tests
test(
'es1-ABI-check',
find_program('ABI-check'),
+ env : env_test,
args : libglesv1_cm
)
endif
diff --git a/src/mapi/es2api/ABI-check b/src/mapi/es2api/ABI-check
index 7bc78480f767d4650bf3..a04b03d7d6006ad7f2cc 100755
--- a/src/mapi/es2api/ABI-check
+++ b/src/mapi/es2api/ABI-check
@@ -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
diff --git a/src/mapi/es2api/meson.build b/src/mapi/es2api/meson.build
index 9f4770a7386a87189737..da5198ed6e898a927b78 100644
--- a/src/mapi/es2api/meson.build
+++ b/src/mapi/es2api/meson.build
@@ -55,6 +55,7 @@ if with_tests
test(
'es2-ABI-check',
find_program('ABI-check'),
+ env : env_test,
args : libgles2
)
endif
--
Cheers,
Eric
More information about the mesa-dev
mailing list