# Default sample rate converter type
DEFAULT_CONVERTER ?= SRC_SINC_MEDIUM_QUALITY
-#
# Comment this out if you don't want UTF-8 support
USE_UTF8 ?= yes
-#
# The OE dipthong is not a latin1 character, but it seems the zmachine
# can handle it, and it is tested for in terpetude. Comment this out
# if you don't want to support the OE dipthong
HANDLE_OE_DIPTHONG ?= yes
# Comment this out if your machine's version of curses doesn't support color.
-#
COLOR ?= yes
-# If this matters, you can choose -lcurses or -lncurses
-# For UTF-8 support -lncursesw needs to be used
-CURSES ?= -lncursesw
+# Select your chosen version of curses. Unless something old is going
+# on, ncursesw should be used because that's how UTF8 is supported.
+#CURSES ?= curses
+#CURSES ?= ncurses
+CURSES ?= ncursesw
# Uncomment this if you want to disable the compilation of Blorb support.
#NO_BLORB = yes
export CC
export CFLAGS
+export CURSES_CFLAGS
export MAKEFLAGS
export AR
export RANLIB
# Compile time options handling
#
+ifeq ($(CURSES), curses)
+ CURSES_LDFLAGS += -lcurses
+ CURSES_DEFINE = USE_CURSES_H
+endif
+ifeq ($(CURSES), ncurses)
+ CURSES_LDFLAGS += -lncurses
+ CURSES_DEFINE = USE_NCURSES_H
+endif
+ifeq ($(CURSES), ncursesw)
+ CURSES_LDFLAGS += -lncursesw -ltinfo
+ CURSES_CFLAGS += -D_XOPEN_SOURCE_EXTENDED
+ CURSES_DEFINE = USE_NCURSES_H
+endif
+
ifeq ($(SOUND), ao)
- CURSES_LDFLAGS = -lao -ldl -lpthread -lm \
+ CURSES_LDFLAGS += -lao -ldl -lpthread -lm \
-lsndfile -lvorbisfile -lmodplug -lsamplerate
endif
curses: $(FROTZ_BIN)
ncurses: $(FROTZ_BIN)
$(FROTZ_BIN): $(COMMON_LIB) $(CURSES_LIB) $(BLORB_LIB) $(COMMON_LIB)
- $(CC) $(CFLAGS) $+ -o $@$(EXTENSION) $(CURSES) $(LDFLAGS) \
- $(CURSES_LDFLAGS)
+ $(CC) $(CFLAGS) $(CURSES_CFLAGS) $+ -o $@$(EXTENSION) $(LDFLAGS) $(CURSES_LDFLAGS)
@echo "** Done building Frotz with curses interface"
dumb: $(DFROTZ_BIN)
@echo "** Generating $@"
@echo "#ifndef CURSES_DEFINES_H" > $@
@echo "#define CURSES_DEFINES_H" >> $@
+ @echo "#define $(CURSES_DEFINE)" >> $@
@echo "#define CONFIG_DIR \"$(SYSCONFDIR)\"" >> $@
@echo "#define SOUND \"$(SOUND)\"" >> $@
@echo "#define SAMPLERATE $(SAMPLERATE)" >> $@