*-symbol-check: Don't hard-code nm executable

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>
main
Heiko Becker 2018-02-19 15:13:15 +00:00 committed by Eric Engestrom
parent 009634e493
commit 4f08bfe96d
20 changed files with 22 additions and 9 deletions

View File

@ -3,7 +3,7 @@
# The following symbols (past the first five) are taken from the public headers. # 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 # 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 ( grep -q "^$func$" || echo $func ) <<EOF
__bss_start __bss_start
_edata _edata

View File

@ -61,5 +61,6 @@ ext_libdrm_amdgpu = declare_dependency(
test( test(
'amdgpu-symbol-check', 'amdgpu-symbol-check',
prog_bash, prog_bash,
env : env_test,
args : [files('amdgpu-symbol-check'), libdrm_amdgpu] args : [files('amdgpu-symbol-check'), libdrm_amdgpu]
) )

View File

@ -45,6 +45,7 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
# Check for programs # Check for programs
AC_PROG_CC AC_PROG_CC
AC_PROG_CC_C99 AC_PROG_CC_C99
AC_PROG_NM
if test "x$ac_cv_prog_cc_c99" = xno; then if test "x$ac_cv_prog_cc_c99" = xno; then
AC_MSG_ERROR([Building libdrm requires C99 enabled compiler]) AC_MSG_ERROR([Building libdrm requires C99 enabled compiler])

View File

@ -3,7 +3,7 @@
# The following symbols (past the first five) are taken from the public headers. # 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 # 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 ( grep -q "^$func$" || echo $func ) <<EOF
__bss_start __bss_start
_edata _edata

View File

@ -49,5 +49,6 @@ pkg.generate(
test( test(
'exynos-symbol-check', 'exynos-symbol-check',
prog_bash, prog_bash,
env : env_test,
args : [files('exynos-symbol-check'), libdrm_exynos] args : [files('exynos-symbol-check'), libdrm_exynos]
) )

View File

@ -3,7 +3,7 @@
# The following symbols (past the first five) are taken from the public headers. # 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 # 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 ( grep -q "^$func$" || echo $func ) <<EOF
__bss_start __bss_start
_edata _edata

View File

@ -72,5 +72,6 @@ pkg.generate(
test( test(
'freedreno-symbol-check', 'freedreno-symbol-check',
prog_bash, prog_bash,
env : env_test,
args : [files('freedreno-symbol-check'), libdrm_freedreno] args : [files('freedreno-symbol-check'), libdrm_freedreno]
) )

View File

@ -3,7 +3,7 @@
# The following symbols (past the first five) are taken from the public headers. # 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 # 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 ( grep -q "^$func$" || echo $func ) <<EOF
__bss_start __bss_start
_edata _edata

View File

@ -101,5 +101,6 @@ test(
test( test(
'intel-symbol-check', 'intel-symbol-check',
prog_bash, prog_bash,
env : env_test,
args : [files('intel-symbol-check'), libdrm_intel] args : [files('intel-symbol-check'), libdrm_intel]
) )

View File

@ -3,7 +3,7 @@
# The following symbols (past the first five) are taken from the public headers. # 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 # 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 ( grep -q "^$func$" || echo $func ) <<EOF
__bss_start __bss_start
_edata _edata

View File

@ -70,5 +70,6 @@ pkg.generate(
test( test(
'kms-symbol-check', 'kms-symbol-check',
prog_bash, prog_bash,
env : env_test,
args : [files('kms-symbol-check'), libkms] args : [files('kms-symbol-check'), libkms]
) )

View File

@ -332,6 +332,9 @@ pkg.generate(
description : 'Userspace interface to kernel DRM services', description : 'Userspace interface to kernel DRM services',
) )
env_test = environment()
env_test.set('NM', find_program('nm').path())
if with_libkms if with_libkms
subdir('libkms') subdir('libkms')
endif endif

View File

@ -54,5 +54,6 @@ pkg.generate(
test( test(
'nouveau-symbol-check', 'nouveau-symbol-check',
prog_bash, prog_bash,
env : env_test,
args : [files('nouveau-symbol-check'), libdrm_nouveau] args : [files('nouveau-symbol-check'), libdrm_nouveau]
) )

View File

@ -3,7 +3,7 @@
# The following symbols (past the first five) are taken from the public headers. # 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 # 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 ( grep -q "^$func$" || echo $func ) <<EOF
__bss_start __bss_start
_edata _edata

View File

@ -49,5 +49,6 @@ pkg.generate(
test( test(
'omap-symbol-check', 'omap-symbol-check',
prog_bash, prog_bash,
env : env_test,
args : [files('omap-symbol-check'), libdrm_omap] args : [files('omap-symbol-check'), libdrm_omap]
) )

View File

@ -3,7 +3,7 @@
# The following symbols (past the first five) are taken from the public headers. # 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 # 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 ( grep -q "^$func$" || echo $func ) <<EOF
__bss_start __bss_start
_edata _edata

View File

@ -59,5 +59,6 @@ pkg.generate(
test( test(
'radeon-symbol-check', 'radeon-symbol-check',
prog_bash, prog_bash,
env : env_test,
args : [files('radeon-symbol-check'), libdrm_radeon] args : [files('radeon-symbol-check'), libdrm_radeon]
) )

View File

@ -3,7 +3,7 @@
# The following symbols (past the first five) are taken from the public headers. # 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 # 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 ( grep -q "^$func$" || echo $func ) <<EOF
__bss_start __bss_start
_edata _edata

View File

@ -48,5 +48,6 @@ pkg.generate(
test( test(
'tegra-symbol-check', 'tegra-symbol-check',
prog_bash, prog_bash,
env : env_test,
args : [files('tegra-symbol-check'), libdrm_tegra] args : [files('tegra-symbol-check'), libdrm_tegra]
) )

View File

@ -2,7 +2,7 @@
# The following symbols (past the first nine) are taken from tegra.h. # 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 ( grep -q "^$func$" || echo $func ) <<EOF
__bss_end__ __bss_end__
__bss_start__ __bss_start__