Commit 4f08bfe9 authored by Heiko Becker's avatar Heiko Becker Committed by Eric Engestrom
Browse files

*-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's avatarHeiko Becker <heirecka@exherbo.org>
Cc: Timo Gurr <timo.gurr@gmail.com>
[Eric: v2: rebase and add Meson support]
Signed-off-by: Eric Engestrom's avatarEric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emma Anholt's avatarEric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov's avatarEmil Velikov <emil.velikov@collabora.com>
parent 009634e4
...@@ -3,7 +3,7 @@ ...@@ -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
......
...@@ -61,5 +61,6 @@ ext_libdrm_amdgpu = declare_dependency( ...@@ -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]
) )
...@@ -45,6 +45,7 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) ...@@ -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])
......
...@@ -3,7 +3,7 @@ ...@@ -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
......
...@@ -49,5 +49,6 @@ pkg.generate( ...@@ -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]
) )
...@@ -3,7 +3,7 @@ ...@@ -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
......
...@@ -72,5 +72,6 @@ pkg.generate( ...@@ -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]
) )
...@@ -3,7 +3,7 @@ ...@@ -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
......
...@@ -101,5 +101,6 @@ test( ...@@ -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]
) )
...@@ -3,7 +3,7 @@ ...@@ -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
......
...@@ -70,5 +70,6 @@ pkg.generate( ...@@ -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]
) )
...@@ -332,6 +332,9 @@ pkg.generate( ...@@ -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
......
...@@ -54,5 +54,6 @@ pkg.generate( ...@@ -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]
) )
...@@ -3,7 +3,7 @@ ...@@ -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
......
...@@ -49,5 +49,6 @@ pkg.generate( ...@@ -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]
) )
...@@ -3,7 +3,7 @@ ...@@ -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
......
...@@ -59,5 +59,6 @@ pkg.generate( ...@@ -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]
) )
...@@ -3,7 +3,7 @@ ...@@ -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
......
...@@ -48,5 +48,6 @@ pkg.generate( ...@@ -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]
) )
...@@ -2,7 +2,7 @@ ...@@ -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__
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment