|
@@ -4,7 +4,9 @@
|
|
# What library to link
|
|
# What library to link
|
|
ldflags()
|
|
ldflags()
|
|
{
|
|
{
|
|
- for ext in so a dylib ; do
|
|
|
|
|
|
+ pkg-config --libs ncursesw 2>/dev/null && exit
|
|
|
|
+ pkg-config --libs ncurses 2>/dev/null && exit
|
|
|
|
+ for ext in so a dll.a dylib ; do
|
|
for lib in ncursesw ncurses curses ; do
|
|
for lib in ncursesw ncurses curses ; do
|
|
$cc -print-file-name=lib${lib}.${ext} | grep -q /
|
|
$cc -print-file-name=lib${lib}.${ext} | grep -q /
|
|
if [ $? -eq 0 ]; then
|
|
if [ $? -eq 0 ]; then
|
|
@@ -19,10 +21,17 @@ ldflags()
|
|
# Where is ncurses.h?
|
|
# Where is ncurses.h?
|
|
ccflags()
|
|
ccflags()
|
|
{
|
|
{
|
|
- if [ -f /usr/include/ncurses/ncurses.h ]; then
|
|
|
|
|
|
+ if pkg-config --cflags ncursesw 2>/dev/null; then
|
|
|
|
+ echo '-DCURSES_LOC="<ncurses.h>" -DNCURSES_WIDECHAR=1'
|
|
|
|
+ elif pkg-config --cflags ncurses 2>/dev/null; then
|
|
|
|
+ echo '-DCURSES_LOC="<ncurses.h>"'
|
|
|
|
+ elif [ -f /usr/include/ncursesw/curses.h ]; then
|
|
|
|
+ echo '-I/usr/include/ncursesw -DCURSES_LOC="<curses.h>"'
|
|
|
|
+ echo ' -DNCURSES_WIDECHAR=1'
|
|
|
|
+ elif [ -f /usr/include/ncurses/ncurses.h ]; then
|
|
echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses.h>"'
|
|
echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses.h>"'
|
|
elif [ -f /usr/include/ncurses/curses.h ]; then
|
|
elif [ -f /usr/include/ncurses/curses.h ]; then
|
|
- echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses/curses.h>"'
|
|
|
|
|
|
+ echo '-I/usr/include/ncurses -DCURSES_LOC="<curses.h>"'
|
|
elif [ -f /usr/include/ncurses.h ]; then
|
|
elif [ -f /usr/include/ncurses.h ]; then
|
|
echo '-DCURSES_LOC="<ncurses.h>"'
|
|
echo '-DCURSES_LOC="<ncurses.h>"'
|
|
else
|
|
else
|
|
@@ -36,7 +45,7 @@ trap "rm -f $tmp" 0 1 2 3 15
|
|
|
|
|
|
# Check if we can link to ncurses
|
|
# Check if we can link to ncurses
|
|
check() {
|
|
check() {
|
|
- $cc -xc - -o $tmp 2>/dev/null <<'EOF'
|
|
|
|
|
|
+ $cc -x c - -o $tmp 2>/dev/null <<'EOF'
|
|
#include CURSES_LOC
|
|
#include CURSES_LOC
|
|
main() {}
|
|
main() {}
|
|
EOF
|
|
EOF
|