diff options
author | Marc-Antoine Perennou <Marc-Antoine@Perennou.com> | 2016-11-22 16:54:42 +0100 |
---|---|---|
committer | Marc-Antoine Perennou <Marc-Antoine@Perennou.com> | 2016-12-05 10:57:10 +0100 |
commit | 4d3cce1532ccd6cbd5cdb6a3d12b076effedd6bd (patch) | |
tree | 19bb5d91f804c3a08e507c22ae2543974e480376 | |
parent | bb3b45a0ececcb81e7049a09f041506f8de121fa (diff) | |
download | meson-4d3cce1532ccd6cbd5cdb6a3d12b076effedd6bd.zip meson-4d3cce1532ccd6cbd5cdb6a3d12b076effedd6bd.tar.gz meson-4d3cce1532ccd6cbd5cdb6a3d12b076effedd6bd.tar.bz2 |
allow overriding readelf with READELF
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
-rwxr-xr-x | mesonbuild/scripts/symbolextractor.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/mesonbuild/scripts/symbolextractor.py b/mesonbuild/scripts/symbolextractor.py index c117301..2d1a428 100755 --- a/mesonbuild/scripts/symbolextractor.py +++ b/mesonbuild/scripts/symbolextractor.py @@ -22,7 +22,7 @@ # This file is basically a reimplementation of # http://cgit.freedesktop.org/libreoffice/core/commit/?id=3213cd54b76bc80a6f0516aac75a48ff3b2ad67c -import sys, subprocess +import os, sys, subprocess from mesonbuild import mesonlib import argparse @@ -49,7 +49,12 @@ def write_if_changed(text, outfilename): f.write(text) def linux_syms(libfilename, outfilename): - pe = subprocess.Popen(['readelf', '-d', libfilename], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + evar = 'READELF' + if evar in os.environ: + readelfbin = os.environ[evar].strip() + else: + readelfbin = 'readelf' + 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') |