Browse Source

Allow lv2 gtk bridges on any system

tags/v2.4.0
falkTX 3 years ago
parent
commit
a09034219e
6 changed files with 41 additions and 17 deletions
  1. +5
    -4
      source/Makefile.mk
  2. +3
    -8
      source/bridges-ui/CarlaBridgeFormat.cpp
  3. +4
    -0
      source/bridges-ui/CarlaBridgeFormatLV2.cpp
  4. +23
    -3
      source/bridges-ui/CarlaBridgeToolkitGtk.cpp
  5. +0
    -1
      source/bridges-ui/CarlaBridgeToolkitNative.cpp
  6. +6
    -1
      source/bridges-ui/Makefile

+ 5
- 4
source/Makefile.mk View File

@@ -281,6 +281,8 @@ endif
# ---------------------------------------------------------------------------------------------------------------------
# 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)
HAVE_ALSA = $(shell $(PKG_CONFIG) --exists alsa && echo true)
HAVE_HYLIA = true
@@ -297,11 +299,10 @@ HAVE_HYLIA = true
endif

ifeq ($(MACOS_OR_WIN32),true)
HAVE_DGL = true
HAVE_DGL = true
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

ifeq ($(UNIX),true)


+ 3
- 8
source/bridges-ui/CarlaBridgeFormat.cpp View File

@@ -1,6 +1,6 @@
/*
* 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
* 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);

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


+ 4
- 0
source/bridges-ui/CarlaBridgeFormatLV2.cpp View File

@@ -1567,3 +1567,7 @@ int main(int argc, const char* argv[])
}

// --------------------------------------------------------------------------------------------------------------------

#include "CarlaMacUtils.cpp"

// --------------------------------------------------------------------------------------------------------------------

+ 23
- 3
source/bridges-ui/CarlaBridgeToolkitGtk.cpp View File

@@ -148,12 +148,32 @@ struct GtkLoader {
# endif
#endif
{
const char* filename;
const char* const filenames[] = {
#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
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
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)
{


+ 0
- 1
source/bridges-ui/CarlaBridgeToolkitNative.cpp View File

@@ -238,7 +238,6 @@ CARLA_BRIDGE_UI_END_NAMESPACE

#define CARLA_PLUGIN_UI_CLASS_PREFIX ToolkitNative
#include "CarlaPluginUI.cpp"
#include "CarlaMacUtils.cpp"
#include "utils/Windows.cpp"

// -------------------------------------------------------------------------

+ 6
- 1
source/bridges-ui/Makefile View File

@@ -48,6 +48,11 @@ LINK_COCOA_FLAGS = $(LINK_FLAGS) -framework Cocoa $(LIBDL_LIBS)
BUILD_WINDOWS_FLAGS = $(BUILD_CXX_FLAGS) -DBRIDGE_HWND
LINK_WINDOWS_FLAGS = $(LINK_FLAGS) -static -mwindows

ifeq ($(MACOS),true)
BUILD_GTK2_FLAGS += -ObjC++
BUILD_GTK3_FLAGS += -ObjC++
endif

ifeq ($(TESTBUILD),true)
BUILD_QT4_FLAGS += -isystem /usr/include/qt4
BUILD_QT5_FLAGS += -isystem /usr/include/qt5
@@ -56,7 +61,6 @@ endif

# ---------------------------------------------------------------------------------------------------------------------

ifneq ($(MACOS_OR_WIN32),true)
ifeq ($(HAVE_GOBJECT),true)
TARGETS += ui_lv2-gtk2
endif
@@ -65,6 +69,7 @@ ifeq ($(HAVE_GOBJECT),true)
TARGETS += ui_lv2-gtk3
endif

ifneq ($(MACOS_OR_WIN32),true)
ifeq ($(HAVE_QT4),true)
TARGETS += ui_lv2-qt4
endif


Loading…
Cancel
Save