summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/makefile26
1 files changed, 16 insertions, 10 deletions
diff --git a/crawl-ref/source/makefile b/crawl-ref/source/makefile
index b44c4791a0..8f64268607 100644
--- a/crawl-ref/source/makefile
+++ b/crawl-ref/source/makefile
@@ -397,10 +397,18 @@ CFOTHERS_L += -DDATA_DIR_PATH=\"$(strip $(prefix))/$(strip $(DATADIR))\"
endif
ifndef NO_NCURSES
+
+NC_LIB = ncurses
+NC_PREFIX = /usr
+NC_INCLUDE = $(NC_PREFIX)/include/ncurses
+
# Usually, it can be autodetected for you:
-ifneq ($(shell ls /usr/include/ncursesw 2> /dev/null),)
+ifndef NO_UNICODE
+ifneq ($(shell ls $(NC_PREFIX)/include/ncursesw 2> /dev/null),)
+NC_INCLUDE = $(NC_PREFIX)/include/ncursesw
USE_UNICODE = YesPlease
endif
+endif
# If you have USE_UNICODE set, and have a preferred Unicode
# (UTF-8) locale you want Crawl to use, you can set it here. The
@@ -408,13 +416,14 @@ endif
# as set in your environment LC_* variables, use UNICODE_LOCALE = .
UNICODE_LOCALE =
+INCLUDES_L += -I$(NC_INCLUDE)
+
ifdef USE_UNICODE
# Include path for (n)curses with Unicode support.
-INCLUDES_L += -I/usr/include/ncursesw
# Your ncurses library may include Unicode support, and you may not have a
# separate libncursesw; in that case, change this line accordingly.
-LIBCURS = ncursesw
+NC_LIB = ncursesw
CFOTHERS_L += -DUNICODE_GLYPHS
ifneq ($(strip $(UNICODE_LOCALE)),)
@@ -427,16 +436,13 @@ endif
# The standard ncurses library also supports Unicode on Mac OS/Darwin.
ifdef LIBNCURSES_IS_UNICODE
-LIBCURS = ncurses
+NC_LIB = ncurses
endif
-LIB += -l$(LIBCURS)
-
-else
-# Include path for curses or ncurses (non-Unicode).
-INCLUDES_L += -I/usr/include/ncurses
-LIB += -lncurses
endif
+
+LIB += -L$(NC_PREFIX)/lib -l$(NC_LIB)
+
endif
ifdef BUILD_PCRE