cmake: Emulate Libtool's behavior on FreeBSD #1685

pull hebasto wants to merge 1 commits into bitcoin-core:master from hebasto:250611-freebsd-lib changing 1 files +1 −1
  1. hebasto commented at 12:17 AM on June 11, 2025: member

    Building the master branch @ f24b838bedffe19643fafd817b82fc49472d4877 on FreeBSD 14.3:

    • with Autotools:
    $ ./autogen.sh
    $ ./configure --disable-static --prefix /tmp/AUTOTOOLS
    $ gmake
    $ gmake install
    $ tree /tmp/AUTOTOOLS/lib
    /tmp/AUTOTOOLS/lib
    ├── libsecp256k1.la
    ├── libsecp256k1.so -> libsecp256k1.so.5.0.1
    ├── libsecp256k1.so.5 -> libsecp256k1.so.5.0.1
    ├── libsecp256k1.so.5.0.1
    └── pkgconfig
        └── libsecp256k1.pc
    
    2 directories, 5 files
    
    • with CMake:
    $ cmake -B build -DCMAKE_INSTALL_PREFIX=/tmp/CMAKE
    $ cmake --build build
    $ cmake --install build
    $ tree /tmp/CMAKE/lib
    /tmp/CMAKE/lib
    ├── cmake
    │   └── libsecp256k1
    │       ├── libsecp256k1-config-version.cmake
    │       ├── libsecp256k1-config.cmake
    │       ├── libsecp256k1-targets-relwithdebinfo.cmake
    │       └── libsecp256k1-targets.cmake
    ├── libsecp256k1.so -> libsecp256k1.so.5
    ├── libsecp256k1.so.5
    └── pkgconfig
        └── libsecp256k1.pc
    
    4 directories, 7 files
    

    With this PR:

    $ cmake -B build -DCMAKE_INSTALL_PREFIX=/tmp/CMAKE+PR
    $ cmake --build build
    $ cmake --install build
    $ tree /tmp/CMAKE+PR/lib
    /tmp/CMAKE+PR/lib
    ├── cmake
    │   └── libsecp256k1
    │       ├── libsecp256k1-config-version.cmake
    │       ├── libsecp256k1-config.cmake
    │       ├── libsecp256k1-targets-relwithdebinfo.cmake
    │       └── libsecp256k1-targets.cmake
    ├── libsecp256k1.so -> libsecp256k1.so.5
    ├── libsecp256k1.so.5 -> libsecp256k1.so.5.0.1
    ├── libsecp256k1.so.5.0.1
    └── pkgconfig
        └── libsecp256k1.pc
    
    4 directories, 8 files
    

    From FreeBSD Developers' Handbook:

    If you are adding shared library support to a port or other piece of software that does not have one, the version numbers should follow these rules. Generally, the resulting numbers will have nothing to do with the release version of the software.

    For ports:

    • Prefer using the number already selected by upstream

    • If upstream provides symbol versioning, ensure that we use their script

  2. cmake: Emulate Libtool's behavior on FreeBSD 37dd422b5c
  3. real-or-random added the label build on Jun 11, 2025
  4. real-or-random added the label refactor/smell on Jun 11, 2025
  5. real-or-random approved
  6. real-or-random commented at 7:43 AM on June 11, 2025: contributor

    utACK 37dd422b5cecad54db40a7304f03bff552d8d9fb

  7. real-or-random commented at 7:44 AM on June 11, 2025: contributor

    What do you think about the alternative version of making this the else branch if neither on Windows nor on macOS?

  8. hebasto commented at 8:23 AM on June 11, 2025: member

    What do you think about the alternative version of making this the else branch if neither on Windows nor on macOS?

    That was my initial thought too. However, shared library naming conventions differ on other systems, such as OpenBSD and NetBSD. So I chose the current approach to self‑document which systems are tested.

  9. hebasto commented at 9:14 AM on June 11, 2025: member

    What do you think about the alternative version of making this the else branch if neither on Windows nor on macOS?

    That was my initial thought too. However, shared library naming conventions differ on other systems, such as OpenBSD and NetBSD. So I chose the current approach to self‑document which systems are tested.

    I've included a reference to the FreeBSD docs in the PR description.

  10. real-or-random merged this on Jun 24, 2025
  11. real-or-random closed this on Jun 24, 2025

  12. hebasto deleted the branch on Jun 24, 2025
  13. hebasto referenced this in commit 68094d6972 on Jun 30, 2025
  14. jonasnick added the label needs-changelog on Jul 15, 2025
  15. Sjors referenced this in commit 1b7453ea88 on Jul 17, 2025
  16. hebasto referenced this in commit 28310efba4 on Jul 18, 2025
  17. real-or-random referenced this in commit 6037833c9e on Jul 21, 2025
  18. fanquake referenced this in commit 5600e6fc4b on Jul 22, 2025
  19. saikiran57 referenced this in commit abe11bd67c on Jul 28, 2025
  20. fanquake removed the label needs-changelog on Jul 29, 2025
  21. fanquake commented at 10:26 AM on July 29, 2025: member

    Changelog was added in #1702. Dropping "needs-changelog".

  22. janus referenced this in commit e0ffd31e87 on Sep 14, 2025
  23. vmta referenced this in commit 2b25f561a0 on Sep 21, 2025
  24. real-or-random referenced this in commit a3733f33c1 on Feb 25, 2026
  25. github-actions[bot] referenced this in commit 758d4e90b4 on Mar 1, 2026
  26. github-actions[bot] referenced this in commit 68a2178f22 on Mar 1, 2026
  27. github-actions[bot] referenced this in commit a8bc1a0b2b on Mar 1, 2026
  28. 0x000000000019d6689c085ae165831e934ff76 referenced this in commit 3b9450150d on Mar 2, 2026
  29. csjones referenced this in commit a4d92824ae on Mar 2, 2026

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/secp256k1. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-19 06:52 UTC