From ad3267cec12d49adc31542cdfbe2344ae68f574f Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Sat, 25 Apr 2020 01:16:39 +0200 Subject: [PATCH] fix osx, hopefully --- client/Makefile | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/client/Makefile b/client/Makefile index ed133eb36..a7bf93383 100644 --- a/client/Makefile +++ b/client/Makefile @@ -82,6 +82,8 @@ else LDFLAGS += -framework Foundation -framework AppKit LDLIBS := -L/usr/local/opt/readline/lib $(LDLIBS) LIBS := -I/usr/local/opt/readline/include $(LIBS) + # cf brew info qt: qt not symlinked anymore + PKG_CONFIG_PATH := PKG_CONFIG_PATH=/usr/local/opt/qt/lib/pkgconfig else LUALIB += -ldl LUAPLATFORM = linux @@ -90,18 +92,19 @@ endif ifneq ($(SKIPQT),1) # Check for correctly configured Qt5 - QTINCLUDES = $(shell pkg-config --cflags Qt5Core Qt5Widgets 2>/dev/null) - QTLDLIBS = $(shell pkg-config --libs Qt5Core Qt5Widgets 2>/dev/null) - MOC = $(shell pkg-config --variable=host_bins Qt5Core)/moc - UIC = $(shell pkg-config --variable=host_bins Qt5Core)/uic + QTINCLUDES = $(shell $(PKG_CONFIG_PATH) pkg-config --cflags Qt5Core Qt5Widgets 2>/dev/null) + QTLDLIBS = $(shell $(PKG_CONFIG_PATH) pkg-config --libs Qt5Core Qt5Widgets 2>/dev/null) + MOC = $(shell $(PKG_CONFIG_PATH) pkg-config --variable=host_bins Qt5Core)/moc + UIC = $(shell $(PKG_CONFIG_PATH) pkg-config --variable=host_bins Qt5Core)/uic ifeq ($(QTINCLUDES), ) # if Qt5 not found check for correctly configured Qt4 - QTINCLUDES = $(shell pkg-config --cflags QtCore QtGui 2>/dev/null) - QTLDLIBS = $(shell pkg-config --libs QtCore QtGui 2>/dev/null) - MOC = $(shell pkg-config --variable=moc_location QtCore) - UIC = $(shell pkg-config --variable=uic_location QtCore) + QTINCLUDES = $(shell $(PKG_CONFIG_PATH) pkg-config --cflags QtCore QtGui 2>/dev/null) + QTLDLIBS = $(shell $(PKG_CONFIG_PATH) pkg-config --libs QtCore QtGui 2>/dev/null) + MOC = $(shell $(PKG_CONFIG_PATH) pkg-config --variable=moc_location QtCore) + UIC = $(shell $(PKG_CONFIG_PATH) pkg-config --variable=uic_location QtCore) else - PM3CXXFLAGS += -fPIC + # On OSX Qt5 is claiming for a C++11 compiler (gnu++14 works too, but if nothing it fails) + PM3CXXFLAGS += -fPIC -std=c++11 endif ifeq ($(QTINCLUDES), ) # if both pkg-config commands failed, search in common places @@ -111,7 +114,7 @@ ifneq ($(SKIPQT),1) ifneq ($(wildcard $(QTDIR)/include/QtWidgets),) QTINCLUDES += -I$(QTDIR)/include/QtWidgets QTLDLIBS = -L$(QTDIR)/lib -lQt5Widgets -lQt5Gui -lQt5Core - PM3CXXFLAGS += -fPIC + PM3CXXFLAGS += -fPIC -std=c++11 endif MOC = $(QTDIR)/bin/moc UIC = $(QTDIR)/bin/uic