Skip to content

Commit 839dcc5

Browse files
committed
Handle @loader_path in libboost on macOS
See #39
1 parent f501567 commit 839dcc5

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

tools/osx-fix-libs.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
is_bad_lib = re.compile(r'(/usr/local|/opt)').match
1111
is_sys_lib = re.compile(r'(/usr|/System)').match
1212
otool_libname_extract = re.compile(r'\s+(/.*?)[(\s:]').search
13+
otool_loader_path_extract = re.compile(r'\s+@loader_path/(.*?)[(\s:]').search
1314
goodlist = []
1415
badlist = []
1516
link_map = {}
@@ -28,9 +29,14 @@ def collectlibs(lib, masterlist, targetdir):
2829

2930
for l in liblist:
3031
lr = otool_libname_extract(l)
31-
if not lr:
32-
continue
33-
l = lr.group(1)
32+
if lr:
33+
l = lr.group(1)
34+
else:
35+
lr = otool_loader_path_extract(l)
36+
if lr:
37+
l = os.path.join(os.path.dirname(lib), lr.group(1))
38+
else:
39+
continue
3440
if is_bad_lib(l) and l not in badlist:
3541
badlist.append(l)
3642
if ((not is_sys_lib(l)) or is_bad_lib(l)) and l not in masterlist:

0 commit comments

Comments
 (0)