Skip to content

Commit

Permalink
allow overriding readelf with READELF
Browse files Browse the repository at this point in the history
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
  • Loading branch information
Keruspe committed Dec 5, 2016
1 parent bb3b45a commit 4d3cce1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions mesonbuild/scripts/symbolextractor.py
Expand Up @@ -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

Expand All @@ -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')
Expand Down

0 comments on commit 4d3cce1

Please sign in to comment.