diff options
author | Frederic Culot <calcurse@culot.org> | 2009-01-23 21:08:31 +0000 |
---|---|---|
committer | Frederic Culot <calcurse@culot.org> | 2009-01-23 21:08:31 +0000 |
commit | 08aaf496fce35c4335dab19a4426442153592840 (patch) | |
tree | b9b60d5e084f21b4ed011113d6087af77945044f /configure.ac | |
parent | d8861f877ec1e52ff03781fa2246e7343a9387ae (diff) | |
download | calcurse-08aaf496fce35c4335dab19a4426442153592840.zip |
configuration script improved to link with ncursesw if ncurses is not found
Diffstat (limited to 'configure.ac')
-rwxr-xr-x | configure.ac | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac index 815a993..1da0051 100755 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $calcurse: configure.ac,v 1.29 2009/01/22 18:11:56 culot Exp $ +# $calcurse: configure.ac,v 1.30 2009/01/23 21:08:31 culot Exp $ #------------------------------------------------------------------------------- # Init @@ -27,14 +27,27 @@ AC_CHECK_HEADERS([ctype.h getopt.h locale.h math.h signal.h stdbool.h stdio.h \ #------------------------------------------------------------------------------- # Checks for system libs #------------------------------------------------------------------------------- -AC_CHECK_HEADERS([ncurses.h], [ - AC_CHECK_LIB(ncurses, initscr, [ - LIBS="$LIBS -lncurses" - AC_DEFINE(HAVE_LIBNCURSES, 1, - [Define to 1 if you have the 'ncurses' library (-lncurses).]) - ], - AC_MSG_ERROR(The ncurses library is required in order to build calcurse!)) -], AC_MSG_ERROR(The ncurses header is required in order to build calcurse!)) +AC_CHECK_FUNC(initscr,, +[ + available_ncurses="none" + for lib in ncursesw ncurses + do + AC_CHECK_LIB($lib, initscr, + [available_ncurses="$lib"; break]) + done + if test "$available_ncurses" = none; then + AC_MSG_ERROR(Either ncurses or ncursesw library is required to build calcurse!) + elif test "$available_ncurses" = ncursesw; then + AC_CHECK_HEADERS([ncursesw/ncurses.h],, + [AC_CHECK_HEADERS([ncurses.h],, + AC_MSG_ERROR([Missing ncursesw header file]))]) + else + AC_CHECK_HEADERS([ncurses/ncurses.h],, + [AC_CHECK_HEADERS([ncurses.h],, + AC_MSG_ERROR([Missing ncurses header file]))]) + fi + LIBS="$LIBS -l$available_ncurses" +]) AC_CHECK_HEADERS([pthread.h], [ AC_CHECK_LIB(pthread, pthread_create, [ |