Revisão | 5bffb285ebb603b11c18e449bcdbe819fef36003 (tree) |
---|---|
Hora | 2024-08-17 19:25:02 |
Autor | Fs <Fsu0413@vip....> |
Commiter | Fs |
deal with OpenSSL rpath (Trial 1)
@@ -862,6 +862,33 @@ conf.OpenSSL.generateConfTable = function(self, host, job) | ||
862 | 862 | ret.INSTALLROOT = installRoot |
863 | 863 | ret.INSTALLPATH = installFolderName |
864 | 864 | |
865 | + ret.EXTRAINSTALL = "" | |
866 | + | |
867 | + if (not jobConfigureDetail.crossCompile) and (string.sub(conf.hostToConfMap[host], 1, 3) == "mac") then | |
868 | + -- macOS hosts needs the library id changed. By default OpenSSL builds with full path in ID. | |
869 | + local libs = {} | |
870 | + for _, l in ipairs(jobConfigureDetail.libPath) do | |
871 | + local s, e = string.find(l, "/", 1, true) | |
872 | + local e2 | |
873 | + while s do | |
874 | + e2 = e | |
875 | + s, e = string.find(l, "/", e + 1, true) | |
876 | + end | |
877 | + table.insert(libs, {p = string.sub(l, 1, e2 - 1), n = string.sub(l, e2 + 1)}) | |
878 | + end | |
879 | + | |
880 | + for _, lib in ipairs(libs) do | |
881 | + ret.EXTRAINSTALL = ret.EXTRAINSTALL .. "\ncd \"" .. installRoot .. "/" .. lib.p .. "\"" | |
882 | + for _, lib2 in ipairs(libs) do | |
883 | + if (lib.p == lib2.p) and (lib.n == lib2.n) then | |
884 | + ret.EXTRAINSTALL = ret.EXTRAINSTALL .. "\ninstall_name_tool -id \"" .. lib.n .. "\" \"" .. lib.n .. "\"" | |
885 | + else | |
886 | + ret.EXTRAINSTALL = ret.EXTRAINSTALL .. "\ninstall_name_tool -change \"" .. installRoot .. "/" .. lib2.p .. "/" .. lib2.n .. "\" \"" .. lib2.n .. "\" \"" .. lib.n .. "\"\n" | |
887 | + end | |
888 | + end | |
889 | + end | |
890 | + end | |
891 | + | |
865 | 892 | -- finally, data required for generating website data |
866 | 893 | ret.buildContentVersion = jobConfigureDetail.opensslVersion |
867 | 894 | ret.buildHost = host |
@@ -483,6 +483,7 @@ exit 0 | ||
483 | 483 | -- INSTALLCOMMANDLINE |
484 | 484 | -- INSTALLROOT |
485 | 485 | -- INSTALLPATH |
486 | +-- EXTRAINSTALL | |
486 | 487 | gen.unix.template4OpenSSL = [[ |
487 | 488 | set -x |
488 | 489 |
@@ -580,6 +581,10 @@ if &INSTALLCOMMANDLINE&; then break; fi | ||
580 | 581 | if [ $i -eq 4 ]; then exit 1; fi |
581 | 582 | done |
582 | 583 | |
584 | +cd &WORKSPACE&/buildDir | |
585 | + | |
586 | +&EXTRAINSTALL& | |
587 | + | |
583 | 588 | cd &INSTALLROOT&/.. |
584 | 589 | |
585 | 590 | $TAR -cf - &INSTALLPATH& | $SEVENZIP a -txz -m0=LZMA2:d256m:fb273 -mmt=3 -myx -si -- &INSTALLPATH&.tar.xz |