johnsonjh/duma

Add support for pkg-config

johnsonjh opened this issue · 4 comments

  • consider installing static library build as libsduma for easier inclusion

is there a hard reson for this?
don't know what exactly the debian package does install .. would this break naming / compatibility?

Shouldn't be an issue, but, I will check to see if it's easily elided everywhere.

  • for GNU ld, using -l:libduma.a is certainly preferable
  • GCC provides "--static -lduma" as "it affects library searching for -l options which follow it."

I'd prefer to check DCP++, XLC, Clang (and LLD, gold, etc.) to see the most universal solution and then document it if it makes packaging easier (rather than the alternative static name)

Looked into this a bit more and asked my friend who suggested it for details.

The following is a summary:

Static linking with GCC / GNU ld is simple - -l:libduma.a vs. -lduma. When using the gcc compiler as a frontend (even without the GNU linker), the preferred invocation is -ldynamic -lanotherdynamic --static -lduma to force static linking of duma.

Works fine on Clang 12 on a modern Linux system as well.

Unfortunately, I see the issue (at least on systems without GNU linker - tested with a ~2010-ish configuration):

"When both a static and dynamic version of a library exist, we must explicitly pass the path to the static library if we wish to link statically with Clang."

Anyway, it seems that going forward that this is not going to be any problem - also, not being a "user-facing" application, I believe that the target audience should be aware of how to use the linker on their target system(s), it's probably not worth explicitly documenting the linker in duma's docs.

I'll close this for now and just keep it in mind as I update the docs.

  • Confirmed that using a different name of the library vs. the name of a package does add a bit of complexity to packaging on Debian and Red Hat I'd rather avoid.

I'll keep this open as a (low-priority) wishlist item.