Skip to content

Commit

Permalink
Try tinfo before ncursesw and use pkg-config for ncurses
Browse files Browse the repository at this point in the history
  • Loading branch information
o11c committed Mar 1, 2014
1 parent ddd7b0c commit c2dd8f2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Makefile
Expand Up @@ -22,11 +22,15 @@ endif
ifeq ($(shell pkg-config --atleast-version=0.1.0 unibilium && echo 1),1)
CFLAGS +=$(shell pkg-config --cflags unibilium) -DHAVE_UNIBILIUM
LDFLAGS+=$(shell pkg-config --libs unibilium)
else ifeq ($(shell pkg-config tinfo && echo 1),1)
CFLAGS +=$(shell pkg-config --cflags tinfo)
LDFLAGS+=$(shell pkg-config --libs tinfo)
else ifeq ($(shell pkg-config ncursesw && echo 1),1)
CFLAGS +=$(shell pkg-config --cflags ncursesw)
LDFLAGS+=$(shell pkg-config --libs ncursesw)
else
LDFLAGS+=-lncurses
CFLAGS +=$(shell pkg-config --cflags ncurses)

This comment has been minimized.

Copy link
@leonerd

leonerd Mar 4, 2014

Contributor

This won't work on most OSes that aren't Linux. Most Linux distributions happen to bundle a ncurses.pc file, but the BSDs and so on don't.

This comment has been minimized.

Copy link
@jamessan

jamessan Nov 18, 2015

@leonerd Then you could use pkg-config --exists ncurses && pkg-config --cflags ncurses || true and similar for LDFLAGS.

LDFLAGS+=$(shell pkg-config --libs ncurses)
endif

OBJECTS=termkey.lo driver-csi.lo driver-ti.lo
Expand Down

1 comment on commit c2dd8f2

@leonerd
Copy link
Contributor

@leonerd leonerd commented on c2dd8f2 Mar 4, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partially merged at bzr -r348
I've only taken the tinfo bits, as the pkg-config wrapping of ncurses itself would break some other OSes.

Please sign in to comment.