Skip to content

Commit

Permalink
configure.ac: Prefer pkgconfig when searching for ncurses
Browse files Browse the repository at this point in the history
otherwise fallback to AC_SEARCH_LIBS

Signed-off-by: Lars Wendler <[email protected]>
  • Loading branch information
Lars Wendler committed Jul 1, 2020
1 parent 62a0ef1 commit 3b93c35
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ 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_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 3b93c35

Please sign in to comment.