diff --git a/GNUmakefile b/GNUmakefile index f5cacba..a991e66 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -70,20 +70,17 @@ endif # If no GTK_VERSION is set, try to auto-determine, with GTK 3 preferred ifeq ($(GTK_VERSION), 0) ifeq ($(shell $(PKG_CONFIG) --errors-to-stdout --print-errors "$(LIBS_GTK3)"), ) - LIBS=$(LIBS_GTK3) - GDK_LIB=gdk-3.0 + override GTK_VERSION=3 else LIBS=$(LIBS_GTK2) - GDK_LIB=gdk-2.0 + override GTK_VERSION=2 endif endif ifeq ($(GTK_VERSION), 2) LIBS=$(LIBS_GTK2) - GDK_LIB=gdk-2.0 endif ifeq ($(GTK_VERSION), 3) LIBS=$(LIBS_GTK3) - GDK_LIB=gdk-3.0 endif LIBS+=$(LIBS_GENERAL) @@ -96,7 +93,7 @@ else endif # We need X11 to workaround a bug, see http://stackoverflow.com/questions/18647475 -ifeq ($(filter x11, $(shell pkg-config --errors-to-stdout --print-requires-private $(GDK_LIB))), x11) +ifeq ($(filter x11, $(shell pkg-config --errors-to-stdout --variable=target gtk+-$(GTK_VERSION).0; pkg-config --errors-to-stdout --variable=targets gtk+-$(GTK_VERSION).0)), x11) LIBS+=x11 endif