ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/libstatgrab/acinclude.m4
Revision: 1.1
Committed: Sat Oct 4 16:05:55 2003 UTC (20 years, 6 months ago) by tdb
Branch: MAIN
CVS Tags: LIBSTATGRAB_0_13, LIBSTATGRAB_0_12, LIBSTATGRAB_0_11_1, LIBSTATGRAB_0_11, LIBSTATGRAB_0_10_3, LIBSTATGRAB_0_10_2, LIBSTATGRAB_0_10_1, LIBSTATGRAB_0_10, LIBSTATGRAB_0_9, LIBSTATGRAB_0_8_2, LIBSTATGRAB_0_8_1, LIBSTATGRAB_0_8, LIBSTATGRAB_0_7, LIBSTATGRAB_0_6_1, LIBSTATGRAB_0_6
Log Message:
Add all the build stuff for saidar (assuming Pete sticks with that
name). The configure script will attempt to find curses, but if it
can't will simply disable building of saidar (after giving a warning).

Also made the building of saidar, statgrab, and the examples
conditional. They're enabled by default, but can be disabled using a
configure flag. Whilst I was at it, added a configure flag to disable
manpage installation at configure time.

I'm not sure how well the curses detection works; we've had at least
one report of a problem with it. Testing will be required.

File Contents

# Content
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 libstatgrab)
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 mp_save_CPPFLAGS="$CPPFLAGS"
11 LIBS="$LIBS $SAIDARLIBS"
12 CPPFLAGS="$CPPFLAGS $SAIDARCPPFLAGS"
13 CURSES_LIB=""
14 if test "$with_ncurses" != yes
15 then
16 AC_CACHE_CHECK([for working curses], mp_cv_curses,
17 [LIBS="$LIBS -lcurses"
18 AC_TRY_LINK(
19 [#include <curses.h>],
20 [chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
21 mp_cv_curses=yes, mp_cv_curses=no)])
22 if test "$mp_cv_curses" = yes
23 then
24 AC_DEFINE(HAVE_CURSES_H)
25 CURSES_LIB="-lcurses"
26 fi
27 fi
28 if test ! "$CURSES_LIB"
29 then
30 AC_CACHE_CHECK([for working ncurses], mp_cv_ncurses,
31 [LIBS="$mp_save_LIBS -lncurses"
32 AC_TRY_LINK(
33 [#include <ncurses.h>],
34 [chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
35 mp_cv_ncurses=yes, mp_cv_ncurses=no)])
36 if test "$mp_cv_ncurses" = yes
37 then
38 AC_DEFINE(HAVE_NCURSES_H)
39 CURSES_LIB="-lncurses"
40 else
41 AC_MSG_WARN([Unable to find curses or ncurses; disabling saidar])
42 AM_CONDITIONAL(SAIDAR, false)
43 fi
44 fi
45 SAIDARLIBS="$SAIDARLIBS $CURSES_LIB"
46 LIBS="$mp_save_LIBS"
47 CPPFLAGS="$mp_save_CPPFLAGS"
48 ])dnl