build with Qt6 support on Linux
This commit is contained in:
@@ -26,10 +26,18 @@ CCFLAGS = -g
|
|||||||
#detection
|
#detection
|
||||||
CCISCLANG := $(shell echo `$(CC) --version` | grep clang)
|
CCISCLANG := $(shell echo `$(CC) --version` | grep clang)
|
||||||
ifeq "$(CCISCLANG)" ""
|
ifeq "$(CCISCLANG)" ""
|
||||||
|
ifdef WANT_WIN_QT6
|
||||||
|
CXX=g++ -std=c++17
|
||||||
|
else
|
||||||
CXX=g++ -std=gnu++11
|
CXX=g++ -std=gnu++11
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
ifdef WANT_WIN_QT6
|
||||||
|
CXX=clang++ -std=c++17
|
||||||
else
|
else
|
||||||
CXX=clang++ -std=gnu++11
|
CXX=clang++ -std=gnu++11
|
||||||
endif
|
endif
|
||||||
|
endif # clang
|
||||||
|
|
||||||
# If you want to override the compiler detection just carried out
|
# If you want to override the compiler detection just carried out
|
||||||
# uncomment one of the following pairs. Note, however, that
|
# uncomment one of the following pairs. Note, however, that
|
||||||
|
|||||||
@@ -49,9 +49,10 @@ endif # not WANT_WIN_QT5
|
|||||||
ifdef WANT_WIN_QT5
|
ifdef WANT_WIN_QT5
|
||||||
QTDIR=/usr
|
QTDIR=/usr
|
||||||
endif # WANT_WIN_QT5
|
endif # WANT_WIN_QT5
|
||||||
#ifdef WANT_WIN_QT6
|
ifdef WANT_WIN_QT6
|
||||||
#QTDIR=/usr
|
#if your Qt6 is elsewhere, change this to match
|
||||||
#endif # WANT_WIN_QT6
|
QTDIR=/usr/local/qt6
|
||||||
|
endif # WANT_WIN_QT6
|
||||||
endif # WANT_WIN_QT
|
endif # WANT_WIN_QT
|
||||||
|
|
||||||
ifndef LIBXPM
|
ifndef LIBXPM
|
||||||
@@ -139,19 +140,51 @@ LFLAGS=-L/opt/X11/lib
|
|||||||
endif # WANT_WIN_X11
|
endif # WANT_WIN_X11
|
||||||
|
|
||||||
ifdef WANT_WIN_QT
|
ifdef WANT_WIN_QT
|
||||||
# Qt5 requires C++11
|
# Qt requires C++11
|
||||||
|
ifdef WANT_WIN_QT5
|
||||||
LINK = $(CXX)
|
LINK = $(CXX)
|
||||||
QTCXXFLAGS += $(sort $(shell PKG_CONFIG_PATH=$(QTDIR)/lib/pkgconfig pkg-config Qt5Gui Qt5Widgets Qt5Multimedia --cflags))
|
QTCXXFLAGS += $(sort $(shell PKG_CONFIG_PATH=$(QTDIR)/lib/pkgconfig pkg-config Qt5Gui Qt5Widgets Qt5Multimedia --cflags))
|
||||||
QTCXXFLAGS += -fPIC
|
|
||||||
WINLIB += $(shell PKG_CONFIG_PATH=$(QTDIR)/lib/pkgconfig pkg-config Qt5Gui Qt5Widgets Qt5Multimedia --libs)
|
WINLIB += $(shell PKG_CONFIG_PATH=$(QTDIR)/lib/pkgconfig pkg-config Qt5Gui Qt5Widgets Qt5Multimedia --libs)
|
||||||
VARDATND0 += nhtiles.bmp rip.xpm nhsplash.xpm
|
endif # WANT_WIN_QT5
|
||||||
# XXX if /Developer/qt exists and QTDIR not set, use that
|
ifdef WANT_WIN_QT6
|
||||||
|
# As of January 2022 there was no Qt6 package was available.
|
||||||
|
ifndef QT_PACKAGE_AVAILABLE
|
||||||
|
# Try some likely spots for a self-built Qt6.
|
||||||
|
# You'll have to change these manually before using the hints file
|
||||||
|
# if they don't match the installed location on your system.
|
||||||
|
ifneq ($(wildcard /usr/local/Qt6/*),)
|
||||||
|
QTDIR=/usr/local/Qt6
|
||||||
|
QTLOCATED=1
|
||||||
|
endif
|
||||||
|
ifneq ($(wildcard /usr/local/qt6/*),)
|
||||||
|
QTDIR=/usr/local/qt6
|
||||||
|
QTLOCATED=1
|
||||||
|
endif
|
||||||
|
ifdef QTLOCATED
|
||||||
|
QTCXXFLAGS += -I$(QTDIR)/include/QtCore
|
||||||
|
QTCXXFLAGS += -I$(QTDIR)/include/QtGui
|
||||||
|
QTCXXFLAGS += -I$(QTDIR)/include/QtMultimedia
|
||||||
|
QTCXXFLAGS += -I$(QTDIR)/include/QtWidgets
|
||||||
|
MOCPATH = $(QTDIR)/libexec/moc
|
||||||
|
endif
|
||||||
|
else # QT_PACKAGE_AVAILABLE
|
||||||
|
$(error error is inside package)
|
||||||
|
LINK = $(CXX)
|
||||||
|
QTCXXFLAGS += $(sort $(shell PKG_CONFIG_PATH=$(QTDIR)/lib/pkgconfig pkg-config Qt6Gui Qt6Widgets Qt6Multimedia --cflags))
|
||||||
|
WINLIB += $(shell PKG_CONFIG_PATH=$(QTDIR)/lib/pkgconfig pkg-config Qt6Gui Qt6Widgets Qt6Multimedia --libs)
|
||||||
|
endif # WANT_WIN_QT6
|
||||||
|
else # QT_PACKAGE_AVAILABLE
|
||||||
|
$(error error QT_PACKAGE_AVAILABLE)
|
||||||
|
endif # QT_PACKAGE_AVAILABLE
|
||||||
ifndef QTDIR
|
ifndef QTDIR
|
||||||
$(error QTDIR not defined in the environment or Makefile)
|
$(error QTDIR not defined in the environment or Makefile)
|
||||||
endif # QTDIR
|
endif # QTDIR
|
||||||
|
# XXX if /Developer/qt exists and QTDIR not set, use that
|
||||||
# XXX make sure QTDIR points to something reasonable
|
# XXX make sure QTDIR points to something reasonable
|
||||||
|
QTCXXFLAGS += -fPIC
|
||||||
POSTINSTALL+= bdftopcf win/X11/nh10.bdf > $(INSTDIR)/nh10.pcf; \
|
POSTINSTALL+= bdftopcf win/X11/nh10.bdf > $(INSTDIR)/nh10.pcf; \
|
||||||
( cd $(INSTDIR); mkfontdir -x .lev );
|
( cd $(INSTDIR); mkfontdir -x .lev );
|
||||||
|
VARDATND0 += nhtiles.bmp rip.xpm nhsplash.xpm
|
||||||
else
|
else
|
||||||
LINK = $(CC)
|
LINK = $(CC)
|
||||||
endif # !WANT_WIN_QT
|
endif # !WANT_WIN_QT
|
||||||
|
|||||||
Reference in New Issue
Block a user