From 11d45304fd20bbdf07222830e76d3f9977e803b4 Mon Sep 17 00:00:00 2001 From: Eric Engestrom Date: Fri, 23 Feb 2018 17:02:08 +0000 Subject: [PATCH] *-symbol-check: use correct `nm` path when cross-compiling Inspired-by: a similar patch for libdrm by Heiko Becker Signed-off-by: Eric Engestrom Reviewed-by: Emil Velikov --- 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 346c8130352..d8093597dd0 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 8cf67b81715..6f2615f9d17 100644 --- a/meson.build +++ b/meson.build @@ -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') diff --git a/src/egl/egl-symbols-check b/src/egl/egl-symbols-check index ae867d04bca..460e61a357c 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 ) <