aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/scripts
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2016-12-06 23:43:36 +0200
committerGitHub <noreply@github.com>2016-12-06 23:43:36 +0200
commitd1501e39d5b66510c53576f9a415e11b9eea6c54 (patch)
tree21ba1fcf8361e7e8fd881855b605b2f793f8fd4d /mesonbuild/scripts
parentc58da4ee52496bd6d7d42d0f3bdb573673465d65 (diff)
parente43dda13633c86411f38383a2261ea40195eef33 (diff)
downloadmeson-d1501e39d5b66510c53576f9a415e11b9eea6c54.zip
meson-d1501e39d5b66510c53576f9a415e11b9eea6c54.tar.gz
meson-d1501e39d5b66510c53576f9a415e11b9eea6c54.tar.bz2
Merge pull request #1086 from Keruspe/master
Allow specifying some toolchain executables using env
Diffstat (limited to 'mesonbuild/scripts')
-rwxr-xr-xmesonbuild/scripts/symbolextractor.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/mesonbuild/scripts/symbolextractor.py b/mesonbuild/scripts/symbolextractor.py
index c117301..9d28028 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,13 +49,23 @@ 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'
+ 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: