summaryrefslogtreecommitdiff
path: root/math
diff options
context:
space:
mode:
authorPietro Cerutti <gahr@FreeBSD.org>2024-04-06 12:18:31 +0000
committerPietro Cerutti <gahr@FreeBSD.org>2024-04-06 12:21:06 +0000
commit8509bb6725e6252f5a9bc193b57a83f4843b0e04 (patch)
tree82a28340fbf63cc82d56e7389bb9ac720f6ec8a8 /math
parentnet/openvswitch: Fix build with python-3.10 and python-3.11 (diff)
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
Diffstat (limited to 'math')
-rw-r--r--math/libtommath/Makefile7
-rw-r--r--math/libtommath/files/patch-CMakeLists.txt15
2 files changed, 22 insertions, 0 deletions
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
#-----------------------------------------------------------------------------