2016-02-20 17:39:17 +00:00
|
|
|
From fd26eed89bbe3f980b76df379eb0d44c02e48918 Mon Sep 17 00:00:00 2001
|
2016-02-19 13:14:54 +00:00
|
|
|
From: Julian Ospald <hasufell@posteo.de>
|
2016-02-20 17:39:17 +00:00
|
|
|
Date: Fri, 19 Feb 2016 16:02:11 +0100
|
|
|
|
Subject: [PATCH] MAKE: use PKGCONFIG to get ncurses flags, if available
|
2016-02-19 13:14:54 +00:00
|
|
|
|
|
|
|
This fixes build failures on some distributions:
|
|
|
|
https://bugs.gentoo.org/show_bug.cgi?id=527034
|
|
|
|
---
|
2016-02-20 17:39:17 +00:00
|
|
|
crawl-ref/source/Makefile | 22 ++++++++++++++++------
|
|
|
|
1 file changed, 16 insertions(+), 6 deletions(-)
|
2016-02-19 13:14:54 +00:00
|
|
|
|
|
|
|
diff --git a/crawl-ref/source/Makefile b/crawl-ref/source/Makefile
|
2016-02-20 17:39:17 +00:00
|
|
|
index e9c54db..88ad7f8 100644
|
2016-02-19 13:14:54 +00:00
|
|
|
--- a/crawl-ref/source/Makefile
|
|
|
|
+++ b/crawl-ref/source/Makefile
|
2016-02-20 17:39:17 +00:00
|
|
|
@@ -1013,17 +1013,27 @@ endif
|
2016-02-19 13:14:54 +00:00
|
|
|
# Your ncurses library may include Unicode support, and you may not have a
|
|
|
|
# separate libncursesw; this is the case on Mac OS/Darwin.
|
|
|
|
ifdef LIBNCURSES_IS_UNICODE
|
|
|
|
-NC_LIB = ncurses
|
|
|
|
-NC_INCLUDE = $(NC_PREFIX)/include/ncurses
|
2016-02-20 17:39:17 +00:00
|
|
|
+ ifndef NO_PKGCONFIG
|
|
|
|
+ NC_LIBS = $(shell $(PKGCONFIG) --libs ncurses 2>/dev/null || echo "-L$(NC_PREFIX)/lib -lncurses")
|
|
|
|
+ NC_CFLAGS = $(shell $(PKGCONFIG) --cflags ncurses 2>/dev/null || echo "-isystem $(NC_PREFIX)/include/ncurses")
|
|
|
|
+ else
|
|
|
|
+ NC_LIBS = -L$(NC_PREFIX)/lib -lncurses
|
|
|
|
+ NC_CFLAGS = -isystem $(NC_PREFIX)/include/ncurses
|
|
|
|
+ endif
|
2016-02-19 13:14:54 +00:00
|
|
|
else
|
|
|
|
-NC_LIB = ncursesw
|
|
|
|
-NC_INCLUDE = $(NC_PREFIX)/include/ncursesw
|
2016-02-20 17:39:17 +00:00
|
|
|
+ ifndef NO_PKGCONFIG
|
|
|
|
+ NC_LIBS = $(shell $(PKGCONFIG) --libs ncursesw || echo "-L$(NC_PREFIX)/lib -lncursesw")
|
|
|
|
+ NC_CFLAGS = $(shell $(PKGCONFIG) --cflags ncursesw 2>/dev/null || echo "-isystem $(NC_PREFIX)/include/ncursesw")
|
|
|
|
+ else
|
|
|
|
+ NC_LIBS = -L$(NC_PREFIX)/lib -lncursesw
|
|
|
|
+ NC_CFLAGS = -isystem $(NC_PREFIX)/include/ncursesw
|
|
|
|
+ endif
|
2016-02-19 13:14:54 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
-INCLUDES_L += -isystem $(NC_INCLUDE)
|
|
|
|
+CFOTHERS_L += $(NC_CFLAGS)
|
|
|
|
|
|
|
|
ifndef TILES
|
|
|
|
-LIBS += -L$(NC_PREFIX)/lib -l$(NC_LIB)
|
|
|
|
+LIBS += $(NC_LIBS)
|
|
|
|
endif
|
|
|
|
|
|
|
|
endif
|