From 1eb4af1d108d235fab480611b77e8edec8e344ca Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Thu, 31 Oct 2019 14:00:07 +0100 Subject: [PATCH] On non-Windows systems, allow `import code from library "-l..."` to link shared libraries --- Pm/PmDriver.icl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Pm/PmDriver.icl b/Pm/PmDriver.icl index bd4d3e5..0fca069 100644 --- a/Pm/PmDriver.icl +++ b/Pm/PmDriver.icl @@ -940,8 +940,15 @@ step intr (DLink ds=:{ok, newpaths, fileinfo, libsinfo, modpaths, abccache, proj = GetPathNames linkObjFileNames ofiles srcpaths abcPathsCache ps # (_,ofiles`,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) - = GetPathNames libs lfiles srcpaths abcPathsCache ps + = GetPathNames library_files lfiles srcpaths abcPathsCache ps | not objPathsOk # line = Level3 ["Link error: File: '" +++ (Head ofiles) +++ "' not found."] # ps = showInfo line ps @@ -957,6 +964,7 @@ step intr (DLink ds=:{ok, newpaths, fileinfo, libsinfo, modpaths, abccache, proj # ofiles = Concat extraObjectModules ofiles # ofiles` = Concat extraObjectModules ofiles` # lfiles = Concat lo.libraries lfiles + # lfiles = Concat shared_libraries lfiles # (env_static_libs,ps) = getCurrentSlibs ps #! sfiles = Concat (SL_Libs libsinfo) env_static_libs // only if really used? -- GitLab