Skip to content

Commit

Permalink
Update DPF and plugins
Browse files Browse the repository at this point in the history
Fixes #14
  • Loading branch information
falkTX committed Jul 7, 2019
1 parent 6078615 commit 0530b43
Show file tree
Hide file tree
Showing 56 changed files with 2,116 additions and 768 deletions.
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ HAVE_PROJM = $(shell pkg-config --exists libprojectM && echo true)
# --------------------------------------------------------------

dgl:
ifeq ($(HAVE_DGL),true)
ifeq ($(HAVE_CAIRO_OR_OPENGL),true)
$(MAKE) -C dpf/dgl
endif

Expand Down Expand Up @@ -50,15 +50,15 @@ plugins: dgl
$(MAKE) all -C plugins/gigaverb
$(MAKE) all -C plugins/pitchshift

ifeq ($(HAVE_DGL),true)
ifeq ($(HAVE_CAIRO_OR_OPENGL),true)
# glBars (needs OpenGL)
$(MAKE) all -C plugins/glBars

ifeq ($(HAVE_PROJM),true)
# ProM (needs OpenGL + ProjectM)
$(MAKE) all -C plugins/ProM
endif # HAVE_PROJM
endif # HAVE_DGL
endif # HAVE_CAIRO_OR_OPENGL

