tools: allow use of NM env variable

Bug: https://bugs.gentoo.org/968162
Signed-off-by: Alfred Wingate <parona@protonmail.com>
This commit is contained in:
Alfred Wingate 2026-03-15 20:13:06 +02:00 committed by Bruno
parent 8184f55c54
commit 4828b2d3f7
2 changed files with 5 additions and 2 deletions

View file

@ -628,6 +628,8 @@ else
endif
if not platform_osx and host_cpu_family != 'x86'
nm = find_program('nm', required: false)
# Verify .def files for Windows linking.
# We check this on non-Windows platform (Debian) on CI, and on Windows itself.
custom_target('check-def-files',
@ -653,6 +655,7 @@ if not platform_osx and host_cpu_family != 'x86'
libgimpthumb,
libgimpwidgets
],
env: nm.found() ? { 'NM': nm.full_path() } : {},
output: [ 'check-def-files', ],
command: [
python, meson.project_source_root() / 'tools' / 'defcheck.py', meson.project_source_root(),

View file

@ -31,7 +31,7 @@ Needs the tool "nm", "objdump" or "dumpbin" to work
import os, sys, subprocess, shutil
from os import path
from os import getenv, path
def_files = (
"libgimpbase/gimpbase.def",
@ -55,7 +55,7 @@ if len(sys.argv) > 1:
sys.exit (-1)
libextension = ".so"
command = "nm --defined-only --extern-only "
command = getenv("NM", default="nm") + " --defined-only --extern-only "
libprefix = "lib"
platform_linux = True