Commit 1eb4af1d authored by Camil Staps's avatar Camil Staps 🐧

On non-Windows systems, allow `import code from library "-l..."` to link shared libraries

parent 97798600
Pipeline #32402 passed with stage
in 51 seconds
...@@ -940,8 +940,15 @@ step intr (DLink ds=:{ok, newpaths, fileinfo, libsinfo, modpaths, abccache, proj ...@@ -940,8 +940,15 @@ step intr (DLink ds=:{ok, newpaths, fileinfo, libsinfo, modpaths, abccache, proj
= GetPathNames linkObjFileNames ofiles srcpaths abcPathsCache ps = GetPathNames linkObjFileNames ofiles srcpaths abcPathsCache ps
# (_,ofiles`,abcPathsCache, ps) # (_,ofiles`,abcPathsCache, ps)
= GetPathNames /*abcLinkInfo.*/linkObjFileNames ofiles` srcpaths abcPathsCache ps = GetPathNames /*abcLinkInfo.*/linkObjFileNames ofiles` srcpaths abcPathsCache ps
# (shared_libraries,library_files)
= IF_WINDOWS
(Nil, libs)
( [|l \\ (_,l) <|- libs | isSharedLibrary l]
, Filter (\(_,l) -> not (isSharedLibrary l)) libs
)
with isSharedLibrary l = size l >= 2 && l.[0]=='-' && l.[1]=='l'
# (libPathsOk,lfiles,abcPathsCache, ps) # (libPathsOk,lfiles,abcPathsCache, ps)
= GetPathNames libs lfiles srcpaths abcPathsCache ps = GetPathNames library_files lfiles srcpaths abcPathsCache ps
| not objPathsOk | not objPathsOk
# line = Level3 ["Link error: File: '" +++ (Head ofiles) +++ "' not found."] # line = Level3 ["Link error: File: '" +++ (Head ofiles) +++ "' not found."]
# ps = showInfo line ps # ps = showInfo line ps
...@@ -957,6 +964,7 @@ step intr (DLink ds=:{ok, newpaths, fileinfo, libsinfo, modpaths, abccache, proj ...@@ -957,6 +964,7 @@ step intr (DLink ds=:{ok, newpaths, fileinfo, libsinfo, modpaths, abccache, proj
# ofiles = Concat extraObjectModules ofiles # ofiles = Concat extraObjectModules ofiles
# ofiles` = Concat extraObjectModules ofiles` # ofiles` = Concat extraObjectModules ofiles`
# lfiles = Concat lo.libraries lfiles # lfiles = Concat lo.libraries lfiles
# lfiles = Concat shared_libraries lfiles
# (env_static_libs,ps) = getCurrentSlibs ps # (env_static_libs,ps) = getCurrentSlibs ps
#! sfiles = Concat (SL_Libs libsinfo) env_static_libs // only if really used? #! sfiles = Concat (SL_Libs libsinfo) env_static_libs // only if really used?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment