summaryrefslogtreecommitdiff
path: root/zam-plugins/system-zita-convolver.patch
blob: 4a189268a7a9b213fcf81a6c32ed4ce5a47385a0 (plain)
    1 From fbdbf082fef6c5e9cd7796c8e6726c8e98c7c040 Mon Sep 17 00:00:00 2001
    2 From: Guido Aulisi <guido.aulisi@gmail.com>
    3 Date: Wed, 28 Feb 2018 12:28:26 +0100
    4 Subject: [PATCH 3/3] Allow using system provided zita convolver library
    5 
    6 v.2: Rebase onto newer zita-convolver
    7 ---
    8  Makefile.mk                       |  9 +++++++++
    9  plugins/ZamHeadX2/Makefile        | 12 ++++++++++--
   10  plugins/ZamHeadX2/convolution.cpp |  1 -
   11  plugins/ZamHeadX2/convolution.hpp |  4 ++++
   12  plugins/ZamVerb/Makefile          | 12 ++++++++++--
   13  plugins/ZamVerb/convolution.cpp   |  1 -
   14  plugins/ZamVerb/convolution.hpp   |  4 ++++
   15  7 files changed, 37 insertions(+), 6 deletions(-)
   16 
   17 diff --git a/Makefile.mk b/Makefile.mk
   18 index 7588326..b53ca4e 100644
   19 --- a/Makefile.mk
   20 +++ b/Makefile.mk
   21 @@ -85,6 +85,15 @@ ifeq ($(LINUX),true)
   22  HAVE_DGL   = $(shell pkg-config --exists gl x11 && echo true)
   23  HAVE_JACK  = $(shell pkg-config --exists jack   && echo true)
   24  HAVE_LIBLO = $(shell pkg-config --exists liblo  && echo true)
   25 +
   26 +# Allow to use system provided libs
   27 +ifeq ($(USE_SYSTEM_LIBS),1)
   28 +HAVE_ZITA_CONVOLVER = true
   29 +ZITA_CONVOLVER_LIBS = -lzita-convolver
   30 +BASE_FLAGS += -I/usr/include
   31 +export HAVE_ZITA_CONVOLVER
   32 +endif
   33 +
   34  endif
   35  
   36  ifeq ($(MACOS),true)
   37 diff --git a/plugins/ZamHeadX2/Makefile b/plugins/ZamHeadX2/Makefile
   38 index 8500534..28e6931 100644
   39 --- a/plugins/ZamHeadX2/Makefile
   40 +++ b/plugins/ZamHeadX2/Makefile
   41 @@ -12,8 +12,11 @@ NAME = ZamHeadX2
   42  # --------------------------------------------------------------
   43  # Files to build
   44  
   45 -OBJS_DSP = \
   46 -	../../lib/zita-convolver-4.0.0/zita-convolver.cpp.o \
   47 +ifneq ($(HAVE_ZITA_CONVOLVER),true)
   48 +OBJS_DSP = ../../lib/zita-convolver-4.0.0/zita-convolver.cpp.o
   49 +endif
   50 +
   51 +OBJS_DSP += \
   52  	convolution.cpp.o \
   53  	ZamHeadX2Plugin.cpp.o
   54  
   55 @@ -38,6 +41,11 @@ else
   56  TARGETS += lv2_dsp
   57  endif
   58  
   59 +ifeq ($(HAVE_ZITA_CONVOLVER),true)
   60 +BASE_FLAGS += -DHAVE_ZITA_CONVOLVER
   61 +LINK_FLAGS += $(ZITA_CONVOLVER_LIBS)
   62 +endif
   63 +
   64  TARGETS += vst
   65  
   66  all: $(TARGETS)
   67 diff --git a/plugins/ZamHeadX2/convolution.cpp b/plugins/ZamHeadX2/convolution.cpp
   68 index 0026ba2..8c42acc 100644
   69 --- a/plugins/ZamHeadX2/convolution.cpp
   70 +++ b/plugins/ZamHeadX2/convolution.cpp
   71 @@ -42,7 +42,6 @@
   72  #include <pthread.h>
   73  #include <assert.h>
   74  
   75 -#include "../../lib/zita-convolver-4.0.0/zita-convolver.h"
   76  #include <samplerate.h>
   77  #include "convolution.hpp"
   78  
   79 diff --git a/plugins/ZamHeadX2/convolution.hpp b/plugins/ZamHeadX2/convolution.hpp
   80 index 80be8e6..8cdcd71 100644
   81 --- a/plugins/ZamHeadX2/convolution.hpp
   82 +++ b/plugins/ZamHeadX2/convolution.hpp
   83 @@ -19,7 +19,11 @@
   84  #ifndef CONVOLUTION_H_
   85  #define CONVOLUTION_H_
   86  
   87 +#ifdef HAVE_ZITA_CONVOLVER
   88 +#include <zita-convolver.h>
   89 +#else
   90  #include "../../lib/zita-convolver-4.0.0/zita-convolver.h"
   91 +#endif
   92  
   93  #define MAX_CHANNEL_MAPS (4)
   94  #define VERBOSE_printf(x, ...)
   95 diff --git a/plugins/ZamVerb/Makefile b/plugins/ZamVerb/Makefile
   96 index eacc080..a08e334 100644
   97 --- a/plugins/ZamVerb/Makefile
   98 +++ b/plugins/ZamVerb/Makefile
   99 @@ -15,8 +15,11 @@ NAME = ZamVerb
  100  OBJS_DSP = \
  101  	ZamVerbPlugin.cpp.o \
  102  	ZamVerbImpulses.cpp.o \
  103 -	convolution.cpp.o \
  104 -	../../lib/zita-convolver-4.0.0/zita-convolver.cpp.o
  105 +	convolution.cpp.o
  106 +
  107 +ifneq ($(HAVE_ZITA_CONVOLVER),true)
  108 +OBJS_DSP += ../../lib/zita-convolver-4.0.0/zita-convolver.cpp.o
  109 +endif
  110  
  111  OBJS_UI  = \
  112  	ZamVerbArtwork.cpp.o \
  113 @@ -39,6 +42,11 @@ else
  114  TARGETS += lv2_dsp
  115  endif
  116  
  117 +ifeq ($(HAVE_ZITA_CONVOLVER),true)
  118 +BASE_FLAGS += -DHAVE_ZITA_CONVOLVER
  119 +LINK_FLAGS += $(ZITA_CONVOLVER_LIBS)
  120 +endif
  121 +
  122  TARGETS += vst
  123  
  124  all: $(TARGETS)
  125 diff --git a/plugins/ZamVerb/convolution.cpp b/plugins/ZamVerb/convolution.cpp
  126 index 27374e0..8357037 100644
  127 --- a/plugins/ZamVerb/convolution.cpp
  128 +++ b/plugins/ZamVerb/convolution.cpp
  129 @@ -42,7 +42,6 @@
  130  #include <pthread.h>
  131  #include <assert.h>
  132  
  133 -#include "../../lib/zita-convolver-4.0.0/zita-convolver.h"
  134  #include <samplerate.h>
  135  #include "convolution.hpp"
  136  #include "ZamVerbImpulses.hpp"
  137 diff --git a/plugins/ZamVerb/convolution.hpp b/plugins/ZamVerb/convolution.hpp
  138 index 1c89971..cfb3755 100644
  139 --- a/plugins/ZamVerb/convolution.hpp
  140 +++ b/plugins/ZamVerb/convolution.hpp
  141 @@ -19,7 +19,11 @@
  142  #ifndef CONVOLUTION_H_
  143  #define CONVOLUTION_H_
  144  
  145 +#ifdef HAVE_ZITA_CONVOLVER
  146 +#include <zita-convolver.h>
  147 +#else
  148  #include "../../lib/zita-convolver-4.0.0/zita-convolver.h"
  149 +#endif
  150  
  151  #define MAX_CHANNEL_MAPS (4)
  152  #define VERBOSE_printf(x, ...)
  153 -- 
  154 2.18.0

Generated by cgit