More mach-o-matic work

This commit is contained in:
Jonathan Campbell 2023-08-29 01:08:23 -07:00
parent 8c6af27d07
commit e2bf949c23

View File

@ -50,13 +50,16 @@ string dylib_replace(string path) {
if (str_startswith(s,"/usr/local/Cellar/"))
return string("@executable_path/x86_64/") + fn;
if (str_startswith(s,"@loader_path/")) { /* often in Brew followed by ../../.. etc */
if (str_startswith(s,"@executable_path/")) { /* often in Brew followed by ../../.. etc */
s = fn;
while (!strncmp(s,"../",3)) s += 3;
printf("'%s' = '%s'\n",path.c_str(),s);
return string("@loader_path/") + s;
return string("@executable_path/") + s;
}
if (str_startswith(s,"@rpath/"))
return string("@executable_path/") + fn;
return path;
}