aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2018-02-19 15:37:54 -0500
committermitchell <70453897+667e-11@users.noreply.github.com>2018-02-19 15:37:54 -0500
commit672a74b9d43ae072baa585d7f63b4cad990ed62a (patch)
treeddc203764c3fd633c87a5ea551abffc52170945c
parent2210542d188ebe4b2fead3057f3df2a6787aeb7d (diff)
downloadtextadept-672a74b9d43ae072baa585d7f63b4cad990ed62a.tar.gz
textadept-672a74b9d43ae072baa585d7f63b4cad990ed62a.zip
Use pkg-config cflags and libs for ncurses if available.
-rw-r--r--src/Makefile12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/Makefile b/src/Makefile
index 0cd41753..312de843 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -55,7 +55,7 @@ else ifeq (osx, $(findstring osx, $(MAKECMDGOALS)))
pkg-config --define-variable=prefix=gtkosx \
--cflags glib-2.0)
else
- plat_flag = -DCURSES -D_XOPEN_SOURCE_EXTENDED
+ plat_flag = -DCURSES
CURSES_LIBS = -lncurses
endif
libluajit = luajit/src/libluajit.osx.a
@@ -92,8 +92,14 @@ else
GLIB_CFLAGS = $(shell pkg-config --cflags glib-2.0)
install_targets = ../textadept ../textadeptjit
else
- plat_flag = -DCURSES -D_XOPEN_SOURCE_EXTENDED
- CURSES_LIBS = -lncursesw
+ plat_flag = -DCURSES
+ CURSES_CFLAGS = $(shell pkg-config --silence-errors --cflags ncursesw || \
+ pkg-config --silence-errors --cflags ncurses || \
+ pkg-config --silence-errors --cflags curses)
+ CURSES_LIBS = $(shell pkg-config --silence-errors --libs ncursesw || \
+ pkg-config --silence-errors --libs ncurses || \
+ pkg-config --silence-errors --libs curses || \
+ echo -lncursesw)
install_targets = ../textadept-curses ../textadeptjit-curses
endif
libluajit = luajit/src/libluajit.a