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 0:17 am on June 11, 2025: member

    Building the master branch @ f24b838bedffe19643fafd817b82fc49472d4877 on FreeBSD 14.3:

    • with Autotools:
     0$ ./autogen.sh
     1$ ./configure --disable-static --prefix /tmp/AUTOTOOLS
     2$ gmake
     3$ gmake install
     4$ tree /tmp/AUTOTOOLS/lib
     5/tmp/AUTOTOOLS/lib
     6├── libsecp256k1.la
     7├── libsecp256k1.so -> libsecp256k1.so.5.0.1
     8├── libsecp256k1.so.5 -> libsecp256k1.so.5.0.1
     9├── libsecp256k1.so.5.0.1
    10└── pkgconfig
    11    └── libsecp256k1.pc
    12
    132 directories, 5 files
    
    • with CMake:
     0$ cmake -B build -DCMAKE_INSTALL_PREFIX=/tmp/CMAKE
     1$ cmake --build build
     2$ cmake --install build
     3$ tree /tmp/CMAKE/lib
     4/tmp/CMAKE/lib
     5├── cmake
     6│   └── libsecp256k1
     7│       ├── libsecp256k1-config-version.cmake
     8│       ├── libsecp256k1-config.cmake
     9│       ├── libsecp256k1-targets-relwithdebinfo.cmake
    10│       └── libsecp256k1-targets.cmake
    11├── libsecp256k1.so -> libsecp256k1.so.5
    12├── libsecp256k1.so.5
    13└── pkgconfig
    14    └── libsecp256k1.pc
    15
    164 directories, 7 files
    

    With this PR:

     0$ cmake -B build -DCMAKE_INSTALL_PREFIX=/tmp/CMAKE+PR
     1$ cmake --build build
     2$ cmake --install build
     3$ tree /tmp/CMAKE+PR/lib
     4/tmp/CMAKE+PR/lib
     5├── cmake
     6│   └── libsecp256k1
     7│       ├── libsecp256k1-config-version.cmake
     8│       ├── libsecp256k1-config.cmake
     9│       ├── libsecp256k1-targets-relwithdebinfo.cmake
    10│       └── libsecp256k1-targets.cmake
    11├── libsecp256k1.so -> libsecp256k1.so.5
    12├── libsecp256k1.so.5 -> libsecp256k1.so.5.0.1
    13├── libsecp256k1.so.5.0.1
    14└── pkgconfig
    15    └── libsecp256k1.pc
    16
    174 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. josibake referenced this in commit bb0dc6d75c on Jul 10, 2025
  15. josibake referenced this in commit 90b6c9e668 on Jul 11, 2025
  16. josibake referenced this in commit 4340be2236 on Jul 14, 2025
  17. jonasnick added the label needs-changelog on Jul 15, 2025
  18. josibake referenced this in commit 3a3815d5ee on Jul 16, 2025
  19. Sjors referenced this in commit 1b7453ea88 on Jul 17, 2025
  20. josibake referenced this in commit 46f5c2f1f3 on Jul 17, 2025
  21. josibake referenced this in commit d5817e485f on Jul 17, 2025
  22. josibake referenced this in commit eb4955b6a7 on Jul 17, 2025
  23. hebasto referenced this in commit 28310efba4 on Jul 18, 2025
  24. real-or-random referenced this in commit 6037833c9e on Jul 21, 2025
  25. fanquake referenced this in commit 5600e6fc4b on Jul 22, 2025
  26. josibake referenced this in commit fef64aa2e0 on Jul 22, 2025
  27. saikiran57 referenced this in commit abe11bd67c on Jul 28, 2025
  28. fanquake removed the label needs-changelog on Jul 29, 2025
  29. fanquake commented at 10:26 am on July 29, 2025: member
    Changelog was added in #1702. Dropping “needs-changelog”.

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: 2025-07-31 06:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me