diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2018-11-14 19:16:38 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2018-11-14 19:20:11 +0200 |
commit | 2ba68c2cb389fee7df21cfa8026cbc074e5e59e8 (patch) | |
tree | 543b8df2127c90594ef54a0bc92d4ba6df728472 | |
parent | de175aac0051b5625e21aeb5b9864ae7c376f9d7 (diff) | |
download | meson-alllibpaths.tar.gz |
Store unexpanded library directory paths. Closes #4392.alllibpaths
-rw-r--r-- | mesonbuild/compilers/c.py | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py index 4d3b2a2a2..1b198b645 100644 --- a/mesonbuild/compilers/c.py +++ b/mesonbuild/compilers/c.py @@ -219,9 +219,22 @@ class CCompiler(Compiler): def _split_fetch_real_dirs(pathstr, sep=':'): paths = [] for p in pathstr.split(sep): - p = Path(p) - if p.exists() and p.resolve().as_posix() not in paths: - paths.append(p.resolve().as_posix()) + # GCC returns paths like this: + # /usr/lib/gcc/x86_64-linux-gnu/8/../../../../x86_64-linux-gnu/lib + # It would make sense to normalize them to get rid of the .. parts + # Sadly when you are on a merged /usr fs it also kills these: + # /lib/x86_64-linux-gnu + # since /lib is a symlink to /usr/lib. This would mean + # paths under /lib would be considered not a "system path", + # which is wrong and breaks things. Store everything, just to be sure. + pobj = Path(p) + unresolved = pobj.as_posix() + resolved = Path(p).resolve().as_posix() + if pobj.exists(): + if unresolved not in paths: + paths.append(unresolved) + if resolved not in paths: + paths.append(resolved) return tuple(paths) def get_compiler_dirs(self, env, name): |