*-symbol-check: Don't hard-code nm executable
authorHeiko Becker <heirecka@exherbo.org>
Mon, 19 Feb 2018 15:13:15 +0000 (15:13 +0000)
committerEric Engestrom <eric.engestrom@imgtec.com>
Fri, 23 Feb 2018 17:53:08 +0000 (17:53 +0000)
Helpful if your nm executable has a prefix based on the
architecture, for example.

Signed-off-by: Heiko Becker <heirecka@exherbo.org>
Cc: Timo Gurr <timo.gurr@gmail.com>
[Eric: v2: rebase and add Meson support]
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
20 files changed:
amdgpu/amdgpu-symbol-check
amdgpu/meson.build
configure.ac
exynos/exynos-symbol-check
exynos/meson.build
freedreno/freedreno-symbol-check
freedreno/meson.build
intel/intel-symbol-check
intel/meson.build
libkms/kms-symbol-check
libkms/meson.build
meson.build
nouveau/meson.build
nouveau/nouveau-symbol-check
omap/meson.build
omap/omap-symbol-check
radeon/meson.build
radeon/radeon-symbol-check
tegra/meson.build
tegra/tegra-symbol-check

index 17de0c3..90b7a1d 100755 (executable)
@@ -3,7 +3,7 @@
 # The following symbols (past the first five) are taken from the public headers.
 # A list of the latter should be available Makefile.am/libdrm_amdgpuinclude_HEADERS
 
