Skip to content

Commit

Permalink
Use the "target"/"targets" var of the gtk+-x.0 package instead of gli…
Browse files Browse the repository at this point in the history
…b to determine X11 availability

See bug #80. Thanks a lot to @rtlanceroad for reporting this & testing
the fix.
  • Loading branch information
phillipberndt committed Mar 1, 2017
1 parent ba838d2 commit 6c69210
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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

Expand Down

0 comments on commit 6c69210

Please sign in to comment.