ifneq ($(CROSS_COMPILING),true)
gen: plugins dpf/utils/lv2_ttl_generator
Expand Down Expand Up @@ -123,9 +123,9 @@ install:
install -m 644 bin/*-dssi.* $(DESTDIR)$(PREFIX)/lib/dssi/
install -m 644 bin/*-vst.* $(DESTDIR)$(PREFIX)/lib/vst/

ifeq ($(HAVE_DGL),true)
ifeq ($(HAVE_CAIRO_OR_OPENGL),true)
cp -r bin/*-dssi $(DESTDIR)$(PREFIX)/lib/dssi/
endif # HAVE_DGL
endif # HAVE_CAIRO_OR_OPENGL
cp -r bin/*.lv2 $(DESTDIR)$(PREFIX)/lib/lv2/

ifeq ($(HAVE_JACK),true)
Expand All @@ -142,12 +142,12 @@ ifeq ($(HAVE_JACK),true)
install -m 755 bin/MaFreeverb $(DESTDIR)$(PREFIX)/bin/
install -m 755 bin/MaGigaverb $(DESTDIR)$(PREFIX)/bin/
install -m 755 bin/MaPitchshift $(DESTDIR)$(PREFIX)/bin/
ifeq ($(HAVE_DGL),true)
ifeq ($(HAVE_CAIRO_OR_OPENGL),true)
install -m 755 bin/glBars $(DESTDIR)$(PREFIX)/bin/
ifeq ($(HAVE_PROJM),true)
install -m 755 bin/ProM $(DESTDIR)$(PREFIX)/bin/
endif # HAVE_PROJM
endif # HAVE_DGL
endif # HAVE_CAIRO_OR_OPENGL
endif # HAVE_JACK

# --------------------------------------------------------------
Expand Down
113 changes: 84 additions & 29 deletions dpf/Makefile.base.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ifneq ($(HAIKU),true)
ifneq ($(HURD),true)
ifneq ($(LINUX),true)
ifneq ($(MACOS),true)
ifneq ($(WIN32),true)
ifneq ($(WINDOWS),true)

TARGET_MACHINE := $(shell $(CC) -dumpmachine)
ifneq (,$(findstring bsd,$(TARGET_MACHINE)))
Expand All @@ -35,7 +35,7 @@ ifneq (,$(findstring apple,$(TARGET_MACHINE)))
MACOS=true
endif
ifneq (,$(findstring mingw,$(TARGET_MACHINE)))
WIN32=true
WINDOWS=true
endif

endif
Expand All @@ -45,6 +45,16 @@ endif
endif
endif

# ---------------------------------------------------------------------------------------------------------------------
# Set PKG_CONFIG (can be overridden by environment variable)

ifeq ($(WINDOWS),true)
# Build statically on Windows by default
PKG_CONFIG ?= pkg-config --static
else
PKG_CONFIG ?= pkg-config
endif

# ---------------------------------------------------------------------------------------------------------------------
# Set LINUX_OR_MACOS

Expand All @@ -57,14 +67,20 @@ LINUX_OR_MACOS=true
endif

# ---------------------------------------------------------------------------------------------------------------------
# Set MACOS_OR_WIN32
# Set MACOS_OR_WINDOWS and HAIKU_OR_MACOS_OR_WINDOWS

ifeq ($(HAIKU),true)
HAIKU_OR_MACOS_OR_WINDOWS=true
endif

ifeq ($(MACOS),true)
MACOS_OR_WIN32=true
MACOS_OR_WINDOWS=true
HAIKU_OR_MACOS_OR_WINDOWS=true
endif

ifeq ($(WIN32),true)
MACOS_OR_WIN32=true
ifeq ($(WINDOWS),true)
MACOS_OR_WINDOWS=true
HAIKU_OR_MACOS_OR_WINDOWS=true
endif

# ---------------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -108,10 +124,12 @@ ifeq ($(NOOPT),true)
BASE_OPTS = -O2 -ffast-math -fdata-sections -ffunction-sections
endif

ifeq ($(WIN32),true)
ifeq ($(WINDOWS),true)
# mingw has issues with this specific optimization
# See https://github.com/falkTX/Carla/issues/696
BASE_OPTS += -fno-rerun-cse-after-loop
# See https://github.com/falkTX/Carla/issues/855
BASE_OPTS += -mstackrealign
ifeq ($(BUILDING_FOR_WINDOWS),true)
BASE_FLAGS += -DBUILDING_CARLA_FOR_WINDOWS
endif
Expand Down Expand Up @@ -141,7 +159,7 @@ ifeq ($(MACOS_OLD),true)
BUILD_CXX_FLAGS = $(BASE_FLAGS) $(CXXFLAGS) -DHAVE_CPP11_SUPPORT=0
endif

ifeq ($(WIN32),true)
ifeq ($(WINDOWS),true)
# Always build statically on windows
LINK_FLAGS += -static
endif
Expand Down Expand Up @@ -170,44 +188,81 @@ CXXFLAGS += -Weffc++ -Wnon-virtual-dtor -Woverloaded-virtual
endif

# ---------------------------------------------------------------------------------------------------------------------
# Check for optional libs
# Check for required libraries

ifeq ($(MACOS_OR_WIN32),true)
HAVE_DGL = true
HAVE_CAIRO = $(shell $(PKG_CONFIG) --exists cairo && echo true)

ifeq ($(HAIKU_OR_MACOS_OR_WINDOWS),true)
HAVE_OPENGL = true
else
HAVE_DGL = $(shell pkg-config --exists gl x11 && echo true)
HAVE_JACK = $(shell pkg-config --exists jack && echo true)
HAVE_LIBLO = $(shell pkg-config --exists liblo && echo true)
HAVE_OPENGL = $(shell $(PKG_CONFIG) --exists gl && echo true)
HAVE_X11 = $(shell $(PKG_CONFIG) --exists x11 && echo true)
endif

ifneq ($(HAVE_DGL),true)
$(error DGL missing 22)
# ---------------------------------------------------------------------------------------------------------------------
# Check for optional libraries

HAVE_JACK = $(shell $(PKG_CONFIG) --exists jack && echo true)
HAVE_LIBLO = $(shell $(PKG_CONFIG) --exists liblo && echo true)

# ---------------------------------------------------------------------------------------------------------------------
# Set Generic DGL stuff

ifeq ($(MACOS),true)
DGL_SYSTEM_LIBS += -framework Cocoa
endif

ifeq ($(WINDOWS),true)
DGL_SYSTEM_LIBS += -lgdi32
endif

ifneq ($(HAIKU_OR_MACOS_OR_WINDOWS),true)
DGL_FLAGS += $(shell $(PKG_CONFIG) --cflags x11)
DGL_SYSTEM_LIBS += $(shell $(PKG_CONFIG) --libs x11)
endif

# ---------------------------------------------------------------------------------------------------------------------
# Set Cairo specific stuff

ifeq ($(HAVE_CAIRO),true)

DGL_FLAGS += -DHAVE_CAIRO

CAIRO_FLAGS = $(shell $(PKG_CONFIG) --cflags cairo)
CAIRO_LIBS = $(shell $(PKG_CONFIG) --libs cairo)

HAVE_CAIRO_OR_OPENGL = true

endif

# ---------------------------------------------------------------------------------------------------------------------
# Set libs stuff
# Set OpenGL specific stuff

ifeq ($(HAVE_OPENGL),true)

ifeq ($(HAVE_DGL),true)
DGL_FLAGS += -DHAVE_OPENGL

ifeq ($(MACOS),true)
DGL_LIBS = -framework OpenGL -framework Cocoa
OPENGL_LIBS = -framework OpenGL
endif

ifeq ($(WIN32),true)
DGL_LIBS = -lopengl32 -lgdi32
ifeq ($(WINDOWS),true)
OPENGL_LIBS = -lopengl32
endif

ifneq ($(MACOS_OR_WIN32),true)
DGL_FLAGS = $(shell pkg-config --cflags gl x11)
DGL_LIBS = $(shell pkg-config --libs gl x11)
ifneq ($(MACOS_OR_WINDOWS),true)
OPENGL_FLAGS = $(shell $(PKG_CONFIG) --cflags gl x11)
OPENGL_LIBS = $(shell $(PKG_CONFIG) --libs gl x11)
endif

endif # HAVE_DGL
HAVE_CAIRO_OR_OPENGL = true

endif

# ---------------------------------------------------------------------------------------------------------------------
# Set app extension

ifeq ($(WIN32),true)
ifeq ($(WINDOWS),true)
APP_EXT = .exe
endif

Expand All @@ -220,17 +275,17 @@ ifeq ($(MACOS),true)
LIB_EXT = .dylib
endif

ifeq ($(WIN32),true)
ifeq ($(WINDOWS),true)
LIB_EXT = .dll
endif

# ---------------------------------------------------------------------------------------------------------------------
# Set shared library CLI arg

SHARED = -shared

ifeq ($(MACOS),true)
SHARED = -dynamiclib
else
SHARED = -shared
endif

# ---------------------------------------------------------------------------------------------------------------------
Loading

0 comments on commit 0530b43

Please sign in to comment.