-FUNCS=$(nm -D --format=bsd --defined-only ${1-.libs/libdrm_amdgpu.so} | awk '{print $3}' | while read func; do
+FUNCS=$($NM -D --format=bsd --defined-only ${1-.libs/libdrm_amdgpu.so} | awk '{print $3}' | while read func; do
 ( grep -q "^$func$" || echo $func )  <<EOF
 __bss_start
 _edata
index 8b04520..518b850 100644 (file)
@@ -61,5 +61,6 @@ ext_libdrm_amdgpu = declare_dependency(
 test(
   'amdgpu-symbol-check',
   prog_bash,
+  env : env_test,
   args : [files('amdgpu-symbol-check'), libdrm_amdgpu]
 )
index 6827000..02644a6 100644 (file)
@@ -45,6 +45,7 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 # Check for programs
 AC_PROG_CC
 AC_PROG_CC_C99
+AC_PROG_NM
 
 if test "x$ac_cv_prog_cc_c99" = xno; then
        AC_MSG_ERROR([Building libdrm requires C99 enabled compiler])
index 9692caa..e9f1b04 100755 (executable)
@@ -3,7 +3,7 @@
 # The following symbols (past the first five) are taken from the public headers.
 # A list of the latter should be available Makefile.am/libdrm_exynos*_HEADERS
 
-FUNCS=$(nm -D --format=bsd --defined-only ${1-.libs/libdrm_exynos.so} | awk '{print $3}'| while read func; do
+FUNCS=$($NM -D --format=bsd --defined-only ${1-.libs/libdrm_exynos.so} | awk '{print $3}'| while read func; do
 ( grep -q "^$func$" || echo $func )  <<EOF
 __bss_start
 _edata
index c96ad4e..30d3640 100644 (file)
@@ -49,5 +49,6 @@ pkg.generate(
 test(
   'exynos-symbol-check',
   prog_bash,
+  env : env_test,
   args : [files('exynos-symbol-check'), libdrm_exynos]
 )
index 6b81040..56e3d3e 100755 (executable)
@@ -3,7 +3,7 @@
 # The following symbols (past the first five) are taken from the public headers.
 # A list of the latter should be available Makefile.sources/LIBDRM_FREEDRENO_H_FILES
 
-FUNCS=$(nm -D --format=bsd --defined-only ${1-.libs/libdrm_freedreno.so} | awk '{print $3}'| while read func; do
+FUNCS=$($NM -D --format=bsd --defined-only ${1-.libs/libdrm_freedreno.so} | awk '{print $3}'| while read func; do
 ( grep -q "^$func$" || echo $func )  <<EOF
 __bss_start
 _edata
index de6a413..741b3b6 100644 (file)
@@ -72,5 +72,6 @@ pkg.generate(
 test(
   'freedreno-symbol-check',
   prog_bash,
+  env : env_test,
   args : [files('freedreno-symbol-check'), libdrm_freedreno]
 )
index 2aa2d81..4d30a4b 100755 (executable)
@@ -3,7 +3,7 @@
 # The following symbols (past the first five) are taken from the public headers.
 # A list of the latter should be available Makefile.sources/LIBDRM_INTEL_H_FILES
 
-FUNCS=$(nm -D --format=bsd --defined-only ${1-.libs/libdrm_intel.so} | awk '{print $3}' | while read func; do
+FUNCS=$($NM -D --format=bsd --defined-only ${1-.libs/libdrm_intel.so} | awk '{print $3}' | while read func; do
 ( grep -q "^$func$" || echo $func )  <<EOF
 __bss_start
 _edata
index ad87727..aa5a134 100644 (file)
@@ -101,5 +101,6 @@ test(
 test(
   'intel-symbol-check',
   prog_bash,
+  env : env_test,
   args : [files('intel-symbol-check'), libdrm_intel]
 )
index 658b269..a5c2120 100755 (executable)
@@ -3,7 +3,7 @@
 # The following symbols (past the first five) are taken from the public headers.
 # A list of the latter should be available Makefile.sources/LIBKMS_H_FILES
 
-FUNCS=$(nm -D --format=bsd --defined-only ${1-.libs/libkms.so} | awk '{print $3}'| while read func; do
+FUNCS=$($NM -D --format=bsd --defined-only ${1-.libs/libkms.so} | awk '{print $3}'| while read func; do
 ( grep -q "^$func$" || echo $func )  <<EOF
 __bss_start
 _edata
index 9eff431..86d1a4e 100644 (file)
@@ -70,5 +70,6 @@ pkg.generate(
 test(
   'kms-symbol-check',
   prog_bash,
+  env : env_test,
   args : [files('kms-symbol-check'), libkms]
 )
index f6b1a43..15a2b08 100644 (file)
@@ -332,6 +332,9 @@ pkg.generate(
   description : 'Userspace interface to kernel DRM services',
 )
 
+env_test = environment()
+env_test.set('NM', find_program('nm').path())
+
 if with_libkms
   subdir('libkms')
 endif
index f031cd6..80a8678 100644 (file)
@@ -54,5 +54,6 @@ pkg.generate(
 test(
   'nouveau-symbol-check',
   prog_bash,
+  env : env_test,
   args : [files('nouveau-symbol-check'), libdrm_nouveau]
 )
index b265cea..b3a2410 100755 (executable)
@@ -3,7 +3,7 @@
 # The following symbols (past the first five) are taken from the public headers.
 # A list of the latter should be available Makefile.sources/LIBDRM_NOUVEAU_H_FILES
 
-FUNCS=$(nm -D --format=bsd --defined-only ${1-.libs/libdrm_nouveau.so} | awk '{print $3}'| while read func; do
+FUNCS=$($NM -D --format=bsd --defined-only ${1-.libs/libdrm_nouveau.so} | awk '{print $3}'| while read func; do
 ( grep -q "^$func$" || echo $func )  <<EOF
 __bss_start
 _edata
index 1881087..8adb221 100644 (file)
@@ -49,5 +49,6 @@ pkg.generate(
 test(
   'omap-symbol-check',
   prog_bash,
+  env : env_test,
   args : [files('omap-symbol-check'), libdrm_omap]
 )
index 759c84b..0fb4a0f 100755 (executable)
@@ -3,7 +3,7 @@
 # The following symbols (past the first five) are taken from the public headers.
 # A list of the latter should be available Makefile.am/libdrm_omap*HEADERS
 
-FUNCS=$(nm -D --format=bsd --defined-only ${1-.libs/libdrm_omap.so} | awk '{print $3}'| while read func; do
+FUNCS=$($NM -D --format=bsd --defined-only ${1-.libs/libdrm_omap.so} | awk '{print $3}'| while read func; do
 ( grep -q "^$func$" || echo $func )  <<EOF
 __bss_start
 _edata
index b02166f..a4171b4 100644 (file)
@@ -59,5 +59,6 @@ pkg.generate(
 test(
   'radeon-symbol-check',
   prog_bash,
+  env : env_test,
   args : [files('radeon-symbol-check'), libdrm_radeon]
 )
index 0bf2ffc..7d79d90 100755 (executable)
@@ -3,7 +3,7 @@
 # The following symbols (past the first five) are taken from the public headers.
 # A list of the latter should be available Makefile.sources/LIBDRM_RADEON_H_FILES
 
-FUNCS=$(nm -D --format=bsd --defined-only ${1-.libs/libdrm_radeon.so} | awk '{print $3}'| while read func; do
+FUNCS=$($NM -D --format=bsd --defined-only ${1-.libs/libdrm_radeon.so} | awk '{print $3}'| while read func; do
 ( grep -q "^$func$" || echo $func )  <<EOF
 __bss_start
 _edata
index 99fdd19..7c671cd 100644 (file)
@@ -48,5 +48,6 @@ pkg.generate(
 test(
   'tegra-symbol-check',
   prog_bash,
+  env : env_test,
   args : [files('tegra-symbol-check'), libdrm_tegra]
 )
index 420469f..509b678 100755 (executable)
@@ -2,7 +2,7 @@
 
 # The following symbols (past the first nine) are taken from tegra.h.
 
-FUNCS=$(nm -D --format=bsd --defined-only ${1-.libs/libdrm_tegra.so} | awk '{print $3}'| while read func; do
+FUNCS=$($NM -D --format=bsd --defined-only ${1-.libs/libdrm_tegra.so} | awk '{print $3}'| while read func; do
 ( grep -q "^$func$" || echo $func )  <<EOF
 __bss_end__
 __bss_start__