Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle variable ncurses naming better #34549

Merged
merged 1 commit into from
Oct 8, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 12 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -581,38 +581,33 @@ ifdef TILES
ODIR = $(ODIRTILES)
endif
else
ifeq ($(LOCALIZE),1)
NCURSES_PREFIX = ncursesw
else
NCURSES_PREFIX = ncurses
endif
# ONLY when not cross-compiling, check for pkg-config or ncurses5-config
# When doing a cross-compile, we can't rely on the host machine's -configs
ifeq ($(CROSS),)
ifneq ($(shell pkg-config --libs ncurses 2>/dev/null),)
ifneq ($(shell pkg-config --libs $(NCURSES_PREFIX) 2>/dev/null),)
HAVE_PKGCONFIG = 1
endif
ifneq ($(shell which ncurses5-config 2>/dev/null),)
ifneq ($(shell which $(NCURSES_PREFIX)5-config 2>/dev/null),)
HAVE_NCURSES5CONFIG = 1
endif
endif

# Link to ncurses if we're using a non-tiles, Linux build
ifeq ($(HAVE_PKGCONFIG),1)
ifeq ($(LOCALIZE),1)
CXXFLAGS += $(shell pkg-config --cflags ncursesw)
LDFLAGS += $(shell pkg-config --libs ncursesw)
else
CXXFLAGS += $(shell pkg-config --cflags ncurses)
LDFLAGS += $(shell pkg-config --libs ncurses)
endif
CXXFLAGS += $(shell pkg-config --cflags $(NCURSES_PREFIX))
LDFLAGS += $(shell pkg-config --libs $(NCURSES_PREFIX))
else
ifeq ($(HAVE_NCURSES5CONFIG),1)
ifeq ($(LOCALIZE),1)
CXXFLAGS += $(shell ncursesw5-config --cflags)
LDFLAGS += $(shell ncursesw5-config --libs)
else
CXXFLAGS += $(shell ncurses5-config --cflags)
LDFLAGS += $(shell ncurses5-config --libs)
endif
CXXFLAGS += $(shell $(NCURSES_PREFIX)5-config --cflags)
LDFLAGS += $(shell $(NCURSES_PREFIX)5-config --libs)
else
ifneq ($(TARGETSYSTEM),WINDOWS)
LDFLAGS += -lncurses
LDFLAGS += -l$(NCURSES_PREFIX)
endif

ifdef OSXCROSS
Expand Down