summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/makefile.unix
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-11-20 13:36:42 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-11-20 13:36:42 +0000
commitcbaaa32d55fd87eba6882c581db2ac32ef88c3f9 (patch)
treec7c89aca11947cf477953eb5138a0b476975c364 /crawl-ref/source/makefile.unix
parente3e729a0259c4c89296ac368556563ca096cd3e9 (diff)
downloadcrawl-ref-cbaaa32d55fd87eba6882c581db2ac32ef88c3f9.tar.gz
crawl-ref-cbaaa32d55fd87eba6882c581db2ac32ef88c3f9.zip
Allow UNICODE_LOCALE=. in makefile.unix to specify a setlocale(LC_ALL,"") call instead of forcing a specific locale (adapted from Guus' Debian patch). Also fixed some makefile.unix checks to strip variables that are prone to trailing spaces.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2885 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/makefile.unix')
-rw-r--r--crawl-ref/source/makefile.unix35
1 files changed, 20 insertions, 15 deletions
diff --git a/crawl-ref/source/makefile.unix b/crawl-ref/source/makefile.unix
index e671d68a25..0e8e0632e0 100644
--- a/crawl-ref/source/makefile.unix
+++ b/crawl-ref/source/makefile.unix
@@ -17,13 +17,14 @@ DELETE = rm -f
COPY = cp
OS_TYPE = UNIX
-# Change this to y if you want to use Unicode glyphs in the map, and you have
-# libncursesw available.
+# Change this to y (case-sensitive!) if you want to use Unicode glyphs
+# in the map, and you have libncursesw available.
UNICODE_GLYPHS = n
# If you're using UNICODE_GLYPHS=y, and have a preferred Unicode
# (UTF-8) locale you want Crawl to use, you can set it here. The
-# default is en_US.UTF-8.
+# default is en_US.UTF-8. If you'd prefer that Crawl use the locale
+# as set in your environment LC_* variables, use UNICODE_LOCALE = .
UNICODE_LOCALE =
# If you have lex and yacc, set DOYACC to y (lowercase y).
@@ -60,14 +61,14 @@ NDBM_FILE := /usr/include/ndbm.h
HAVE_DBH := $(shell [ -f $(DBH_FILE) ] && echo y)
HAVE_NDBM := $(shell [ -f $(NDBM_FILE) ] && echo y)
-ifeq ($(HAVE_DBH),y)
+ifeq ($(strip $(HAVE_DBH)),y)
ifneq ($(shell grep dbm_open $(DBH_FILE)),)
SELDBM := -DDB_DBH
LIBDBM := -ldb
endif
endif
-ifeq ($(HAVE_NDBM),y)
+ifeq ($(strip $(HAVE_NDBM)),y)
SELDBM ?= -DDB_NDBM
ifeq ($(SELDBM),-DDB_NDBM)
LIBDBM := -ldbm
@@ -79,7 +80,7 @@ SQLLIB := sqlite3
SQLLIBA := lib$(SQLLIB).a
FSQLLIBA := $(SQLSRC)/$(SQLLIBA)
-ifeq ($(LIBDBM),)
+ifeq ($(strip $(LIBDBM)),)
LIBDBM := -L$(SQLSRC) -lsqlite3
EXTRA_INCLUDES += -I$(SQLSRC)
EXTRA_DEPENDS += $(FSQLLIBA)
@@ -98,15 +99,15 @@ CFWARN += -Wuninitialized
CFOTHERS += -O2
endif
-ifneq ($(SAVEDIR),)
-CFOTHERS += '-DSAVE_DIR_PATH="$(SAVEDIR)"'
+ifneq ($(strip $(SAVEDIR)),)
+CFOTHERS += '-DSAVE_DIR_PATH="$(strip $(SAVEDIR))"'
endif
-ifneq ($(DATADIR),)
-CFOTHERS += '-DDATA_DIR_PATH="$(DATADIR)"'
+ifneq ($(strip $(DATADIR)),)
+CFOTHERS += '-DDATA_DIR_PATH="$(strip $(DATADIR))"'
endif
-ifeq ($(UNICODE_GLYPHS),y)
+ifeq ($(strip $(UNICODE_GLYPHS)),y)
# Include path for (n)curses with Unicode support.
INCLUDES += -I/usr/include/ncursesw
@@ -115,8 +116,12 @@ INCLUDES += -I/usr/include/ncursesw
LIBCURS = ncursesw
CFOTHERS += -DUNICODE_GLYPHS
-ifneq ($(UNICODE_LOCALE),)
-CFOTHERS += -DUNICODE_LOCALE=\"$(UNICODE_LOCALE)\"
+ifneq ($(strip $(UNICODE_LOCALE)),)
+ifneq ($(strip $(UNICODE_LOCALE)),.)
+CFOTHERS += -DUNICODE_LOCALE=\"$(strip $(UNICODE_LOCALE))\"
+else
+CFOTHERS += -DUNICODE_LOCALE=\"\"
+endif
endif
# The standard ncurses library also supports Unicode on Mac OS/Darwin.
@@ -142,11 +147,11 @@ YTABH := levcomp.tab.h
OBJECTS := $(UTIL)levcomp.tab.o $(UTIL)levcomp.lex.o $(OBJECTS)
-ifeq ($(LEX),)
+ifeq ($(strip $(LEX)),)
DOYACC :=
endif
-ifeq ($(YACC),)
+ifeq ($(strip $(YACC)),)
DOYACC :=
endif