convert a static library to a dynamic one?

Mark Brethen mark.brethen at gmail.com
Sun Nov 18 19:36:22 UTC 2018


The spooles src creates a static ‘spooles.a’ library. I want to get a dynamic library out of it. In BSD, for a .so library you would use:

ld -Bshareable -o libspooles.so.1 -x -soname libspooles.so.1 --whole-archive spooles.a

For macports I tried

system -W ${worksrcpath}_SHARED ld -dylib -force_load spooles.a -o libspooles.1.dylib

ld fails with an error:

:info:build ld: symbol(s) not found for inferred architecture x86_64
:info:build Command failed: ld -dylib -force_load spooles.a -o libspooles.1.dylib
:info:build Exit code: 1
:error:build Failed to build spooles: command execution failed

How do I have to modify above command so I will get the desired result?


Mark Brethen
mark.brethen at gmail.com





More information about the macports-dev mailing list