mirror of
https://git.freebsd.org/ports.git
synced 2025-05-25 07:26:29 -04:00
Improve sysutils/b2sum:
Make SSE2+ instructions optinal (default ON for amd64, can be used on some i386) to alow buiding on any platform Add OpenMP option Patch to not crash when compiled with Clang Pass maintainership to submitter Bump portrevision PR: 200561 Submitted by: matthew@reztek.cz
This commit is contained in:
parent
589c3c90b2
commit
abf63a1927
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=388290
3 changed files with 69 additions and 9 deletions
|
@ -1,25 +1,50 @@
|
||||||
# $FreeBSD$
|
# $FreeBSD$
|
||||||
|
|
||||||
PORTNAME= b2sum
|
PORTNAME= b2sum
|
||||||
PORTVERSION= 0.0.d${DISTVERSION}
|
PORTVERSION= 0.0.d${B2VERSION}
|
||||||
DISTVERSION= 20150529
|
PORTREVISION= 1
|
||||||
DISTNAME= blake2_code_${DISTVERSION}${EXTRACT_SUFFX}
|
|
||||||
CATEGORIES= sysutils security
|
CATEGORIES= sysutils security
|
||||||
MASTER_SITES= http://blake2.net/
|
MASTER_SITES= http://blake2.net/
|
||||||
|
DISTNAME= blake2_code_${B2VERSION}${EXTRACT_SUFFX}
|
||||||
|
|
||||||
MAINTAINER= bapt@FreeBSD.org
|
MAINTAINER= matthew@reztek.cz
|
||||||
COMMENT= fast secure hashing
|
COMMENT= Fast secure hashing
|
||||||
|
|
||||||
|
LICENSE= CC0-1.0
|
||||||
|
LICENSE_FILE= ${WRKSRC}/../COPYING
|
||||||
|
|
||||||
|
B2VERSION= 20150529
|
||||||
|
|
||||||
USES= zip
|
USES= zip
|
||||||
|
USE_CSTD= c99
|
||||||
ONLY_FOR_ARCH= amd64
|
|
||||||
|
|
||||||
CFLAGS+= -I../sse
|
|
||||||
WRKSRC_SUBDIR= b2sum
|
WRKSRC_SUBDIR= b2sum
|
||||||
MAKEFILE= makefile
|
MAKEFILE= makefile
|
||||||
MAKE_ARGS= CC="${CC}" CFLAGS="${CFLAGS}"
|
MAKE_ARGS= CC="${CC}" CFLAGS="${CFLAGS}"
|
||||||
PLIST_FILES= bin/b2sum
|
PLIST_FILES= bin/b2sum
|
||||||
|
|
||||||
|
OPTIONS_DEFINE= OPENMP OPTIMIZED_CFLAGS SSE
|
||||||
|
OPTIONS_DEFAULT_amd64=SSE
|
||||||
|
SSE_DESC= Use SSE2, SSSE3, SSE4.1, AVX or XOP instructions
|
||||||
|
|
||||||
|
OPENMP_USES+= compiler:openmp
|
||||||
|
OPENMP_CFLAGS+= -fopenmp
|
||||||
|
|
||||||
|
.include <bsd.port.options.mk>
|
||||||
|
|
||||||
|
.if ${PORT_OPTIONS:MOPTIMIZED_CFLAGS}
|
||||||
|
CFLAGS+= -O3
|
||||||
|
.if !${CFLAGS:M-march=*}
|
||||||
|
CFLAGS+= -march=native
|
||||||
|
.endif
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.if (${PORT_OPTIONS:MSSE} && (${ARCH} == "i386" || ${ARCH} == "amd64"))
|
||||||
|
CFLAGS+= -I../sse
|
||||||
|
.else
|
||||||
|
CFLAGS+= -I../ref
|
||||||
|
EXTRA_PATCHES= ${PATCHDIR}/use_ref.patch
|
||||||
|
.endif
|
||||||
|
|
||||||
do-install:
|
do-install:
|
||||||
${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin
|
${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin
|
||||||
|
|
||||||
|
|
22
sysutils/b2sum/files/patch-blake2.h
Normal file
22
sysutils/b2sum/files/patch-blake2.h
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
--- ../ref/blake2.h.orig 2015-06-01 01:10:19 UTC
|
||||||
|
+++ ../ref/blake2.h
|
||||||
|
@@ -19,6 +19,8 @@
|
||||||
|
|
||||||
|
#if defined(_MSC_VER)
|
||||||
|
#define ALIGN(x) __declspec(align(x))
|
||||||
|
+#elif defined(__clang__)
|
||||||
|
+#define ALIGN(x) /* unaligned access in b2*p at -O >0 */
|
||||||
|
#else
|
||||||
|
#define ALIGN(x) __attribute__((aligned(x)))
|
||||||
|
#endif
|
||||||
|
--- ../sse/blake2.h.orig 2015-05-29 08:02:54 UTC
|
||||||
|
+++ ../sse/blake2.h
|
||||||
|
@@ -19,6 +19,8 @@
|
||||||
|
|
||||||
|
#if defined(_MSC_VER)
|
||||||
|
#define ALIGN(x) __declspec(align(x))
|
||||||
|
+#elif defined(__clang__)
|
||||||
|
+#define ALIGN(x) /* unaligned access in b2*p at -O >0 */
|
||||||
|
#else
|
||||||
|
#define ALIGN(x) __attribute__ ((__aligned__(x)))
|
||||||
|
#endif
|
13
sysutils/b2sum/files/use_ref.patch
Normal file
13
sysutils/b2sum/files/use_ref.patch
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
--- makefile.orig 2015-05-31 23:30:20 UTC
|
||||||
|
+++ makefile
|
||||||
|
@@ -1,8 +1,8 @@
|
||||||
|
CC=gcc
|
||||||
|
CFLAGS=-std=c99 -O3 -march=native -I../sse -static -fopenmp
|
||||||
|
LIBS=
|
||||||
|
-#FILES=blake2sum.c ../ref/blake2b-ref.c ../ref/blake2s-ref.c ../ref/blake2bp-ref.c ../ref/blake2sp-ref.c
|
||||||
|
-FILES=b2sum.c ../sse/blake2b.c ../sse/blake2s.c ../sse/blake2bp.c ../sse/blake2sp.c
|
||||||
|
+FILES=b2sum.c ../ref/blake2b-ref.c ../ref/blake2s-ref.c ../ref/blake2bp-ref.c ../ref/blake2sp-ref.c
|
||||||
|
+#FILES=b2sum.c ../sse/blake2b.c ../sse/blake2s.c ../sse/blake2bp.c ../sse/blake2sp.c
|
||||||
|
all: $(FILES)
|
||||||
|
$(CC) $(FILES) $(CFLAGS) $(LIBS) -o b2sum
|
||||||
|
|
Loading…
Add table
Reference in a new issue