From 5094196ece4e3af480ec34f1133cf8373c38a367 Mon Sep 17 00:00:00 2001 From: falkTX Date: Mon, 1 Jan 2018 13:46:12 +0100 Subject: [PATCH] Show if libmagic is available during "make features" --- Makefile | 37 +++++++++++++++++++------------ source/Makefile.mk | 4 ++-- source/utils/CarlaBinaryUtils.hpp | 2 +- 3 files changed, 26 insertions(+), 17 deletions(-) diff --git a/Makefile b/Makefile index 9acfe6225..90f13f45a 100644 --- a/Makefile +++ b/Makefile @@ -722,39 +722,48 @@ endif features_print_main: @printf -- "$(tS)---> Main features $(tE)\n" ifeq ($(HAVE_PYQT),true) - @printf -- "Front-End: $(ANS_YES) (Using $(FEV))\n" + @printf -- "Front-End: $(ANS_YES) (Using $(FEV))\n" ifneq ($(WIN32),true) - @printf -- "LV2 plugin: $(ANS_YES)\n" + @printf -- "LV2 plugin: $(ANS_YES)\n" else - @printf -- "LV2 plugin: $(ANS_NO) $(mZ)Not available for Windows$(mE)\n" + @printf -- "LV2 plugin: $(ANS_NO) $(mZ)Not available for Windows$(mE)\n" endif ifeq ($(LINUX),true) ifeq ($(HAVE_X11),true) - @printf -- "VST plugin: $(ANS_YES)\n" + @printf -- "VST plugin: $(ANS_YES)\n" else # HAVE_X11 - @printf -- "VST plugin: $(ANS_NO) $(mS)X11 missing$(mE)\n" + @printf -- "VST plugin: $(ANS_NO) $(mS)X11 missing$(mE)\n" endif else # LINUX - @printf -- "VST plugin: $(ANS_NO) $(mZ)Linux only$(mE)\n" + @printf -- "VST plugin: $(ANS_NO) $(mZ)Linux only$(mE)\n" endif else - @printf -- "Front-End: $(ANS_NO) $(mS)Missing PyQt$(mE)\n" - @printf -- "LV2 plugin: $(ANS_NO) $(mS)No front-end$(mE)\n" - @printf -- "VST plugin: $(ANS_NO) $(mS)No front-end$(mE)\n" + @printf -- "Front-End: $(ANS_NO) $(mS)Missing PyQt$(mE)\n" + @printf -- "LV2 plugin: $(ANS_NO) $(mS)No front-end$(mE)\n" + @printf -- "VST plugin: $(ANS_NO) $(mS)No front-end$(mE)\n" endif ifeq ($(HAVE_HYLIA),true) - @printf -- "Link support: $(ANS_YES)\n" + @printf -- "Link support: $(ANS_YES)\n" else ifeq ($(MACOS_OLD),true) - @printf -- "Link support: $(ANS_NO) $(mZ)MacOS >= 10.10 only$(mE)\n" + @printf -- "Link support: $(ANS_NO) $(mZ)MacOS >= 10.10 only$(mE)\n" else - @printf -- "Link support: $(ANS_NO) $(mZ)Linux, MacOS and Windows only$(mE)\n" + @printf -- "Link support: $(ANS_NO) $(mZ)Linux, MacOS and Windows only$(mE)\n" endif endif ifeq ($(HAVE_LIBLO),true) - @printf -- "OSC support: $(ANS_YES)\n" + @printf -- "OSC support: $(ANS_YES)\n" else - @printf -- "OSC support: $(ANS_NO) $(mS)Missing liblo$(mE)\n" + @printf -- "OSC support: $(ANS_NO) $(mS)Missing liblo$(mE)\n" +endif +ifeq ($(WIN32),true) + @printf -- "Binary detect: $(ANS_YES)\n" +else +ifeq ($(HAVE_LIBMAGIC),true) + @printf -- "Binary detect: $(ANS_YES)\n" +else + @printf -- "Binary detect: $(ANS_NO) $(mS)Missing libmagic/file$(mE)\n" +endif endif @printf -- "\n" diff --git a/source/Makefile.mk b/source/Makefile.mk index 5674b0194..292f79e46 100644 --- a/source/Makefile.mk +++ b/source/Makefile.mk @@ -238,9 +238,9 @@ HAVE_QT5 = $(shell pkg-config --exists Qt5Core Qt5Gui Qt5Widgets && ech HAVE_SNDFILE = $(shell pkg-config --exists sndfile && echo true) # --------------------------------------------------------------------------------------------------------------------- -# Check for optional libs (special non-pkgconfig unix tests) +# Check for optional libs (special non-pkgconfig tests) -ifeq ($(UNIX),true) +ifneq ($(WIN32),true) # libmagic doesn't have a pkg-config file, so we need to call the compiler to test it HAVE_LIBMAGIC = $(shell echo '\#include ' | $(CC) $(CFLAGS) -x c -w -c - -o .libmagic-tmp 2>/dev/null && echo true) diff --git a/source/utils/CarlaBinaryUtils.hpp b/source/utils/CarlaBinaryUtils.hpp index 45b75902c..8a27f04c0 100644 --- a/source/utils/CarlaBinaryUtils.hpp +++ b/source/utils/CarlaBinaryUtils.hpp @@ -79,7 +79,7 @@ BinaryType getBinaryTypeFromFile(const char* const filename) using water::FileInputStream; ScopedPointer stream(File(filename).createInputStream()); - CARLA_SAFE_ASSERT_RETURN(stream != nullptr || stream->failedToOpen(), BINARY_NATIVE); + CARLA_SAFE_ASSERT_RETURN(stream != nullptr && ! stream->failedToOpen(), BINARY_NATIVE); // ------------------------------------------------------------------- // binary type code based on Ardour's dll_info function