From 52f8c50096424fc4740937c7f872a6967c5a3df8 Mon Sep 17 00:00:00 2001 From: bsp2 Date: Fri, 26 Oct 2018 20:15:14 +0200 Subject: [PATCH] add EXTRA_* compiler/linker/optimization flags. default to athlon-fx CPU architecture. --- dep/yac/install_linux.mk | 16 ++++++--- other/vst2_lglw_debug_plugin/makefile.linux | 4 --- setenv_linux.sh | 36 +++++++++++++++++++-- 3 files changed, 45 insertions(+), 11 deletions(-) diff --git a/dep/yac/install_linux.mk b/dep/yac/install_linux.mk index b8188e83..b9da91ac 100644 --- a/dep/yac/install_linux.mk +++ b/dep/yac/install_linux.mk @@ -5,8 +5,13 @@ # n=32bit build ("x86", jit) # y=64bit build ("amd64", no jit) +ifeq ($(BUILD_64),) BUILD_64=y +endif + +ifeq ($(BUILD_ARM),) BUILD_ARM=n +endif MK=linux @@ -122,13 +127,13 @@ endif # # C compiler flags # -CFLAGS= -Wall +CFLAGS= -Wall $(EXTRA_CFLAGS) # # C++ compiler flags # -CPPFLAGS= -Wall +CPPFLAGS= -Wall $(EXTRA_CPPFLAGS) # @@ -166,7 +171,7 @@ endif # # Linker flags # -LDFLAGS= +LDFLAGS= $(EXTRA_LDFLAGS) # @@ -238,8 +243,9 @@ HAVE_HYPOTF=y # Which flags to use for plugins # # "hack" for VSVR build (pffft lib requires SSE) -#OPTFLAGS+=-mtune=core2 -OPTFLAGS+=-march=haswell +#OPTFLAGS+= -mtune=core2 +#OPTFLAGS+= -march=haswell +OPTFLAGS+= $(EXTRA_OPTFLAGS) #OPTFLAGS_PLUGIN = $(OPTFLAGS_SIZE) OPTFLAGS_PLUGIN = $(OPTFLAGS) diff --git a/other/vst2_lglw_debug_plugin/makefile.linux b/other/vst2_lglw_debug_plugin/makefile.linux index 38993182..59fe55fe 100644 --- a/other/vst2_lglw_debug_plugin/makefile.linux +++ b/other/vst2_lglw_debug_plugin/makefile.linux @@ -8,10 +8,6 @@ ALL_OBJ= \ $(VSVR_BASE_DIR)/dep/lglw/lglw_linux.o EXTRAFLAGS+=-I"$(VST2_SDK_DIR)" -I"$(VSVR_BASE_DIR)/dep/lglw/" -EXTRAFLAGS+= -march=haswell -EXTRAFLAGS+= -fPIC - -EXTRALIBS+= -march=haswell -fPIC EXTRALIBS+= -lGL -ldl .PHONY: clean diff --git a/setenv_linux.sh b/setenv_linux.sh index 91c2bf6d..68e256bc 100644 --- a/setenv_linux.sh +++ b/setenv_linux.sh @@ -1,10 +1,42 @@ export VSVR_BASE_DIR=`pwd` +# y=64 bit build +# n=32 bit build +export BUILD_64=y + +# y=cross compile for ARM target (untested in VSVR build) +export BUILD_ARM=n + + +# CPU architecture +#CPU_ARCH=haswell +CPU_ARCH=athlon-fx + +if [ "${USER}" = "bsp" ]; then +CPU_ARCH=haswell +fi + +if [ "${USER}" = "cameron" ]; then +CPU_ARCH=haswell +fi + +# Extra C compiler flags +export EXTRA_CFLAGS=-march=${CPU_ARCH} + +# Extra C++ compiler flags +export EXTRA_CPPFLAGS=-march=${CPU_ARCH} + +# Extra optimization flags (C/C++) +export EXTRA_OPTFLAGS= + +# Extra linker flags +export EXTRA_LDFLAGS=-march=${CPU_ARCH} + # this must point to the directory which contains the 'aeffect.h' and 'aeffectx.h' files export VST2_SDK_DIR=/mnt/dev/vstsdk2.4/pluginterfaces/vst2.x/ -# 'n' = build the plugin w/o 3rd party modules +# n = build the plugin w/o 3rd party modules (only useful for debugging purposes) +# y = statically link 3rd party modules #export RACK_STATIC_MODULES=y export RACK_STATIC_MODULES=n -