From 30777a471138b62b166b895ce6ab945d8cd824f0 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sat, 19 Jul 2014 21:54:04 +0100 Subject: [PATCH] Cleanup Makefile.mk now that qt is not required for backend --- Makefile | 5 -- source/Makefile.mk | 106 ++++++++----------------------- source/utils/CarlaStateUtils.cpp | 4 +- 3 files changed, 30 insertions(+), 85 deletions(-) diff --git a/Makefile b/Makefile index eb950b52c..955842001 100644 --- a/Makefile +++ b/Makefile @@ -584,11 +584,6 @@ endif endif @echo "$(tS)---> File formats: $(tE)" -ifeq ($(CARLA_CSOUND_SUPPORT),true) - @echo "CSD:$(ANS_YES)" -else - @echo "CSD:$(ANS_NO) $(mS)CSound disabled$(mE)" -endif ifeq ($(CARLA_SAMPLERS_SUPPORT),true) ifeq ($(HAVE_LINUXSAMPLER),true) @echo "GIG:$(ANS_YES)" diff --git a/source/Makefile.mk b/source/Makefile.mk index bd6e0d88b..ec76b4db1 100644 --- a/source/Makefile.mk +++ b/source/Makefile.mk @@ -122,76 +122,15 @@ CFLAGS += -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes CXXFLAGS += -Wnon-virtual-dtor -Woverloaded-virtual ifeq ($(LINUX),true) CFLAGS += -isystem /opt/kxstudio/include -CXXFLAGS += -isystem /opt/kxstudio/include -isystem /usr/include/qt4 +CXXFLAGS += -isystem /opt/kxstudio/include endif ifeq ($(MACOS),true) CFLAGS += -isystem /opt/kxstudio/include -CXXFLAGS += -isystem /opt/kxstudio/include -isystem /opt/kxstudio/include/qt5 +CXXFLAGS += -isystem /opt/kxstudio/include endif ifeq ($(WIN32),true) CFLAGS += -isystem /opt/mingw32/include -CXXFLAGS += -isystem /opt/mingw32/include -isystem /opt/mingw32/include/qt4 -endif -endif - -# -------------------------------------------------------------- -# Check for qt, set default version - -HAVE_QT4 = $(shell pkg-config --exists QtCore && echo true) -HAVE_QT5 = $(shell pkg-config --exists Qt5Core && echo true) - -ifeq ($(MACOS_OR_WIN32),true) -DEFAULT_QT ?= 5 -else -DEFAULT_QT ?= 4 -endif - -# -------------------------------------------------------------- -# Set Qt tools -# FIXME - -ifeq ($(HAVE_QT4),true) -MOC_QT4 ?= $(shell pkg-config --variable=moc_location QtCore) -RCC_QT4 ?= $(shell pkg-config --variable=rcc_location QtCore) -UIC_QT4 ?= $(shell pkg-config --variable=uic_location QtCore) -ifeq (,$(wildcard $(MOC_QT4))) -HAVE_QT4=false -endif -endif - -ifeq ($(HAVE_QT5),true) -QT5_LIBDIR = $(shell pkg-config --variable=libdir Qt5Core) -ifeq ($(MACOS),true) -MOC_QT5 ?= $(QT5_LIBDIR)/../bin/moc -RCC_QT5 ?= $(QT5_LIBDIR)/../bin/rcc -UIC_QT5 ?= $(QT5_LIBDIR)/../bin/uic -else # MACOS -ifneq (,$(wildcard $(QT5_LIBDIR)/qt5/bin/moc)) -MOC_QT5 ?= $(QT5_LIBDIR)/qt5/bin/moc -RCC_QT5 ?= $(QT5_LIBDIR)/qt5/bin/rcc -UIC_QT5 ?= $(QT5_LIBDIR)/qt5/bin/uic -else -MOC_QT5 ?= $(QT5_LIBDIR)/qt/bin/moc -RCC_QT5 ?= $(QT5_LIBDIR)/qt/bin/rcc -UIC_QT5 ?= $(QT5_LIBDIR)/qt/bin/uic -endif -endif # MACOS -ifeq (,$(wildcard $(MOC_QT5))) -HAVE_QT5=false -endif -endif - -# -------------------------------------------------------------- -# Fail if prefered Qt is not found -# FIXME - -ifeq ($(DEFAULT_QT),4) -ifneq ($(HAVE_QT4),true) -$(error Qt4 missing, cannot continue) -endif -else -ifneq ($(HAVE_QT5),true) -$(error Qt5 missing, cannot continue) +CXXFLAGS += -isystem /opt/mingw32/include endif endif @@ -218,8 +157,8 @@ else HAVE_FFMPEG = $(shell pkg-config --exists libavcodec libavformat libavutil && 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_QTGUI4 = $(shell pkg-config --exists QtCore QtGui && echo true) -HAVE_QTGUI5 = $(shell pkg-config --exists Qt5Core Qt5Gui Qt5Widgets && echo true) +HAVE_QT4 = $(shell pkg-config --exists QtCore QtGui && echo true) +HAVE_QT5 = $(shell pkg-config --exists Qt5Core Qt5Gui Qt5Widgets && echo true) ifeq ($(LINUX),true) HAVE_ALSA = $(shell pkg-config --exists alsa && echo true) HAVE_DGL = $(shell pkg-config --exists gl && echo true) @@ -236,18 +175,35 @@ endif # -------------------------------------------------------------- # Set Qt tools -# TODO -ifeq ($(HAVE_QTGUI4),true) +ifeq ($(HAVE_QT4),true) +MOC_QT4 ?= $(shell pkg-config --variable=moc_location QtCore) +RCC_QT4 ?= $(shell pkg-config --variable=rcc_location QtCore) +UIC_QT4 ?= $(shell pkg-config --variable=uic_location QtCore) ifeq (,$(wildcard $(MOC_QT4))) -HAVE_QTGUI4=false +HAVE_QT4=false endif endif -ifeq ($(HAVE_QTGUI5),true) +ifeq ($(HAVE_QT5),true) QT5_LIBDIR = $(shell pkg-config --variable=libdir Qt5Core) +ifeq ($(MACOS),true) +MOC_QT5 ?= $(QT5_LIBDIR)/../bin/moc +RCC_QT5 ?= $(QT5_LIBDIR)/../bin/rcc +UIC_QT5 ?= $(QT5_LIBDIR)/../bin/uic +else # MACOS +ifneq (,$(wildcard $(QT5_LIBDIR)/qt5/bin/moc)) +MOC_QT5 ?= $(QT5_LIBDIR)/qt5/bin/moc +RCC_QT5 ?= $(QT5_LIBDIR)/qt5/bin/rcc +UIC_QT5 ?= $(QT5_LIBDIR)/qt5/bin/uic +else +MOC_QT5 ?= $(QT5_LIBDIR)/qt/bin/moc +RCC_QT5 ?= $(QT5_LIBDIR)/qt/bin/rcc +UIC_QT5 ?= $(QT5_LIBDIR)/qt/bin/uic +endif +endif # MACOS ifeq (,$(wildcard $(MOC_QT5))) -HAVE_QTGUI5=false +HAVE_QT5=false endif endif @@ -285,14 +241,6 @@ endif LIBLO_FLAGS = $(shell pkg-config --cflags liblo) LIBLO_LIBS = $(shell pkg-config --libs liblo) -ifeq ($(DEFAULT_QT),4) -QTCORE_FLAGS = $(shell pkg-config --cflags QtCore) -QTCORE_LIBS = $(shell pkg-config --libs QtCore) -else -QTCORE_FLAGS = $(shell pkg-config --cflags Qt5Core) -QTCORE_LIBS = $(shell pkg-config --libs Qt5Core) -endif - ifeq ($(HAVE_FLUIDSYNTH),true) FLUIDSYNTH_FLAGS = $(shell pkg-config --cflags fluidsynth) FLUIDSYNTH_LIBS = $(shell pkg-config --libs fluidsynth) diff --git a/source/utils/CarlaStateUtils.cpp b/source/utils/CarlaStateUtils.cpp index dbbd20d18..30d31acae 100644 --- a/source/utils/CarlaStateUtils.cpp +++ b/source/utils/CarlaStateUtils.cpp @@ -299,7 +299,9 @@ bool StateSave::fillFromXmlElement(const XmlElement* const xmlElement) } else if (tag.equalsIgnoreCase("options")) { - options = text.getHexValue32(); + const int value(text.getHexValue32()); + if (value > 0) + options = static_cast(value); } // -------------------------------------------------------