Skip to content

Commit

Permalink
Merge pull request #317 from jlec/tinfo
Browse files Browse the repository at this point in the history
Try use pkg-config to detect ncurses libraries
  • Loading branch information
rakshasa committed Mar 9, 2016
2 parents 83d7dc8 + 9ba4d1d commit b19cf8b
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,21 @@ TORRENT_WITHOUT_STATVFS
TORRENT_WITHOUT_STATFS

AX_PTHREAD([], AC_MSG_ERROR([requires pthread]))
AX_WITH_CURSES

if test "x$ax_cv_ncursesw" != xyes && test "x$ax_cv_ncurses" != xyes; then
AC_MSG_ERROR([requires either NcursesW or Ncurses library])
fi
PKG_CHECK_MODULES([CURSES],[ncursesw],[
AC_DEFINE(HAVE_NCURSESW_CURSES_H, 1)
],
[PKG_CHECK_MODULES([CURSES],[ncurses],[
AC_DEFINE(HAVE_NCURSES_H, 1)
],
[AX_WITH_CURSES
if test "x$ax_cv_ncursesw" != xyes && test "x$ax_cv_ncurses" != xyes; then
AC_MSG_ERROR([requires either NcursesW or Ncurses library])
fi])
])

CFLAGS="$CFLAGS $PTHREAD_CFLAGS $CURSES_CFLAGS"
CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS $CURSES_CFLAGS"
LIBS="$PTHREAD_LIBS $CURSES_LIB $LIBS"
LIBS="$PTHREAD_LIBS $CURSES_LIB $CURSES_LIBS $LIBS"

PKG_CHECK_MODULES([libcurl], libcurl >= 7.15.4,
CXXFLAGS="$CXXFLAGS $libcurl_CFLAGS";
Expand Down

0 comments on commit b19cf8b

Please sign in to comment.