[Bug 299312] Port `SHLIB_LINKS` from contrib/bmake/lib.mk to share/mk/bsd.lib.mk

From: <bugzilla-noreply_at_freebsd.org>
Date: Sun, 11 Oct 2026 16:32:38 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299312

            Bug ID: 299312
           Summary: Port `SHLIB_LINKS` from contrib/bmake/lib.mk to
                    share/mk/bsd.lib.mk
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: conf
          Assignee: bugs@FreeBSD.org
          Reporter: ngie@FreeBSD.org

In the trivial case bsd.lib.mk creates a link from `libfoo.so.1` to
`libfoo.so`. This works great for simple libraries, but for more complex
libraries where the major version means something (`libcrypto.so.35`), bumping
the major number makes versioning less useful.

bmake's lib.mk features `SHLIB_LINKS` which handles this case and also allows
for additional structured linking. I think it's worth porting this feature over
to bsd.lib.mk to allow for the scenario of `libcrypto.so.35` ->
`libcrypto.so.35.1`.

This might require some changes to linker args in order to make this actually
work as this functionality only seems to apply to Darwin (macOS). Some
investigation will need to be done beforehand to confirm whether or not
compatible linker support exists with the toolchains available to FreeBSD.

-- 
You are receiving this mail because:
You are the assignee for the bug.