2021-05-01 13:34:18 +00:00

41 lines
1.3 KiB
Plaintext

$OpenBSD: patch-makefile,v 1.17 2021/05/01 13:34:18 fcambus Exp $
- Disable hardcoded -O3 optimizations
- Fix GCC_VERSION and CLANG_VERSION detection
Index: makefile
--- makefile.orig
+++ makefile
@@ -212,7 +212,7 @@ GENIEOS := freebsd
endif
ifeq ($(firstword $(filter OpenBSD,$(UNAME))),OpenBSD)
OS := openbsd
-GENIEOS := freebsd
+GENIEOS := bsd
endif
ifeq ($(firstword $(filter Darwin,$(UNAME))),Darwin)
OS := macosx
@@ -625,11 +625,6 @@ PROFILER =
SYMBOLS = 1
endif
-# specify a default optimization level if none explicitly stated
-ifndef OPTIMIZE
-OPTIMIZE = 3
-endif
-
# set the symbols level
ifdef SYMBOLS
PARAMS += --SYMBOLS='$(SYMBOLS)'
@@ -994,8 +989,8 @@ endif
ifeq ($(OS),windows)
ifeq (posix,$(SHELLTYPE))
-GCC_VERSION := $(shell $(TOOLCHAIN)$(subst @,,$(CC)) -dumpversion 2> /dev/null)
-CLANG_VERSION := $(shell $(TOOLCHAIN)$(subst @,,$(CC)) --version 2> /dev/null| head -n 1 | grep clang | sed "s/^.*[^0-9]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*$$/\1/" | head -n 1)
+GCC_VERSION := $(shell cc -dumpversion 2> /dev/null)
+CLANG_VERSION := $(shell cc --version 2> /dev/null | head -n 1 | grep -e 'version [0-9]\.[0-9]\.[0-9]' -o | sed -e 's,version ,,' | tail -n 1)
PYTHON_AVAILABLE := $(shell $(PYTHON) --version > /dev/null 2>&1 && echo python)
GIT_AVAILABLE := $(shell git --version > /dev/null 2>&1 && echo git)
else