Skip to content

Commit 29e73f4

Browse files
Merge #1685: cmake: Emulate Libtool's behavior on FreeBSD
37dd422 cmake: Emulate Libtool's behavior on FreeBSD (Hennadii Stepanov) Pull request description: Building the master branch @ f24b838 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](https://docs.freebsd.org/en/books/developers-handbook/policies/#policies-shlib): > 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 ACKs for top commit: real-or-random: utACK 37dd422 Tree-SHA512: b603d7e293ae1fb15c2b3c05957dcc3cbe94294083ad1d8cb00b06b0e295597fa09719d32c18d628670952b6d00467f5bc884be9ab791baf59ec265e26032470
2 parents 746e36b + 37dd422 commit 29e73f4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ math(EXPR ${PROJECT_NAME}_soversion "${${PROJECT_NAME}_LIB_VERSION_CURRENT} - ${
9595
set_target_properties(secp256k1 PROPERTIES
9696
SOVERSION ${${PROJECT_NAME}_soversion}
9797
)
98-
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
98+
if(CMAKE_SYSTEM_NAME MATCHES "^(Linux|FreeBSD)$")
9999
set_target_properties(secp256k1 PROPERTIES
100100
VERSION ${${PROJECT_NAME}_soversion}.${${PROJECT_NAME}_LIB_VERSION_AGE}.${${PROJECT_NAME}_LIB_VERSION_REVISION}
101101
)

0 commit comments

Comments
 (0)