Skip to content

Commit

Permalink
Merge pull request adrianlopezroche#145 from Polynomial-C/ncurses_pkg…
Browse files Browse the repository at this point in the history
…config

Improved ncurses detection
  • Loading branch information
adrianlopezroche authored Jul 3, 2020
2 parents 45a3df0 + 2905725 commit 066651d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@ AC_CONFIG_HEADERS([config.h])

AC_ARG_PROGRAM

PKG_PROG_PKG_CONFIG

AC_ARG_WITH([ncurses], AS_HELP_STRING([--without-ncurses], [Do not use ncurses interface]))

AC_CHECK_HEADERS([getopt.h ncursesw/curses.h])

AS_IF([test x"$with_ncurses" != x"no"],
[AC_SEARCH_LIBS([wget_wch], [ncursesw ncurses curses], [], [AC_ERROR([ncurses library not found (or lacks wide character support)])])]
[PKG_CHECK_MODULES([NCURSES], [ncursesw],
[LIBS="$LIBS $NCURSES_LIBS"],
[AC_SEARCH_LIBS([wget_wch], [ncursesw ncurses curses], [], [AC_ERROR([ncurses library not found (or lacks wide character support)])])]
[AC_SEARCH_LIBS([keypad], [ncursesw tinfow ncurses tinfo curses], [], [AC_ERROR([ncurses library not found (lacks keypad support)])])]
)]
[AC_DEFINE([_XOPEN_SOURCE], [], [enable certain functions in wchar.h])]
[AC_DEFINE([_XOPEN_SOURCE_EXTENDED], [], [enable certain functions in curses.h])]
[AC_DEFINE([_ISOC99_SOURCE], [], [enable strtoll])]
Expand Down

0 comments on commit 066651d

Please sign in to comment.