diff --git a/textproc/krep/Makefile b/textproc/krep/Makefile index 9b348d3c46d8..951dbdc69c80 100644 --- a/textproc/krep/Makefile +++ b/textproc/krep/Makefile @@ -1,26 +1,21 @@ PORTNAME= krep DISTVERSIONPREFIX= v DISTVERSION= 2.2.0 CATEGORIES= textproc MAINTAINER= alven@FreeBSD.org COMMENT= High-performance string search utility WWW= https://github.com/davidesantangelo/krep/ LICENSE= BSD2CLAUSE LICENSE_FILE= ${WRKSRC}/LICENSE USES= gmake - USE_GITHUB= yes GH_ACCOUNT= davidesantangelo TEST_TARGET= test PLIST_FILES= bin/krep -OPTIONS_DEFINE= SIMD - -SIMD_MAKE_ARGS= SIMD=1 - .include diff --git a/textproc/krep/files/patch-Makefile b/textproc/krep/files/patch-Makefile index fc763f843ff5..32f8eaefbddd 100644 --- a/textproc/krep/files/patch-Makefile +++ b/textproc/krep/files/patch-Makefile @@ -1,34 +1,30 @@ ---- Makefile.orig 2026-02-18 16:14:00 UTC +--- Makefile.orig 2026-02-18 15:31:31 UTC +++ Makefile -@@ -5,10 +5,10 @@ BINDIR = $(PREFIX)/bin +@@ -5,11 +5,15 @@ BINDIR = $(PREFIX)/bin PREFIX ?= /usr/local BINDIR = $(PREFIX)/bin -CC = gcc -CFLAGS = -Wall -Wextra -O3 -ffast-math -std=c11 -pthread -D_GNU_SOURCE -D_DEFAULT_SOURCE \ +CC ?= gcc +CFLAGS ?= -Wall -Wextra -O3 -ffast-math -std=c11 -pthread -D_GNU_SOURCE -D_DEFAULT_SOURCE \ -flto -funroll-loops -finline-functions -LDFLAGS = -pthread -flto +LDFLAGS += -pthread -flto ++# All SIMD "hacks/detection" should be disabled as we have CPUTYPE and the current ++# approach is also broken as host might not share the same CPU features as target. ++ifeq (0, 1) ++ # Build mode: set NATIVE=1 for maximum performance on local machine # Example: make NATIVE=1 -@@ -19,6 +19,9 @@ ARCH := $(shell uname -m) - # Detect architecture for SIMD flags - ARCH := $(shell uname -m) - -+# Build mode: set SIMD=1 for maximum performance using SIMD instructions -+# Example: make SIMD=1 -+ifdef SIMD - ifeq ($(ARCH), x86_64) - # Check for AVX-512 support (Linux: /proc/cpuinfo, macOS: sysctl) - HAS_AVX512 := $(shell (grep -q avx512f /proc/cpuinfo 2>/dev/null && echo 1) || \ -@@ -46,6 +49,7 @@ else ifeq ($(ARCH), aarch64) + ifdef NATIVE +@@ -46,6 +50,8 @@ else ifeq ($(ARCH), aarch64) else ifeq ($(ARCH), aarch64) # Enable NEON for aarch64 Linux CFLAGS += -D__ARM_NEON +endif ++ endif # Source files