git: 8509bb6725e6 - main - math/libtommath: small improvements
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 06 Apr 2024 12:21:08 UTC
The branch main has been updated by gahr:
URL: https://cgit.FreeBSD.org/ports/commit/?id=8509bb6725e6252f5a9bc193b57a83f4843b0e04
commit 8509bb6725e6252f5a9bc193b57a83f4843b0e04
Author: Pietro Cerutti <gahr@FreeBSD.org>
AuthorDate: 2024-04-06 12:18:31 +0000
Commit: Pietro Cerutti <gahr@FreeBSD.org>
CommitDate: 2024-04-06 12:21:06 +0000
math/libtommath: small improvements
- remove built-in ccache detection, see
https://github.com/libtom/libtommath/pull/577/
- put OPTIMIZED_CFLAGS and LTO in OPTIONS, on by default
PR: 278155
Reported by: diizzy
---
math/libtommath/Makefile | 7 +++++++
math/libtommath/files/patch-CMakeLists.txt | 15 +++++++++++++++
2 files changed, 22 insertions(+)
diff --git a/math/libtommath/Makefile b/math/libtommath/Makefile
index 14cb5f597382..fbe85a92e75d 100644
--- a/math/libtommath/Makefile
+++ b/math/libtommath/Makefile
@@ -1,5 +1,6 @@
PORTNAME= libtommath
DISTVERSION= 1.3.0
+PORTREVISION= 2
CATEGORIES= math
MASTER_SITES= https://github.com/libtom/libtommath/releases/download/v${DISTVERSION}/
DISTNAME= ltm-${DISTVERSION}
@@ -12,6 +13,12 @@ LICENSE= UNLICENSE
LICENSE_FILE= ${WRKSRC}/LICENSE
USES= cmake:testing tar:xz
+
+OPTIONS_DEFINE= OPTIMIZED_CFLAGS LTO
+OPTIONS_DEFAULT=OPTIMIZED_CFLAGS LTO
+OPTIMIZED_CFLAGS_CFLAGS= -O3 -funroll-loops -fomit-frame-pointer
+LTO_CMAKE_BOOL= COMPILE_LTO
+
CMAKE_ARGS= -DBUILD_TESTING:BOOL=ON \
-DCMAKE_INSTALL_PKGCONFIGDIR:STRING=libdata/pkgconfig
WRKSRC= ${WRKDIR}/${PORTNAME}-${DISTVERSION}
diff --git a/math/libtommath/files/patch-CMakeLists.txt b/math/libtommath/files/patch-CMakeLists.txt
index fe22d8758e0f..5a6bef8dcf3a 100644
--- a/math/libtommath/files/patch-CMakeLists.txt
+++ b/math/libtommath/files/patch-CMakeLists.txt
@@ -12,6 +12,21 @@
# Add support for ccache if desired
#-----------------------------------------------------------------------------
find_program(CCACHE ccache)
+@@ -68,10 +63,10 @@ else()
+ set(LTM_C_FLAGS -Wall -Wsign-compare -Wextra -Wshadow
+ -Wdeclaration-after-statement -Wbad-function-cast -Wcast-align
+ -Wstrict-prototypes -Wpointer-arith -Wsystem-headers)
+- set(CMAKE_C_FLAGS_DEBUG "-g3")
+- set(CMAKE_C_FLAGS_RELEASE "-O3 -funroll-loops -fomit-frame-pointer")
+- set(CMAKE_C_FLAGS_RELWITHDEBINFO "-g3 -O2")
+- set(CMAKE_C_FLAGS_MINSIZEREL "-Os")
++# set(CMAKE_C_FLAGS_DEBUG "-g3")
++# set(CMAKE_C_FLAGS_RELEASE "-O3 -funroll-loops -fomit-frame-pointer")
++# set(CMAKE_C_FLAGS_RELWITHDEBINFO "-g3 -O2")
++# set(CMAKE_C_FLAGS_MINSIZEREL "-Os")
+ endif()
+
+ # What compiler do we have and what are their...uhm... peculiarities
@@ -103,6 +98,7 @@ add_library(${PROJECT_NAME}
# library target
#-----------------------------------------------------------------------------