ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/idar/acinclude.m4
Revision: 1.1
Committed: Sun Mar 30 17:11:26 2003 UTC (21 years, 8 months ago) by tdb
Branch: MAIN
CVS Tags: IDAR_1_2, IDAR_1_1, IDAR_1_0, HEAD
Log Message:
Now tests for either curses or ncurses. By default prefers to use curses,
but will use ncurses if curses is not available or if forced by a configure
flag. Also minor other tweaks.

File Contents

# User Rev Content
1 tdb 1.1 dnl Available from the GNU Autoconf Macro Archive at:
2     dnl http://www.gnu.org/software/ac-archive/htmldoc/mp_with_curses.html
3     dnl (Hacked by tdb for idar)
4     dnl $Id$
5     AC_DEFINE([HAVE_CURSES_H], [], [Define to 1 if you have the <curses.h> header file.])
6     AC_DEFINE([HAVE_NCURSES_H], [], [Define to 1 if you have the <ncurses.h> header file.])
7     AC_DEFUN([MP_WITH_CURSES],
8     [AC_ARG_WITH(ncurses, [ --with-ncurses Force the use of ncurses over curses],,)
9     mp_save_LIBS="$LIBS"
10     CURSES_LIB=""
11     if test "$with_ncurses" != yes
12     then
13     AC_CACHE_CHECK([for working curses], mp_cv_curses,
14     [LIBS="$LIBS -lcurses"
15     AC_TRY_LINK(
16     [#include <curses.h>],
17     [chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
18     mp_cv_curses=yes, mp_cv_curses=no)])
19     if test "$mp_cv_curses" = yes
20     then
21     AC_DEFINE(HAVE_CURSES_H)
22     CURSES_LIB="-lcurses"
23     fi
24     fi
25     if test ! "$CURSES_LIB"
26     then
27     AC_CACHE_CHECK([for working ncurses], mp_cv_ncurses,
28     [LIBS="$mp_save_LIBS -lncurses"
29     AC_TRY_LINK(
30     [#include <ncurses.h>],
31     [chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
32     mp_cv_ncurses=yes, mp_cv_ncurses=no)])
33     if test "$mp_cv_ncurses" = yes
34     then
35     AC_DEFINE(HAVE_NCURSES_H)
36     CURSES_LIB="-lncurses"
37     else
38     AC_MSG_ERROR([Need either curses or ncurses])
39     fi
40     fi
41     LIBS="$mp_save_LIBS $CURSES_LIB"
42     ])dnl