From 3a270f573cdf2b335ec8e4e1fc31e81e8a603e83 Mon Sep 17 00:00:00 2001 From: falkTX Date: Wed, 22 Aug 2018 19:51:13 +0200 Subject: [PATCH] Always build DGL, even if not using external plugins --- Makefile | 4 ++++ source/Makefile.mk | 42 ++++++++++++++++++++++++++-------- source/native-plugins/Makefile | 4 ++-- source/native-plugins/external | 2 +- 4 files changed, 39 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 6ff61e977..8953eca7b 100644 --- a/Makefile +++ b/Makefile @@ -62,6 +62,10 @@ ALL_LIBS += $(MODULEDIR)/rtmempool.a ALL_LIBS += $(MODULEDIR)/sfzero.a ALL_LIBS += $(MODULEDIR)/water.a +ifeq ($(HAVE_DGL),true) +ALL_LIBS += $(MODULEDIR)/dgl.a +endif + ifeq ($(HAVE_HYLIA),true) ALL_LIBS += $(MODULEDIR)/hylia.a endif diff --git a/source/Makefile.mk b/source/Makefile.mk index e6d19a227..0c34a9f48 100644 --- a/source/Makefile.mk +++ b/source/Makefile.mk @@ -202,7 +202,10 @@ HAVE_HYLIA = true endif endif -ifneq ($(MACOS_OR_WIN32),true) +ifeq ($(MACOS_OR_WIN32),true) +HAVE_DGL = true +else +HAVE_DGL = $(shell pkg-config --exists gl x11 && echo true) HAVE_GTK2 = $(shell pkg-config --exists gtk+-2.0 && echo true) HAVE_GTK3 = $(shell pkg-config --exists gtk+-3.0 && echo true) HAVE_X11 = $(shell pkg-config --exists x11 && echo true) @@ -307,8 +310,9 @@ endif # --------------------------------------------------------------------------------------------------------------------- # Set base defines -ifeq ($(HAVE_PYQT),true) -BASE_FLAGS += -DHAVE_PYQT +ifeq ($(HAVE_DGL),true) +BASE_FLAGS += -DHAVE_DGL +BASE_FLAGS += -DDGL_NAMESPACE=CarlaDGL -DDGL_FILE_BROWSER_DISABLED -DDGL_NO_SHARED_RESOURCES endif ifeq ($(HAVE_FLUIDSYNTH),true) @@ -331,6 +335,10 @@ ifeq ($(HAVE_LIBMAGIC),true) BASE_FLAGS += -DHAVE_LIBMAGIC endif +ifeq ($(HAVE_PYQT),true) +BASE_FLAGS += -DHAVE_PYQT +endif + ifeq ($(HAVE_SNDFILE),true) BASE_FLAGS += -DHAVE_SNDFILE endif @@ -346,11 +354,31 @@ ifeq ($(LINUX_OR_MACOS),true) LIBDL_LIBS = -ldl endif +ifeq ($(HAVE_DGL),true) +ifeq ($(MACOS),true) +DGL_LIBS = -framework OpenGL -framework Cocoa +endif +ifeq ($(WIN32),true) +DGL_LIBS = -lopengl32 -lgdi32 +endif +ifneq ($(MACOS_OR_WIN32),true) +DGL_FLAGS = $(shell pkg-config --cflags gl x11) +DGL_LIBS = $(shell pkg-config --libs gl x11) +endif +endif + ifeq ($(HAVE_LIBLO),true) LIBLO_FLAGS = $(shell pkg-config --cflags liblo) LIBLO_LIBS = $(shell pkg-config --libs liblo) endif +ifeq ($(HAVE_LIBMAGIC),true) +MAGIC_LIBS += -lmagic +ifeq ($(LINUX_OR_MACOS),true) +MAGIC_LIBS += -lz +endif +endif + ifeq ($(HAVE_FFMPEG),true) FFMPEG_FLAGS = $(shell pkg-config --cflags libavcodec libavformat libavutil) FFMPEG_LIBS = $(shell pkg-config --libs libavcodec libavformat libavutil) @@ -371,13 +399,6 @@ X11_FLAGS = $(shell pkg-config --cflags x11) X11_LIBS = $(shell pkg-config --libs x11) endif -ifeq ($(HAVE_LIBMAGIC),true) -MAGIC_LIBS += -lmagic -ifeq ($(LINUX_OR_MACOS),true) -MAGIC_LIBS += -lz -endif -endif - # --------------------------------------------------------------------------------------------------------------------- # Set libs stuff (part 2) @@ -459,6 +480,7 @@ endif # --------------------------------------------------------------------------------------------------------------------- +NATIVE_PLUGINS_LIBS += $(DGL_LIBS) NATIVE_PLUGINS_LIBS += $(FFMPEG_LIBS) NATIVE_PLUGINS_LIBS += $(SNDFILE_LIBS) diff --git a/source/native-plugins/Makefile b/source/native-plugins/Makefile index f99f0e52d..147992484 100644 --- a/source/native-plugins/Makefile +++ b/source/native-plugins/Makefile @@ -53,8 +53,8 @@ OBJS_all = \ # --------------------------------------------------------------------------------------------------------------------- # Include external plugins, if present -ifneq (,$(wildcard external/Makefile)) -include external/Makefile +ifneq (,$(wildcard external/Makefile.mk2)) +include external/Makefile.mk2 endif # --------------------------------------------------------------------------------------------------------------------- diff --git a/source/native-plugins/external b/source/native-plugins/external index dbd7b4d5e..5fccac046 160000 --- a/source/native-plugins/external +++ b/source/native-plugins/external @@ -1 +1 @@ -Subproject commit dbd7b4d5ef8ae0aa0aee9890a09971265a9557db +Subproject commit 5fccac046b09bba67900f675e0aea18ce3b09775