diff --git a/benchmarks/unixbench/Makefile b/benchmarks/unixbench/Makefile index 81d71c91c934..71b578e03425 100644 --- a/benchmarks/unixbench/Makefile +++ b/benchmarks/unixbench/Makefile @@ -1,53 +1,64 @@ PORTNAME= unixbench DISTVERSIONPREFIX= v DISTVERSION= 5.1.3-51 DISTVERSIONSUFFIX= -g6705203 +PORTREVISION= 1 CATEGORIES= benchmarks MAINTAINER= pizzamig@FreeBSD.org COMMENT= BYTE magazine's Public Domain benchmark for UNIX WWW= https://github.com/kdlucas/byte-unixbench LICENSE= GPLv2 RUN_DEPENDS= x11perf:x11/x11perf USES= gmake gl perl5 shebangfix xorg USE_GITHUB= yes GH_ACCOUNT= kdlucas GH_PROJECT= byte-unixbench WRKSRC_SUBDIR= UnixBench USE_GL= gl USE_XORG= x11 xext CFLAGS+= -I${LOCALBASE}/include \ -L${LOCALBASE}/lib +OPTIONS_DEFINE= OPTIMIZED_CFLAGS +OPTIONS_EXCLUDE_aarch64= OPTIMIZED_CFLAGS +MAKE_ENV= "UB_GCC_OPTIONS=-O3 -ffast-math -fomit-frame-pointer" +#march generates code that can be incompatibe with previous CPU generations +OPTIMIZED_CFLAGS_MAKE_ENV= "UB_GCC_OPTIONS=-O3 -ffast-math -fomit-frame-pointer -march=native" + SUB_FILES= unixbench SHEBANG_FILES= Run pgms/gfx-x11 +post-patch: + ${REINPLACE_CMD} -e 's/^CC=gcc/#CC=gcc/' ${WRKSRC}/Makefile + ${REINPLACE_CMD} -e 's/^# GRAPHIC_TESTS = defined/GRAPHIC_TESTS = defined/' ${WRKSRC}/Makefile + do-install: ${INSTALL_SCRIPT} ${WRKDIR}/unixbench ${STAGEDIR}${PREFIX}/bin/ ${MKDIR} ${STAGEDIR}${PREFIX}/libexec/unixbench ${INSTALL_SCRIPT} ${WRKSRC}/Run ${STAGEDIR}${PREFIX}/libexec/unixbench ${MKDIR} ${STAGEDIR}${PREFIX}/libexec/unixbench/pgms for f in ${WRKSRC}/pgms/* ; do \ case $$f in \ *.sh|*gfx-x11) \ ${INSTALL_SCRIPT} $${f} \ ${STAGEDIR}${PREFIX}/libexec/unixbench/pgms/ ;; \ *.logo|*.base) \ ${INSTALL_DATA} $${f} \ ${STAGEDIR}${PREFIX}/libexec/unixbench/pgms/ ;; \ *.orig|*.rej|*~) \ ;;\ *) \ ${INSTALL_PROGRAM} $${f} \ ${STAGEDIR}${PREFIX}/libexec/unixbench/pgms/ ;; \ esac ; \ done ${MKDIR} ${STAGEDIR}${PREFIX}/libexec/unixbench/testdir ${INSTALL_DATA} ${WRKSRC}/testdir/* ${STAGEDIR}${PREFIX}/libexec/unixbench/testdir/ ${INSTALL_DATA} ${WRKSRC}/README ${STAGEDIR}${PREFIX}/libexec/unixbench/ ${INSTALL_DATA} ${WRKSRC}/Makefile ${STAGEDIR}${PREFIX}/libexec/unixbench/ .include diff --git a/benchmarks/unixbench/files/patch-Makefile b/benchmarks/unixbench/files/patch-Makefile deleted file mode 100644 index 3c2539dc046d..000000000000 --- a/benchmarks/unixbench/files/patch-Makefile +++ /dev/null @@ -1,32 +0,0 @@ ---- Makefile.orig 2023-02-07 23:18:07.000000000 +0100 -+++ Makefile 2023-03-26 13:40:57.699042000 +0200 -@@ -46,7 +46,7 @@ - # X11 libraries on your system. (e.g. libX11-devel mesa-libGL-devel) - # - # Comment the line out to disable these tests. --# GRAPHIC_TESTS = defined -+GRAPHIC_TESTS = defined - - # Set "GL_LIBS" to the libraries needed to link a GL program. - GL_LIBS = -lGL -lXext -lX11 -@@ -55,7 +55,7 @@ - # COMPILER CONFIGURATION: Set "CC" to the name of the compiler to use - # to build the binary benchmarks. You should also set "$cCompiler" in the - # Run script to the name of the compiler you want to test. --CC=gcc -+#CC=gcc - - # OPTIMISATION SETTINGS: - # Use gcc option if defined UB_GCC_OPTIONS via "Environment variable" or "Command-line arguments". -@@ -113,6 +113,13 @@ - CFLAGS += -Wa,-q - endif - -+ ifeq ($(OSNAME),FreeBSD) -+ ifeq ($(ARCH),aarch64) -+ OPTON += -fomit-frame-pointer -+ else -+ OPTON += -march=native -mtune=native -fomit-frame-pointer -+ endif -+ endif - endif