@@ -281,6 +281,8 @@ endif | |||||
# --------------------------------------------------------------------------------------------------------------------- | # --------------------------------------------------------------------------------------------------------------------- | ||||
# Check for optional libs (required by backend or bridges) | # Check for optional libs (required by backend or bridges) | ||||
HAVE_GOBJECT = $(shell $(PKG_CONFIG) --exists glib-2.0 gobject-2.0 && echo true) | |||||
ifeq ($(LINUX),true) | ifeq ($(LINUX),true) | ||||
HAVE_ALSA = $(shell $(PKG_CONFIG) --exists alsa && echo true) | HAVE_ALSA = $(shell $(PKG_CONFIG) --exists alsa && echo true) | ||||
HAVE_HYLIA = true | HAVE_HYLIA = true | ||||
@@ -297,11 +299,10 @@ HAVE_HYLIA = true | |||||
endif | endif | ||||
ifeq ($(MACOS_OR_WIN32),true) | ifeq ($(MACOS_OR_WIN32),true) | ||||
HAVE_DGL = true | |||||
HAVE_DGL = true | |||||
else | else | ||||
HAVE_DGL = $(shell $(PKG_CONFIG) --exists gl x11 && echo true) | |||||
HAVE_GOBJECT = $(shell $(PKG_CONFIG) --exists glib-2.0 gobject-2.0 && echo true) | |||||
HAVE_X11 = $(shell $(PKG_CONFIG) --exists x11 && echo true) | |||||
HAVE_DGL = $(shell $(PKG_CONFIG) --exists gl x11 && echo true) | |||||
HAVE_X11 = $(shell $(PKG_CONFIG) --exists x11 && echo true) | |||||
endif | endif | ||||
ifeq ($(UNIX),true) | ifeq ($(UNIX),true) | ||||
@@ -1,6 +1,6 @@ | |||||
/* | /* | ||||
* Carla Bridge UI | * Carla Bridge UI | ||||
* Copyright (C) 2011-2019 Filipe Coelho <falktx@falktx.com> | |||||
* Copyright (C) 2011-2021 Filipe Coelho <falktx@falktx.com> | |||||
* | * | ||||
* This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | ||||
* modify it under the terms of the GNU General Public License as | * modify it under the terms of the GNU General Public License as | ||||
@@ -82,14 +82,9 @@ bool CarlaBridgeFormat::libOpen(const char* const filename) noexcept | |||||
CARLA_SAFE_ASSERT_RETURN(fLib == nullptr, false); | CARLA_SAFE_ASSERT_RETURN(fLib == nullptr, false); | ||||
fLib = lib_open(filename); | fLib = lib_open(filename); | ||||
fLibFilename = filename; | |||||
if (fLib != nullptr) | |||||
{ | |||||
fLibFilename = filename; | |||||
return true; | |||||
} | |||||
return false; | |||||
return fLib != nullptr; | |||||
} | } | ||||
void* CarlaBridgeFormat::libSymbol(const char* const symbol) const noexcept | void* CarlaBridgeFormat::libSymbol(const char* const symbol) const noexcept | ||||
@@ -1567,3 +1567,7 @@ int main(int argc, const char* argv[]) | |||||
} | } | ||||
// -------------------------------------------------------------------------------------------------------------------- | // -------------------------------------------------------------------------------------------------------------------- | ||||
#include "CarlaMacUtils.cpp" | |||||
// -------------------------------------------------------------------------------------------------------------------- |
@@ -148,12 +148,32 @@ struct GtkLoader { | |||||
# endif | # endif | ||||
#endif | #endif | ||||
{ | { | ||||
const char* filename; | |||||
const char* const filenames[] = { | |||||
#ifdef BRIDGE_GTK3 | #ifdef BRIDGE_GTK3 | ||||
const char* const filename = "libgtk-3.so.0"; | |||||
# if defined(CARLA_OS_MAC) | |||||
"libgtk-3.0.dylib", | |||||
# else | |||||
"libgtk-3.so.0", | |||||
# endif | |||||
#else | #else | ||||
const char* const filename = "libgtk-x11-2.0.so.0"; | |||||
# if defined(CARLA_OS_MAC) | |||||
"libgtk-quartz-2.0.dylib", | |||||
"libgtk-x11-2.0.dylib", | |||||
"/opt/local/lib/libgtk-quartz-2.0.dylib", | |||||
"/opt/local/lib/libgtk-x11-2.0.dylib", | |||||
# else | |||||
"libgtk-x11-2.0.so.0", | |||||
# endif | |||||
#endif | #endif | ||||
lib = lib_open(filename); | |||||
}; | |||||
for (size_t i=0; i<sizeof(filenames)/sizeof(filenames[0]); ++i) | |||||
{ | |||||
filename = filenames[i]; | |||||
if ((lib = lib_open(filename)) != nullptr) | |||||
break; | |||||
} | |||||
if (lib == nullptr) | if (lib == nullptr) | ||||
{ | { | ||||
@@ -238,7 +238,6 @@ CARLA_BRIDGE_UI_END_NAMESPACE | |||||
#define CARLA_PLUGIN_UI_CLASS_PREFIX ToolkitNative | #define CARLA_PLUGIN_UI_CLASS_PREFIX ToolkitNative | ||||
#include "CarlaPluginUI.cpp" | #include "CarlaPluginUI.cpp" | ||||
#include "CarlaMacUtils.cpp" | |||||
#include "utils/Windows.cpp" | #include "utils/Windows.cpp" | ||||
// ------------------------------------------------------------------------- | // ------------------------------------------------------------------------- |
@@ -48,6 +48,11 @@ LINK_COCOA_FLAGS = $(LINK_FLAGS) -framework Cocoa $(LIBDL_LIBS) | |||||
BUILD_WINDOWS_FLAGS = $(BUILD_CXX_FLAGS) -DBRIDGE_HWND | BUILD_WINDOWS_FLAGS = $(BUILD_CXX_FLAGS) -DBRIDGE_HWND | ||||
LINK_WINDOWS_FLAGS = $(LINK_FLAGS) -static -mwindows | LINK_WINDOWS_FLAGS = $(LINK_FLAGS) -static -mwindows | ||||
ifeq ($(MACOS),true) | |||||
BUILD_GTK2_FLAGS += -ObjC++ | |||||
BUILD_GTK3_FLAGS += -ObjC++ | |||||
endif | |||||
ifeq ($(TESTBUILD),true) | ifeq ($(TESTBUILD),true) | ||||
BUILD_QT4_FLAGS += -isystem /usr/include/qt4 | BUILD_QT4_FLAGS += -isystem /usr/include/qt4 | ||||
BUILD_QT5_FLAGS += -isystem /usr/include/qt5 | BUILD_QT5_FLAGS += -isystem /usr/include/qt5 | ||||
@@ -56,7 +61,6 @@ endif | |||||
# --------------------------------------------------------------------------------------------------------------------- | # --------------------------------------------------------------------------------------------------------------------- | ||||
ifneq ($(MACOS_OR_WIN32),true) | |||||
ifeq ($(HAVE_GOBJECT),true) | ifeq ($(HAVE_GOBJECT),true) | ||||
TARGETS += ui_lv2-gtk2 | TARGETS += ui_lv2-gtk2 | ||||
endif | endif | ||||
@@ -65,6 +69,7 @@ ifeq ($(HAVE_GOBJECT),true) | |||||
TARGETS += ui_lv2-gtk3 | TARGETS += ui_lv2-gtk3 | ||||
endif | endif | ||||
ifneq ($(MACOS_OR_WIN32),true) | |||||
ifeq ($(HAVE_QT4),true) | ifeq ($(HAVE_QT4),true) | ||||
TARGETS += ui_lv2-qt4 | TARGETS += ui_lv2-qt4 | ||||
endif | endif | ||||