diff options
author | Marc-Antoine Perennou <Marc-Antoine@Perennou.com> | 2016-11-22 17:08:01 +0100 |
---|---|---|
committer | Marc-Antoine Perennou <Marc-Antoine@Perennou.com> | 2016-12-05 10:57:10 +0100 |
commit | a70f39f815a66885cabc118d077634095b2b0878 (patch) | |
tree | 42f62b0555d4a3abc0495b317a9db69ddc06adcb | |
parent | 4d3cce1532ccd6cbd5cdb6a3d12b076effedd6bd (diff) | |
download | meson-a70f39f815a66885cabc118d077634095b2b0878.zip meson-a70f39f815a66885cabc118d077634095b2b0878.tar.gz meson-a70f39f815a66885cabc118d077634095b2b0878.tar.bz2 |
allow overriding nm with NM
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
-rwxr-xr-x | mesonbuild/scripts/symbolextractor.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/mesonbuild/scripts/symbolextractor.py b/mesonbuild/scripts/symbolextractor.py index 2d1a428..9d28028 100755 --- a/mesonbuild/scripts/symbolextractor.py +++ b/mesonbuild/scripts/symbolextractor.py @@ -54,13 +54,18 @@ def linux_syms(libfilename, outfilename): readelfbin = os.environ[evar].strip() else: readelfbin = 'readelf' + evar = 'NM' + if evar in os.environ: + nmbin = os.environ[evar].strip() + else: + nmbin = 'nm' pe = subprocess.Popen([readelfbin, '-d', libfilename], stdout=subprocess.PIPE, stderr=subprocess.PIPE) output = pe.communicate()[0].decode() if pe.returncode != 0: raise RuntimeError('Readelf does not work') result = [x for x in output.split('\n') if 'SONAME' in x] assert(len(result) <= 1) - pnm = subprocess.Popen(['nm', '--dynamic', '--extern-only', '--defined-only', '--format=posix', libfilename], + pnm = subprocess.Popen([nmbin, '--dynamic', '--extern-only', '--defined-only', '--format=posix', libfilename], stdout=subprocess.PIPE, stderr=subprocess.PIPE) output = pnm.communicate()[0].decode() if pnm.returncode != 0: |