diff --git a/libgimp/meson.build b/libgimp/meson.build index df774151c9..8f5d2c4a96 100644 --- a/libgimp/meson.build +++ b/libgimp/meson.build @@ -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(), diff --git a/tools/defcheck.py b/tools/defcheck.py index 261a4b2a61..ae19ab747a 100755 --- a/tools/defcheck.py +++ b/tools/defcheck.py @@ -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