Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 Apr 2024 12:21:08 GMT
From:      Pietro Cerutti <gahr@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 8509bb6725e6 - main - math/libtommath: small improvements
Message-ID:  <202404061221.436CL8Tf029836@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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
  #-----------------------------------------------------------------------------



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202404061221.436CL8Tf029836>