From 51540d510e6ed6cbcd9bc21f395ac813086c9243 Mon Sep 17 00:00:00 2001 From: falkTX Date: Fri, 24 Nov 2017 11:42:47 +0100 Subject: [PATCH] First attempt to make it work on Hurd --- source/Makefile.mk | 43 ++++++++++++++++++++++++++-------- source/includes/CarlaDefines.h | 2 ++ source/utils/CarlaThread.hpp | 2 +- 3 files changed, 36 insertions(+), 11 deletions(-) diff --git a/source/Makefile.mk b/source/Makefile.mk index fb4f6e7aa..0b5567f7e 100644 --- a/source/Makefile.mk +++ b/source/Makefile.mk @@ -22,6 +22,7 @@ CXX ?= g++ ifneq ($(BSD),true) ifneq ($(HAIKU),true) +ifneq ($(HURD),true) ifneq ($(MACOS),true) ifneq ($(WIN32),true) LINUX=true @@ -29,6 +30,7 @@ endif endif endif endif +endif # --------------------------------------------------------------------------------------------------------------------- # Set LINUX_OR_MACOS @@ -59,6 +61,10 @@ ifeq ($(BSD),true) UNIX=true endif +ifeq ($(HURD),true) +UNIX=true +endif + ifeq ($(LINUX),true) UNIX=true endif @@ -176,13 +182,13 @@ endif # --------------------------------------------------------------------------------------------------------------------- # Check for optional libs (required by backend or bridges) -ifneq ($(MACOS_OR_WIN32),true) -HAVE_GTK2 = $(shell pkg-config --exists gtk+-2.0 && echo true) -HAVE_GTK3 = $(shell pkg-config --exists gtk+-3.0 && echo true) -HAVE_PULSEAUDIO = $(shell pkg-config --exists libpulse-simple && echo true) -HAVE_QT4 = $(shell pkg-config --exists QtCore QtGui && echo true) -HAVE_QT5 = $(shell pkg-config --exists Qt5Core Qt5Gui Qt5Widgets && echo true) -HAVE_X11 = $(shell pkg-config --exists x11 && echo true) +ifeq ($(HURD),true) +HAVE_ALSA = $(shell pkg-config --exists alsa && echo true) +endif + +ifeq ($(LINUX),true) +HAVE_ALSA = $(shell pkg-config --exists alsa && echo true) +HAVE_HYLIA = true endif ifeq ($(MACOS),true) @@ -191,9 +197,13 @@ HAVE_HYLIA = true endif endif -ifeq ($(LINUX),true) -HAVE_ALSA = $(shell pkg-config --exists alsa && echo true) -HAVE_HYLIA = true +ifneq ($(MACOS_OR_WIN32),true) +HAVE_GTK2 = $(shell pkg-config --exists gtk+-2.0 && echo true) +HAVE_GTK3 = $(shell pkg-config --exists gtk+-3.0 && echo true) +HAVE_PULSEAUDIO = $(shell pkg-config --exists libpulse-simple && echo true) +HAVE_QT4 = $(shell pkg-config --exists QtCore QtGui && echo true) +HAVE_QT5 = $(shell pkg-config --exists Qt5Core Qt5Gui Qt5Widgets && echo true) +HAVE_X11 = $(shell pkg-config --exists x11 && echo true) endif HAVE_FFMPEG = $(shell pkg-config --exists libavcodec libavformat libavutil && echo true) @@ -422,6 +432,19 @@ RTMEMPOOL_LIBS = -lpthread WATER_LIBS = -lpthread endif +ifeq ($(HURD),true) +JACKBRIDGE_LIBS = -ldl -lpthread -lrt +LILV_LIBS = -ldl -lm -lrt +RTMEMPOOL_LIBS = -lpthread -lrt +WATER_LIBS = -ldl -lpthread -lrt +ifeq ($(HAVE_ALSA),true) +RTAUDIO_FLAGS += $(shell pkg-config --cflags alsa) -D__LINUX_ALSA__ +RTAUDIO_LIBS += $(shell pkg-config --libs alsa) -lpthread +RTMIDI_FLAGS += $(shell pkg-config --cflags alsa) -D__LINUX_ALSA__ +RTMIDI_LIBS += $(shell pkg-config --libs alsa) +endif +endif + ifeq ($(LINUX),true) HYLIA_FLAGS = -DLINK_PLATFORM_LINUX=1 JACKBRIDGE_LIBS = -ldl -lpthread -lrt diff --git a/source/includes/CarlaDefines.h b/source/includes/CarlaDefines.h index 6334188dd..2aa3c7a74 100644 --- a/source/includes/CarlaDefines.h +++ b/source/includes/CarlaDefines.h @@ -48,6 +48,8 @@ # define CARLA_OS_LINUX #elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) # define CARLA_OS_BSD +#elif defined(__GNU__) +# define CARLA_OS_GNU_HURD #else # warning Unsupported platform! #endif diff --git a/source/utils/CarlaThread.hpp b/source/utils/CarlaThread.hpp index cd7744bb0..137362ef5 100644 --- a/source/utils/CarlaThread.hpp +++ b/source/utils/CarlaThread.hpp @@ -207,7 +207,7 @@ public: #ifdef CARLA_OS_LINUX prctl(PR_SET_NAME, name, 0, 0, 0); #endif -#if defined(__GLIBC__) && (__GLIBC__ * 1000 + __GLIBC_MINOR__) >= 2012 +#if defined(__GLIBC__) && (__GLIBC__ * 1000 + __GLIBC_MINOR__) >= 2012 && !defined(CARLA_OS_GNU_HURD) pthread_setname_np(pthread_self(), name); #endif }