diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2018-01-13 19:01:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-13 19:01:26 +0200 |
commit | 933eaf602268dc5b20a90aed13b4d832a18047d6 (patch) | |
tree | 09400eb3d446aa044b92e546531f5347cc8b41f9 /mesonbuild/scripts | |
parent | d6bed2a77df7f7ff4512fd1be6333420d84b71b8 (diff) | |
parent | 9ec950c4ae5281336d4f7804dcf52943860d5d32 (diff) | |
download | meson-933eaf602268dc5b20a90aed13b4d832a18047d6.zip meson-933eaf602268dc5b20a90aed13b4d832a18047d6.tar.gz meson-933eaf602268dc5b20a90aed13b4d832a18047d6.tar.bz2 |
Merge pull request #2800 from lantw44/master
Fix -L order, LDFLAGS, LD_LIBRARY_PATH issues in GNOME module
Diffstat (limited to 'mesonbuild/scripts')
-rw-r--r-- | mesonbuild/scripts/gtkdochelper.py | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/mesonbuild/scripts/gtkdochelper.py b/mesonbuild/scripts/gtkdochelper.py index 4406b28..2a5ee8b 100644 --- a/mesonbuild/scripts/gtkdochelper.py +++ b/mesonbuild/scripts/gtkdochelper.py @@ -14,6 +14,7 @@ import sys, os import subprocess +import shlex import shutil import argparse from ..mesonlib import MesonException, Popen_safe @@ -45,10 +46,13 @@ parser.add_argument('--namespace', dest='namespace', default='') parser.add_argument('--mode', dest='mode', default='') parser.add_argument('--installdir', dest='install_dir') -def gtkdoc_run_check(cmd, cwd): +def gtkdoc_run_check(cmd, cwd, library_path=None): + env = dict(os.environ) + if library_path: + env['LD_LIBRARY_PATH'] = library_path # Put stderr into stdout since we want to print it out anyway. # This preserves the order of messages. - p, out = Popen_safe(cmd, cwd=cwd, stderr=subprocess.STDOUT)[0:2] + p, out = Popen_safe(cmd, cwd=cwd, env=env, stderr=subprocess.STDOUT)[0:2] if p.returncode != 0: err_msg = ["{!r} failed with status {:d}".format(cmd[0], p.returncode)] if out: @@ -115,7 +119,15 @@ def build_gtkdoc(source_root, build_root, doc_subdir, src_subdirs, '--ldflags=' + ldflags, '--ld=' + ld] - gtkdoc_run_check(scanobjs_cmd, abs_out) + library_paths = [] + for ldflag in shlex.split(ldflags): + if ldflag.startswith('-Wl,-rpath,'): + library_paths.append(ldflag[11:]) + if 'LD_LIBRARY_PATH' in os.environ: + library_paths.append(os.environ['LD_LIBRARY_PATH']) + library_path = ':'.join(library_paths) + + gtkdoc_run_check(scanobjs_cmd, abs_out, library_path) # Make docbook files if mode == 'auto': |