diff options
author | Sven Eden <sven.eden@gmx.de> | 2013-04-03 15:40:01 +0200 |
---|---|---|
committer | Sven Eden <sven.eden@gmx.de> | 2013-04-03 15:40:01 +0200 |
commit | 1827b95160b29d5b53393add21b54bdab2cbc8e0 (patch) | |
tree | 910bb572f39a1e6365177d74ae8eee4be0d69391 /configure.ac | |
parent | Fixed a typo: package/description order toggle is F9, not F8. (diff) | |
download | ufed-1827b95160b29d5b53393add21b54bdab2cbc8e0.tar.gz ufed-1827b95160b29d5b53393add21b54bdab2cbc8e0.tar.bz2 ufed-1827b95160b29d5b53393add21b54bdab2cbc8e0.zip |
Use pkg-config to check for ncurses. this should fix bug #464328
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac index 1f47b68..a3308b9 100644 --- a/configure.ac +++ b/configure.ac @@ -18,14 +18,36 @@ else fi CFLAGS="${CFLAGS} -Wmissing-prototypes -Wstrict-prototypes" +PKG_PROG_PKG_CONFIG + AC_TYPE_SIZE_T AC_CHECK_HEADER_STDBOOL +curses="default" +HAVE_CURSES=0 + AC_ARG_WITH([curses], [AS_HELP_STRING([--with-curses], [override default curses library (ncursesw ncurses curses)])], - [curses=$withval], - [curses="ncursesw ncurses curses"]) -AC_SEARCH_LIBS([initscr], [$curses], [], [AC_MSG_ERROR([curses library not found])]) + [curses=$withval]) + +dnl try user option first +dnl --------------------- + +AS_IF([test "x$curses" != "xdefault"], [ + PKG_CHECK_MODULES([NCURSES], [$curses], [HAVE_CURSES=1]) +]) + +dnl otherwise check the defaults +dnl ---------------------------- + +AS_IF([test "x$HAVE_CURSES" = "x0"], [ + PKG_CHECK_MODULES([NCURSES], [ncursesw], [HAVE_CURSES=1], [ + PKG_CHECK_MODULES([NCURSES], [ncurses], [HAVE_CURSES=1], [ + PKG_CHECK_MODULES([NCURSES], [curses], [HAVE_CURSES=1], [ + AC_MSG_ERROR([No valid ncurses installation found])]) + ]) + ]) +]) AC_PATH_PROG([PERL], [perl], []) |