# Example configuration for Cygwin (`uname -s` = CYGWIN_NT-6.1)
#
# Use ncursesw.

NCURSESW_LIBS = $(shell ncursesw6-config --libs 2>/dev/null)
HAS_ICONV = $(shell test -e "/usr/include/iconv.h" && echo true)

ifeq ($(NCURSESW_LIBS),)
$(error Please install the libncursesw-devel package)
endif

ifneq ($(HAS_ICONV),true)
$(error Please install the libiconv-devel package)
endif

TIG_NCURSES = $(NCURSESW_LIBS)
TIG_LDLIBS = -liconv
TIG_CPPFLAGS = -DHAVE_NCURSESW_CURSES_H

HAS_READLINE = $(shell test -e "/usr/include/readline/readline.h" && echo true)

ifeq ($(HAS_READLINE),true)
	TIG_LDLIBS += -lreadline
	TIG_CPPFLAGS += -DHAVE_READLINE
endif

HAS_PCRE2 = $(shell test -e "/usr/include/pcre2posix.h" && echo true)

ifeq ($(HAS_PCRE2),true)
	TIG_LDLIBS += -lpcre2-posix -lpcre2-8
	TIG_CPPFLAGS += -DHAVE_PCRE2 -DPCRE2_CODE_UNIT_WIDTH=8
endif

# Avoid Cygwin's wordexp() as it spawns a bash shell each time it is called.
NO_WORDEXP=y

# vim: ft=make:
