core: Fix libdwarf and Qt build failure gnu-build-fixes
authorClinton Ebadi <clinton@unknownlamer.org>
Sun, 27 Jun 2021 21:10:55 +0000 (17:10 -0400)
committerClinton Ebadi <clinton@unknownlamer.org>
Sun, 27 Jun 2021 21:10:55 +0000 (17:10 -0400)
libdwarf headers are in /usr/include/libdwarf (at least on Debian),
and the core code now uses Qt directly so the QtWidgets cflags/ldflags
are needed to build the core library. Not sure if the core should be
using Qt directly, but this gets it to build again on GNU/Linux.

Makefile

index 5ea57f8..369a664 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -35,6 +35,11 @@ CXXFLAGS += $(CPPFLAGS)
 CFLAGS += -ffast-math -fomit-frame-pointer\r
 CXXFLAGS += -ffast-math -fomit-frame-pointer\r
 \r
+ifeq "$(findstring Linux,$(OSTYPE))" "Linux"\r
+CFLAGS += -I/usr/include/libdwarf\r
+CXXFLAGS += -I/usr/include/libdwarf\r
+endif\r
+\r
 # Flags to pass on to qmake...\r
 QMAKE_EXTRA += "QMAKE_CFLAGS_RELEASE=$(CFLAGS)"\r
 QMAKE_EXTRA += "QMAKE_CXXFLAGS_RELEASE=$(CXXFLAGS)"\r
@@ -44,6 +49,12 @@ QMAKE_EXTRA += "QMAKE_CFLAGS_DEBUG=$(CFLAGS)"
 QMAKE_EXTRA += "QMAKE_CXXFLAGS_DEBUG=$(CXXFLAGS)"\r
 QMAKE_EXTRA += "QMAKE_LFLAGS_DEBUG=$(LDFLAGS)"\r
 \r
+# Add Qt flags on GNU/Linux since core code uses Qt Widgets now\r
+ifeq "$(findstring Linux,$(OSTYPE))" "Linux"\r
+CFLAGS += $(shell pkg-config --cflags Qt5Widgets)\r
+CXXFLAGS += $(shell pkg-config --cflags Qt5Widgets)\r
+LDFLAGS += $(shell pkg-config --libs Qt5Widgets)\r
+endif\r
 \r
 all: prepare virtualjaguar\r
        @echo -e "\033[01;33m***\033[00;32m Success!\033[00m"\r